diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 58a700fd80..33b71bb2aa 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 7d661e3c89..76c52d2e5c 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 index c111b36b0a..2a83dd5933 100644 --- a/code/ATMOSPHERICS/components/binary_devices/pipeturbine.dm +++ b/code/ATMOSPHERICS/components/binary_devices/pipeturbine.dm @@ -1,5 +1,3 @@ -#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." 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/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 2811ff6c77..0be44bb358 100644 --- a/code/ZAS/ConnectionGroup.dm +++ b/code/ZAS/ConnectionGroup.dm @@ -244,7 +244,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 5aa2c73df2..224904a567 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") add_overlay(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 4017d0a74a..a8c797ec2a 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() @@ -183,7 +183,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/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 af112ef4d6..73db8eef6e 100644 --- a/code/__defines/color.dm +++ b/code/__defines/color.dm @@ -7,7 +7,7 @@ #define COLOR_MAROON "#800000" #define COLOR_PURPLE "#800080" #define COLOR_VIOLET "#9933ff" -#define COLOR_OLIVE "#808000" +#define COLOR_OLIVE "#52613b" // VOREStation Edit #define COLOR_BROWN_ORANGE "#824b28" #define COLOR_DARK_ORANGE "#b95a00" #define COLOR_GRAY40 "#666666" @@ -91,7 +91,6 @@ #define COLOR_DARK_TEAL "#2db5b5" #define COLOR_LIGHT_VIOLET "#e7bfff" #define COLOR_SAN_MARINO_BLUE "#4b75ab" -#define COLOR_OLIVE "#52613b" //VOREStation Addition #define COLOR_HALF_TRANSPARENT_BLACK "#0000007A" #define PIPE_COLOR_GREY "#808080" @@ -165,9 +164,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/dcs/helpers.dm b/code/__defines/dcs/helpers.dm index c5c7e3c42d..a7925329fd 100644 --- a/code/__defines/dcs/helpers.dm +++ b/code/__defines/dcs/helpers.dm @@ -8,7 +8,8 @@ /// Signifies that this proc is used to handle signals. /// Every proc you pass to RegisterSignal must have this. -#define SIGNAL_HANDLER SHOULD_NOT_SLEEP(TRUE) +//#define SIGNAL_HANDLER SHOULD_NOT_SLEEP(TRUE) +#define SIGNAL_HANDLER // Sigh /// A wrapper for _AddElement that allows us to pretend we're using normal named arguments #define AddElement(arguments...) _AddElement(list(##arguments)) diff --git a/code/__defines/dcs/signals.dm b/code/__defines/dcs/signals.dm index 7079362659..9ca46ce7e8 100644 --- a/code/__defines/dcs/signals.dm +++ b/code/__defines/dcs/signals.dm @@ -121,8 +121,6 @@ ///from obj/machinery/bsa/full/proc/fire(): () #define COMSIG_ATOM_BSA_BEAM "atom_bsa_beam_pass" #define COMSIG_ATOM_BLOCKS_BSA_BEAM (1<<0) -///from base of atom/set_light(): (l_range, l_power, l_color) -#define COMSIG_ATOM_SET_LIGHT "atom_set_light" ///from base of atom/setDir(): (old_dir, new_dir) #define COMSIG_ATOM_DIR_CHANGE "atom_dir_change" ///from base of atom/handle_atom_del(): (atom/deleted) diff --git a/code/__defines/gamemode.dm b/code/__defines/gamemode.dm index 5f67308094..b512065f61 100644 --- a/code/__defines/gamemode.dm +++ b/code/__defines/gamemode.dm @@ -101,7 +101,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" @@ -149,4 +148,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 b7dc0305ad..53584a5648 100644 --- a/code/__defines/holomap.dm +++ b/code/__defines/holomap.dm @@ -2,8 +2,6 @@ // 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" @@ -21,6 +19,7 @@ #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" @@ -85,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/lighting_vr.dm b/code/__defines/lighting_vr.dm index a7f51e8bbc..aa7cb6994d 100644 --- a/code/__defines/lighting_vr.dm +++ b/code/__defines/lighting_vr.dm @@ -1,4 +1,8 @@ +#undef LIGHT_COLOR_INCANDESCENT_TUBE #define LIGHT_COLOR_INCANDESCENT_TUBE "#E0EFF0" +#undef LIGHT_COLOR_INCANDESCENT_BULB #define LIGHT_COLOR_INCANDESCENT_BULB "#FFFEB8" + //Fake ambient occlusion filter +#undef AMBIENT_OCCLUSION #define AMBIENT_OCCLUSION filter(type="drop_shadow", x=0, y=-1, size=2, offset=2, color="#04080F55") //VOREStation Edit for prettier visuals. \ No newline at end of file diff --git a/code/__defines/machinery.dm b/code/__defines/machinery.dm index 24f7b26dda..ece4cd7498 100644 --- a/code/__defines/machinery.dm +++ b/code/__defines/machinery.dm @@ -171,4 +171,4 @@ if (!(DATUM.datum_flags & DF_ISPROCESSING)) {\ // Computer login types #define LOGIN_TYPE_NORMAL 1 #define LOGIN_TYPE_AI 2 -#define LOGIN_TYPE_ROBOT 3 \ No newline at end of file +#define LOGIN_TYPE_ROBOT 3 diff --git a/code/__defines/materials.dm b/code/__defines/materials.dm index 3dea12295e..ec665c37dd 100644 --- a/code/__defines/materials.dm +++ b/code/__defines/materials.dm @@ -57,9 +57,6 @@ #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) //Material Container Flags. 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 7f1304c26b..d05f34bcc0 100644 --- a/code/__defines/misc.dm +++ b/code/__defines/misc.dm @@ -197,8 +197,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 @@ -464,4 +462,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 bdfbebb1bc..268b5d3253 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/subsystems_vr.dm b/code/__defines/subsystems_vr.dm deleted file mode 100644 index 5c028803b9..0000000000 --- a/code/__defines/subsystems_vr.dm +++ /dev/null @@ -1 +0,0 @@ -#define INIT_ORDER_HOLOMAPS -5 //VOREStation Add \ No newline at end of file diff --git a/code/__defines/turfs.dm b/code/__defines/turfs.dm index 770d58573f..cbcc45c1f5 100644 --- a/code/__defines/turfs.dm +++ b/code/__defines/turfs.dm @@ -20,3 +20,4 @@ #define isDiagonal(x) (x == NORTHEAST || x == SOUTHEAST || x == NORTHWEST || x == SOUTHWEST) #define IS_OPAQUE_TURF(turf) (turf.directional_opacity == ALL_CARDINALS) +#define FOOTSTEP_SPRITE_AMT 2 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 3bd4e20fe1..c7631479f8 100644 --- a/code/_helpers/game.dm +++ b/code/_helpers/game.dm @@ -309,39 +309,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,14 +366,14 @@ proc/ReadRGB(rgb) . = list(r, g, b) if(usealpha) . += alpha -proc/RGBdec2hex(var/list/values) +/proc/RGBdec2hex(var/list/values) var/string = "" while(values.len) string = "[num2text(values[values.len], 2, 16)][string]" values.len-- return "#[string]" -proc/ReadHSV(hsv) +/proc/ReadHSV(hsv) if(!hsv) return // interpret the HSV or HSVA value @@ -413,7 +412,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" @@ -441,7 +440,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" @@ -472,7 +471,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) @@ -505,7 +504,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) @@ -559,7 +558,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) @@ -575,10 +574,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 @@ -586,7 +585,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) @@ -596,7 +595,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 @@ -618,13 +617,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) @@ -934,7 +933,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 @@ -944,7 +943,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 d4400da8df..684aa40dae 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 b1980d6da1..dc2419b0b0 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 afc4c9a463..bfa7256c9f 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 5b1210dfe5..167af12ab1 100644 --- a/code/_helpers/time.dm +++ b/code/_helpers/time.dm @@ -80,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 69f705a969..319deaa777 100644 --- a/code/_helpers/unsorted.dm +++ b/code/_helpers/unsorted.dm @@ -596,7 +596,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 @@ -606,7 +606,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' @@ -867,7 +867,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 @@ -1015,16 +1015,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) @@ -1032,7 +1032,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) @@ -1040,7 +1040,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) @@ -1097,7 +1097,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 @@ -1487,8 +1487,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 4a1eb20d11..bdde739d83 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -191,7 +191,7 @@ var/list/global_huds = list( var/list/minihuds = list() -datum/hud/New(mob/owner) +/datum/hud/New(mob/owner) mymob = owner instantiate() ..() diff --git a/code/_onclick/hud/skybox.dm b/code/_onclick/hud/skybox.dm index efd1179891..268e4e6518 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 bf1b337e77..48accdb7fa 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: diff --git a/code/controllers/autotransfer.dm b/code/controllers/autotransfer.dm index a972b6e2a0..a4eac0278e 100644 --- a/code/controllers/autotransfer.dm +++ b/code/controllers/autotransfer.dm @@ -1,20 +1,20 @@ 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 var/shift_hard_end = 0 //VOREStation Edit var/shift_last_vote = 0 //VOREStation Edit -datum/controller/transfer_controller/New() +/datum/controller/transfer_controller/New() timerbuffer = config.vote_autotransfer_initial shift_hard_end = config.vote_autotransfer_initial + (config.vote_autotransfer_interval * config.vote_autotransfer_amount) //YW Edit: made that '1' a config //VOREStation Edit //Change this "1" to how many extend votes you want there to be. shift_last_vote = shift_hard_end - config.vote_autotransfer_interval //VOREStation Edit 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 //VOREStation Edit START if (round_duration_in_ds >= shift_last_vote - 2 MINUTES) diff --git a/code/controllers/communications.dm b/code/controllers/communications.dm index c1d87d7ef3..3839853567 100644 --- a/code/controllers/communications.dm +++ b/code/controllers/communications.dm @@ -194,9 +194,6 @@ var/list/DEPT_FREQS = list(AI_FREQ, COMM_FREQ, ENG_FREQ, ENT_FREQ, MED_FREQ, SEC var/list/OFFMAP_FREQS = list(TALON_FREQ) //VOREStation Add -#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/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/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/mapping.dm b/code/controllers/subsystems/mapping.dm index b7f14bf74f..848a5552d6 100644 --- a/code/controllers/subsystems/mapping.dm +++ b/code/controllers/subsystems/mapping.dm @@ -102,6 +102,10 @@ SUBSYSTEM_DEF(mapping) return for(var/map in picklist) + if(islist(map)) + // TRIPLE NEST. In this situation we pick one at random from the choices in the list. + //This allows a sort of a1,a2,a3,b1,b2,b3,c1,c2,c3 setup where it picks one 'a', one 'b', one 'c' + map = pick(map) var/datum/map_template/MT = map_templates[map] if(!istype(MT)) error("Randompick Z level \"[map]\" is not a valid map!") 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/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 7cfac614e6..12d1fee625 100644 --- a/code/datums/helper_datums/getrev.dm +++ b/code/datums/helper_datums/getrev.dm @@ -53,7 +53,7 @@ GLOBAL_DATUM(revdata, /datum/getrev) continue . += "#[tm.number][details]" -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/outfits/jobs/special_vr.dm b/code/datums/outfits/jobs/special_vr.dm index e16efb7947..20473f0e8e 100644 --- a/code/datums/outfits/jobs/special_vr.dm +++ b/code/datums/outfits/jobs/special_vr.dm @@ -22,9 +22,9 @@ pda_type = /obj/item/device/pda/centcom flags = OUTFIT_EXTENDED_SURVIVAL|OUTFIT_COMPREHENSIVE_SURVIVAL - post_equip(var/mob/living/carbon/human/H) - ..() - ert.add_antagonist(H.mind) +/decl/hierarchy/outfit/job/emergency_responder/post_equip(var/mob/living/carbon/human/H) + ..() + ert.add_antagonist(H.mind) /decl/hierarchy/outfit/job/clown name = OUTFIT_JOB_NAME("Clown") @@ -47,7 +47,7 @@ id_type = /obj/item/weapon/card/id/civilian/mime pda_type = /obj/item/device/pda/mime - post_equip(var/mob/living/carbon/human/H) - ..() - if(H.backbag == 1) - H.equip_to_slot_or_del(new /obj/item/weapon/pen/crayon/mime(H), slot_l_hand) +/decl/hierarchy/outfit/job/mime/post_equip(var/mob/living/carbon/human/H) + ..() + if(H.backbag == 1) + H.equip_to_slot_or_del(new /obj/item/weapon/pen/crayon/mime(H), slot_l_hand) 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/medical.dm b/code/datums/supplypacks/medical.dm index 69f198bbd4..28ed9f07bf 100644 --- a/code/datums/supplypacks/medical.dm +++ b/code/datums/supplypacks/medical.dm @@ -66,7 +66,8 @@ /obj/item/weapon/surgical/bonegel, /obj/item/weapon/surgical/retractor, /obj/item/weapon/surgical/bonesetter, - /obj/item/weapon/surgical/circular_saw + /obj/item/weapon/surgical/circular_saw, + /obj/item/weapon/surgical/bioregen ) cost = 25 containertype = /obj/structure/closet/crate/secure/veymed diff --git a/code/datums/supplypacks/munitions_vr.dm b/code/datums/supplypacks/munitions_vr.dm index fb0f0f9048..d9f23902f8 100644 --- a/code/datums/supplypacks/munitions_vr.dm +++ b/code/datums/supplypacks/munitions_vr.dm @@ -16,5 +16,5 @@ ) cost = 20 containertype = /obj/structure/closet/crate/secure - containername = "frontier phaser crate" + containername = "phaser handbow crate" access = access_explorer 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 33f30174fb..b926fa8b8d 100644 --- a/code/datums/supplypacks/security.dm +++ b/code/datums/supplypacks/security.dm @@ -668,9 +668,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/medical.dm b/code/datums/uplink/medical.dm index 0657b62b2e..c7b0b0d123 100644 --- a/code/datums/uplink/medical.dm +++ b/code/datums/uplink/medical.dm @@ -33,7 +33,12 @@ /datum/uplink_item/item/medical/bonemeds name = "Bone Repair injector" item_cost = 10 - path = /obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/bonemed + path = /obj/item/weapon/reagent_containers/hypospray/autoinjector/bonemed + +/datum/uplink_item/item/medical/clonemeds + name = "Clone injector" + item_cost = 15 + path = /obj/item/weapon/reagent_containers/hypospray/autoinjector/clonemed /datum/uplink_item/item/medical/bonemeds_case name = "Bone Repair case" @@ -41,6 +46,12 @@ desc = "A case of three osteodaxon injectors. Can rapidly remove and stow up to six injectors." path = /obj/item/weapon/storage/quickdraw/syringe_case/bonemed +/datum/uplink_item/item/medical/clonemeds_case + name = "Clone case" + item_cost = 30 + desc = "A case of three rezadone injectors. Can rapidly remove and stow up to six injectors." + path = /obj/item/weapon/storage/quickdraw/syringe_case/clonemed + /datum/uplink_item/item/medical/ambrosiadeusseeds name = "Box of 7x ambrosia deus seed packets" item_cost = 10 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 9778492615..3a7517507d 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 = "" @@ -129,9 +129,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/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 9ea9023de4..23c2025b84 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 = GLOB.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 23c66f7869..c6217291cd 100755 --- a/code/game/area/Space Station 13 areas.dm +++ b/code/game/area/Space Station 13 areas.dm @@ -1483,29 +1483,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 e43b024ed1..c25e0e3c15 100644 --- a/code/game/area/asteroid_areas.dm +++ b/code/game/area/asteroid_areas.dm @@ -134,9 +134,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/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 ef0af0fab7..93a2895311 100644 --- a/code/game/dna/dna2.dm +++ b/code/game/dna/dna2.dm @@ -89,10 +89,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 aea5270f95..48394146b5 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 98a41a2be4..fa3dba92bc 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 2834b81cbd..a241b80256 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 == USELESS_JOB) //VOREStation Edit - Visitor not 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 == USELESS_JOB) //VOREStation Edit - Visitor not 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 7999b47c98..76bceb2982 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 diff --git a/code/game/gamemodes/technomancer/spell_objs.dm b/code/game/gamemodes/technomancer/spell_objs.dm index a9eb862ee9..f8833d13b2 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 e7d0ae9177..dd41ba70a8 100644 --- a/code/game/jobs/access.dm +++ b/code/game/jobs/access.dm @@ -230,13 +230,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/special_vr.dm b/code/game/jobs/job/special_vr.dm index 9862f653be..fff0c70ec4 100644 --- a/code/game/jobs/job/special_vr.dm +++ b/code/game/jobs/job/special_vr.dm @@ -21,8 +21,8 @@ pto_type = PTO_CIVILIAN - get_access() - return get_all_accesses().Copy() +/datum/job/centcom_officer/get_access() + return get_all_accesses().Copy() /datum/job/emergency_responder //For staff managing/leading ERTs title = "Emergency Responder" @@ -47,8 +47,8 @@ pto_type = PTO_CIVILIAN - get_access() - return get_all_accesses().Copy() +/datum/job/emergency_responder/get_access() + return get_all_accesses().Copy() //YW UNCOMMENTINGSTART: INSTATE LOYALTY IMPLANT /datum/job/centcom_officer/equip(var/mob/living/carbon/human/H) diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm index 5f2fa97e54..2e45691570 100644 --- a/code/game/jobs/job_controller.dm +++ b/code/game/jobs/job_controller.dm @@ -14,637 +14,637 @@ 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 - //VOREStation Add - if(!job.player_has_enough_playtime(player.client)) - return 0 - if(!is_job_whitelisted(player, rank)) - return 0 - //VOREStation Add End - - 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 + //VOREStation Add + if(!job.player_has_enough_playtime(player.client)) + return 0 + if(!is_job_whitelisted(player, rank)) + return 0 + //VOREStation Add End + + 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 - //VOREStation Code Start - if(!job.player_has_enough_playtime(player.client)) - Debug("FOC character not enough playtime, Player: [player]") - continue - if(!is_job_whitelisted(player, job.title)) - Debug("FOC is_job_whitelisted failed, Player: [player]") - continue - //VOREStation Code End - 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 + //VOREStation Code Start + if(!job.player_has_enough_playtime(player.client)) + Debug("FOC character not enough playtime, Player: [player]") + continue + if(!is_job_whitelisted(player, job.title)) + Debug("FOC is_job_whitelisted failed, Player: [player]") + continue + //VOREStation Code End + 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(USELESS_JOB))) // We don't want to give him assistant, that's boring! //VOREStation Edit - Visitor not Assistant - 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(USELESS_JOB))) // We don't want to give him assistant, that's boring! //VOREStation Edit - Visitor not Assistant + 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 - //VOREStation Code Start - if(!job.player_has_enough_playtime(player.client)) - Debug("GRJ player not enough playtime, Player: [player]") - continue - if(!is_job_whitelisted(player, job.title)) - Debug("GRJ player not whitelisted for this job, Player: [player], Job: [job.title]") - continue - //VOREStation Code End + if(!job.player_old_enough(player.client)) + Debug("GRJ player not old enough, Player: [player]") + 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 + //VOREStation Code Start + if(!job.player_has_enough_playtime(player.client)) + Debug("GRJ player not enough playtime, Player: [player]") + continue + if(!is_job_whitelisted(player, job.title)) + Debug("GRJ player not whitelisted for this job, Player: [player], Job: [job.title]") + continue + //VOREStation Code End - 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, USELESS_JOB) //VOREStation Edit - Visitor not 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, USELESS_JOB) //VOREStation Edit - Visitor not 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 - - //VOREStation Add - if(!job.player_has_enough_playtime(player.client)) - Debug("DO player not enough playtime, Player: [player]") - continue - //VOREStation Add End - - // 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) - 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") - - 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, USELESS_JOB) //VOREStation Edit - Visitor not 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 - - - 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() - 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]\"") - log_game("SPECIES [key_name(H)] is a: \"[H.species.name]\"") //VOREStation Add - - // 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) - 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 - - - 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++ + Debug("DO isbanned failed, Player: [player], Job:[job.title]") continue + if(!job.player_old_enough(player.client)) - level6++ + Debug("DO player not old enough, Player: [player], Job:[job.title]") continue + //VOREStation Add if(!job.player_has_enough_playtime(player.client)) - level6++ + Debug("DO player not enough playtime, Player: [player]") continue //VOREStation Add End - 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) + // 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 + 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 + 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*/ + + Debug("DO, Standard Check end") + + 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, USELESS_JOB) //VOREStation Edit - Visitor not 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() + 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]\"") + log_game("SPECIES [key_name(H)] is a: \"[H.species.name]\"") //VOREStation Add + + // 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 + //VOREStation Add + if(!job.player_has_enough_playtime(player.client)) + level6++ + continue + //VOREStation Add End + 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) /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/air_alarm.dm b/code/game/machinery/air_alarm.dm index b03acc5258..0555964d87 100644 --- a/code/game/machinery/air_alarm.dm +++ b/code/game/machinery/air_alarm.dm @@ -568,21 +568,22 @@ var/list/info = alarm_area.air_scrub_info[id_tag] if(!info) continue - var/list/list/filters = list() - scrubbers.Add(list(list( + scrubbers += list(list( "id_tag" = id_tag, "long_name" = sanitize(long_name), "power" = info["power"], "scrubbing" = info["scrubbing"], "panic" = info["panic"], - "filters" = filters - ))) - filters.Add(list(list("name" = "Oxygen", "command" = "o2_scrub", "val" = info["filter_o2"]))) - filters.Add(list(list("name" = "Nitrogen", "command" = "n2_scrub", "val" = info["filter_n2"]))) - filters.Add(list(list("name" = "Carbon Dioxide", "command" = "co2_scrub","val" = info["filter_co2"]))) - filters.Add(list(list("name" = "Toxin" , "command" = "tox_scrub","val" = info["filter_phoron"]))) - filters.Add(list(list("name" = "Nitrous Oxide", "command" = "n2o_scrub","val" = info["filter_n2o"]))) - filters.Add(list(list("name" = "Fuel", "command" = "fuel_scrub","val" = info["filter_fuel"]))) + "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"]) + ) + )) + data["scrubbers"] = scrubbers data["mode"] = mode @@ -798,4 +799,4 @@ TLV["temperature"] = list(T0C - 40, T0C - 20, T0C + 40, T0C + 66) // K, Lower Temperature for Freezer Air Alarms (This is because TLV is hardcoded to be generated on first_run, and therefore the only way to modify this without changing TLV generation) -// VOREStation Edit End \ No newline at end of file +// VOREStation Edit End 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/biogenerator.dm b/code/game/machinery/biogenerator.dm index c193417572..2790a5ec15 100644 --- a/code/game/machinery/biogenerator.dm +++ b/code/game/machinery/biogenerator.dm @@ -305,5 +305,3 @@ build_eff = man_rating eat_eff = bin_rating - -#undef BIOGENITEM 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 6993fa6e0f..53da61382e 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -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/computer.dm b/code/game/machinery/computer/computer.dm index 110b70ab8c..956c3fe2d7 100644 --- a/code/game/machinery/computer/computer.dm +++ b/code/game/machinery/computer/computer.dm @@ -35,11 +35,11 @@ /obj/machinery/computer/ex_act(severity) switch(severity) if(1.0) - qdel(src) + fall_apart(severity) return if(2.0) if (prob(25)) - qdel(src) + fall_apart(severity) return if (prob(50)) for(var/x in verbs) 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/computer/supply.dm b/code/game/machinery/computer/supply.dm index 7783fa7eb0..6b9b0f7380 100644 --- a/code/game/machinery/computer/supply.dm +++ b/code/game/machinery/computer/supply.dm @@ -65,7 +65,7 @@ if(shuttle.has_arrive_time()) shuttle_status["location"] = "In transit" shuttle_status["mode"] = SUP_SHUTTLE_TRANSIT - shuttle_status["time"] = shuttle.eta_seconds() + shuttle_status["time"] = shuttle.eta_deciseconds() // tgui expects time for it's formatTime() in DS else shuttle_status["time"] = 0 diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 6288de28b2..d06e53271b 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -1,1530 +1,1534 @@ -//VOREStation Edit - Redone a lot of airlock things: -/* -- Specific department maintenance doors -- Named doors properly according to type -- Gave them default access levels with the access constants -- Improper'd all of the names in the new() -*/ - -/obj/machinery/door/airlock - name = "Airlock" - icon = 'icons/obj/doors/Doorint.dmi' - icon_state = "door_closed" - power_channel = ENVIRON - - explosion_resistance = 10 - blocks_emissive = EMISSIVE_BLOCK_GENERIC // Not quite as nice as /tg/'s custom masks. We should make those sometime - - var/aiControlDisabled = 0 //If 1, AI control is disabled until the AI hacks back in and disables the lock. If 2, the AI has bypassed the lock. If -1, the control is enabled but the AI had bypassed it earlier, so if it is disabled again the AI would have no trouble getting back in. - var/hackProof = 0 // if 1, this door can't be hacked by the AI - var/electrified_until = 0 //World time when the door is no longer electrified. -1 if it is permanently electrified until someone fixes it. - var/main_power_lost_until = 0 //World time when main power is restored. - var/backup_power_lost_until = -1 //World time when backup power is restored. - var/has_beeped = 0 //If 1, will not beep on failed closing attempt. Resets when door closes. - var/spawnPowerRestoreRunning = 0 - var/welded = null - var/locked = 0 - var/lights = 1 // bolt lights show by default - var/aiDisabledIdScanner = 0 - var/aiHacking = 0 - var/obj/machinery/door/airlock/closeOther = null - var/closeOtherId = null - var/lockdownbyai = 0 - autoclose = 1 - var/assembly_type = /obj/structure/door_assembly - var/mineral = null - var/justzap = 0 - var/safe = 1 - normalspeed = 1 - var/obj/item/weapon/airlock_electronics/electronics = null - var/hasShocked = 0 //Prevents multiple shocks from happening - var/secured_wires = 0 - var/datum/wires/airlock/wires = null - - var/open_sound_powered = 'sound/machines/door/covert1o.ogg' - var/open_sound_unpowered = 'sound/machines/door/airlockforced.ogg' - var/close_sound_powered = 'sound/machines/door/covert1c.ogg' - var/legacy_open_powered = 'sound/machines/door/old_airlock.ogg' - var/legacy_close_powered = 'sound/machines/door/old_airlockclose.ogg' - var/department_open_powered = null - var/department_close_powered = null - var/denied_sound = 'sound/machines/deniedbeep.ogg' - var/bolt_up_sound = 'sound/machines/door/boltsup.ogg' - var/bolt_down_sound = 'sound/machines/door/boltsdown.ogg' - -/obj/machinery/door/airlock/attack_generic(var/mob/living/user, var/damage) - if(stat & (BROKEN|NOPOWER)) - if(damage >= STRUCTURE_MIN_DAMAGE_THRESHOLD) - if(src.locked || src.welded) - visible_message("\The [user] begins breaking into \the [src] internals!") - user.set_AI_busy(TRUE) // If the mob doesn't have an AI attached, this won't do anything. - if(do_after(user,10 SECONDS,src)) - src.locked = 0 - src.welded = 0 - update_icon() - open(1) - if(prob(25)) - src.shock(user, 100) - user.set_AI_busy(FALSE) - else if(src.density) - visible_message("\The [user] forces \the [src] open!") - open(1) - else - visible_message("\The [user] forces \the [src] closed!") - close(1) - else - visible_message("\The [user] strains fruitlessly to force \the [src] [density ? "open" : "closed"].") - return - ..() - -/obj/machinery/door/airlock/attack_alien(var/mob/user) //Familiar, right? Doors. -Mechoid - if(istype(user, /mob/living/carbon/human)) - var/mob/living/carbon/human/X = user - if(istype(X.species, /datum/species/xenos)) - if(src.locked || src.welded) - visible_message("\The [user] begins digging into \the [src] internals!") - src.do_animate("deny") - if(do_after(user,5 SECONDS,src)) - visible_message("\The [user] forces \the [src] open, sparks flying from its electronics!") - src.do_animate("spark") - playsound(src, 'sound/machines/door/airlock_creaking.ogg', 100, 1, volume_channel = VOLUME_CHANNEL_DOORS) - src.locked = 0 - src.welded = 0 - update_icon() - open(1) - src.emag_act() - else if(src.density) - visible_message("\The [user] begins forcing \the [src] open!") - if(do_after(user, 5 SECONDS,src)) - playsound(src, 'sound/machines/door/airlock_creaking.ogg', 100, 1, volume_channel = VOLUME_CHANNEL_DOORS) - visible_message("\The [user] forces \the [src] open!") - open(1) - else - visible_message("\The [user] forces \the [src] closed!") - close(1) - else - src.do_animate("deny") - visible_message("\The [user] strains fruitlessly to force \the [src] [density ? "open" : "closed"].") - return - ..() - -/obj/machinery/door/airlock/get_material() - if(mineral) - return get_material_by_name(mineral) - return get_material_by_name(DEFAULT_WALL_MATERIAL) - -/obj/machinery/door/airlock/command - name = "Command Airlock" - icon = 'icons/obj/doors/Doorcom.dmi' - req_one_access = list(access_heads) - assembly_type = /obj/structure/door_assembly/door_assembly_com - open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - department_open_powered = 'sound/machines/door/cmd3o.ogg' - department_close_powered = 'sound/machines/door/cmd3c.ogg' - -/obj/machinery/door/airlock/security - name = "Security Airlock" - icon = 'icons/obj/doors/Doorsec.dmi' - req_one_access = list(access_security) - assembly_type = /obj/structure/door_assembly/door_assembly_sec - open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - department_open_powered = 'sound/machines/door/sec1o.ogg' - department_close_powered = 'sound/machines/door/sec1c.ogg' - -/obj/machinery/door/airlock/engineering - name = "Engineering Airlock" - icon = 'icons/obj/doors/Dooreng.dmi' - req_one_access = list(access_engine) - assembly_type = /obj/structure/door_assembly/door_assembly_eng - open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - department_open_powered = 'sound/machines/door/eng1o.ogg' - department_close_powered = 'sound/machines/door/eng1c.ogg' - -/obj/machinery/door/airlock/engineeringatmos - name = "Atmospherics Airlock" - icon = 'icons/obj/doors/Doorengatmos.dmi' - req_one_access = list(access_atmospherics) - assembly_type = /obj/structure/door_assembly/door_assembly_eat - open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - department_open_powered = 'sound/machines/door/eng1o.ogg' - department_close_powered = 'sound/machines/door/eng1c.ogg' - -/obj/machinery/door/airlock/medical - name = "Medical Airlock" - icon = 'icons/obj/doors/Doormed.dmi' - req_one_access = list(access_medical) - assembly_type = /obj/structure/door_assembly/door_assembly_med - open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - department_open_powered = 'sound/machines/door/med1o.ogg' - department_close_powered = 'sound/machines/door/med1c.ogg' - -/obj/machinery/door/airlock/maintenance - name = "Maintenance Access" - icon = 'icons/obj/doors/Doormaint.dmi' - //req_one_access = list(access_maint_tunnels) //VOREStation Edit - Maintenance is open access - assembly_type = /obj/structure/door_assembly/door_assembly_mai - open_sound_powered = 'sound/machines/door/door2o.ogg' - close_sound_powered = 'sound/machines/door/door2c.ogg' - -/obj/machinery/door/airlock/maintenance/cargo - icon = 'icons/obj/doors/Doormaint_cargo.dmi' - req_one_access = list(access_cargo) - open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - department_open_powered = 'sound/machines/door/door2o.ogg' - department_close_powered = 'sound/machines/door/door2c.ogg' - -/obj/machinery/door/airlock/maintenance/command - icon = 'icons/obj/doors/Doormaint_command.dmi' - req_one_access = list(access_heads) - -/obj/machinery/door/airlock/maintenance/common - icon = 'icons/obj/doors/Doormaint_common.dmi' - open_sound_powered = 'sound/machines/door/hall3o.ogg' - close_sound_powered = 'sound/machines/door/hall3c.ogg' - -/obj/machinery/door/airlock/maintenance/engi - icon = 'icons/obj/doors/Doormaint_engi.dmi' - req_one_access = list(access_engine) - -/obj/machinery/door/airlock/maintenance/int - icon = 'icons/obj/doors/Doormaint_int.dmi' - -/obj/machinery/door/airlock/maintenance/medical - icon = 'icons/obj/doors/Doormaint_med.dmi' - req_one_access = list(access_medical) - -/obj/machinery/door/airlock/maintenance/rnd - icon = 'icons/obj/doors/Doormaint_rnd.dmi' - req_one_access = list(access_research) - -/obj/machinery/door/airlock/maintenance/sec - icon = 'icons/obj/doors/Doormaint_sec.dmi' - req_one_access = list(access_security) - -/obj/machinery/door/airlock/external - name = "External Airlock" - icon = 'icons/obj/doors/Doorext.dmi' - assembly_type = /obj/structure/door_assembly/door_assembly_ext - open_sound_powered = 'sound/machines/door/space1o.ogg' - close_sound_powered = 'sound/machines/door/space1c.ogg' - -/obj/machinery/door/airlock/external/glass/bolted - icon_state = "door_locked" // So it looks visibly bolted in map editor - locked = 1 - -// For convenience in making docking ports: one that is pre-bolted with frequency set! -/obj/machinery/door/airlock/external/glass/bolted/cycling - frequency = 1379 - -/obj/machinery/door/airlock/glass_external - name = "External Airlock" - icon = 'icons/obj/doors/Doorextglass.dmi' - assembly_type = /obj/structure/door_assembly/door_assembly_ext - opacity = 0 - glass = 1 - req_one_access = list(access_external_airlocks) - open_sound_powered = 'sound/machines/door/space1o.ogg' - close_sound_powered = 'sound/machines/door/space1c.ogg' - -/obj/machinery/door/airlock/glass - name = "Glass Airlock" - icon = 'icons/obj/doors/Doorglass.dmi' - hitsound = 'sound/effects/Glasshit.ogg' - open_sound_powered = 'sound/machines/door/hall1o.ogg' - close_sound_powered = 'sound/machines/door/hall1c.ogg' - legacy_open_powered = 'sound/machines/door/windowdoor.ogg' - maxhealth = 300 - explosion_resistance = 5 - opacity = 0 - glass = 1 - -/obj/machinery/door/airlock/centcom - name = "Centcom Airlock" - icon = 'icons/obj/doors/Doorele.dmi' - req_one_access = list(access_cent_general) - opacity = 1 - open_sound_powered = 'sound/machines/door/cmd3o.ogg' - close_sound_powered = 'sound/machines/door/cmd3c.ogg' - -/obj/machinery/door/airlock/glass_centcom - name = "Airlock" - icon = 'icons/obj/doors/Dooreleglass.dmi' - opacity = 0 - glass = 1 - open_sound_powered = 'sound/machines/door/cmd3o.ogg' - close_sound_powered = 'sound/machines/door/cmd3c.ogg' - -/obj/machinery/door/airlock/vault - name = "Vault" - icon = 'icons/obj/doors/vault.dmi' - explosion_resistance = 20 - opacity = 1 - secured_wires = 1 - assembly_type = /obj/structure/door_assembly/door_assembly_highsecurity //Until somebody makes better sprites. - req_one_access = list(access_heads_vault) - open_sound_powered = 'sound/machines/door/vault1o.ogg' - close_sound_powered = 'sound/machines/door/vault1c.ogg' - -/obj/machinery/door/airlock/vault/bolted - icon_state = "door_locked" - locked = 1 - -/obj/machinery/door/airlock/freezer - name = "Freezer Airlock" - icon = 'icons/obj/doors/Doorfreezer.dmi' - opacity = 1 - assembly_type = /obj/structure/door_assembly/door_assembly_fre - -/obj/machinery/door/airlock/hatch - name = "Airtight Hatch" - icon = 'icons/obj/doors/Doorhatchele.dmi' - explosion_resistance = 20 - opacity = 1 - assembly_type = /obj/structure/door_assembly/door_assembly_hatch - req_one_access = list(access_maint_tunnels) - open_sound_powered = 'sound/machines/door/hatchopen.ogg' - close_sound_powered = 'sound/machines/door/hatchclose.ogg' - open_sound_unpowered = 'sound/machines/door/hatchforced.ogg' - -/obj/machinery/door/airlock/maintenance_hatch - name = "Maintenance Hatch" - icon = 'icons/obj/doors/Doorhatchmaint2.dmi' - explosion_resistance = 20 - opacity = 1 - assembly_type = /obj/structure/door_assembly/door_assembly_mhatch - req_one_access = list(access_maint_tunnels) - open_sound_powered = 'sound/machines/door/hatchopen.ogg' - close_sound_powered = 'sound/machines/door/hatchclose.ogg' - open_sound_unpowered = 'sound/machines/door/hatchforced.ogg' - -/obj/machinery/door/airlock/glass_command - name = "Command Airlock" - icon = 'icons/obj/doors/Doorcomglass.dmi' - hitsound = 'sound/effects/Glasshit.ogg' - maxhealth = 300 - explosion_resistance = 5 - opacity = 0 - assembly_type = /obj/structure/door_assembly/door_assembly_com - glass = 1 - req_one_access = list(access_heads) - open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - department_open_powered = 'sound/machines/door/cmd1o.ogg' - department_close_powered = 'sound/machines/door/cmd1c.ogg' - -/obj/machinery/door/airlock/glass_engineering - name = "Engineering Airlock" - icon = 'icons/obj/doors/Doorengglass.dmi' - hitsound = 'sound/effects/Glasshit.ogg' - maxhealth = 300 - explosion_resistance = 5 - opacity = 0 - assembly_type = /obj/structure/door_assembly/door_assembly_eng - glass = 1 - req_one_access = list(access_engine) - department_open_powered = 'sound/machines/door/eng1o.ogg' - department_close_powered = 'sound/machines/door/eng1c.ogg' - -/obj/machinery/door/airlock/glass_engineeringatmos - name = "Atmospherics Airlock" - icon = 'icons/obj/doors/Doorengatmoglass.dmi' - hitsound = 'sound/effects/Glasshit.ogg' - maxhealth = 300 - explosion_resistance = 5 - opacity = 0 - assembly_type = /obj/structure/door_assembly/door_assembly_eat - glass = 1 - req_one_access = list(access_atmospherics) - open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - department_open_powered = 'sound/machines/door/eng1o.ogg' - department_close_powered = 'sound/machines/door/eng1c.ogg' - -/obj/machinery/door/airlock/glass_security - name = "Security Airlock" - icon = 'icons/obj/doors/Doorsecglass.dmi' - hitsound = 'sound/effects/Glasshit.ogg' - maxhealth = 300 - explosion_resistance = 5 - opacity = 0 - assembly_type = /obj/structure/door_assembly/door_assembly_sec - glass = 1 - req_one_access = list(access_security) - open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - department_open_powered = 'sound/machines/door/sec1o.ogg' - department_close_powered = 'sound/machines/door/sec1c.ogg' - -/obj/machinery/door/airlock/glass_medical - name = "Medical Airlock" - icon = 'icons/obj/doors/Doormedglass.dmi' - hitsound = 'sound/effects/Glasshit.ogg' - maxhealth = 300 - explosion_resistance = 5 - opacity = 0 - assembly_type = /obj/structure/door_assembly/door_assembly_med - glass = 1 - req_one_access = list(access_medical) - open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - department_open_powered = 'sound/machines/door/med1o.ogg' - department_close_powered = 'sound/machines/door/med1c.ogg' - -/obj/machinery/door/airlock/mining - name = "Mining Airlock" - icon = 'icons/obj/doors/Doormining.dmi' - assembly_type = /obj/structure/door_assembly/door_assembly_min - req_one_access = list(access_mining) - open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - department_open_powered = 'sound/machines/door/cgo1o.ogg' - department_close_powered = 'sound/machines/door/cgo1c.ogg' - -/obj/machinery/door/airlock/atmos - name = "Atmospherics Airlock" - icon = 'icons/obj/doors/Dooratmo.dmi' - assembly_type = /obj/structure/door_assembly/door_assembly_atmo - req_one_access = list(access_atmospherics) - open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - department_open_powered = 'sound/machines/door/eng1o.ogg' - department_close_powered = 'sound/machines/door/eng1c.ogg' - -/obj/machinery/door/airlock/research - name = "Research Airlock" - icon = 'icons/obj/doors/Doorresearch.dmi' - assembly_type = /obj/structure/door_assembly/door_assembly_research - open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - department_open_powered = 'sound/machines/door/sci1o.ogg' - department_close_powered = 'sound/machines/door/sci1c.ogg' - -/obj/machinery/door/airlock/glass_research - name = "Research Airlock" - icon = 'icons/obj/doors/Doorresearchglass.dmi' - hitsound = 'sound/effects/Glasshit.ogg' - maxhealth = 300 - explosion_resistance = 5 - opacity = 0 - assembly_type = /obj/structure/door_assembly/door_assembly_research - glass = 1 - req_one_access = list(access_research) - open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - department_open_powered = 'sound/machines/door/sci1o.ogg' - department_close_powered = 'sound/machines/door/sci1c.ogg' - -/obj/machinery/door/airlock/glass_mining - name = "Mining Airlock" - icon = 'icons/obj/doors/Doorminingglass.dmi' - hitsound = 'sound/effects/Glasshit.ogg' - maxhealth = 300 - explosion_resistance = 5 - opacity = 0 - assembly_type = /obj/structure/door_assembly/door_assembly_min - glass = 1 - req_one_access = list(access_mining) - open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - department_open_powered = 'sound/machines/door/cgo1o.ogg' - department_close_powered = 'sound/machines/door/cgo1c.ogg' - -/obj/machinery/door/airlock/glass_atmos - name = "Atmospherics Airlock" - icon = 'icons/obj/doors/Dooratmoglass.dmi' - hitsound = 'sound/effects/Glasshit.ogg' - maxhealth = 300 - explosion_resistance = 5 - opacity = 0 - assembly_type = /obj/structure/door_assembly/door_assembly_atmo - glass = 1 - req_one_access = list(access_atmospherics) - open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - department_open_powered = 'sound/machines/door/eng1o.ogg' - department_close_powered = 'sound/machines/door/eng1c.ogg' - -/obj/machinery/door/airlock/gold - name = "Gold Airlock" - icon = 'icons/obj/doors/Doorgold.dmi' - mineral = "gold" - -/obj/machinery/door/airlock/silver - name = "Silver Airlock" - icon = 'icons/obj/doors/Doorsilver.dmi' - mineral = "silver" - -/obj/machinery/door/airlock/diamond - name = "Diamond Airlock" - icon = 'icons/obj/doors/Doordiamond.dmi' - mineral = "diamond" - -/obj/machinery/door/airlock/uranium - name = "Uranium Airlock" - desc = "And they said I was crazy." - icon = 'icons/obj/doors/Dooruranium.dmi' - mineral = "uranium" - var/last_event = 0 - var/rad_power = 7.5 - -/obj/machinery/door/airlock/process() - // Deliberate no call to parent. - if(main_power_lost_until > 0 && world.time >= main_power_lost_until) - regainMainPower() - - if(backup_power_lost_until > 0 && world.time >= backup_power_lost_until) - regainBackupPower() - - else if(electrified_until > 0 && world.time >= electrified_until) - electrify(0) - - if (..() == PROCESS_KILL && !(main_power_lost_until > 0 || backup_power_lost_until > 0 || electrified_until > 0)) - . = PROCESS_KILL - -/obj/machinery/door/airlock/uranium/process() - if(world.time > last_event+20) - if(prob(50)) - SSradiation.radiate(src, rad_power) - last_event = world.time - ..() - -/obj/machinery/door/airlock/phoron - name = "Phoron Airlock" - desc = "No way this can end badly." - icon = 'icons/obj/doors/Doorphoron.dmi' - mineral = "phoron" - -/obj/machinery/door/airlock/phoron/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume) - if(exposed_temperature > 300) - PhoronBurn(exposed_temperature) - -/obj/machinery/door/airlock/phoron/proc/ignite(exposed_temperature) - if(exposed_temperature > 300) - PhoronBurn(exposed_temperature) - -/obj/machinery/door/airlock/phoron/proc/PhoronBurn(temperature) - for(var/turf/simulated/floor/target_tile in range(2,loc)) - target_tile.assume_gas("phoron", 35, 400+T0C) - spawn (0) target_tile.hotspot_expose(temperature, 400) - for(var/turf/simulated/wall/W in range(3,src)) - W.burn((temperature/4))//Added so that you can't set off a massive chain reaction with a small flame - for(var/obj/machinery/door/airlock/phoron/D in range(3,src)) - D.ignite(temperature/4) - new/obj/structure/door_assembly( src.loc ) - qdel(src) - -/obj/machinery/door/airlock/sandstone - name = "Sandstone Airlock" - icon = 'icons/obj/doors/Doorsand.dmi' - mineral = "sandstone" - -/obj/machinery/door/airlock/science - name = "Research Airlock" - icon = 'icons/obj/doors/Doorsci.dmi' - assembly_type = /obj/structure/door_assembly/door_assembly_science - req_one_access = list(access_research) - open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - department_open_powered = 'sound/machines/door/sci1o.ogg' - department_close_powered = 'sound/machines/door/sci1c.ogg' - -/obj/machinery/door/airlock/glass_science - name = "Glass Airlocks" - icon = 'icons/obj/doors/Doorsciglass.dmi' - opacity = 0 - assembly_type = /obj/structure/door_assembly/door_assembly_science - glass = 1 - req_one_access = list(access_research) - open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. - department_open_powered = 'sound/machines/door/sci1o.ogg' - department_close_powered = 'sound/machines/door/sci1c.ogg' - -/obj/machinery/door/airlock/highsecurity - name = "Secure Airlock" - icon = 'icons/obj/doors/hightechsecurity.dmi' - explosion_resistance = 20 - secured_wires = 1 - assembly_type = /obj/structure/door_assembly/door_assembly_highsecurity - req_one_access = list(access_heads_vault) - open_sound_powered = 'sound/machines/door/secure1o.ogg' - close_sound_powered = 'sound/machines/door/secure1c.ogg' - -/obj/machinery/door/airlock/voidcraft - name = "voidcraft hatch" - desc = "It's an extra resilient airlock intended for spacefaring vessels." - icon = 'icons/obj/doors/shuttledoors.dmi' - explosion_resistance = 20 - opacity = 0 - glass = 1 - assembly_type = /obj/structure/door_assembly/door_assembly_voidcraft - open_sound_powered = 'sound/machines/door/shuttle1o.ogg' - close_sound_powered = 'sound/machines/door/shuttle1c.ogg' - -// Airlock opens from top-bottom instead of left-right. -/obj/machinery/door/airlock/voidcraft/vertical - icon = 'icons/obj/doors/shuttledoors_vertical.dmi' - assembly_type = /obj/structure/door_assembly/door_assembly_voidcraft/vertical - open_sound_powered = 'sound/machines/door/shuttle1o.ogg' - close_sound_powered = 'sound/machines/door/shuttle1c.ogg' - - -/datum/category_item/catalogue/anomalous/precursor_a/alien_airlock - name = "Precursor Alpha Object - Doors" - desc = "This object appears to be used in order to restrict or allow access to \ - rooms based on its physical state. In other words, a door. \ - Despite being designed and created by unknown ancient alien hands, this door has \ - a large number of similarities to the conventional airlock, such as being driven by \ - electricity, opening and closing by physically moving, and being air tight. \ - It also operates by responding to signals through internal electrical conduits. \ - These characteristics make it possible for one with experience with a multitool \ - to manipulate the door.\ -

\ - The symbol on the door does not match any living species' patterns, giving further \ - implications that this door is very old, and yet it remains operational after \ - thousands of years. It is unknown if that is due to superb construction, or \ - unseen autonomous maintenance having been performed." - value = CATALOGUER_REWARD_EASY - -/obj/machinery/door/airlock/alien - name = "alien airlock" - desc = "You're fairly sure this is a door." - catalogue_data = list(/datum/category_item/catalogue/anomalous/precursor_a/alien_airlock) - icon = 'icons/obj/doors/Dooralien.dmi' - explosion_resistance = 20 - secured_wires = TRUE - hackProof = TRUE - assembly_type = /obj/structure/door_assembly/door_assembly_alien - req_one_access = list(access_alien) - -/obj/machinery/door/airlock/alien/locked - icon_state = "door_locked" - locked = TRUE - -/obj/machinery/door/airlock/alien/public // Entry to UFO. - req_one_access = list() - normalspeed = FALSE // So it closes faster and hopefully keeps the warm air inside. - hackProof = TRUE //VOREStation Edit - No borgos - -/* -About the new airlock wires panel: -* An airlock wire dialog can be accessed by the normal way or by using wirecutters or a multitool on the door while the wire-panel is open. This would show the following wires, which you can either wirecut/mend or send a multitool pulse through. There are 9 wires. -* one wire from the ID scanner. Sending a pulse through this flashes the red light on the door (if the door has power). If you cut this wire, the door will stop recognizing valid IDs. (If the door has 0000 access, it still opens and closes, though) -* two wires for power. Sending a pulse through either one causes a breaker to trip, disabling the door for 10 seconds if backup power is connected, or 1 minute if not (or until backup power comes back on, whichever is shorter). Cutting either one disables the main door power, but unless backup power is also cut, the backup power re-powers the door in 10 seconds. While unpowered, the door may be open, but bolts-raising will not work. Cutting these wires may electrocute the user. -* one wire for door bolts. Sending a pulse through this drops door bolts (whether the door is powered or not) or raises them (if it is). Cutting this wire also drops the door bolts, and mending it does not raise them. If the wire is cut, trying to raise the door bolts will not work. -* two wires for backup power. Sending a pulse through either one causes a breaker to trip, but this does not disable it unless main power is down too (in which case it is disabled for 1 minute or however long it takes main power to come back, whichever is shorter). Cutting either one disables the backup door power (allowing it to be crowbarred open, but disabling bolts-raising), but may electocute the user. -* one wire for opening the door. Sending a pulse through this while the door has power makes it open the door if no access is required. -* one wire for AI control. Sending a pulse through this blocks AI control for a second or so (which is enough to see the AI control light on the panel dialog go off and back on again). Cutting this prevents the AI from controlling the door unless it has hacked the door through the power connection (which takes about a minute). If both main and backup power are cut, as well as this wire, then the AI cannot operate or hack the door at all. -* one wire for electrifying the door. Sending a pulse through this electrifies the door for 30 seconds. Cutting this wire electrifies the door, so that the next person to touch the door without insulated gloves gets electrocuted. (Currently it is also STAYING electrified until someone mends the wire) -* one wire for controling door safetys. When active, door does not close on someone. When cut, door will ruin someone's shit. When pulsed, door will immedately ruin someone's shit. -* one wire for controlling door speed. When active, dor closes at normal rate. When cut, door does not close manually. When pulsed, door attempts to close every tick. -*/ - - - -/obj/machinery/door/airlock/bumpopen(mob/living/user as mob) //Airlocks now zap you when you 'bump' them open when they're electrified. --NeoFite - if(!issilicon(usr)) - if(src.isElectrified()) - if(!src.justzap) - if(src.shock(user, 100)) - src.justzap = 1 - spawn (10) - src.justzap = 0 - return - else /*if(src.justzap)*/ - return - else if(user.hallucination > 50 && prob(10) && src.operating == 0) - to_chat(user, "You feel a powerful shock course through your body!") - user.halloss += 10 - user.stunned += 10 - return - ..(user) - -/obj/machinery/door/airlock/proc/isElectrified() - if(src.electrified_until != 0) - return 1 - return 0 - -/obj/machinery/door/airlock/proc/canAIControl() - return ((src.aiControlDisabled!=1) && (!src.isAllPowerLoss())); - -/obj/machinery/door/airlock/proc/canAIHack() - return ((src.aiControlDisabled==1) && (!hackProof) && (!src.isAllPowerLoss())); - -/obj/machinery/door/airlock/proc/arePowerSystemsOn() - if (stat & (NOPOWER|BROKEN)) - return 0 - return (src.main_power_lost_until==0 || src.backup_power_lost_until==0) - -/obj/machinery/door/airlock/requiresID() - return !(wires.is_cut(WIRE_IDSCAN) || aiDisabledIdScanner) - -/obj/machinery/door/airlock/proc/isAllPowerLoss() - if(stat & (NOPOWER|BROKEN)) - return 1 - if(mainPowerCablesCut() && backupPowerCablesCut()) - return 1 - return 0 - -/obj/machinery/door/airlock/proc/mainPowerCablesCut() - return wires.is_cut(WIRE_MAIN_POWER1) || wires.is_cut(WIRE_MAIN_POWER2) - -/obj/machinery/door/airlock/proc/backupPowerCablesCut() - return wires.is_cut(WIRE_BACKUP_POWER1) || wires.is_cut(WIRE_BACKUP_POWER2) - -/obj/machinery/door/airlock/proc/loseMainPower() - main_power_lost_until = mainPowerCablesCut() ? -1 : world.time + SecondsToTicks(60) - - // If backup power is permanently disabled then activate in 10 seconds if possible, otherwise it's already enabled or a timer is already running - if(backup_power_lost_until == -1 && !backupPowerCablesCut()) - backup_power_lost_until = world.time + SecondsToTicks(10) - - if(main_power_lost_until > 0 || backup_power_lost_until > 0) - START_MACHINE_PROCESSING(src) - - // Disable electricity if required - if(electrified_until && isAllPowerLoss()) - electrify(0) - - update_icon() - -/obj/machinery/door/airlock/proc/loseBackupPower() - backup_power_lost_until = backupPowerCablesCut() ? -1 : world.time + SecondsToTicks(60) - - if(backup_power_lost_until > 0) - START_MACHINE_PROCESSING(src) - - // Disable electricity if required - if(electrified_until && isAllPowerLoss()) - electrify(0) - - update_icon() - -/obj/machinery/door/airlock/proc/regainMainPower() - if(!mainPowerCablesCut()) - main_power_lost_until = 0 - // If backup power is currently active then disable, otherwise let it count down and disable itself later - if(!backup_power_lost_until) - backup_power_lost_until = -1 - - update_icon() - -/obj/machinery/door/airlock/proc/regainBackupPower() - if(!backupPowerCablesCut()) - // Restore backup power only if main power is offline, otherwise permanently disable - backup_power_lost_until = main_power_lost_until == 0 ? -1 : 0 - - update_icon() - -/obj/machinery/door/airlock/proc/electrify(var/duration, var/feedback = 0) - var/message = "" - if(wires.is_cut(WIRE_ELECTRIFY) && arePowerSystemsOn()) - message = text("The electrification wire is cut - Door permanently electrified.") - src.electrified_until = -1 - else if(duration && !arePowerSystemsOn()) - message = text("The door is unpowered - Cannot electrify the door.") - src.electrified_until = 0 - else if(!duration && electrified_until != 0) - message = "The door is now un-electrified." - src.electrified_until = 0 - else if(duration) //electrify door for the given duration seconds - if(usr) - shockedby += text("\[[time_stamp()]\] - [usr](ckey:[usr.ckey])") - add_attack_logs(usr,name,"Electrified a door") - else - shockedby += text("\[[time_stamp()]\] - EMP)") - message = "The door is now electrified [duration == -1 ? "permanently" : "for [duration] second\s"]." - src.electrified_until = duration == -1 ? -1 : world.time + SecondsToTicks(duration) - - if(electrified_until > 0) - START_MACHINE_PROCESSING(src) - - if(feedback && message) - to_chat(usr,message) - -/obj/machinery/door/airlock/proc/set_idscan(var/activate, var/feedback = 0) - var/message = "" - if(wires.is_cut(WIRE_IDSCAN)) - message = "The IdScan wire is cut - IdScan feature permanently disabled." - else if(activate && src.aiDisabledIdScanner) - src.aiDisabledIdScanner = 0 - message = "IdScan feature has been enabled." - else if(!activate && !src.aiDisabledIdScanner) - src.aiDisabledIdScanner = 1 - message = "IdScan feature has been disabled." - - if(feedback && message) - to_chat(usr,message) - -/obj/machinery/door/airlock/proc/set_safeties(var/activate, var/feedback = 0) - var/message = "" - // Safeties! We don't need no stinking safeties! - if (wires.is_cut(WIRE_SAFETY)) - message = text("The safety wire is cut - Cannot enable safeties.") - else if (!activate && src.safe) - safe = 0 - else if (activate && !src.safe) - safe = 1 - - if(feedback && message) - to_chat(usr,message) - -// shock user with probability prb (if all connections & power are working) -// returns 1 if shocked, 0 otherwise -// The preceding comment was borrowed from the grille's shock script -/obj/machinery/door/airlock/shock(mob/user, prb) - if(!arePowerSystemsOn()) - return 0 - if(hasShocked) - return 0 //Already shocked someone recently? - if(..()) - hasShocked = 1 - sleep(10) - hasShocked = 0 - return 1 - else - return 0 - - -/obj/machinery/door/airlock/update_icon() - cut_overlays() - if(density) - if(locked && lights && src.arePowerSystemsOn()) - icon_state = "door_locked" - else - icon_state = "door_closed" - if(p_open || welded) - if(p_open) - add_overlay("panel_open") - if (!(stat & NOPOWER)) - if(stat & BROKEN) - add_overlay("sparks_broken") - else if (health < maxhealth * 3/4) - add_overlay("sparks_damaged") - if(welded) - add_overlay("welded") - else if (health < maxhealth * 3/4 && !(stat & NOPOWER)) - add_overlay("sparks_damaged") - else - icon_state = "door_open" - if((stat & BROKEN) && !(stat & NOPOWER)) - add_overlay("sparks_open") - return - -/obj/machinery/door/airlock/do_animate(animation) - switch(animation) - if("opening") - cut_overlay() - if(p_open) - spawn(2) // The only work around that works. Downside is that the door will be gone for a millisecond. - flick("o_door_opening", src) //can not use flick due to BYOND bug updating overlays right before flicking - update_icon() - else - flick("door_opening", src)//[stat ? "_stat":] - update_icon() - if("closing") - cut_overlay() - if(p_open) - spawn(2) - flick("o_door_closing", src) - update_icon() - else - flick("door_closing", src) - update_icon() - if("spark") - if(density) - flick("door_spark", src) - if("deny") - if(density && src.arePowerSystemsOn()) - flick("door_deny", src) - playsound(src, denied_sound, 50, 0, 3) - return - -/obj/machinery/door/airlock/attack_ai(mob/user as mob) - tgui_interact(user) - -/obj/machinery/door/airlock/attack_ghost(mob/user) - tgui_interact(user) - -/obj/machinery/door/airlock/tgui_interact(mob/user, datum/tgui/ui, datum/tgui/parent_ui, datum/tgui_state/custom_state) - ui = SStgui.try_update_ui(user, src, ui) - if(!ui) - ui = new(user, src, "AiAirlock", name) - ui.open() - if(custom_state) - ui.set_state(custom_state) - return TRUE - -/obj/machinery/door/airlock/tgui_data(mob/user) - var/list/data = list() - - var/list/power = list() - power["main"] = main_power_lost_until > 0 ? 0 : 2 - power["main_timeleft"] = round(main_power_lost_until > 0 ? max(main_power_lost_until - world.time, 0) / 10 : main_power_lost_until, 1) - power["backup"] = backup_power_lost_until > 0 ? 0 : 2 - power["backup_timeleft"] = round(backup_power_lost_until > 0 ? max(backup_power_lost_until - world.time, 0) / 10 : backup_power_lost_until, 1) - data["power"] = power - - data["shock"] = (electrified_until == 0) ? 2 : 0 - data["shock_timeleft"] = round(electrified_until > 0 ? max(electrified_until - world.time, 0) / 10 : electrified_until, 1) - data["id_scanner"] = !aiDisabledIdScanner - data["locked"] = locked // bolted - data["lights"] = lights // bolt lights - data["safe"] = safe // safeties - data["speed"] = normalspeed // safe speed - data["welded"] = welded // welded - data["opened"] = !density // opened - - var/list/wire = list() - wire["main_1"] = !wires.is_cut(WIRE_MAIN_POWER1) - wire["main_2"] = !wires.is_cut(WIRE_MAIN_POWER2) - wire["backup_1"] = !wires.is_cut(WIRE_BACKUP_POWER1) - wire["backup_2"] = !wires.is_cut(WIRE_BACKUP_POWER2) - wire["shock"] = !wires.is_cut(WIRE_ELECTRIFY) - wire["id_scanner"] = !wires.is_cut(WIRE_IDSCAN) - wire["bolts"] = !wires.is_cut(WIRE_DOOR_BOLTS) - wire["lights"] = !wires.is_cut(WIRE_BOLT_LIGHT) - wire["safe"] = !wires.is_cut(WIRE_SAFETY) - wire["timing"] = !wires.is_cut(WIRE_SPEED) - - data["wires"] = wire - return data - -/obj/machinery/door/airlock/proc/hack(mob/user as mob) - if(src.aiHacking==0) - src.aiHacking=1 - spawn(20) - //TODO: Make this take a minute - to_chat(user, "Airlock AI control has been blocked. Beginning fault-detection.") - sleep(50) - if(src.canAIControl()) - to_chat(user, "Alert cancelled. Airlock control has been restored without our assistance.") - src.aiHacking=0 - return - else if(!src.canAIHack(user)) - to_chat(user, "We've lost our connection! Unable to hack airlock.") - src.aiHacking=0 - return - to_chat(user, "Fault confirmed: airlock control wire disabled or cut.") - sleep(20) - to_chat(user, "Attempting to hack into airlock. This may take some time.") - sleep(200) - if(src.canAIControl()) - to_chat(user, "Alert cancelled. Airlock control has been restored without our assistance.") - src.aiHacking=0 - return - else if(!src.canAIHack(user)) - to_chat(user, "We've lost our connection! Unable to hack airlock.") - src.aiHacking=0 - return - to_chat(user, "Upload access confirmed. Loading control program into airlock software.") - sleep(170) - if(src.canAIControl()) - to_chat(user, "Alert cancelled. Airlock control has been restored without our assistance.") - src.aiHacking=0 - return - else if(!src.canAIHack(user)) - to_chat(user, "We've lost our connection! Unable to hack airlock.") - src.aiHacking=0 - return - to_chat(user, "Transfer complete. Forcing airlock to execute program.") - sleep(50) - //disable blocked control - src.aiControlDisabled = 2 - to_chat(user, "Receiving control information from airlock.") - sleep(10) - //bring up airlock dialog - src.aiHacking = 0 - if (user) - src.attack_ai(user) - -/obj/machinery/door/airlock/CanPass(atom/movable/mover, turf/target) - if (src.isElectrified()) - if (istype(mover, /obj/item)) - var/obj/item/i = mover - if (i.matter && (DEFAULT_WALL_MATERIAL in i.matter) && i.matter[DEFAULT_WALL_MATERIAL] > 0) - var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread - s.set_up(5, 1, src) - s.start() - return ..() - -/obj/machinery/door/airlock/attack_hand(mob/user as mob) - if(!istype(usr, /mob/living/silicon)) - if(src.isElectrified()) - if(src.shock(user, 100)) - return - - if(istype(user, /mob/living/carbon/human)) - var/mob/living/carbon/human/X = user - if(istype(X.species, /datum/species/xenos)) - src.attack_alien(user) - return - - if(src.p_open) - user.set_machine(src) - wires.Interact(user) - else - ..(user) - return - -/obj/machinery/door/airlock/tgui_act(action, params) - if(..()) - return TRUE - if(!user_allowed(usr)) - return TRUE - - switch(action) - if("disrupt-main") - if(!main_power_lost_until) - loseMainPower() - update_icon() - else - to_chat(usr, "Main power is already offline.") - . = TRUE - if("disrupt-backup") - if(!backup_power_lost_until) - loseBackupPower() - update_icon() - else - to_chat(usr, "Backup power is already offline.") - . = TRUE - if("shock-restore") - electrify(0, 1) - . = TRUE - if("shock-temp") - electrify(30, 1) - . = TRUE - if("shock-perm") - electrify(-1, 1) - . = TRUE - if("idscan-toggle") - set_idscan(aiDisabledIdScanner, 1) - . = TRUE - // if("emergency-toggle") - // toggle_emergency(usr) - // . = TRUE - if("bolt-toggle") - toggle_bolt(usr) - . = TRUE - if("light-toggle") - if(wires.is_cut(WIRE_BOLT_LIGHT)) - to_chat(usr, "The bolt lights wire is cut - The door bolt lights are permanently disabled.") - return - lights = !lights - update_icon() - . = TRUE - if("safe-toggle") - set_safeties(!safe, 1) - . = TRUE - if("speed-toggle") - if(wires.is_cut(WIRE_SPEED)) - to_chat(usr, "The timing wire is cut - Cannot alter timing.") - return - normalspeed = !normalspeed - . = TRUE - if("open-close") - user_toggle_open(usr) - . = TRUE - - update_icon() - return 1 - -/obj/machinery/door/airlock/proc/user_allowed(mob/user) - var/allowed = (issilicon(user) && canAIControl(user)) - if(!allowed && isobserver(user)) - var/mob/observer/dead/D = user - if(D.can_admin_interact()) - allowed = TRUE - return allowed - -/obj/machinery/door/airlock/proc/toggle_bolt(mob/user) - if(!user_allowed(user)) - return - if(wires.is_cut(WIRE_DOOR_BOLTS)) - to_chat(user, "The door bolt drop wire is cut - you can't toggle the door bolts.") - return - if(locked) - if(!arePowerSystemsOn()) - to_chat(user, "The door has no power - you can't raise the door bolts.") - else - unlock() - to_chat(user, "The door bolts have been raised.") - // log_combat(user, src, "unbolted") - else - lock() - to_chat(user, "The door bolts have been dropped.") - // log_combat(user, src, "bolted") - -/obj/machinery/door/airlock/proc/user_toggle_open(mob/user) - if(!user_allowed(user)) - return - if(welded) - to_chat(user, text("The airlock has been welded shut!")) - else if(locked) - to_chat(user, text("The door bolts are down!")) - else if(!density) - close() - else - open() - -/obj/machinery/door/airlock/proc/can_remove_electronics() - return src.p_open && (operating < 0 || (!operating && welded && !src.arePowerSystemsOn() && density && (!src.locked || (stat & BROKEN)))) - -/obj/machinery/door/airlock/attackby(obj/item/C, mob/user as mob) - //to_world("airlock attackby src [src] obj [C] mob [user]") - if(!istype(usr, /mob/living/silicon)) - if(src.isElectrified()) - if(src.shock(user, 75)) - return - if(istype(C, /obj/item/taperoll)) - return - - src.add_fingerprint(user) - if (attempt_vr(src,"attackby_vr",list(C, user))) return - if(istype(C, /mob/living)) - ..() - return - if(!repairing && istype(C, /obj/item/weapon/weldingtool) && !( src.operating > 0 ) && src.density) - var/obj/item/weapon/weldingtool/W = C - if(W.remove_fuel(0,user)) - if(!src.welded) - src.welded = 1 - else - src.welded = null - playsound(src, C.usesound, 75, 1) - src.update_icon() - return - else - return - else if(C.is_screwdriver()) - if (src.p_open) - if (stat & BROKEN) - to_chat(usr, "The panel is broken and cannot be closed.") - else - src.p_open = 0 - playsound(src, C.usesound, 50, 1) - else - src.p_open = 1 - playsound(src, C.usesound, 50, 1) - src.update_icon() - else if(C.is_wirecutter()) - return src.attack_hand(user) - else if(istype(C, /obj/item/device/multitool)) - return src.attack_hand(user) - else if(istype(C, /obj/item/device/assembly/signaler)) - return src.attack_hand(user) - else if(istype(C, /obj/item/weapon/pai_cable)) // -- TLE - var/obj/item/weapon/pai_cable/cable = C - cable.plugin(src, user) - else if(!repairing && C.is_crowbar()) - if(can_remove_electronics()) - playsound(src, C.usesound, 75, 1) - user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to remove electronics from the airlock assembly.") - if(do_after(user,40 * C.toolspeed)) - to_chat(user, "You removed the airlock electronics!") - - var/obj/structure/door_assembly/da = new assembly_type(src.loc) - if (istype(da, /obj/structure/door_assembly/multi_tile)) - da.set_dir(src.dir) - - da.anchored = 1 - if(mineral) - da.glass = mineral - //else if(glass) - else if(glass && !da.glass) - da.glass = 1 - da.state = 1 - da.created_name = src.name - da.update_state() - - if(operating == -1 || (stat & BROKEN)) - new /obj/item/weapon/circuitboard/broken(src.loc) - operating = 0 - else - if (!electronics) create_electronics() - - electronics.loc = src.loc - electronics = null - - qdel(src) - return - else if(arePowerSystemsOn()) - to_chat(user, "The airlock's motors resist your efforts to force it.") - else if(locked) - to_chat(user, "The airlock's bolts prevent it from being forced.") - else - if(density) - spawn(0) open(1) - else - spawn(0) close(1) - - // Check if we're using a crowbar or armblade, and if the airlock's unpowered for whatever reason (off, broken, etc). - else if(istype(C, /obj/item/weapon)) - var/obj/item/weapon/W = C - if((W.pry == 1) && !arePowerSystemsOn()) - if(locked) - to_chat(user, "The airlock's bolts prevent it from being forced.") - else if( !welded && !operating ) - if(istype(C, /obj/item/weapon/material/twohanded/fireaxe)) // If this is a fireaxe, make sure it's held in two hands. - var/obj/item/weapon/material/twohanded/fireaxe/F = C - if(!F.wielded) - to_chat(user, "You need to be wielding \the [F] to do that.") - return - // At this point, it's an armblade or a fireaxe that passed the wielded test, let's try to open it. - if(density) - spawn(0) - open(1) - else - spawn(0) - close(1) - else - ..() - else - ..() - return - -/obj/machinery/door/airlock/phoron/attackby(C as obj, mob/user as mob) - if(C) - ignite(is_hot(C)) - ..() - -/obj/machinery/door/airlock/set_broken() - src.p_open = 1 - stat |= BROKEN - if (secured_wires) - lock() - for (var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message("[src.name]'s control panel bursts open, sparks spewing out!") - - var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread - s.set_up(5, 1, src) - s.start() - - update_icon() - return - -/obj/machinery/door/airlock/open(var/forced=0) - if(!can_open(forced)) - return 0 - use_power(360) //360 W seems much more appropriate for an actuator moving an industrial door capable of crushing people - - //if the door is unpowered then it doesn't make sense to hear the woosh of a pneumatic actuator - for(var/P in player_list) - var/mob/M = P - if(!M || !M.client) - continue - var/old_sounds = M.client.is_preference_enabled(/datum/client_preference/old_door_sounds) - var/department_door_sounds = M.client.is_preference_enabled(/datum/client_preference/department_door_sounds) - var/sound - var/volume - if(old_sounds) // Do we have old sounds enabled? Play these even if we have department door sounds enabled. - if(arePowerSystemsOn()) - sound = legacy_open_powered - volume = 50 - else - sound = open_sound_unpowered - volume = 75 - else if(!old_sounds && department_door_sounds && src.department_open_powered) // Else, we have old sounds disabled, the door has per-department door sounds, and we have chosen to play department door sounds, use these. - if(arePowerSystemsOn()) - sound = department_open_powered - volume = 50 - else - sound = open_sound_unpowered - volume = 75 - else // Else, play these. - if(arePowerSystemsOn()) - sound = open_sound_powered - volume = 50 - else - sound = open_sound_unpowered - volume = 75 - - var/turf/T = get_turf(M) - var/distance = get_dist(T, get_turf(src)) - if(distance <= world.view * 2) - if(T && T.z == get_z(src)) - M.playsound_local(get_turf(src), sound, volume, 1, null, 0, TRUE, sound(sound), volume_channel = VOLUME_CHANNEL_DOORS) - - if(src.closeOther != null && istype(src.closeOther, /obj/machinery/door/airlock/) && !src.closeOther.density) - src.closeOther.close() - return ..() - -/obj/machinery/door/airlock/can_open(var/forced=0) - if(!forced) - if(!arePowerSystemsOn() || wires.is_cut(WIRE_OPEN_DOOR)) - return 0 - - if(locked || welded) - return 0 - return ..() - -/obj/machinery/door/airlock/can_close(var/forced=0) - if(locked || welded) - return 0 - - if(!forced) - //despite the name, this wire is for general door control. - if(!arePowerSystemsOn() || wires.is_cut(WIRE_OPEN_DOOR)) - return 0 - - return ..() - -/atom/movable/proc/blocks_airlock() - return density - -/obj/machinery/door/blocks_airlock() - return 0 - -/obj/machinery/mech_sensor/blocks_airlock() - return 0 - -/mob/living/blocks_airlock() - return 1 - -/atom/movable/proc/airlock_crush(var/crush_damage) - return 0 - -/obj/machinery/portable_atmospherics/canister/airlock_crush(var/crush_damage) - . = ..() - health -= crush_damage - healthcheck() - -/obj/effect/energy_field/airlock_crush(var/crush_damage) - adjust_strength(crush_damage) - -/obj/structure/closet/airlock_crush(var/crush_damage) - ..() - damage(crush_damage) - for(var/atom/movable/AM in src) - AM.airlock_crush() - return 1 - -/mob/living/airlock_crush(var/crush_damage) - . = ..() - adjustBruteLoss(crush_damage) - SetStunned(5) - SetWeakened(5) - var/turf/T = get_turf(src) - T.add_blood(src) - return 1 - -/mob/living/carbon/airlock_crush(var/crush_damage) - . = ..() - if(can_feel_pain()) - emote("scream") - -/mob/living/silicon/robot/airlock_crush(var/crush_damage) - adjustBruteLoss(crush_damage) - return 0 - -/obj/machinery/door/airlock/close(var/forced=0) - if(!can_close(forced)) - return 0 - - if(safe) - for(var/turf/turf in locs) - for(var/atom/movable/AM in turf) - if(AM.blocks_airlock()) - if(!has_beeped) - playsound(src, 'sound/machines/buzz-two.ogg', 50, 0) - has_beeped = 1 - autoclose_in(6) - return - - for(var/turf/turf in locs) - for(var/atom/movable/AM in turf) - if(AM.airlock_crush(DOOR_CRUSH_DAMAGE)) - take_damage(DOOR_CRUSH_DAMAGE) - - use_power(360) //360 W seems much more appropriate for an actuator moving an industrial door capable of crushing people - has_beeped = 0 - for(var/P in player_list) - var/mob/M = P - if(!M || !M.client) - continue - var/old_sounds = M.client.is_preference_enabled(/datum/client_preference/old_door_sounds) - var/department_door_sounds = M.client.is_preference_enabled(/datum/client_preference/department_door_sounds) - var/sound - var/volume - if(old_sounds) - if(arePowerSystemsOn()) - sound = legacy_close_powered - volume = 50 - else - sound = open_sound_unpowered - volume = 75 - else if(!old_sounds && department_door_sounds && src.department_close_powered) // Else, we have old sounds disabled, the door has per-department door sounds, and we have chosen to play department door sounds, use these. - if(arePowerSystemsOn()) - sound = department_close_powered - volume = 50 - else - sound = open_sound_unpowered - volume = 75 - else - if(arePowerSystemsOn()) - sound = close_sound_powered - volume = 50 - else - sound = open_sound_unpowered - volume = 75 - - var/turf/T = get_turf(M) - var/distance = get_dist(T, get_turf(src)) - if(distance <= world.view * 2) - if(T && T.z == get_z(src)) - M.playsound_local(get_turf(src), sound, volume, 1, null, 0, TRUE, sound(sound), volume_channel = VOLUME_CHANNEL_DOORS) - for(var/turf/turf in locs) - var/obj/structure/window/killthis = (locate(/obj/structure/window) in turf) - if(killthis) - killthis.ex_act(2)//Smashin windows - return ..() - -/obj/machinery/door/airlock/proc/lock(var/forced=0) - if(locked) - return 0 - - if (operating && !forced) return 0 - - src.locked = 1 - playsound(src, bolt_down_sound, 30, 0, 3, volume_channel = VOLUME_CHANNEL_DOORS) - for(var/mob/M in range(1,src)) - M.show_message("You hear a click from the bottom of the door.", 2) - update_icon() - return 1 - -/obj/machinery/door/airlock/proc/unlock(var/forced=0) - if(!src.locked) - return - - if (!forced) - if(operating || !src.arePowerSystemsOn() || wires.is_cut(WIRE_DOOR_BOLTS)) return - - src.locked = 0 - playsound(src, bolt_up_sound, 30, 0, 3, volume_channel = VOLUME_CHANNEL_DOORS) - for(var/mob/M in range(1,src)) - M.show_message("You hear a click from the bottom of the door.", 2) - update_icon() - return 1 - -/obj/machinery/door/airlock/allowed(mob/M) - if(locked) - return 0 - return ..(M) - -/obj/machinery/door/airlock/New(var/newloc, var/obj/structure/door_assembly/assembly=null) - ..() - - //if assembly is given, create the new door from the assembly - if (assembly && istype(assembly)) - assembly_type = assembly.type - - electronics = assembly.electronics - electronics.loc = src - - //update the door's access to match the electronics' - secured_wires = electronics.secure - if(electronics.one_access) - LAZYCLEARLIST(req_access) - req_one_access = src.electronics.conf_access - else - LAZYCLEARLIST(req_one_access) - req_access = src.electronics.conf_access - - //get the name from the assembly - if(assembly.created_name) - name = assembly.created_name - else - name = "[istext(assembly.glass) ? "[assembly.glass] airlock" : assembly.base_name]" - - //get the dir from the assembly - set_dir(assembly.dir) - - //wires - var/turf/T = get_turf(newloc) - if(T && (T.z in using_map.admin_levels)) - secured_wires = 1 - if (secured_wires) - wires = new/datum/wires/airlock/secure(src) - else - wires = new/datum/wires/airlock(src) - -/obj/machinery/door/airlock/Initialize() - if(src.closeOtherId != null) - for (var/obj/machinery/door/airlock/A in machines) - if(A.closeOtherId == src.closeOtherId && A != src) - src.closeOther = A - break - name = "\improper [name]" - . = ..() - -/obj/machinery/door/airlock/Destroy() - qdel(wires) - wires = null - return ..() - -// Most doors will never be deconstructed over the course of a round, -// so as an optimization defer the creation of electronics until -// the airlock is deconstructed -/obj/machinery/door/airlock/proc/create_electronics() - //create new electronics - if (secured_wires) - src.electronics = new/obj/item/weapon/airlock_electronics/secure( src.loc ) - else - src.electronics = new/obj/item/weapon/airlock_electronics( src.loc ) - - //update the electronics to match the door's access - if(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) - if(prob(40/severity)) - var/duration = world.time + SecondsToTicks(30 / severity) - if(duration > electrified_until) - electrify(duration) - ..() - -/obj/machinery/door/airlock/power_change() //putting this is obj/machinery/door itself makes non-airlock doors turn invisible for some reason - ..() - if(stat & NOPOWER) - // If we lost power, disable electrification - // Keeping door lights on, runs on internal battery or something. - electrified_until = 0 - update_icon() - -/obj/machinery/door/airlock/proc/prison_open() - if(arePowerSystemsOn()) - src.unlock() - src.open() - src.lock() - return - - -/obj/machinery/door/airlock/rcd_values(mob/living/user, obj/item/weapon/rcd/the_rcd, passed_mode) - switch(passed_mode) - if(RCD_DECONSTRUCT) - // Old RCD code made it cost 10 units to decon an airlock. - // Now the new one costs ten "sheets". - return list( - RCD_VALUE_MODE = RCD_DECONSTRUCT, - RCD_VALUE_DELAY = 5 SECONDS, - RCD_VALUE_COST = RCD_SHEETS_PER_MATTER_UNIT * 10 - ) - return FALSE - -/obj/machinery/door/airlock/rcd_act(mob/living/user, obj/item/weapon/rcd/the_rcd, passed_mode) - switch(passed_mode) - if(RCD_DECONSTRUCT) - to_chat(user, span("notice", "You deconstruct \the [src].")) - qdel(src) - return TRUE - return FALSE +//VOREStation Edit - Redone a lot of airlock things: +/* +- Specific department maintenance doors +- Named doors properly according to type +- Gave them default access levels with the access constants +- Improper'd all of the names in the new() +*/ + +/obj/machinery/door/airlock + name = "Airlock" + icon = 'icons/obj/doors/Doorint.dmi' + icon_state = "door_closed" + power_channel = ENVIRON + + explosion_resistance = 10 + + // Doors do their own stuff + bullet_vulnerability = 0 + + blocks_emissive = EMISSIVE_BLOCK_GENERIC // Not quite as nice as /tg/'s custom masks. We should make those sometime + + var/aiControlDisabled = 0 //If 1, AI control is disabled until the AI hacks back in and disables the lock. If 2, the AI has bypassed the lock. If -1, the control is enabled but the AI had bypassed it earlier, so if it is disabled again the AI would have no trouble getting back in. + var/hackProof = 0 // if 1, this door can't be hacked by the AI + var/electrified_until = 0 //World time when the door is no longer electrified. -1 if it is permanently electrified until someone fixes it. + var/main_power_lost_until = 0 //World time when main power is restored. + var/backup_power_lost_until = -1 //World time when backup power is restored. + var/has_beeped = 0 //If 1, will not beep on failed closing attempt. Resets when door closes. + var/spawnPowerRestoreRunning = 0 + var/welded = null + var/locked = 0 + var/lights = 1 // bolt lights show by default + var/aiDisabledIdScanner = 0 + var/aiHacking = 0 + var/obj/machinery/door/airlock/closeOther = null + var/closeOtherId = null + var/lockdownbyai = 0 + autoclose = 1 + var/assembly_type = /obj/structure/door_assembly + var/mineral = null + var/justzap = 0 + var/safe = 1 + normalspeed = 1 + var/obj/item/weapon/airlock_electronics/electronics = null + var/hasShocked = 0 //Prevents multiple shocks from happening + var/secured_wires = 0 + var/datum/wires/airlock/wires = null + + var/open_sound_powered = 'sound/machines/door/covert1o.ogg' + var/open_sound_unpowered = 'sound/machines/door/airlockforced.ogg' + var/close_sound_powered = 'sound/machines/door/covert1c.ogg' + var/legacy_open_powered = 'sound/machines/door/old_airlock.ogg' + var/legacy_close_powered = 'sound/machines/door/old_airlockclose.ogg' + var/department_open_powered = null + var/department_close_powered = null + var/denied_sound = 'sound/machines/deniedbeep.ogg' + var/bolt_up_sound = 'sound/machines/door/boltsup.ogg' + var/bolt_down_sound = 'sound/machines/door/boltsdown.ogg' + +/obj/machinery/door/airlock/attack_generic(var/mob/living/user, var/damage) + if(stat & (BROKEN|NOPOWER)) + if(damage >= STRUCTURE_MIN_DAMAGE_THRESHOLD) + if(src.locked || src.welded) + visible_message("\The [user] begins breaking into \the [src] internals!") + user.set_AI_busy(TRUE) // If the mob doesn't have an AI attached, this won't do anything. + if(do_after(user,10 SECONDS,src)) + src.locked = 0 + src.welded = 0 + update_icon() + open(1) + if(prob(25)) + src.shock(user, 100) + user.set_AI_busy(FALSE) + else if(src.density) + visible_message("\The [user] forces \the [src] open!") + open(1) + else + visible_message("\The [user] forces \the [src] closed!") + close(1) + else + visible_message("\The [user] strains fruitlessly to force \the [src] [density ? "open" : "closed"].") + return + ..() + +/obj/machinery/door/airlock/attack_alien(var/mob/user) //Familiar, right? Doors. -Mechoid + if(istype(user, /mob/living/carbon/human)) + var/mob/living/carbon/human/X = user + if(istype(X.species, /datum/species/xenos)) + if(src.locked || src.welded) + visible_message("\The [user] begins digging into \the [src] internals!") + src.do_animate("deny") + if(do_after(user,5 SECONDS,src)) + visible_message("\The [user] forces \the [src] open, sparks flying from its electronics!") + src.do_animate("spark") + playsound(src, 'sound/machines/door/airlock_creaking.ogg', 100, 1, volume_channel = VOLUME_CHANNEL_DOORS) + src.locked = 0 + src.welded = 0 + update_icon() + open(1) + src.emag_act() + else if(src.density) + visible_message("\The [user] begins forcing \the [src] open!") + if(do_after(user, 5 SECONDS,src)) + playsound(src, 'sound/machines/door/airlock_creaking.ogg', 100, 1, volume_channel = VOLUME_CHANNEL_DOORS) + visible_message("\The [user] forces \the [src] open!") + open(1) + else + visible_message("\The [user] forces \the [src] closed!") + close(1) + else + src.do_animate("deny") + visible_message("\The [user] strains fruitlessly to force \the [src] [density ? "open" : "closed"].") + return + ..() + +/obj/machinery/door/airlock/get_material() + if(mineral) + return get_material_by_name(mineral) + return get_material_by_name(DEFAULT_WALL_MATERIAL) + +/obj/machinery/door/airlock/command + name = "Command Airlock" + icon = 'icons/obj/doors/Doorcom.dmi' + req_one_access = list(access_heads) + assembly_type = /obj/structure/door_assembly/door_assembly_com + open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + department_open_powered = 'sound/machines/door/cmd3o.ogg' + department_close_powered = 'sound/machines/door/cmd3c.ogg' + +/obj/machinery/door/airlock/security + name = "Security Airlock" + icon = 'icons/obj/doors/Doorsec.dmi' + req_one_access = list(access_security) + assembly_type = /obj/structure/door_assembly/door_assembly_sec + open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + department_open_powered = 'sound/machines/door/sec1o.ogg' + department_close_powered = 'sound/machines/door/sec1c.ogg' + +/obj/machinery/door/airlock/engineering + name = "Engineering Airlock" + icon = 'icons/obj/doors/Dooreng.dmi' + req_one_access = list(access_engine) + assembly_type = /obj/structure/door_assembly/door_assembly_eng + open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + department_open_powered = 'sound/machines/door/eng1o.ogg' + department_close_powered = 'sound/machines/door/eng1c.ogg' + +/obj/machinery/door/airlock/engineeringatmos + name = "Atmospherics Airlock" + icon = 'icons/obj/doors/Doorengatmos.dmi' + req_one_access = list(access_atmospherics) + assembly_type = /obj/structure/door_assembly/door_assembly_eat + open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + department_open_powered = 'sound/machines/door/eng1o.ogg' + department_close_powered = 'sound/machines/door/eng1c.ogg' + +/obj/machinery/door/airlock/medical + name = "Medical Airlock" + icon = 'icons/obj/doors/Doormed.dmi' + req_one_access = list(access_medical) + assembly_type = /obj/structure/door_assembly/door_assembly_med + open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + department_open_powered = 'sound/machines/door/med1o.ogg' + department_close_powered = 'sound/machines/door/med1c.ogg' + +/obj/machinery/door/airlock/maintenance + name = "Maintenance Access" + icon = 'icons/obj/doors/Doormaint.dmi' + //req_one_access = list(access_maint_tunnels) //VOREStation Edit - Maintenance is open access + assembly_type = /obj/structure/door_assembly/door_assembly_mai + open_sound_powered = 'sound/machines/door/door2o.ogg' + close_sound_powered = 'sound/machines/door/door2c.ogg' + +/obj/machinery/door/airlock/maintenance/cargo + icon = 'icons/obj/doors/Doormaint_cargo.dmi' + req_one_access = list(access_cargo) + open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + department_open_powered = 'sound/machines/door/door2o.ogg' + department_close_powered = 'sound/machines/door/door2c.ogg' + +/obj/machinery/door/airlock/maintenance/command + icon = 'icons/obj/doors/Doormaint_command.dmi' + req_one_access = list(access_heads) + +/obj/machinery/door/airlock/maintenance/common + icon = 'icons/obj/doors/Doormaint_common.dmi' + open_sound_powered = 'sound/machines/door/hall3o.ogg' + close_sound_powered = 'sound/machines/door/hall3c.ogg' + +/obj/machinery/door/airlock/maintenance/engi + icon = 'icons/obj/doors/Doormaint_engi.dmi' + req_one_access = list(access_engine) + +/obj/machinery/door/airlock/maintenance/int + icon = 'icons/obj/doors/Doormaint_int.dmi' + +/obj/machinery/door/airlock/maintenance/medical + icon = 'icons/obj/doors/Doormaint_med.dmi' + req_one_access = list(access_medical) + +/obj/machinery/door/airlock/maintenance/rnd + icon = 'icons/obj/doors/Doormaint_rnd.dmi' + req_one_access = list(access_research) + +/obj/machinery/door/airlock/maintenance/sec + icon = 'icons/obj/doors/Doormaint_sec.dmi' + req_one_access = list(access_security) + +/obj/machinery/door/airlock/external + name = "External Airlock" + icon = 'icons/obj/doors/Doorext.dmi' + assembly_type = /obj/structure/door_assembly/door_assembly_ext + open_sound_powered = 'sound/machines/door/space1o.ogg' + close_sound_powered = 'sound/machines/door/space1c.ogg' + +/obj/machinery/door/airlock/external/glass/bolted + icon_state = "door_locked" // So it looks visibly bolted in map editor + locked = 1 + +// For convenience in making docking ports: one that is pre-bolted with frequency set! +/obj/machinery/door/airlock/external/glass/bolted/cycling + frequency = 1379 + +/obj/machinery/door/airlock/glass_external + name = "External Airlock" + icon = 'icons/obj/doors/Doorextglass.dmi' + assembly_type = /obj/structure/door_assembly/door_assembly_ext + opacity = 0 + glass = 1 + req_one_access = list(access_external_airlocks) + open_sound_powered = 'sound/machines/door/space1o.ogg' + close_sound_powered = 'sound/machines/door/space1c.ogg' + +/obj/machinery/door/airlock/glass + name = "Glass Airlock" + icon = 'icons/obj/doors/Doorglass.dmi' + hitsound = 'sound/effects/Glasshit.ogg' + open_sound_powered = 'sound/machines/door/hall1o.ogg' + close_sound_powered = 'sound/machines/door/hall1c.ogg' + legacy_open_powered = 'sound/machines/door/windowdoor.ogg' + maxhealth = 300 + explosion_resistance = 5 + opacity = 0 + glass = 1 + +/obj/machinery/door/airlock/centcom + name = "Centcom Airlock" + icon = 'icons/obj/doors/Doorele.dmi' + req_one_access = list(access_cent_general) + opacity = 1 + open_sound_powered = 'sound/machines/door/cmd3o.ogg' + close_sound_powered = 'sound/machines/door/cmd3c.ogg' + +/obj/machinery/door/airlock/glass_centcom + name = "Airlock" + icon = 'icons/obj/doors/Dooreleglass.dmi' + opacity = 0 + glass = 1 + open_sound_powered = 'sound/machines/door/cmd3o.ogg' + close_sound_powered = 'sound/machines/door/cmd3c.ogg' + +/obj/machinery/door/airlock/vault + name = "Vault" + icon = 'icons/obj/doors/vault.dmi' + explosion_resistance = 20 + opacity = 1 + secured_wires = 1 + assembly_type = /obj/structure/door_assembly/door_assembly_highsecurity //Until somebody makes better sprites. + req_one_access = list(access_heads_vault) + open_sound_powered = 'sound/machines/door/vault1o.ogg' + close_sound_powered = 'sound/machines/door/vault1c.ogg' + +/obj/machinery/door/airlock/vault/bolted + icon_state = "door_locked" + locked = 1 + +/obj/machinery/door/airlock/freezer + name = "Freezer Airlock" + icon = 'icons/obj/doors/Doorfreezer.dmi' + opacity = 1 + assembly_type = /obj/structure/door_assembly/door_assembly_fre + +/obj/machinery/door/airlock/hatch + name = "Airtight Hatch" + icon = 'icons/obj/doors/Doorhatchele.dmi' + explosion_resistance = 20 + opacity = 1 + assembly_type = /obj/structure/door_assembly/door_assembly_hatch + req_one_access = list(access_maint_tunnels) + open_sound_powered = 'sound/machines/door/hatchopen.ogg' + close_sound_powered = 'sound/machines/door/hatchclose.ogg' + open_sound_unpowered = 'sound/machines/door/hatchforced.ogg' + +/obj/machinery/door/airlock/maintenance_hatch + name = "Maintenance Hatch" + icon = 'icons/obj/doors/Doorhatchmaint2.dmi' + explosion_resistance = 20 + opacity = 1 + assembly_type = /obj/structure/door_assembly/door_assembly_mhatch + req_one_access = list(access_maint_tunnels) + open_sound_powered = 'sound/machines/door/hatchopen.ogg' + close_sound_powered = 'sound/machines/door/hatchclose.ogg' + open_sound_unpowered = 'sound/machines/door/hatchforced.ogg' + +/obj/machinery/door/airlock/glass_command + name = "Command Airlock" + icon = 'icons/obj/doors/Doorcomglass.dmi' + hitsound = 'sound/effects/Glasshit.ogg' + maxhealth = 300 + explosion_resistance = 5 + opacity = 0 + assembly_type = /obj/structure/door_assembly/door_assembly_com + glass = 1 + req_one_access = list(access_heads) + open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + department_open_powered = 'sound/machines/door/cmd1o.ogg' + department_close_powered = 'sound/machines/door/cmd1c.ogg' + +/obj/machinery/door/airlock/glass_engineering + name = "Engineering Airlock" + icon = 'icons/obj/doors/Doorengglass.dmi' + hitsound = 'sound/effects/Glasshit.ogg' + maxhealth = 300 + explosion_resistance = 5 + opacity = 0 + assembly_type = /obj/structure/door_assembly/door_assembly_eng + glass = 1 + req_one_access = list(access_engine) + department_open_powered = 'sound/machines/door/eng1o.ogg' + department_close_powered = 'sound/machines/door/eng1c.ogg' + +/obj/machinery/door/airlock/glass_engineeringatmos + name = "Atmospherics Airlock" + icon = 'icons/obj/doors/Doorengatmoglass.dmi' + hitsound = 'sound/effects/Glasshit.ogg' + maxhealth = 300 + explosion_resistance = 5 + opacity = 0 + assembly_type = /obj/structure/door_assembly/door_assembly_eat + glass = 1 + req_one_access = list(access_atmospherics) + open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + department_open_powered = 'sound/machines/door/eng1o.ogg' + department_close_powered = 'sound/machines/door/eng1c.ogg' + +/obj/machinery/door/airlock/glass_security + name = "Security Airlock" + icon = 'icons/obj/doors/Doorsecglass.dmi' + hitsound = 'sound/effects/Glasshit.ogg' + maxhealth = 300 + explosion_resistance = 5 + opacity = 0 + assembly_type = /obj/structure/door_assembly/door_assembly_sec + glass = 1 + req_one_access = list(access_security) + open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + department_open_powered = 'sound/machines/door/sec1o.ogg' + department_close_powered = 'sound/machines/door/sec1c.ogg' + +/obj/machinery/door/airlock/glass_medical + name = "Medical Airlock" + icon = 'icons/obj/doors/Doormedglass.dmi' + hitsound = 'sound/effects/Glasshit.ogg' + maxhealth = 300 + explosion_resistance = 5 + opacity = 0 + assembly_type = /obj/structure/door_assembly/door_assembly_med + glass = 1 + req_one_access = list(access_medical) + open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + department_open_powered = 'sound/machines/door/med1o.ogg' + department_close_powered = 'sound/machines/door/med1c.ogg' + +/obj/machinery/door/airlock/mining + name = "Mining Airlock" + icon = 'icons/obj/doors/Doormining.dmi' + assembly_type = /obj/structure/door_assembly/door_assembly_min + req_one_access = list(access_mining) + open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + department_open_powered = 'sound/machines/door/cgo1o.ogg' + department_close_powered = 'sound/machines/door/cgo1c.ogg' + +/obj/machinery/door/airlock/atmos + name = "Atmospherics Airlock" + icon = 'icons/obj/doors/Dooratmo.dmi' + assembly_type = /obj/structure/door_assembly/door_assembly_atmo + req_one_access = list(access_atmospherics) + open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + department_open_powered = 'sound/machines/door/eng1o.ogg' + department_close_powered = 'sound/machines/door/eng1c.ogg' + +/obj/machinery/door/airlock/research + name = "Research Airlock" + icon = 'icons/obj/doors/Doorresearch.dmi' + assembly_type = /obj/structure/door_assembly/door_assembly_research + open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + department_open_powered = 'sound/machines/door/sci1o.ogg' + department_close_powered = 'sound/machines/door/sci1c.ogg' + +/obj/machinery/door/airlock/glass_research + name = "Research Airlock" + icon = 'icons/obj/doors/Doorresearchglass.dmi' + hitsound = 'sound/effects/Glasshit.ogg' + maxhealth = 300 + explosion_resistance = 5 + opacity = 0 + assembly_type = /obj/structure/door_assembly/door_assembly_research + glass = 1 + req_one_access = list(access_research) + open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + department_open_powered = 'sound/machines/door/sci1o.ogg' + department_close_powered = 'sound/machines/door/sci1c.ogg' + +/obj/machinery/door/airlock/glass_mining + name = "Mining Airlock" + icon = 'icons/obj/doors/Doorminingglass.dmi' + hitsound = 'sound/effects/Glasshit.ogg' + maxhealth = 300 + explosion_resistance = 5 + opacity = 0 + assembly_type = /obj/structure/door_assembly/door_assembly_min + glass = 1 + req_one_access = list(access_mining) + open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + department_open_powered = 'sound/machines/door/cgo1o.ogg' + department_close_powered = 'sound/machines/door/cgo1c.ogg' + +/obj/machinery/door/airlock/glass_atmos + name = "Atmospherics Airlock" + icon = 'icons/obj/doors/Dooratmoglass.dmi' + hitsound = 'sound/effects/Glasshit.ogg' + maxhealth = 300 + explosion_resistance = 5 + opacity = 0 + assembly_type = /obj/structure/door_assembly/door_assembly_atmo + glass = 1 + req_one_access = list(access_atmospherics) + open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + department_open_powered = 'sound/machines/door/eng1o.ogg' + department_close_powered = 'sound/machines/door/eng1c.ogg' + +/obj/machinery/door/airlock/gold + name = "Gold Airlock" + icon = 'icons/obj/doors/Doorgold.dmi' + mineral = "gold" + +/obj/machinery/door/airlock/silver + name = "Silver Airlock" + icon = 'icons/obj/doors/Doorsilver.dmi' + mineral = "silver" + +/obj/machinery/door/airlock/diamond + name = "Diamond Airlock" + icon = 'icons/obj/doors/Doordiamond.dmi' + mineral = "diamond" + +/obj/machinery/door/airlock/uranium + name = "Uranium Airlock" + desc = "And they said I was crazy." + icon = 'icons/obj/doors/Dooruranium.dmi' + mineral = "uranium" + var/last_event = 0 + var/rad_power = 7.5 + +/obj/machinery/door/airlock/process() + // Deliberate no call to parent. + if(main_power_lost_until > 0 && world.time >= main_power_lost_until) + regainMainPower() + + if(backup_power_lost_until > 0 && world.time >= backup_power_lost_until) + regainBackupPower() + + else if(electrified_until > 0 && world.time >= electrified_until) + electrify(0) + + if (..() == PROCESS_KILL && !(main_power_lost_until > 0 || backup_power_lost_until > 0 || electrified_until > 0)) + . = PROCESS_KILL + +/obj/machinery/door/airlock/uranium/process() + if(world.time > last_event+20) + if(prob(50)) + SSradiation.radiate(src, rad_power) + last_event = world.time + ..() + +/obj/machinery/door/airlock/phoron + name = "Phoron Airlock" + desc = "No way this can end badly." + icon = 'icons/obj/doors/Doorphoron.dmi' + mineral = "phoron" + +/obj/machinery/door/airlock/phoron/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume) + if(exposed_temperature > 300) + PhoronBurn(exposed_temperature) + +/obj/machinery/door/airlock/phoron/proc/ignite(exposed_temperature) + if(exposed_temperature > 300) + PhoronBurn(exposed_temperature) + +/obj/machinery/door/airlock/phoron/proc/PhoronBurn(temperature) + for(var/turf/simulated/floor/target_tile in range(2,loc)) + target_tile.assume_gas("phoron", 35, 400+T0C) + spawn (0) target_tile.hotspot_expose(temperature, 400) + for(var/turf/simulated/wall/W in range(3,src)) + W.burn((temperature/4))//Added so that you can't set off a massive chain reaction with a small flame + for(var/obj/machinery/door/airlock/phoron/D in range(3,src)) + D.ignite(temperature/4) + new/obj/structure/door_assembly( src.loc ) + qdel(src) + +/obj/machinery/door/airlock/sandstone + name = "Sandstone Airlock" + icon = 'icons/obj/doors/Doorsand.dmi' + mineral = "sandstone" + +/obj/machinery/door/airlock/science + name = "Research Airlock" + icon = 'icons/obj/doors/Doorsci.dmi' + assembly_type = /obj/structure/door_assembly/door_assembly_science + req_one_access = list(access_research) + open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + department_open_powered = 'sound/machines/door/sci1o.ogg' + department_close_powered = 'sound/machines/door/sci1c.ogg' + +/obj/machinery/door/airlock/glass_science + name = "Glass Airlocks" + icon = 'icons/obj/doors/Doorsciglass.dmi' + opacity = 0 + assembly_type = /obj/structure/door_assembly/door_assembly_science + glass = 1 + req_one_access = list(access_research) + open_sound_powered = 'sound/machines/door/hall1o.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + close_sound_powered = 'sound/machines/door/hall1c.ogg' // VOREStation Edit: Default door sounds for fancy, department-off. + department_open_powered = 'sound/machines/door/sci1o.ogg' + department_close_powered = 'sound/machines/door/sci1c.ogg' + +/obj/machinery/door/airlock/highsecurity + name = "Secure Airlock" + icon = 'icons/obj/doors/hightechsecurity.dmi' + explosion_resistance = 20 + secured_wires = 1 + assembly_type = /obj/structure/door_assembly/door_assembly_highsecurity + req_one_access = list(access_heads_vault) + open_sound_powered = 'sound/machines/door/secure1o.ogg' + close_sound_powered = 'sound/machines/door/secure1c.ogg' + +/obj/machinery/door/airlock/voidcraft + name = "voidcraft hatch" + desc = "It's an extra resilient airlock intended for spacefaring vessels." + icon = 'icons/obj/doors/shuttledoors.dmi' + explosion_resistance = 20 + opacity = 0 + glass = 1 + assembly_type = /obj/structure/door_assembly/door_assembly_voidcraft + open_sound_powered = 'sound/machines/door/shuttle1o.ogg' + close_sound_powered = 'sound/machines/door/shuttle1c.ogg' + +// Airlock opens from top-bottom instead of left-right. +/obj/machinery/door/airlock/voidcraft/vertical + icon = 'icons/obj/doors/shuttledoors_vertical.dmi' + assembly_type = /obj/structure/door_assembly/door_assembly_voidcraft/vertical + open_sound_powered = 'sound/machines/door/shuttle1o.ogg' + close_sound_powered = 'sound/machines/door/shuttle1c.ogg' + + +/datum/category_item/catalogue/anomalous/precursor_a/alien_airlock + name = "Precursor Alpha Object - Doors" + desc = "This object appears to be used in order to restrict or allow access to \ + rooms based on its physical state. In other words, a door. \ + Despite being designed and created by unknown ancient alien hands, this door has \ + a large number of similarities to the conventional airlock, such as being driven by \ + electricity, opening and closing by physically moving, and being air tight. \ + It also operates by responding to signals through internal electrical conduits. \ + These characteristics make it possible for one with experience with a multitool \ + to manipulate the door.\ +

\ + The symbol on the door does not match any living species' patterns, giving further \ + implications that this door is very old, and yet it remains operational after \ + thousands of years. It is unknown if that is due to superb construction, or \ + unseen autonomous maintenance having been performed." + value = CATALOGUER_REWARD_EASY + +/obj/machinery/door/airlock/alien + name = "alien airlock" + desc = "You're fairly sure this is a door." + catalogue_data = list(/datum/category_item/catalogue/anomalous/precursor_a/alien_airlock) + icon = 'icons/obj/doors/Dooralien.dmi' + explosion_resistance = 20 + secured_wires = TRUE + hackProof = TRUE + assembly_type = /obj/structure/door_assembly/door_assembly_alien + req_one_access = list(access_alien) + +/obj/machinery/door/airlock/alien/locked + icon_state = "door_locked" + locked = TRUE + +/obj/machinery/door/airlock/alien/public // Entry to UFO. + req_one_access = list() + normalspeed = FALSE // So it closes faster and hopefully keeps the warm air inside. + hackProof = TRUE //VOREStation Edit - No borgos + +/* +About the new airlock wires panel: +* An airlock wire dialog can be accessed by the normal way or by using wirecutters or a multitool on the door while the wire-panel is open. This would show the following wires, which you can either wirecut/mend or send a multitool pulse through. There are 9 wires. +* one wire from the ID scanner. Sending a pulse through this flashes the red light on the door (if the door has power). If you cut this wire, the door will stop recognizing valid IDs. (If the door has 0000 access, it still opens and closes, though) +* two wires for power. Sending a pulse through either one causes a breaker to trip, disabling the door for 10 seconds if backup power is connected, or 1 minute if not (or until backup power comes back on, whichever is shorter). Cutting either one disables the main door power, but unless backup power is also cut, the backup power re-powers the door in 10 seconds. While unpowered, the door may be open, but bolts-raising will not work. Cutting these wires may electrocute the user. +* one wire for door bolts. Sending a pulse through this drops door bolts (whether the door is powered or not) or raises them (if it is). Cutting this wire also drops the door bolts, and mending it does not raise them. If the wire is cut, trying to raise the door bolts will not work. +* two wires for backup power. Sending a pulse through either one causes a breaker to trip, but this does not disable it unless main power is down too (in which case it is disabled for 1 minute or however long it takes main power to come back, whichever is shorter). Cutting either one disables the backup door power (allowing it to be crowbarred open, but disabling bolts-raising), but may electocute the user. +* one wire for opening the door. Sending a pulse through this while the door has power makes it open the door if no access is required. +* one wire for AI control. Sending a pulse through this blocks AI control for a second or so (which is enough to see the AI control light on the panel dialog go off and back on again). Cutting this prevents the AI from controlling the door unless it has hacked the door through the power connection (which takes about a minute). If both main and backup power are cut, as well as this wire, then the AI cannot operate or hack the door at all. +* one wire for electrifying the door. Sending a pulse through this electrifies the door for 30 seconds. Cutting this wire electrifies the door, so that the next person to touch the door without insulated gloves gets electrocuted. (Currently it is also STAYING electrified until someone mends the wire) +* one wire for controling door safetys. When active, door does not close on someone. When cut, door will ruin someone's shit. When pulsed, door will immedately ruin someone's shit. +* one wire for controlling door speed. When active, dor closes at normal rate. When cut, door does not close manually. When pulsed, door attempts to close every tick. +*/ + + + +/obj/machinery/door/airlock/bumpopen(mob/living/user as mob) //Airlocks now zap you when you 'bump' them open when they're electrified. --NeoFite + if(!issilicon(usr)) + if(src.isElectrified()) + if(!src.justzap) + if(src.shock(user, 100)) + src.justzap = 1 + spawn (10) + src.justzap = 0 + return + else /*if(src.justzap)*/ + return + else if(user.hallucination > 50 && prob(10) && src.operating == 0) + to_chat(user, "You feel a powerful shock course through your body!") + user.halloss += 10 + user.stunned += 10 + return + ..(user) + +/obj/machinery/door/airlock/proc/isElectrified() + if(src.electrified_until != 0) + return 1 + return 0 + +/obj/machinery/door/airlock/proc/canAIControl() + return ((src.aiControlDisabled!=1) && (!src.isAllPowerLoss())); + +/obj/machinery/door/airlock/proc/canAIHack() + return ((src.aiControlDisabled==1) && (!hackProof) && (!src.isAllPowerLoss())); + +/obj/machinery/door/airlock/proc/arePowerSystemsOn() + if (stat & (NOPOWER|BROKEN)) + return 0 + return (src.main_power_lost_until==0 || src.backup_power_lost_until==0) + +/obj/machinery/door/airlock/requiresID() + return !(wires.is_cut(WIRE_IDSCAN) || aiDisabledIdScanner) + +/obj/machinery/door/airlock/proc/isAllPowerLoss() + if(stat & (NOPOWER|BROKEN)) + return 1 + if(mainPowerCablesCut() && backupPowerCablesCut()) + return 1 + return 0 + +/obj/machinery/door/airlock/proc/mainPowerCablesCut() + return wires.is_cut(WIRE_MAIN_POWER1) || wires.is_cut(WIRE_MAIN_POWER2) + +/obj/machinery/door/airlock/proc/backupPowerCablesCut() + return wires.is_cut(WIRE_BACKUP_POWER1) || wires.is_cut(WIRE_BACKUP_POWER2) + +/obj/machinery/door/airlock/proc/loseMainPower() + main_power_lost_until = mainPowerCablesCut() ? -1 : world.time + SecondsToTicks(60) + + // If backup power is permanently disabled then activate in 10 seconds if possible, otherwise it's already enabled or a timer is already running + if(backup_power_lost_until == -1 && !backupPowerCablesCut()) + backup_power_lost_until = world.time + SecondsToTicks(10) + + if(main_power_lost_until > 0 || backup_power_lost_until > 0) + START_MACHINE_PROCESSING(src) + + // Disable electricity if required + if(electrified_until && isAllPowerLoss()) + electrify(0) + + update_icon() + +/obj/machinery/door/airlock/proc/loseBackupPower() + backup_power_lost_until = backupPowerCablesCut() ? -1 : world.time + SecondsToTicks(60) + + if(backup_power_lost_until > 0) + START_MACHINE_PROCESSING(src) + + // Disable electricity if required + if(electrified_until && isAllPowerLoss()) + electrify(0) + + update_icon() + +/obj/machinery/door/airlock/proc/regainMainPower() + if(!mainPowerCablesCut()) + main_power_lost_until = 0 + // If backup power is currently active then disable, otherwise let it count down and disable itself later + if(!backup_power_lost_until) + backup_power_lost_until = -1 + + update_icon() + +/obj/machinery/door/airlock/proc/regainBackupPower() + if(!backupPowerCablesCut()) + // Restore backup power only if main power is offline, otherwise permanently disable + backup_power_lost_until = main_power_lost_until == 0 ? -1 : 0 + + update_icon() + +/obj/machinery/door/airlock/proc/electrify(var/duration, var/feedback = 0) + var/message = "" + if(wires.is_cut(WIRE_ELECTRIFY) && arePowerSystemsOn()) + message = text("The electrification wire is cut - Door permanently electrified.") + src.electrified_until = -1 + else if(duration && !arePowerSystemsOn()) + message = text("The door is unpowered - Cannot electrify the door.") + src.electrified_until = 0 + else if(!duration && electrified_until != 0) + message = "The door is now un-electrified." + src.electrified_until = 0 + else if(duration) //electrify door for the given duration seconds + if(usr) + shockedby += text("\[[time_stamp()]\] - [usr](ckey:[usr.ckey])") + add_attack_logs(usr,name,"Electrified a door") + else + shockedby += text("\[[time_stamp()]\] - EMP)") + message = "The door is now electrified [duration == -1 ? "permanently" : "for [duration] second\s"]." + src.electrified_until = duration == -1 ? -1 : world.time + SecondsToTicks(duration) + + if(electrified_until > 0) + START_MACHINE_PROCESSING(src) + + if(feedback && message) + to_chat(usr,message) + +/obj/machinery/door/airlock/proc/set_idscan(var/activate, var/feedback = 0) + var/message = "" + if(wires.is_cut(WIRE_IDSCAN)) + message = "The IdScan wire is cut - IdScan feature permanently disabled." + else if(activate && src.aiDisabledIdScanner) + src.aiDisabledIdScanner = 0 + message = "IdScan feature has been enabled." + else if(!activate && !src.aiDisabledIdScanner) + src.aiDisabledIdScanner = 1 + message = "IdScan feature has been disabled." + + if(feedback && message) + to_chat(usr,message) + +/obj/machinery/door/airlock/proc/set_safeties(var/activate, var/feedback = 0) + var/message = "" + // Safeties! We don't need no stinking safeties! + if (wires.is_cut(WIRE_SAFETY)) + message = text("The safety wire is cut - Cannot enable safeties.") + else if (!activate && src.safe) + safe = 0 + else if (activate && !src.safe) + safe = 1 + + if(feedback && message) + to_chat(usr,message) + +// shock user with probability prb (if all connections & power are working) +// returns 1 if shocked, 0 otherwise +// The preceding comment was borrowed from the grille's shock script +/obj/machinery/door/airlock/shock(mob/user, prb) + if(!arePowerSystemsOn()) + return 0 + if(hasShocked) + return 0 //Already shocked someone recently? + if(..()) + hasShocked = 1 + sleep(10) + hasShocked = 0 + return 1 + else + return 0 + + +/obj/machinery/door/airlock/update_icon() + cut_overlays() + if(density) + if(locked && lights && src.arePowerSystemsOn()) + icon_state = "door_locked" + else + icon_state = "door_closed" + if(p_open || welded) + if(p_open) + add_overlay("panel_open") + if (!(stat & NOPOWER)) + if(stat & BROKEN) + add_overlay("sparks_broken") + else if (health < maxhealth * 3/4) + add_overlay("sparks_damaged") + if(welded) + add_overlay("welded") + else if (health < maxhealth * 3/4 && !(stat & NOPOWER)) + add_overlay("sparks_damaged") + else + icon_state = "door_open" + if((stat & BROKEN) && !(stat & NOPOWER)) + add_overlay("sparks_open") + return + +/obj/machinery/door/airlock/do_animate(animation) + switch(animation) + if("opening") + cut_overlay() + if(p_open) + spawn(2) // The only work around that works. Downside is that the door will be gone for a millisecond. + flick("o_door_opening", src) //can not use flick due to BYOND bug updating overlays right before flicking + update_icon() + else + flick("door_opening", src)//[stat ? "_stat":] + update_icon() + if("closing") + cut_overlay() + if(p_open) + spawn(2) + flick("o_door_closing", src) + update_icon() + else + flick("door_closing", src) + update_icon() + if("spark") + if(density) + flick("door_spark", src) + if("deny") + if(density && src.arePowerSystemsOn()) + flick("door_deny", src) + playsound(src, denied_sound, 50, 0, 3) + return + +/obj/machinery/door/airlock/attack_ai(mob/user as mob) + tgui_interact(user) + +/obj/machinery/door/airlock/attack_ghost(mob/user) + tgui_interact(user) + +/obj/machinery/door/airlock/tgui_interact(mob/user, datum/tgui/ui, datum/tgui/parent_ui, datum/tgui_state/custom_state) + ui = SStgui.try_update_ui(user, src, ui) + if(!ui) + ui = new(user, src, "AiAirlock", name) + ui.open() + if(custom_state) + ui.set_state(custom_state) + return TRUE + +/obj/machinery/door/airlock/tgui_data(mob/user) + var/list/data = list() + + var/list/power = list() + power["main"] = main_power_lost_until > 0 ? 0 : 2 + power["main_timeleft"] = round(main_power_lost_until > 0 ? max(main_power_lost_until - world.time, 0) / 10 : main_power_lost_until, 1) + power["backup"] = backup_power_lost_until > 0 ? 0 : 2 + power["backup_timeleft"] = round(backup_power_lost_until > 0 ? max(backup_power_lost_until - world.time, 0) / 10 : backup_power_lost_until, 1) + data["power"] = power + + data["shock"] = (electrified_until == 0) ? 2 : 0 + data["shock_timeleft"] = round(electrified_until > 0 ? max(electrified_until - world.time, 0) / 10 : electrified_until, 1) + data["id_scanner"] = !aiDisabledIdScanner + data["locked"] = locked // bolted + data["lights"] = lights // bolt lights + data["safe"] = safe // safeties + data["speed"] = normalspeed // safe speed + data["welded"] = welded // welded + data["opened"] = !density // opened + + var/list/wire = list() + wire["main_1"] = !wires.is_cut(WIRE_MAIN_POWER1) + wire["main_2"] = !wires.is_cut(WIRE_MAIN_POWER2) + wire["backup_1"] = !wires.is_cut(WIRE_BACKUP_POWER1) + wire["backup_2"] = !wires.is_cut(WIRE_BACKUP_POWER2) + wire["shock"] = !wires.is_cut(WIRE_ELECTRIFY) + wire["id_scanner"] = !wires.is_cut(WIRE_IDSCAN) + wire["bolts"] = !wires.is_cut(WIRE_DOOR_BOLTS) + wire["lights"] = !wires.is_cut(WIRE_BOLT_LIGHT) + wire["safe"] = !wires.is_cut(WIRE_SAFETY) + wire["timing"] = !wires.is_cut(WIRE_SPEED) + + data["wires"] = wire + return data + +/obj/machinery/door/airlock/proc/hack(mob/user as mob) + if(src.aiHacking==0) + src.aiHacking=1 + spawn(20) + //TODO: Make this take a minute + to_chat(user, "Airlock AI control has been blocked. Beginning fault-detection.") + sleep(50) + if(src.canAIControl()) + to_chat(user, "Alert cancelled. Airlock control has been restored without our assistance.") + src.aiHacking=0 + return + else if(!src.canAIHack(user)) + to_chat(user, "We've lost our connection! Unable to hack airlock.") + src.aiHacking=0 + return + to_chat(user, "Fault confirmed: airlock control wire disabled or cut.") + sleep(20) + to_chat(user, "Attempting to hack into airlock. This may take some time.") + sleep(200) + if(src.canAIControl()) + to_chat(user, "Alert cancelled. Airlock control has been restored without our assistance.") + src.aiHacking=0 + return + else if(!src.canAIHack(user)) + to_chat(user, "We've lost our connection! Unable to hack airlock.") + src.aiHacking=0 + return + to_chat(user, "Upload access confirmed. Loading control program into airlock software.") + sleep(170) + if(src.canAIControl()) + to_chat(user, "Alert cancelled. Airlock control has been restored without our assistance.") + src.aiHacking=0 + return + else if(!src.canAIHack(user)) + to_chat(user, "We've lost our connection! Unable to hack airlock.") + src.aiHacking=0 + return + to_chat(user, "Transfer complete. Forcing airlock to execute program.") + sleep(50) + //disable blocked control + src.aiControlDisabled = 2 + to_chat(user, "Receiving control information from airlock.") + sleep(10) + //bring up airlock dialog + src.aiHacking = 0 + if (user) + src.attack_ai(user) + +/obj/machinery/door/airlock/CanPass(atom/movable/mover, turf/target) + if (src.isElectrified()) + if (istype(mover, /obj/item)) + var/obj/item/i = mover + if (i.matter && (DEFAULT_WALL_MATERIAL in i.matter) && i.matter[DEFAULT_WALL_MATERIAL] > 0) + var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread + s.set_up(5, 1, src) + s.start() + return ..() + +/obj/machinery/door/airlock/attack_hand(mob/user as mob) + if(!istype(usr, /mob/living/silicon)) + if(src.isElectrified()) + if(src.shock(user, 100)) + return + + if(istype(user, /mob/living/carbon/human)) + var/mob/living/carbon/human/X = user + if(istype(X.species, /datum/species/xenos)) + src.attack_alien(user) + return + + if(src.p_open) + user.set_machine(src) + wires.Interact(user) + else + ..(user) + return + +/obj/machinery/door/airlock/tgui_act(action, params) + if(..()) + return TRUE + if(!user_allowed(usr)) + return TRUE + + switch(action) + if("disrupt-main") + if(!main_power_lost_until) + loseMainPower() + update_icon() + else + to_chat(usr, "Main power is already offline.") + . = TRUE + if("disrupt-backup") + if(!backup_power_lost_until) + loseBackupPower() + update_icon() + else + to_chat(usr, "Backup power is already offline.") + . = TRUE + if("shock-restore") + electrify(0, 1) + . = TRUE + if("shock-temp") + electrify(30, 1) + . = TRUE + if("shock-perm") + electrify(-1, 1) + . = TRUE + if("idscan-toggle") + set_idscan(aiDisabledIdScanner, 1) + . = TRUE + // if("emergency-toggle") + // toggle_emergency(usr) + // . = TRUE + if("bolt-toggle") + toggle_bolt(usr) + . = TRUE + if("light-toggle") + if(wires.is_cut(WIRE_BOLT_LIGHT)) + to_chat(usr, "The bolt lights wire is cut - The door bolt lights are permanently disabled.") + return + lights = !lights + update_icon() + . = TRUE + if("safe-toggle") + set_safeties(!safe, 1) + . = TRUE + if("speed-toggle") + if(wires.is_cut(WIRE_SPEED)) + to_chat(usr, "The timing wire is cut - Cannot alter timing.") + return + normalspeed = !normalspeed + . = TRUE + if("open-close") + user_toggle_open(usr) + . = TRUE + + update_icon() + return 1 + +/obj/machinery/door/airlock/proc/user_allowed(mob/user) + var/allowed = (issilicon(user) && canAIControl(user)) + if(!allowed && isobserver(user)) + var/mob/observer/dead/D = user + if(D.can_admin_interact()) + allowed = TRUE + return allowed + +/obj/machinery/door/airlock/proc/toggle_bolt(mob/user) + if(!user_allowed(user)) + return + if(wires.is_cut(WIRE_DOOR_BOLTS)) + to_chat(user, "The door bolt drop wire is cut - you can't toggle the door bolts.") + return + if(locked) + if(!arePowerSystemsOn()) + to_chat(user, "The door has no power - you can't raise the door bolts.") + else + unlock() + to_chat(user, "The door bolts have been raised.") + // log_combat(user, src, "unbolted") + else + lock() + to_chat(user, "The door bolts have been dropped.") + // log_combat(user, src, "bolted") + +/obj/machinery/door/airlock/proc/user_toggle_open(mob/user) + if(!user_allowed(user)) + return + if(welded) + to_chat(user, text("The airlock has been welded shut!")) + else if(locked) + to_chat(user, text("The door bolts are down!")) + else if(!density) + close() + else + open() + +/obj/machinery/door/airlock/proc/can_remove_electronics() + return src.p_open && (operating < 0 || (!operating && welded && !src.arePowerSystemsOn() && density && (!src.locked || (stat & BROKEN)))) + +/obj/machinery/door/airlock/attackby(obj/item/C, mob/user as mob) + //to_world("airlock attackby src [src] obj [C] mob [user]") + if(!istype(usr, /mob/living/silicon)) + if(src.isElectrified()) + if(src.shock(user, 75)) + return + if(istype(C, /obj/item/taperoll)) + return + + src.add_fingerprint(user) + if (attempt_vr(src,"attackby_vr",list(C, user))) return + if(istype(C, /mob/living)) + ..() + return + if(!repairing && istype(C, /obj/item/weapon/weldingtool) && !( src.operating > 0 ) && src.density) + var/obj/item/weapon/weldingtool/W = C + if(W.remove_fuel(0,user)) + if(!src.welded) + src.welded = 1 + else + src.welded = null + playsound(src, C.usesound, 75, 1) + src.update_icon() + return + else + return + else if(C.is_screwdriver()) + if (src.p_open) + if (stat & BROKEN) + to_chat(usr, "The panel is broken and cannot be closed.") + else + src.p_open = 0 + playsound(src, C.usesound, 50, 1) + else + src.p_open = 1 + playsound(src, C.usesound, 50, 1) + src.update_icon() + else if(C.is_wirecutter()) + return src.attack_hand(user) + else if(istype(C, /obj/item/device/multitool)) + return src.attack_hand(user) + else if(istype(C, /obj/item/device/assembly/signaler)) + return src.attack_hand(user) + else if(istype(C, /obj/item/weapon/pai_cable)) // -- TLE + var/obj/item/weapon/pai_cable/cable = C + cable.plugin(src, user) + else if(!repairing && C.is_crowbar()) + if(can_remove_electronics()) + playsound(src, C.usesound, 75, 1) + user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to remove electronics from the airlock assembly.") + if(do_after(user,40 * C.toolspeed)) + to_chat(user, "You removed the airlock electronics!") + + var/obj/structure/door_assembly/da = new assembly_type(src.loc) + if (istype(da, /obj/structure/door_assembly/multi_tile)) + da.set_dir(src.dir) + + da.anchored = 1 + if(mineral) + da.glass = mineral + //else if(glass) + else if(glass && !da.glass) + da.glass = 1 + da.state = 1 + da.created_name = src.name + da.update_state() + + if(operating == -1 || (stat & BROKEN)) + new /obj/item/weapon/circuitboard/broken(src.loc) + operating = 0 + else + if (!electronics) create_electronics() + + electronics.loc = src.loc + electronics = null + + qdel(src) + return + else if(arePowerSystemsOn()) + to_chat(user, "The airlock's motors resist your efforts to force it.") + else if(locked) + to_chat(user, "The airlock's bolts prevent it from being forced.") + else + if(density) + spawn(0) open(1) + else + spawn(0) close(1) + + // Check if we're using a crowbar or armblade, and if the airlock's unpowered for whatever reason (off, broken, etc). + else if(istype(C, /obj/item/weapon)) + var/obj/item/weapon/W = C + if((W.pry == 1) && !arePowerSystemsOn()) + if(locked) + to_chat(user, "The airlock's bolts prevent it from being forced.") + else if( !welded && !operating ) + if(istype(C, /obj/item/weapon/material/twohanded/fireaxe)) // If this is a fireaxe, make sure it's held in two hands. + var/obj/item/weapon/material/twohanded/fireaxe/F = C + if(!F.wielded) + to_chat(user, "You need to be wielding \the [F] to do that.") + return + // At this point, it's an armblade or a fireaxe that passed the wielded test, let's try to open it. + if(density) + spawn(0) + open(1) + else + spawn(0) + close(1) + else + ..() + else + ..() + return + +/obj/machinery/door/airlock/phoron/attackby(C as obj, mob/user as mob) + if(C) + ignite(is_hot(C)) + ..() + +/obj/machinery/door/airlock/set_broken() + src.p_open = 1 + stat |= BROKEN + if (secured_wires) + lock() + for (var/mob/O in viewers(src, null)) + if ((O.client && !( O.blinded ))) + O.show_message("[src.name]'s control panel bursts open, sparks spewing out!") + + var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread + s.set_up(5, 1, src) + s.start() + + update_icon() + return + +/obj/machinery/door/airlock/open(var/forced=0) + if(!can_open(forced)) + return 0 + use_power(360) //360 W seems much more appropriate for an actuator moving an industrial door capable of crushing people + + //if the door is unpowered then it doesn't make sense to hear the woosh of a pneumatic actuator + for(var/P in player_list) + var/mob/M = P + if(!M || !M.client) + continue + var/old_sounds = M.client.is_preference_enabled(/datum/client_preference/old_door_sounds) + var/department_door_sounds = M.client.is_preference_enabled(/datum/client_preference/department_door_sounds) + var/sound + var/volume + if(old_sounds) // Do we have old sounds enabled? Play these even if we have department door sounds enabled. + if(arePowerSystemsOn()) + sound = legacy_open_powered + volume = 50 + else + sound = open_sound_unpowered + volume = 75 + else if(!old_sounds && department_door_sounds && src.department_open_powered) // Else, we have old sounds disabled, the door has per-department door sounds, and we have chosen to play department door sounds, use these. + if(arePowerSystemsOn()) + sound = department_open_powered + volume = 50 + else + sound = open_sound_unpowered + volume = 75 + else // Else, play these. + if(arePowerSystemsOn()) + sound = open_sound_powered + volume = 50 + else + sound = open_sound_unpowered + volume = 75 + + var/turf/T = get_turf(M) + var/distance = get_dist(T, get_turf(src)) + if(distance <= world.view * 2) + if(T && T.z == get_z(src)) + M.playsound_local(get_turf(src), sound, volume, 1, null, 0, TRUE, sound(sound), volume_channel = VOLUME_CHANNEL_DOORS) + + if(src.closeOther != null && istype(src.closeOther, /obj/machinery/door/airlock/) && !src.closeOther.density) + src.closeOther.close() + return ..() + +/obj/machinery/door/airlock/can_open(var/forced=0) + if(!forced) + if(!arePowerSystemsOn() || wires.is_cut(WIRE_OPEN_DOOR)) + return 0 + + if(locked || welded) + return 0 + return ..() + +/obj/machinery/door/airlock/can_close(var/forced=0) + if(locked || welded) + return 0 + + if(!forced) + //despite the name, this wire is for general door control. + if(!arePowerSystemsOn() || wires.is_cut(WIRE_OPEN_DOOR)) + return 0 + + return ..() + +/atom/movable/proc/blocks_airlock() + return density + +/obj/machinery/door/blocks_airlock() + return 0 + +/obj/machinery/mech_sensor/blocks_airlock() + return 0 + +/mob/living/blocks_airlock() + return 1 + +/atom/movable/proc/airlock_crush(var/crush_damage) + return 0 + +/obj/machinery/portable_atmospherics/canister/airlock_crush(var/crush_damage) + . = ..() + health -= crush_damage + healthcheck() + +/obj/effect/energy_field/airlock_crush(var/crush_damage) + adjust_strength(crush_damage) + +/obj/structure/closet/airlock_crush(var/crush_damage) + ..() + damage(crush_damage) + for(var/atom/movable/AM in src) + AM.airlock_crush() + return 1 + +/mob/living/airlock_crush(var/crush_damage) + . = ..() + adjustBruteLoss(crush_damage) + SetStunned(5) + SetWeakened(5) + var/turf/T = get_turf(src) + T.add_blood(src) + return 1 + +/mob/living/carbon/airlock_crush(var/crush_damage) + . = ..() + if(can_feel_pain()) + emote("scream") + +/mob/living/silicon/robot/airlock_crush(var/crush_damage) + adjustBruteLoss(crush_damage) + return 0 + +/obj/machinery/door/airlock/close(var/forced=0) + if(!can_close(forced)) + return 0 + + if(safe) + for(var/turf/turf in locs) + for(var/atom/movable/AM in turf) + if(AM.blocks_airlock()) + if(!has_beeped) + playsound(src, 'sound/machines/buzz-two.ogg', 50, 0) + has_beeped = 1 + autoclose_in(6) + return + + for(var/turf/turf in locs) + for(var/atom/movable/AM in turf) + if(AM.airlock_crush(DOOR_CRUSH_DAMAGE)) + take_damage(DOOR_CRUSH_DAMAGE) + + use_power(360) //360 W seems much more appropriate for an actuator moving an industrial door capable of crushing people + has_beeped = 0 + for(var/P in player_list) + var/mob/M = P + if(!M || !M.client) + continue + var/old_sounds = M.client.is_preference_enabled(/datum/client_preference/old_door_sounds) + var/department_door_sounds = M.client.is_preference_enabled(/datum/client_preference/department_door_sounds) + var/sound + var/volume + if(old_sounds) + if(arePowerSystemsOn()) + sound = legacy_close_powered + volume = 50 + else + sound = open_sound_unpowered + volume = 75 + else if(!old_sounds && department_door_sounds && src.department_close_powered) // Else, we have old sounds disabled, the door has per-department door sounds, and we have chosen to play department door sounds, use these. + if(arePowerSystemsOn()) + sound = department_close_powered + volume = 50 + else + sound = open_sound_unpowered + volume = 75 + else + if(arePowerSystemsOn()) + sound = close_sound_powered + volume = 50 + else + sound = open_sound_unpowered + volume = 75 + + var/turf/T = get_turf(M) + var/distance = get_dist(T, get_turf(src)) + if(distance <= world.view * 2) + if(T && T.z == get_z(src)) + M.playsound_local(get_turf(src), sound, volume, 1, null, 0, TRUE, sound(sound), volume_channel = VOLUME_CHANNEL_DOORS) + for(var/turf/turf in locs) + var/obj/structure/window/killthis = (locate(/obj/structure/window) in turf) + if(killthis) + killthis.ex_act(2)//Smashin windows + return ..() + +/obj/machinery/door/airlock/proc/lock(var/forced=0) + if(locked) + return 0 + + if (operating && !forced) return 0 + + src.locked = 1 + playsound(src, bolt_down_sound, 30, 0, 3, volume_channel = VOLUME_CHANNEL_DOORS) + for(var/mob/M in range(1,src)) + M.show_message("You hear a click from the bottom of the door.", 2) + update_icon() + return 1 + +/obj/machinery/door/airlock/proc/unlock(var/forced=0) + if(!src.locked) + return + + if (!forced) + if(operating || !src.arePowerSystemsOn() || wires.is_cut(WIRE_DOOR_BOLTS)) return + + src.locked = 0 + playsound(src, bolt_up_sound, 30, 0, 3, volume_channel = VOLUME_CHANNEL_DOORS) + for(var/mob/M in range(1,src)) + M.show_message("You hear a click from the bottom of the door.", 2) + update_icon() + return 1 + +/obj/machinery/door/airlock/allowed(mob/M) + if(locked) + return 0 + return ..(M) + +/obj/machinery/door/airlock/New(var/newloc, var/obj/structure/door_assembly/assembly=null) + ..() + + //if assembly is given, create the new door from the assembly + if (assembly && istype(assembly)) + assembly_type = assembly.type + + electronics = assembly.electronics + electronics.loc = src + + //update the door's access to match the electronics' + secured_wires = electronics.secure + if(electronics.one_access) + LAZYCLEARLIST(req_access) + req_one_access = src.electronics.conf_access + else + LAZYCLEARLIST(req_one_access) + req_access = src.electronics.conf_access + + //get the name from the assembly + if(assembly.created_name) + name = assembly.created_name + else + name = "[istext(assembly.glass) ? "[assembly.glass] airlock" : assembly.base_name]" + + //get the dir from the assembly + set_dir(assembly.dir) + + //wires + var/turf/T = get_turf(newloc) + if(T && (T.z in using_map.admin_levels)) + secured_wires = 1 + if (secured_wires) + wires = new/datum/wires/airlock/secure(src) + else + wires = new/datum/wires/airlock(src) + +/obj/machinery/door/airlock/Initialize() + if(src.closeOtherId != null) + for (var/obj/machinery/door/airlock/A in machines) + if(A.closeOtherId == src.closeOtherId && A != src) + src.closeOther = A + break + name = "\improper [name]" + . = ..() + +/obj/machinery/door/airlock/Destroy() + qdel(wires) + wires = null + return ..() + +// Most doors will never be deconstructed over the course of a round, +// so as an optimization defer the creation of electronics until +// the airlock is deconstructed +/obj/machinery/door/airlock/proc/create_electronics() + //create new electronics + if (secured_wires) + src.electronics = new/obj/item/weapon/airlock_electronics/secure( src.loc ) + else + src.electronics = new/obj/item/weapon/airlock_electronics( src.loc ) + + //update the electronics to match the door's access + if(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) + if(prob(40/severity)) + var/duration = world.time + SecondsToTicks(30 / severity) + if(duration > electrified_until) + electrify(duration) + ..() + +/obj/machinery/door/airlock/power_change() //putting this is obj/machinery/door itself makes non-airlock doors turn invisible for some reason + ..() + if(stat & NOPOWER) + // If we lost power, disable electrification + // Keeping door lights on, runs on internal battery or something. + electrified_until = 0 + update_icon() + +/obj/machinery/door/airlock/proc/prison_open() + if(arePowerSystemsOn()) + src.unlock() + src.open() + src.lock() + return + + +/obj/machinery/door/airlock/rcd_values(mob/living/user, obj/item/weapon/rcd/the_rcd, passed_mode) + switch(passed_mode) + if(RCD_DECONSTRUCT) + // Old RCD code made it cost 10 units to decon an airlock. + // Now the new one costs ten "sheets". + return list( + RCD_VALUE_MODE = RCD_DECONSTRUCT, + RCD_VALUE_DELAY = 5 SECONDS, + RCD_VALUE_COST = RCD_SHEETS_PER_MATTER_UNIT * 10 + ) + return FALSE + +/obj/machinery/door/airlock/rcd_act(mob/living/user, obj/item/weapon/rcd/the_rcd, passed_mode) + switch(passed_mode) + if(RCD_DECONSTRUCT) + to_chat(user, span("notice", "You deconstruct \the [src].")) + qdel(src) + return TRUE + return FALSE diff --git a/code/game/machinery/doors/airlock_control.dm b/code/game/machinery/doors/airlock_control.dm index 4fa8a41901..83878767b7 100644 --- a/code/game/machinery/doors/airlock_control.dm +++ b/code/game/machinery/doors/airlock_control.dm @@ -1,20 +1,20 @@ #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 (..() == PROCESS_KILL && !cur_command) . = PROCESS_KILL 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 @@ -27,7 +27,7 @@ obj/machinery/door/airlock/receive_signal(datum/signal/signal) START_MACHINE_PROCESSING(src) -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 @@ -39,7 +39,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() @@ -70,7 +70,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) @@ -92,7 +92,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 @@ -108,17 +108,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 @@ -126,26 +126,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 @@ -166,7 +166,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" @@ -175,7 +175,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 @@ -184,7 +184,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) @@ -204,34 +204,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 @@ -249,20 +249,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") @@ -277,25 +277,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 121918af1f..c1cdc8a969 100644 --- a/code/game/machinery/doors/blast_door.dm +++ b/code/game/machinery/doors/blast_door.dm @@ -306,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" @@ -314,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 @@ -331,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" @@ -344,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 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/embedded_controller/airlock_controllers.dm b/code/game/machinery/embedded_controller/airlock_controllers.dm index 96a7e15aa0..879b532b08 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 be58897622..1cf4e1cb3c 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 dd0d863091..90558cf622 100644 --- a/code/game/machinery/embedded_controller/airlock_program.dm +++ b/code/game/machinery/embedded_controller/airlock_program.dm @@ -1,5 +1,4 @@ //Handles the control of airlocks - #define STATE_IDLE 0 #define STATE_PREPARE 1 #define STATE_DEPRESSURIZE 2 @@ -12,7 +11,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 +28,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 +61,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 +114,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 +174,7 @@ -/datum/computer/file/embedded_program/airlock/process() +/datum/embedded_program/airlock/process() if(!state) //Idle if(target_state) switch(target_state) @@ -278,49 +277,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, @@ -332,7 +331,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") @@ -348,17 +347,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) @@ -374,7 +373,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") @@ -416,8 +415,10 @@ send an additional command to open the door again. signalDoor(doorTag, doorCommand) #undef SKIPCYCLE_MARGIN +#undef MIN_TARGET_PRESSURE #undef STATE_IDLE +#undef STATE_PREPARE #undef STATE_DEPRESSURIZE #undef STATE_PRESSURIZE 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/machinery.dm b/code/game/machinery/machinery.dm index 1900811c8a..4ecc95b7c3 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -111,6 +111,11 @@ Class Procs: var/clickvol = 40 // volume var/interact_offline = 0 // Can the machine be interacted with while de-powered. var/obj/item/weapon/circuitboard/circuit = null + + // 0.0 - 1.0 multipler for prob() based on bullet structure damage + // So if this is 1.0 then a 100 damage bullet will always break this structure + // If this is 0.5 then a 50 damage bullet will break this structure 25% of the time + var/bullet_vulnerability = 0.25 var/speed_process = FALSE //If false, SSmachines. If true, SSfastprocess. @@ -181,15 +186,15 @@ Class Procs: /obj/machinery/ex_act(severity) switch(severity) if(1.0) - qdel(src) + fall_apart(severity) return if(2.0) if(prob(50)) - qdel(src) + fall_apart(severity) return if(3.0) if(prob(25)) - qdel(src) + fall_apart(severity) return else return @@ -476,6 +481,85 @@ Class Procs: qdel(src) return 1 +/obj/machinery/bullet_act(obj/item/projectile/P, def_zone) + . = ..() + if(prob(P.get_structure_damage() * bullet_vulnerability)) + fall_apart() + +/** + * Like an angrier dismantle, where it destroys some of the parts and doesn't give you a frame + ** severity: Same severities as ex_act (so lower is more destructive) + ** scatter: If you want the parts to slide around 1 turf in random directions + */ +/obj/machinery/proc/fall_apart(var/severity = 3, var/scatter = TRUE) + var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread() + spark_system.set_up(5, 0, src) + spark_system.attach(src) + + var/atom/droploc = drop_location() + if(!droploc || !contents.len) // not even a circuit? + playsound(src, 'sound/machines/machine_die_short.ogg') + spark_system.start() + qdel(spark_system) + qdel(src) + return + + var/list/surviving_parts = list() + // Deleting IDs is lame, unless this is like nuclear severity + if(severity != 1) + for(var/obj/item/weapon/card/id/I in contents) + surviving_parts |= I + + // May populate some items to throw around + if(!LAZYLEN(component_parts) && circuit) + circuit.apply_default_parts(src) + + var/survivability + switch(severity) + // No survivors + if(1) + survivability = 0 + + // 1 part survives + if(2) + survivability = 0 + var/atom/movable/picked_part = pick(contents) + if(istype(picked_part)) + surviving_parts |= picked_part + + // 50% of parts destroyed on average + if(3) + survivability = 50 + + // No parts destroyed, but you lose the frame + else + survivability = 100 + + for(var/atom/movable/P in contents) + if(prob(survivability)) + surviving_parts |= P + + if(circuit && severity >= 2) + var/datum/frame/frame_types/FT = circuit.board_type + if(istype(FT)) + // Some steel from the frame, but about half + surviving_parts += new /obj/item/stack/material/steel(null, max(1,round(FT.frame_size/2))) + // Two bits of cable, but not the 5 required to rebuild + surviving_parts += new /obj/item/stack/cable_coil(null, 1) + surviving_parts += new /obj/item/stack/cable_coil(null, 1) + + for(var/a in surviving_parts) + var/atom/movable/A = a + A.forceMove(droploc) + if(scatter && isturf(droploc)) + var/turf/T = droploc + A.Move(get_step(T, pick(alldirs))) + + playsound(src, 'sound/machines/machine_die_short.ogg') + spark_system.start() + qdel(spark_system) + qdel(src) + /datum/proc/apply_visual(mob/M) M.sight = 0 //Just reset their mesons and stuff so they can't use them, by default. return diff --git a/code/game/machinery/nuclear_bomb.dm b/code/game/machinery/nuclear_bomb.dm index 536da9fd0b..cb83cddd92 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 f7821a4e84..ee0d44ede0 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 75d7542ba1..0ae1785d50 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 819774d0e3..c35085382b 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 diff --git a/code/game/machinery/telecomms/presets.dm b/code/game/machinery/telecomms/presets.dm index b9c616c14e..8d11f99619 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 f37600acd5..24bf11b49b 100644 --- a/code/game/mecha/combat/gorilla.dm +++ b/code/game/mecha/combat/gorilla.dm @@ -104,7 +104,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 c716b1f33e..82db351ed1 100644 --- a/code/game/mecha/equipment/mecha_equipment.dm +++ b/code/game/mecha/equipment/mecha_equipment.dm @@ -17,13 +17,13 @@ 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 /// Bitflag. Used by exosuit fabricator to assign sub-categories based on which exosuits can equip this. var/mech_flags = NONE - 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 @@ -34,7 +34,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) @@ -45,10 +45,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 @@ -227,33 +223,37 @@ 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 - //VOREStation Addition begin: MICROMECHS - if(EQUIP_MICRO_UTILITY) - chassis.micro_utility_equipment -= src - if(EQUIP_MICRO_WEAPON) - chassis.micro_weapon_equipment -= src - //VOREStation Addition end: MICROMECHS - 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 + //VOREStation Addition begin: MICROMECHS + if(EQUIP_MICRO_UTILITY) + chassis.micro_utility_equipment -= src + if(EQUIP_MICRO_WEAPON) + chassis.micro_weapon_equipment -= src + //VOREStation Addition end: MICROMECHS + 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 4579c46919..ede02bb5b2 100644 --- a/code/game/mecha/equipment/tools/extinguisher.dm +++ b/code/game/mecha/equipment/tools/extinguisher.dm @@ -20,7 +20,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) && get_dist(chassis,target) <= 1) //VOREStation Edit 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 8ee94b162e..494b5eded8 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 595c860d57..8ee24a7755 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 bdac763a5b..9163ecec2b 100644 --- a/code/game/mecha/equipment/tools/sleeper.dm +++ b/code/game/mecha/equipment/tools/sleeper.dm @@ -9,20 +9,12 @@ equip_cooldown = 30 mech_flags = EXOSUIT_MODULE_MEDICAL 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 ..() @@ -63,8 +55,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.") @@ -84,15 +76,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() @@ -218,18 +210,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) @@ -243,6 +234,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 e12345844b..9825a3037a 100644 --- a/code/game/mecha/equipment/tools/syringe_gun.dm +++ b/code/game/mecha/equipment/tools/syringe_gun.dm @@ -18,17 +18,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() @@ -59,7 +58,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] @@ -123,7 +122,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.") @@ -243,7 +242,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 @@ -264,22 +263,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" @@ -321,10 +315,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) @@ -464,10 +454,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 080891672e..cacaf0d75a 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 @@ -222,8 +226,6 @@ /obj/mecha/New() ..() - events = new - icon_state += "-open" add_radio() add_cabin() @@ -239,7 +241,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) @@ -282,7 +283,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() @@ -324,16 +325,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 ///////// //////////////////////// @@ -372,12 +479,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) @@ -692,7 +793,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 @@ -711,16 +812,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 @@ -780,7 +872,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 @@ -882,10 +975,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 @@ -895,7 +986,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) @@ -2725,103 +2816,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 0b438e5632..aa5226c172 100644 --- a/code/game/mecha/mecha_control_console.dm +++ b/code/game/mecha/mecha_control_console.dm @@ -131,13 +131,4 @@ /obj/item/weapon/storage/box/mechabeacons name = "Exosuit Tracking Beacons" - -/obj/item/weapon/storage/box/mechabeacons/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/micro/mecha_construction_paths_vr.dm b/code/game/mecha/micro/mecha_construction_paths_vr.dm index 637a5ab36c..7019c64399 100644 --- a/code/game/mecha/micro/mecha_construction_paths_vr.dm +++ b/code/game/mecha/micro/mecha_construction_paths_vr.dm @@ -1,768 +1,771 @@ /datum/construction/mecha/polecat_chassis - steps = list(list("key"=/obj/item/mecha_parts/micro/part/polecat_torso),//1 - list("key"=/obj/item/mecha_parts/micro/part/polecat_left_arm),//2 - list("key"=/obj/item/mecha_parts/micro/part/polecat_right_arm),//3 - list("key"=/obj/item/mecha_parts/micro/part/polecat_left_leg),//4 - list("key"=/obj/item/mecha_parts/micro/part/polecat_right_leg)//5 - ) + steps = list( + list("key"=/obj/item/mecha_parts/micro/part/polecat_torso),//1 + list("key"=/obj/item/mecha_parts/micro/part/polecat_left_arm),//2 + list("key"=/obj/item/mecha_parts/micro/part/polecat_right_arm),//3 + list("key"=/obj/item/mecha_parts/micro/part/polecat_left_leg),//4 + list("key"=/obj/item/mecha_parts/micro/part/polecat_right_leg)//5 + ) - custom_action(step, atom/used_atom, mob/user) - user.visible_message("[user] has connected [used_atom] to [holder].", "You connect [used_atom] to [holder]") - holder.add_overlay(used_atom.icon_state+"+o") - qdel(used_atom) - return 1 +/datum/construction/mecha/polecat_chassis/custom_action(step, atom/used_atom, mob/user) + user.visible_message("[user] has connected [used_atom] to [holder].", "You connect [used_atom] to [holder]") + holder.add_overlay(used_atom.icon_state+"+o") + qdel(used_atom) + return 1 - action(atom/used_atom,mob/user as mob) - return check_all_steps(used_atom,user) +/datum/construction/mecha/polecat_chassis/action(atom/used_atom,mob/user as mob) + return check_all_steps(used_atom,user) - spawn_result() - var/obj/item/mecha_parts/chassis/const_holder = holder - const_holder.construct = new /datum/construction/reversible/mecha/polecat(const_holder) - const_holder.icon = 'icons/mecha/mech_construction_vr.dmi' - const_holder.icon_state = "polecat0" - const_holder.density = 1 - const_holder.overlays.len = 0 - spawn() - qdel(src) - return +/datum/construction/mecha/polecat_chassis/spawn_result() + var/obj/item/mecha_parts/chassis/const_holder = holder + const_holder.construct = new /datum/construction/reversible/mecha/polecat(const_holder) + const_holder.icon = 'icons/mecha/mech_construction_vr.dmi' + const_holder.icon_state = "polecat0" + const_holder.density = 1 + const_holder.overlays.len = 0 + spawn() + qdel(src) + return /datum/construction/reversible/mecha/polecat result = "/obj/mecha/micro/sec/polecat" steps = list( - //1 - list("key"=/obj/item/weapon/weldingtool, - "backkey"=IS_WRENCH, - "desc"="External armor is wrenched."), - //2 - list("key"=IS_WRENCH, - "backkey"=IS_CROWBAR, - "desc"="External armor is installed."), - //3 - list("key"=/obj/item/mecha_parts/micro/part/polecat_armour, - "backkey"=/obj/item/weapon/weldingtool, - "desc"="Internal armor is welded."), - //4 - list("key"=/obj/item/weapon/weldingtool, - "backkey"=IS_WRENCH, - "desc"="Internal armor is wrenched"), - //5 - list("key"=IS_WRENCH, - "backkey"=IS_CROWBAR, - "desc"="Internal armor is installed"), - //6 - list("key"=/obj/item/stack/material/steel, - "backkey"=IS_SCREWDRIVER, - "desc"="Advanced capacitor is secured"), - //7 - list("key"=IS_SCREWDRIVER, - "backkey"=IS_CROWBAR, - "desc"="Advanced capacitor is installed"), - //8 - list("key"=/obj/item/weapon/stock_parts/capacitor/adv, - "backkey"=IS_SCREWDRIVER, - "desc"="Advanced scanner module is secured"), - //9 - list("key"=IS_SCREWDRIVER, - "backkey"=IS_CROWBAR, - "desc"="Advanced scanner module is installed"), - //10 - list("key"=/obj/item/weapon/stock_parts/scanning_module/adv, - "backkey"=IS_SCREWDRIVER, - "desc"="Targeting module is secured"), - //11 - list("key"=IS_SCREWDRIVER, - "backkey"=IS_CROWBAR, - "desc"="Targeting module is installed"), - //12 - list("key"=/obj/item/weapon/circuitboard/mecha/polecat/targeting, - "backkey"=IS_SCREWDRIVER, - "desc"="Peripherals control module is secured"), - //13 - list("key"=IS_SCREWDRIVER, - "backkey"=IS_CROWBAR, - "desc"="Peripherals control module is installed"), - //14 - list("key"=/obj/item/weapon/circuitboard/mecha/polecat/peripherals, - "backkey"=IS_SCREWDRIVER, - "desc"="Central control module is secured"), - //15 - list("key"=IS_SCREWDRIVER, - "backkey"=IS_CROWBAR, - "desc"="Central control module is installed"), - //16 - list("key"=/obj/item/weapon/circuitboard/mecha/polecat/main, - "backkey"=IS_SCREWDRIVER, - "desc"="The wiring is adjusted"), - //17 - list("key"=IS_WIRECUTTER, - "backkey"=IS_SCREWDRIVER, - "desc"="The wiring is added"), - //18 - list("key"=/obj/item/stack/cable_coil, - "backkey"=IS_SCREWDRIVER, - "desc"="The hydraulic systems are active."), - //19 - list("key"=IS_SCREWDRIVER, - "backkey"=IS_WRENCH, - "desc"="The hydraulic systems are connected."), - //20 - list("key"=IS_WRENCH, - "desc"="The hydraulic systems are disconnected.") - ) + //1 + list("key"=/obj/item/weapon/weldingtool, + "backkey"=IS_WRENCH, + "desc"="External armor is wrenched."), + //2 + list("key"=IS_WRENCH, + "backkey"=IS_CROWBAR, + "desc"="External armor is installed."), + //3 + list("key"=/obj/item/mecha_parts/micro/part/polecat_armour, + "backkey"=/obj/item/weapon/weldingtool, + "desc"="Internal armor is welded."), + //4 + list("key"=/obj/item/weapon/weldingtool, + "backkey"=IS_WRENCH, + "desc"="Internal armor is wrenched"), + //5 + list("key"=IS_WRENCH, + "backkey"=IS_CROWBAR, + "desc"="Internal armor is installed"), + //6 + list("key"=/obj/item/stack/material/steel, + "backkey"=IS_SCREWDRIVER, + "desc"="Advanced capacitor is secured"), + //7 + list("key"=IS_SCREWDRIVER, + "backkey"=IS_CROWBAR, + "desc"="Advanced capacitor is installed"), + //8 + list("key"=/obj/item/weapon/stock_parts/capacitor/adv, + "backkey"=IS_SCREWDRIVER, + "desc"="Advanced scanner module is secured"), + //9 + list("key"=IS_SCREWDRIVER, + "backkey"=IS_CROWBAR, + "desc"="Advanced scanner module is installed"), + //10 + list("key"=/obj/item/weapon/stock_parts/scanning_module/adv, + "backkey"=IS_SCREWDRIVER, + "desc"="Targeting module is secured"), + //11 + list("key"=IS_SCREWDRIVER, + "backkey"=IS_CROWBAR, + "desc"="Targeting module is installed"), + //12 + list("key"=/obj/item/weapon/circuitboard/mecha/polecat/targeting, + "backkey"=IS_SCREWDRIVER, + "desc"="Peripherals control module is secured"), + //13 + list("key"=IS_SCREWDRIVER, + "backkey"=IS_CROWBAR, + "desc"="Peripherals control module is installed"), + //14 + list("key"=/obj/item/weapon/circuitboard/mecha/polecat/peripherals, + "backkey"=IS_SCREWDRIVER, + "desc"="Central control module is secured"), + //15 + list("key"=IS_SCREWDRIVER, + "backkey"=IS_CROWBAR, + "desc"="Central control module is installed"), + //16 + list("key"=/obj/item/weapon/circuitboard/mecha/polecat/main, + "backkey"=IS_SCREWDRIVER, + "desc"="The wiring is adjusted"), + //17 + list("key"=IS_WIRECUTTER, + "backkey"=IS_SCREWDRIVER, + "desc"="The wiring is added"), + //18 + list("key"=/obj/item/stack/cable_coil, + "backkey"=IS_SCREWDRIVER, + "desc"="The hydraulic systems are active."), + //19 + list("key"=IS_SCREWDRIVER, + "backkey"=IS_WRENCH, + "desc"="The hydraulic systems are connected."), + //20 + list("key"=IS_WRENCH, + "desc"="The hydraulic systems are disconnected.") + ) - action(atom/used_atom,mob/user as mob) - return check_step(used_atom,user) +/datum/construction/reversible/mecha/polecat/action(atom/used_atom,mob/user as mob) + return check_step(used_atom,user) - custom_action(index, diff, atom/used_atom, mob/user) - if(!..()) - return 0 - //TODO: better messages. - switch(index) - if(20) - user.visible_message("[user] connects [holder] hydraulic systems", "You connect [holder] hydraulic systems.") +/datum/construction/reversible/mecha/polecat/custom_action(index, diff, atom/used_atom, mob/user) + if(!..()) + return 0 + //TODO: better messages. + switch(index) + if(20) + user.visible_message("[user] connects [holder] hydraulic systems", "You connect [holder] hydraulic systems.") + holder.icon_state = "polecat1" + if(19) + if(diff==FORWARD) + user.visible_message("[user] activates [holder] hydraulic systems.", "You activate [holder] hydraulic systems.") + holder.icon_state = "polecat2" + else + user.visible_message("[user] disconnects [holder] hydraulic systems", "You disconnect [holder] hydraulic systems.") + holder.icon_state = "polecat0" + if(18) + if(diff==FORWARD) + user.visible_message("[user] adds the wiring to [holder].", "You add the wiring to [holder].") + holder.icon_state = "polecat3" + else + user.visible_message("[user] deactivates [holder] hydraulic systems.", "You deactivate [holder] hydraulic systems.") holder.icon_state = "polecat1" - if(19) - if(diff==FORWARD) - user.visible_message("[user] activates [holder] hydraulic systems.", "You activate [holder] hydraulic systems.") - holder.icon_state = "polecat2" - else - user.visible_message("[user] disconnects [holder] hydraulic systems", "You disconnect [holder] hydraulic systems.") - holder.icon_state = "polecat0" - if(18) - if(diff==FORWARD) - user.visible_message("[user] adds the wiring to [holder].", "You add the wiring to [holder].") - holder.icon_state = "polecat3" - else - user.visible_message("[user] deactivates [holder] hydraulic systems.", "You deactivate [holder] hydraulic systems.") - holder.icon_state = "polecat1" - if(17) - if(diff==FORWARD) - user.visible_message("[user] adjusts the wiring of [holder].", "You adjust the wiring of [holder].") - holder.icon_state = "polecat4" - else - user.visible_message("[user] removes the wiring from [holder].", "You remove the wiring from [holder].") - var/obj/item/stack/cable_coil/coil = new /obj/item/stack/cable_coil(get_turf(holder)) - coil.amount = 4 - holder.icon_state = "polecat2" - if(16) - if(diff==FORWARD) - user.visible_message("[user] installs the central control module into [holder].", "You install the central computer mainboard into [holder].") - qdel(used_atom) - holder.icon_state = "polecat5" - else - user.visible_message("[user] disconnects the wiring of [holder].", "You disconnect the wiring of [holder].") - holder.icon_state = "polecat3" - if(15) - if(diff==FORWARD) - user.visible_message("[user] secures the mainboard.", "You secure the mainboard.") - holder.icon_state = "polecat6" - else - user.visible_message("[user] removes the central control module from [holder].", "You remove the central computer mainboard from [holder].") - new /obj/item/weapon/circuitboard/mecha/polecat/main(get_turf(holder)) - holder.icon_state = "polecat4" - if(14) - if(diff==FORWARD) - user.visible_message("[user] installs the peripherals control module into [holder].", "You install the peripherals control module into [holder].") - qdel(used_atom) - holder.icon_state = "polecat7" - else - user.visible_message("[user] unfastens the mainboard.", "You unfasten the mainboard.") - holder.icon_state = "polecat5" - if(13) - if(diff==FORWARD) - user.visible_message("[user] secures the peripherals control module.", "You secure the peripherals control module.") - holder.icon_state = "polecat8" - else - user.visible_message("[user] removes the peripherals control module from [holder].", "You remove the peripherals control module from [holder].") - new /obj/item/weapon/circuitboard/mecha/polecat/peripherals(get_turf(holder)) - holder.icon_state = "polecat6" - if(12) - if(diff==FORWARD) - user.visible_message("[user] installs the weapon control module into [holder].", "You install the weapon control module into [holder].") - qdel(used_atom) - holder.icon_state = "polecat9" - else - user.visible_message("[user] unfastens the peripherals control module.", "You unfasten the peripherals control module.") - holder.icon_state = "polecat7" - if(11) - if(diff==FORWARD) - user.visible_message("[user] secures the weapon control module.", "You secure the weapon control module.") - holder.icon_state = "polecat10" - else - user.visible_message("[user] removes the weapon control module from [holder].", "You remove the weapon control module from [holder].") - new /obj/item/weapon/circuitboard/mecha/polecat/targeting(get_turf(holder)) - holder.icon_state = "polecat8" - if(10) - if(diff==FORWARD) - user.visible_message("[user] installs advanced scanner module to [holder].", "You install advanced scanner module to [holder].") - qdel(used_atom) - holder.icon_state = "polecat11" - else - user.visible_message("[user] unfastens the weapon control module.", "You unfasten the weapon control module.") - holder.icon_state = "polecat9" - if(9) - if(diff==FORWARD) - user.visible_message("[user] secures the advanced scanner module.", "You secure the advanced scanner module.") - holder.icon_state = "polecat12" - else - user.visible_message("[user] removes the advanced scanner module from [holder].", "You remove the advanced scanner module from [holder].") - new /obj/item/weapon/stock_parts/scanning_module/adv(get_turf(holder)) - holder.icon_state = "polecat10" - if(8) - if(diff==FORWARD) - user.visible_message("[user] installs advanced capacitor to [holder].", "You install advanced capacitor to [holder].") - qdel(used_atom) - holder.icon_state = "polecat13" - else - user.visible_message("[user] unfastens the advanced scanner module.", "You unfasten the advanced scanner module.") - holder.icon_state = "polecat11" - if(7) - if(diff==FORWARD) - user.visible_message("[user] secures the advanced capacitor.", "You secure the advanced capacitor.") - holder.icon_state = "polecat14" - else - user.visible_message("[user] removes the advanced capacitor from [holder].", "You remove the advanced capacitor from [holder].") - new /obj/item/weapon/stock_parts/capacitor/adv(get_turf(holder)) - holder.icon_state = "polecat12" - if(6) - if(diff==FORWARD) - user.visible_message("[user] installs internal armor layer to [holder].", "You install internal armor layer to [holder].") - holder.icon_state = "polecat15" - else - user.visible_message("[user] unfastens the advanced capacitor.", "You unfasten the advanced capacitor.") - holder.icon_state = "polecat13" - if(5) - if(diff==FORWARD) - user.visible_message("[user] secures internal armor layer.", "You secure internal armor layer.") - holder.icon_state = "polecat16" - else - user.visible_message("[user] pries internal armor layer from [holder].", "You prie internal armor layer from [holder].") - var/obj/item/stack/material/steel/MS = new /obj/item/stack/material/steel(get_turf(holder)) - MS.amount = 3 - holder.icon_state = "polecat14" - if(4) - if(diff==FORWARD) - user.visible_message("[user] welds internal armor layer to [holder].", "You weld the internal armor layer to [holder].") - holder.icon_state = "polecat17" - else - user.visible_message("[user] unfastens the internal armor layer.", "You unfasten the internal armor layer.") - holder.icon_state = "polecat15" - if(3) - if(diff==FORWARD) - user.visible_message("[user] installs external reinforced armor layer to [holder].", "You install external reinforced armor layer to [holder].") - qdel(used_atom)//CHOMPedit upstream port. Fixes polecat not useing it's armor plates up. - holder.icon_state = "polecat18" - else - user.visible_message("[user] cuts internal armor layer from [holder].", "You cut the internal armor layer from [holder].") - holder.icon_state = "polecat16" - if(2) - if(diff==FORWARD) - user.visible_message("[user] secures external armor layer.", "You secure external reinforced armor layer.") - holder.icon_state = "polecat19" - else - user.visible_message("[user] pries external armor layer from [holder].", "You pry the external armor layer from [holder].") // Rykka does smol grammar fix. - new /obj/item/mecha_parts/micro/part/polecat_armour(get_turf(holder))// Actually gives you the polecat's armored plates back instead of plasteel. - holder.icon_state = "polecat17" - if(1) - if(diff==FORWARD) - user.visible_message("[user] welds external armor layer to [holder].", "You weld external armor layer to [holder].") - else - user.visible_message("[user] unfastens the external armor layer.", "You unfasten the external armor layer.") - holder.icon_state = "polecat18" - return 1 + if(17) + if(diff==FORWARD) + user.visible_message("[user] adjusts the wiring of [holder].", "You adjust the wiring of [holder].") + holder.icon_state = "polecat4" + else + user.visible_message("[user] removes the wiring from [holder].", "You remove the wiring from [holder].") + var/obj/item/stack/cable_coil/coil = new /obj/item/stack/cable_coil(get_turf(holder)) + coil.amount = 4 + holder.icon_state = "polecat2" + if(16) + if(diff==FORWARD) + user.visible_message("[user] installs the central control module into [holder].", "You install the central computer mainboard into [holder].") + qdel(used_atom) + holder.icon_state = "polecat5" + else + user.visible_message("[user] disconnects the wiring of [holder].", "You disconnect the wiring of [holder].") + holder.icon_state = "polecat3" + if(15) + if(diff==FORWARD) + user.visible_message("[user] secures the mainboard.", "You secure the mainboard.") + holder.icon_state = "polecat6" + else + user.visible_message("[user] removes the central control module from [holder].", "You remove the central computer mainboard from [holder].") + new /obj/item/weapon/circuitboard/mecha/polecat/main(get_turf(holder)) + holder.icon_state = "polecat4" + if(14) + if(diff==FORWARD) + user.visible_message("[user] installs the peripherals control module into [holder].", "You install the peripherals control module into [holder].") + qdel(used_atom) + holder.icon_state = "polecat7" + else + user.visible_message("[user] unfastens the mainboard.", "You unfasten the mainboard.") + holder.icon_state = "polecat5" + if(13) + if(diff==FORWARD) + user.visible_message("[user] secures the peripherals control module.", "You secure the peripherals control module.") + holder.icon_state = "polecat8" + else + user.visible_message("[user] removes the peripherals control module from [holder].", "You remove the peripherals control module from [holder].") + new /obj/item/weapon/circuitboard/mecha/polecat/peripherals(get_turf(holder)) + holder.icon_state = "polecat6" + if(12) + if(diff==FORWARD) + user.visible_message("[user] installs the weapon control module into [holder].", "You install the weapon control module into [holder].") + qdel(used_atom) + holder.icon_state = "polecat9" + else + user.visible_message("[user] unfastens the peripherals control module.", "You unfasten the peripherals control module.") + holder.icon_state = "polecat7" + if(11) + if(diff==FORWARD) + user.visible_message("[user] secures the weapon control module.", "You secure the weapon control module.") + holder.icon_state = "polecat10" + else + user.visible_message("[user] removes the weapon control module from [holder].", "You remove the weapon control module from [holder].") + new /obj/item/weapon/circuitboard/mecha/polecat/targeting(get_turf(holder)) + holder.icon_state = "polecat8" + if(10) + if(diff==FORWARD) + user.visible_message("[user] installs advanced scanner module to [holder].", "You install advanced scanner module to [holder].") + qdel(used_atom) + holder.icon_state = "polecat11" + else + user.visible_message("[user] unfastens the weapon control module.", "You unfasten the weapon control module.") + holder.icon_state = "polecat9" + if(9) + if(diff==FORWARD) + user.visible_message("[user] secures the advanced scanner module.", "You secure the advanced scanner module.") + holder.icon_state = "polecat12" + else + user.visible_message("[user] removes the advanced scanner module from [holder].", "You remove the advanced scanner module from [holder].") + new /obj/item/weapon/stock_parts/scanning_module/adv(get_turf(holder)) + holder.icon_state = "polecat10" + if(8) + if(diff==FORWARD) + user.visible_message("[user] installs advanced capacitor to [holder].", "You install advanced capacitor to [holder].") + qdel(used_atom) + holder.icon_state = "polecat13" + else + user.visible_message("[user] unfastens the advanced scanner module.", "You unfasten the advanced scanner module.") + holder.icon_state = "polecat11" + if(7) + if(diff==FORWARD) + user.visible_message("[user] secures the advanced capacitor.", "You secure the advanced capacitor.") + holder.icon_state = "polecat14" + else + user.visible_message("[user] removes the advanced capacitor from [holder].", "You remove the advanced capacitor from [holder].") + new /obj/item/weapon/stock_parts/capacitor/adv(get_turf(holder)) + holder.icon_state = "polecat12" + if(6) + if(diff==FORWARD) + user.visible_message("[user] installs internal armor layer to [holder].", "You install internal armor layer to [holder].") + holder.icon_state = "polecat15" + else + user.visible_message("[user] unfastens the advanced capacitor.", "You unfasten the advanced capacitor.") + holder.icon_state = "polecat13" + if(5) + if(diff==FORWARD) + user.visible_message("[user] secures internal armor layer.", "You secure internal armor layer.") + holder.icon_state = "polecat16" + else + user.visible_message("[user] pries internal armor layer from [holder].", "You prie internal armor layer from [holder].") + var/obj/item/stack/material/steel/MS = new /obj/item/stack/material/steel(get_turf(holder)) + MS.amount = 3 + holder.icon_state = "polecat14" + if(4) + if(diff==FORWARD) + user.visible_message("[user] welds internal armor layer to [holder].", "You weld the internal armor layer to [holder].") + holder.icon_state = "polecat17" + else + user.visible_message("[user] unfastens the internal armor layer.", "You unfasten the internal armor layer.") + holder.icon_state = "polecat15" + if(3) + if(diff==FORWARD) + user.visible_message("[user] installs external reinforced armor layer to [holder].", "You install external reinforced armor layer to [holder].") + qdel(used_atom)//CHOMPedit upstream port. Fixes polecat not useing it's armor plates up. + holder.icon_state = "polecat18" + else + user.visible_message("[user] cuts internal armor layer from [holder].", "You cut the internal armor layer from [holder].") + holder.icon_state = "polecat16" + if(2) + if(diff==FORWARD) + user.visible_message("[user] secures external armor layer.", "You secure external reinforced armor layer.") + holder.icon_state = "polecat19" + else + user.visible_message("[user] pries external armor layer from [holder].", "You pry the external armor layer from [holder].") // Rykka does smol grammar fix. + new /obj/item/mecha_parts/micro/part/polecat_armour(get_turf(holder))// Actually gives you the polecat's armored plates back instead of plasteel. + holder.icon_state = "polecat17" + if(1) + if(diff==FORWARD) + user.visible_message("[user] welds external armor layer to [holder].", "You weld external armor layer to [holder].") + else + user.visible_message("[user] unfastens the external armor layer.", "You unfasten the external armor layer.") + holder.icon_state = "polecat18" + return 1 - spawn_result() - ..() - feedback_inc("mecha_polecat_created",1) - return +/datum/construction/reversible/mecha/polecat/spawn_result() + ..() + feedback_inc("mecha_polecat_created",1) + return /datum/construction/mecha/gopher_chassis - steps = list(list("key"=/obj/item/mecha_parts/micro/part/gopher_torso),//1 - list("key"=/obj/item/mecha_parts/micro/part/gopher_left_arm),//2 - list("key"=/obj/item/mecha_parts/micro/part/gopher_right_arm),//3 - list("key"=/obj/item/mecha_parts/micro/part/gopher_left_leg),//4 - list("key"=/obj/item/mecha_parts/micro/part/gopher_right_leg)//5 - ) + steps = list( + list("key"=/obj/item/mecha_parts/micro/part/gopher_torso),//1 + list("key"=/obj/item/mecha_parts/micro/part/gopher_left_arm),//2 + list("key"=/obj/item/mecha_parts/micro/part/gopher_right_arm),//3 + list("key"=/obj/item/mecha_parts/micro/part/gopher_left_leg),//4 + list("key"=/obj/item/mecha_parts/micro/part/gopher_right_leg)//5 + ) - custom_action(step, atom/used_atom, mob/user) - user.visible_message("[user] has connected [used_atom] to [holder].", "You connect [used_atom] to [holder]") - holder.add_overlay(used_atom.icon_state+"+o") - qdel(used_atom) - return 1 +/datum/construction/mecha/gopher_chassis/custom_action(step, atom/used_atom, mob/user) + user.visible_message("[user] has connected [used_atom] to [holder].", "You connect [used_atom] to [holder]") + holder.add_overlay(used_atom.icon_state+"+o") + qdel(used_atom) + return 1 - action(atom/used_atom,mob/user as mob) - return check_all_steps(used_atom,user) +/datum/construction/mecha/gopher_chassis/action(atom/used_atom,mob/user as mob) + return check_all_steps(used_atom,user) - spawn_result() - var/obj/item/mecha_parts/chassis/const_holder = holder - const_holder.construct = new /datum/construction/reversible/mecha/gopher(const_holder) - const_holder.icon = 'icons/mecha/mech_construction_vr.dmi' - const_holder.icon_state = "gopher0" - const_holder.density = 1 - const_holder.overlays.len = 0 - spawn() - qdel(src) - return +/datum/construction/mecha/gopher_chassis/spawn_result() + var/obj/item/mecha_parts/chassis/const_holder = holder + const_holder.construct = new /datum/construction/reversible/mecha/gopher(const_holder) + const_holder.icon = 'icons/mecha/mech_construction_vr.dmi' + const_holder.icon_state = "gopher0" + const_holder.density = 1 + const_holder.overlays.len = 0 + spawn() + qdel(src) + return /datum/construction/reversible/mecha/gopher result = "/obj/mecha/micro/utility/gopher" steps = list( - //1 - list("key"=/obj/item/weapon/weldingtool, - "backkey"=IS_WRENCH, - "desc"="External armor is wrenched."), - //2 - list("key"=IS_WRENCH, - "backkey"=IS_CROWBAR, - "desc"="External armor is installed."), - //3 - list("key"=/obj/item/stack/material/plasteel, - "backkey"=/obj/item/weapon/weldingtool, - "desc"="Internal armor is welded."), - //4 - list("key"=/obj/item/weapon/weldingtool, - "backkey"=IS_WRENCH, - "desc"="Internal armor is wrenched"), - //5 - list("key"=IS_WRENCH, - "backkey"=IS_CROWBAR, - "desc"="Internal armor is installed"), - //6 - list("key"=/obj/item/stack/material/steel, - "backkey"=IS_SCREWDRIVER, - "desc"="Peripherals control module is secured"), - //7 - list("key"=IS_SCREWDRIVER, - "backkey"=IS_CROWBAR, - "desc"="Peripherals control module is installed"), - //8 - list("key"=/obj/item/weapon/circuitboard/mecha/gopher/peripherals, - "backkey"=IS_SCREWDRIVER, - "desc"="Central control module is secured"), - //9 - list("key"=IS_SCREWDRIVER, - "backkey"=IS_CROWBAR, - "desc"="Central control module is installed"), - //10 - list("key"=/obj/item/weapon/circuitboard/mecha/gopher/main, - "backkey"=IS_SCREWDRIVER, - "desc"="The wiring is adjusted"), - //11 - list("key"=IS_WIRECUTTER, - "backkey"=IS_SCREWDRIVER, - "desc"="The wiring is added"), - //12 - list("key"=/obj/item/stack/cable_coil, - "backkey"=IS_SCREWDRIVER, - "desc"="The hydraulic systems are active."), - //13 - list("key"=IS_SCREWDRIVER, - "backkey"=IS_WRENCH, - "desc"="The hydraulic systems are connected."), - //14 - list("key"=IS_WRENCH, - "desc"="The hydraulic systems are disconnected.") - ) + //1 + list("key"=/obj/item/weapon/weldingtool, + "backkey"=IS_WRENCH, + "desc"="External armor is wrenched."), + //2 + list("key"=IS_WRENCH, + "backkey"=IS_CROWBAR, + "desc"="External armor is installed."), + //3 + list("key"=/obj/item/stack/material/plasteel, + "backkey"=/obj/item/weapon/weldingtool, + "desc"="Internal armor is welded."), + //4 + list("key"=/obj/item/weapon/weldingtool, + "backkey"=IS_WRENCH, + "desc"="Internal armor is wrenched"), + //5 + list("key"=IS_WRENCH, + "backkey"=IS_CROWBAR, + "desc"="Internal armor is installed"), + //6 + list("key"=/obj/item/stack/material/steel, + "backkey"=IS_SCREWDRIVER, + "desc"="Peripherals control module is secured"), + //7 + list("key"=IS_SCREWDRIVER, + "backkey"=IS_CROWBAR, + "desc"="Peripherals control module is installed"), + //8 + list("key"=/obj/item/weapon/circuitboard/mecha/gopher/peripherals, + "backkey"=IS_SCREWDRIVER, + "desc"="Central control module is secured"), + //9 + list("key"=IS_SCREWDRIVER, + "backkey"=IS_CROWBAR, + "desc"="Central control module is installed"), + //10 + list("key"=/obj/item/weapon/circuitboard/mecha/gopher/main, + "backkey"=IS_SCREWDRIVER, + "desc"="The wiring is adjusted"), + //11 + list("key"=IS_WIRECUTTER, + "backkey"=IS_SCREWDRIVER, + "desc"="The wiring is added"), + //12 + list("key"=/obj/item/stack/cable_coil, + "backkey"=IS_SCREWDRIVER, + "desc"="The hydraulic systems are active."), + //13 + list("key"=IS_SCREWDRIVER, + "backkey"=IS_WRENCH, + "desc"="The hydraulic systems are connected."), + //14 + list("key"=IS_WRENCH, + "desc"="The hydraulic systems are disconnected.") + ) - action(atom/used_atom,mob/user as mob) - return check_step(used_atom,user) +/datum/construction/reversible/mecha/gopher/action(atom/used_atom,mob/user as mob) + return check_step(used_atom,user) - custom_action(index, diff, atom/used_atom, mob/user) - if(!..()) - return 0 +/datum/construction/reversible/mecha/gopher/custom_action(index, diff, atom/used_atom, mob/user) + if(!..()) + return 0 - //TODO: better messages. - switch(index) - if(14) - user.visible_message("[user] connects [holder] hydraulic systems", "You connect [holder] hydraulic systems.") + //TODO: better messages. + switch(index) + if(14) + user.visible_message("[user] connects [holder] hydraulic systems", "You connect [holder] hydraulic systems.") + holder.icon_state = "gopher1" + if(13) + if(diff==FORWARD) + user.visible_message("[user] activates [holder] hydraulic systems.", "You activate [holder] hydraulic systems.") + holder.icon_state = "gopher2" + else + user.visible_message("[user] disconnects [holder] hydraulic systems", "You disconnect [holder] hydraulic systems.") + holder.icon_state = "gopher0" + if(12) + if(diff==FORWARD) + user.visible_message("[user] adds the wiring to [holder].", "You add the wiring to [holder].") + holder.icon_state = "gopher3" + else + user.visible_message("[user] deactivates [holder] hydraulic systems.", "You deactivate [holder] hydraulic systems.") holder.icon_state = "gopher1" - if(13) - if(diff==FORWARD) - user.visible_message("[user] activates [holder] hydraulic systems.", "You activate [holder] hydraulic systems.") - holder.icon_state = "gopher2" - else - user.visible_message("[user] disconnects [holder] hydraulic systems", "You disconnect [holder] hydraulic systems.") - holder.icon_state = "gopher0" - if(12) - if(diff==FORWARD) - user.visible_message("[user] adds the wiring to [holder].", "You add the wiring to [holder].") - holder.icon_state = "gopher3" - else - user.visible_message("[user] deactivates [holder] hydraulic systems.", "You deactivate [holder] hydraulic systems.") - holder.icon_state = "gopher1" - if(11) - if(diff==FORWARD) - user.visible_message("[user] adjusts the wiring of [holder].", "You adjust the wiring of [holder].") - holder.icon_state = "gopher4" - else - user.visible_message("[user] removes the wiring from [holder].", "You remove the wiring from [holder].") - var/obj/item/stack/cable_coil/coil = new /obj/item/stack/cable_coil(get_turf(holder)) - coil.amount = 4 - holder.icon_state = "gopher2" - if(10) - if(diff==FORWARD) - user.visible_message("[user] installs the central control module into [holder].", "You install the central computer mainboard into [holder].") - qdel(used_atom) - holder.icon_state = "gopher5" - else - user.visible_message("[user] disconnects the wiring of [holder].", "You disconnect the wiring of [holder].") - holder.icon_state = "gopher3" - if(9) - if(diff==FORWARD) - user.visible_message("[user] secures the mainboard.", "You secure the mainboard.") - holder.icon_state = "gopher6" - else - user.visible_message("[user] removes the central control module from [holder].", "You remove the central computer mainboard from [holder].") - new /obj/item/weapon/circuitboard/mecha/gopher/main(get_turf(holder)) - holder.icon_state = "gopher4" - if(8) - if(diff==FORWARD) - user.visible_message("[user] installs the peripherals control module into [holder].", "You install the peripherals control module into [holder].") - qdel(used_atom) - holder.icon_state = "gopher7" - else - user.visible_message("[user] unfastens the mainboard.", "You unfasten the mainboard.") - holder.icon_state = "gopher5" - if(7) - if(diff==FORWARD) - user.visible_message("[user] secures the peripherals control module.", "You secure the peripherals control module.") - holder.icon_state = "gopher8" - else - user.visible_message("[user] removes the peripherals control module from [holder].", "You remove the peripherals control module from [holder].") - new /obj/item/weapon/circuitboard/mecha/gopher/peripherals(get_turf(holder)) - holder.icon_state = "gopher6" - if(6) - if(diff==FORWARD) - user.visible_message("[user] installs internal armor layer to [holder].", "You install internal armor layer to [holder].") - holder.icon_state = "gopher9" - else - user.visible_message("[user] unfastens the peripherals control module.", "You unfasten the peripherals control module.") - holder.icon_state = "gopher7" - if(5) - if(diff==FORWARD) - user.visible_message("[user] secures internal armor layer.", "You secure internal armor layer.") - holder.icon_state = "gopher10" - else - user.visible_message("[user] pries internal armor layer from [holder].", "You prie internal armor layer from [holder].") - var/obj/item/stack/material/steel/MS = new /obj/item/stack/material/steel(get_turf(holder)) - MS.amount = 3 - holder.icon_state = "gopher8" - if(4) - if(diff==FORWARD) - user.visible_message("[user] welds internal armor layer to [holder].", "You weld the internal armor layer to [holder].") - holder.icon_state = "gopher11" - else - user.visible_message("[user] unfastens the internal armor layer.", "You unfasten the internal armor layer.") - holder.icon_state = "gopher9" - if(3) - if(diff==FORWARD) - user.visible_message("[user] installs external reinforced armor layer to [holder].", "You install external reinforced armor layer to [holder].") - holder.icon_state = "gopher12" - else - user.visible_message("[user] cuts internal armor layer from [holder].", "You cut the internal armor layer from [holder].") - holder.icon_state = "gopher10" - if(2) - if(diff==FORWARD) - user.visible_message("[user] secures external armor layer.", "You secure external reinforced armor layer.") - holder.icon_state = "gopher13" - else - user.visible_message("[user] pries external armor layer from [holder].", "You prie external armor layer from [holder].") - var/obj/item/stack/material/plasteel/MS = new /obj/item/stack/material/plasteel(get_turf(holder)) - MS.amount = 2 - holder.icon_state = "gopher11" - if(1) - if(diff==FORWARD) - user.visible_message("[user] welds external armor layer to [holder].", "You weld external armor layer to [holder].") - else - user.visible_message("[user] unfastens the external armor layer.", "You unfasten the external armor layer.") - holder.icon_state = "gopher12" - return 1 + if(11) + if(diff==FORWARD) + user.visible_message("[user] adjusts the wiring of [holder].", "You adjust the wiring of [holder].") + holder.icon_state = "gopher4" + else + user.visible_message("[user] removes the wiring from [holder].", "You remove the wiring from [holder].") + var/obj/item/stack/cable_coil/coil = new /obj/item/stack/cable_coil(get_turf(holder)) + coil.amount = 4 + holder.icon_state = "gopher2" + if(10) + if(diff==FORWARD) + user.visible_message("[user] installs the central control module into [holder].", "You install the central computer mainboard into [holder].") + qdel(used_atom) + holder.icon_state = "gopher5" + else + user.visible_message("[user] disconnects the wiring of [holder].", "You disconnect the wiring of [holder].") + holder.icon_state = "gopher3" + if(9) + if(diff==FORWARD) + user.visible_message("[user] secures the mainboard.", "You secure the mainboard.") + holder.icon_state = "gopher6" + else + user.visible_message("[user] removes the central control module from [holder].", "You remove the central computer mainboard from [holder].") + new /obj/item/weapon/circuitboard/mecha/gopher/main(get_turf(holder)) + holder.icon_state = "gopher4" + if(8) + if(diff==FORWARD) + user.visible_message("[user] installs the peripherals control module into [holder].", "You install the peripherals control module into [holder].") + qdel(used_atom) + holder.icon_state = "gopher7" + else + user.visible_message("[user] unfastens the mainboard.", "You unfasten the mainboard.") + holder.icon_state = "gopher5" + if(7) + if(diff==FORWARD) + user.visible_message("[user] secures the peripherals control module.", "You secure the peripherals control module.") + holder.icon_state = "gopher8" + else + user.visible_message("[user] removes the peripherals control module from [holder].", "You remove the peripherals control module from [holder].") + new /obj/item/weapon/circuitboard/mecha/gopher/peripherals(get_turf(holder)) + holder.icon_state = "gopher6" + if(6) + if(diff==FORWARD) + user.visible_message("[user] installs internal armor layer to [holder].", "You install internal armor layer to [holder].") + holder.icon_state = "gopher9" + else + user.visible_message("[user] unfastens the peripherals control module.", "You unfasten the peripherals control module.") + holder.icon_state = "gopher7" + if(5) + if(diff==FORWARD) + user.visible_message("[user] secures internal armor layer.", "You secure internal armor layer.") + holder.icon_state = "gopher10" + else + user.visible_message("[user] pries internal armor layer from [holder].", "You prie internal armor layer from [holder].") + var/obj/item/stack/material/steel/MS = new /obj/item/stack/material/steel(get_turf(holder)) + MS.amount = 3 + holder.icon_state = "gopher8" + if(4) + if(diff==FORWARD) + user.visible_message("[user] welds internal armor layer to [holder].", "You weld the internal armor layer to [holder].") + holder.icon_state = "gopher11" + else + user.visible_message("[user] unfastens the internal armor layer.", "You unfasten the internal armor layer.") + holder.icon_state = "gopher9" + if(3) + if(diff==FORWARD) + user.visible_message("[user] installs external reinforced armor layer to [holder].", "You install external reinforced armor layer to [holder].") + holder.icon_state = "gopher12" + else + user.visible_message("[user] cuts internal armor layer from [holder].", "You cut the internal armor layer from [holder].") + holder.icon_state = "gopher10" + if(2) + if(diff==FORWARD) + user.visible_message("[user] secures external armor layer.", "You secure external reinforced armor layer.") + holder.icon_state = "gopher13" + else + user.visible_message("[user] pries external armor layer from [holder].", "You prie external armor layer from [holder].") + var/obj/item/stack/material/plasteel/MS = new /obj/item/stack/material/plasteel(get_turf(holder)) + MS.amount = 2 + holder.icon_state = "gopher11" + if(1) + if(diff==FORWARD) + user.visible_message("[user] welds external armor layer to [holder].", "You weld external armor layer to [holder].") + else + user.visible_message("[user] unfastens the external armor layer.", "You unfasten the external armor layer.") + holder.icon_state = "gopher12" + return 1 - spawn_result() - ..() - feedback_inc("mecha_gopher_created",1) - return +/datum/construction/reversible/mecha/gopher/spawn_result() + ..() + feedback_inc("mecha_gopher_created",1) + return /datum/construction/mecha/weasel_chassis - steps = list(list("key"=/obj/item/mecha_parts/micro/part/weasel_torso),//1 - list("key"=/obj/item/mecha_parts/micro/part/weasel_head),//2 - list("key"=/obj/item/mecha_parts/micro/part/weasel_left_arm),//3 - list("key"=/obj/item/mecha_parts/micro/part/weasel_right_arm),//4 - list("key"=/obj/item/mecha_parts/micro/part/weasel_tri_leg),//5 - ) + steps = list( + list("key"=/obj/item/mecha_parts/micro/part/weasel_torso),//1 + list("key"=/obj/item/mecha_parts/micro/part/weasel_head),//2 + list("key"=/obj/item/mecha_parts/micro/part/weasel_left_arm),//3 + list("key"=/obj/item/mecha_parts/micro/part/weasel_right_arm),//4 + list("key"=/obj/item/mecha_parts/micro/part/weasel_tri_leg),//5 + ) - custom_action(step, atom/used_atom, mob/user) - user.visible_message("[user] has connected [used_atom] to [holder].", "You connect [used_atom] to [holder]") - holder.add_overlay(used_atom.icon_state+"+o") - qdel(used_atom) - return 1 +/datum/construction/mecha/weasel_chassis/custom_action(step, atom/used_atom, mob/user) + user.visible_message("[user] has connected [used_atom] to [holder].", "You connect [used_atom] to [holder]") + holder.add_overlay(used_atom.icon_state+"+o") + qdel(used_atom) + return 1 - action(atom/used_atom,mob/user as mob) - return check_all_steps(used_atom,user) +/datum/construction/mecha/weasel_chassis/action(atom/used_atom,mob/user as mob) + return check_all_steps(used_atom,user) - spawn_result() - var/obj/item/mecha_parts/chassis/const_holder = holder - const_holder.construct = new /datum/construction/reversible/mecha/weasel(const_holder) - const_holder.icon = 'icons/mecha/mech_construction_vr.dmi' - const_holder.icon_state = "weasel0" - const_holder.density = 1 - const_holder.overlays.len = 0 - spawn() - qdel(src) - return +/datum/construction/mecha/weasel_chassis/spawn_result() + var/obj/item/mecha_parts/chassis/const_holder = holder + const_holder.construct = new /datum/construction/reversible/mecha/weasel(const_holder) + const_holder.icon = 'icons/mecha/mech_construction_vr.dmi' + const_holder.icon_state = "weasel0" + const_holder.density = 1 + const_holder.overlays.len = 0 + spawn() + qdel(src) + return /datum/construction/reversible/mecha/weasel result = "/obj/mecha/micro/sec/weasel" steps = list( - //1 - list("key"=/obj/item/weapon/weldingtool, - "backkey"=IS_WRENCH, - "desc"="External armor is wrenched."), - //2 - list("key"=IS_WRENCH, - "backkey"=IS_CROWBAR, - "desc"="External armor is installed."), - //3 - list("key"=/obj/item/stack/material/plasteel, - "backkey"=/obj/item/weapon/weldingtool, - "desc"="Internal armor is welded."), - //4 - list("key"=/obj/item/weapon/weldingtool, - "backkey"=IS_WRENCH, - "desc"="Internal armor is wrenched"), - //5 - list("key"=IS_WRENCH, - "backkey"=IS_CROWBAR, - "desc"="Internal armor is installed"), - //6 - list("key"=/obj/item/stack/material/steel, - "backkey"=IS_SCREWDRIVER, - "desc"="Advanced capacitor is secured"), - //7 - list("key"=IS_SCREWDRIVER, - "backkey"=IS_CROWBAR, - "desc"="Advanced capacitor is installed"), - //8 - list("key"=/obj/item/weapon/stock_parts/capacitor/adv, - "backkey"=IS_SCREWDRIVER, - "desc"="Advanced scanner module is secured"), - //9 - list("key"=IS_SCREWDRIVER, - "backkey"=IS_CROWBAR, - "desc"="Advanced scanner module is installed"), - //10 - list("key"=/obj/item/weapon/stock_parts/scanning_module/adv, - "backkey"=IS_SCREWDRIVER, - "desc"="Targeting module is secured"), - //11 - list("key"=IS_SCREWDRIVER, - "backkey"=IS_CROWBAR, - "desc"="Targeting module is installed"), - //12 - list("key"=/obj/item/weapon/circuitboard/mecha/weasel/targeting, - "backkey"=IS_SCREWDRIVER, - "desc"="Peripherals control module is secured"), - //13 - list("key"=IS_SCREWDRIVER, - "backkey"=IS_CROWBAR, - "desc"="Peripherals control module is installed"), - //14 - list("key"=/obj/item/weapon/circuitboard/mecha/weasel/peripherals, - "backkey"=IS_SCREWDRIVER, - "desc"="Central control module is secured"), - //15 - list("key"=IS_SCREWDRIVER, - "backkey"=IS_CROWBAR, - "desc"="Central control module is installed"), - //16 - list("key"=/obj/item/weapon/circuitboard/mecha/weasel/main, - "backkey"=IS_SCREWDRIVER, - "desc"="The wiring is adjusted"), - //17 - list("key"=IS_WIRECUTTER, - "backkey"=IS_SCREWDRIVER, - "desc"="The wiring is added"), - //18 - list("key"=/obj/item/stack/cable_coil, - "backkey"=IS_SCREWDRIVER, - "desc"="The hydraulic systems are active."), - //19 - list("key"=IS_SCREWDRIVER, - "backkey"=IS_WRENCH, - "desc"="The hydraulic systems are connected."), - //20 - list("key"=IS_WRENCH, - "desc"="The hydraulic systems are disconnected.") - ) + //1 + list("key"=/obj/item/weapon/weldingtool, + "backkey"=IS_WRENCH, + "desc"="External armor is wrenched."), + //2 + list("key"=IS_WRENCH, + "backkey"=IS_CROWBAR, + "desc"="External armor is installed."), + //3 + list("key"=/obj/item/stack/material/plasteel, + "backkey"=/obj/item/weapon/weldingtool, + "desc"="Internal armor is welded."), + //4 + list("key"=/obj/item/weapon/weldingtool, + "backkey"=IS_WRENCH, + "desc"="Internal armor is wrenched"), + //5 + list("key"=IS_WRENCH, + "backkey"=IS_CROWBAR, + "desc"="Internal armor is installed"), + //6 + list("key"=/obj/item/stack/material/steel, + "backkey"=IS_SCREWDRIVER, + "desc"="Advanced capacitor is secured"), + //7 + list("key"=IS_SCREWDRIVER, + "backkey"=IS_CROWBAR, + "desc"="Advanced capacitor is installed"), + //8 + list("key"=/obj/item/weapon/stock_parts/capacitor/adv, + "backkey"=IS_SCREWDRIVER, + "desc"="Advanced scanner module is secured"), + //9 + list("key"=IS_SCREWDRIVER, + "backkey"=IS_CROWBAR, + "desc"="Advanced scanner module is installed"), + //10 + list("key"=/obj/item/weapon/stock_parts/scanning_module/adv, + "backkey"=IS_SCREWDRIVER, + "desc"="Targeting module is secured"), + //11 + list("key"=IS_SCREWDRIVER, + "backkey"=IS_CROWBAR, + "desc"="Targeting module is installed"), + //12 + list("key"=/obj/item/weapon/circuitboard/mecha/weasel/targeting, + "backkey"=IS_SCREWDRIVER, + "desc"="Peripherals control module is secured"), + //13 + list("key"=IS_SCREWDRIVER, + "backkey"=IS_CROWBAR, + "desc"="Peripherals control module is installed"), + //14 + list("key"=/obj/item/weapon/circuitboard/mecha/weasel/peripherals, + "backkey"=IS_SCREWDRIVER, + "desc"="Central control module is secured"), + //15 + list("key"=IS_SCREWDRIVER, + "backkey"=IS_CROWBAR, + "desc"="Central control module is installed"), + //16 + list("key"=/obj/item/weapon/circuitboard/mecha/weasel/main, + "backkey"=IS_SCREWDRIVER, + "desc"="The wiring is adjusted"), + //17 + list("key"=IS_WIRECUTTER, + "backkey"=IS_SCREWDRIVER, + "desc"="The wiring is added"), + //18 + list("key"=/obj/item/stack/cable_coil, + "backkey"=IS_SCREWDRIVER, + "desc"="The hydraulic systems are active."), + //19 + list("key"=IS_SCREWDRIVER, + "backkey"=IS_WRENCH, + "desc"="The hydraulic systems are connected."), + //20 + list("key"=IS_WRENCH, + "desc"="The hydraulic systems are disconnected.") + ) - action(atom/used_atom,mob/user as mob) - return check_step(used_atom,user) +/datum/construction/reversible/mecha/weasel/action(atom/used_atom,mob/user as mob) + return check_step(used_atom,user) - custom_action(index, diff, atom/used_atom, mob/user) - if(!..()) - return 0 - //TODO: better messages. - switch(index) - if(20) - user.visible_message("[user] connects [holder] hydraulic systems", "You connect [holder] hydraulic systems.") +/datum/construction/reversible/mecha/weasel/custom_action(index, diff, atom/used_atom, mob/user) + if(!..()) + return 0 + //TODO: better messages. + switch(index) + if(20) + user.visible_message("[user] connects [holder] hydraulic systems", "You connect [holder] hydraulic systems.") + holder.icon_state = "weasel1" + if(19) + if(diff==FORWARD) + user.visible_message("[user] activates [holder] hydraulic systems.", "You activate [holder] hydraulic systems.") + holder.icon_state = "weasel2" + else + user.visible_message("[user] disconnects [holder] hydraulic systems", "You disconnect [holder] hydraulic systems.") + holder.icon_state = "weasel0" + if(18) + if(diff==FORWARD) + user.visible_message("[user] adds the wiring to [holder].", "You add the wiring to [holder].") + holder.icon_state = "weasel3" + else + user.visible_message("[user] deactivates [holder] hydraulic systems.", "You deactivate [holder] hydraulic systems.") holder.icon_state = "weasel1" - if(19) - if(diff==FORWARD) - user.visible_message("[user] activates [holder] hydraulic systems.", "You activate [holder] hydraulic systems.") - holder.icon_state = "weasel2" - else - user.visible_message("[user] disconnects [holder] hydraulic systems", "You disconnect [holder] hydraulic systems.") - holder.icon_state = "weasel0" - if(18) - if(diff==FORWARD) - user.visible_message("[user] adds the wiring to [holder].", "You add the wiring to [holder].") - holder.icon_state = "weasel3" - else - user.visible_message("[user] deactivates [holder] hydraulic systems.", "You deactivate [holder] hydraulic systems.") - holder.icon_state = "weasel1" - if(17) - if(diff==FORWARD) - user.visible_message("[user] adjusts the wiring of [holder].", "You adjust the wiring of [holder].") - holder.icon_state = "weasel4" - else - user.visible_message("[user] removes the wiring from [holder].", "You remove the wiring from [holder].") - var/obj/item/stack/cable_coil/coil = new /obj/item/stack/cable_coil(get_turf(holder)) - coil.amount = 4 - holder.icon_state = "weasel2" - if(16) - if(diff==FORWARD) - user.visible_message("[user] installs the central control module into [holder].", "You install the central computer mainboard into [holder].") - qdel(used_atom) - holder.icon_state = "weasel5" - else - user.visible_message("[user] disconnects the wiring of [holder].", "You disconnect the wiring of [holder].") - holder.icon_state = "weasel3" - if(15) - if(diff==FORWARD) - user.visible_message("[user] secures the mainboard.", "You secure the mainboard.") - holder.icon_state = "weasel6" - else - user.visible_message("[user] removes the central control module from [holder].", "You remove the central computer mainboard from [holder].") - new /obj/item/weapon/circuitboard/mecha/weasel/main(get_turf(holder)) - holder.icon_state = "weasel4" - if(14) - if(diff==FORWARD) - user.visible_message("[user] installs the peripherals control module into [holder].", "You install the peripherals control module into [holder].") - qdel(used_atom) - holder.icon_state = "weasel7" - else - user.visible_message("[user] unfastens the mainboard.", "You unfasten the mainboard.") - holder.icon_state = "weasel5" - if(13) - if(diff==FORWARD) - user.visible_message("[user] secures the peripherals control module.", "You secure the peripherals control module.") - holder.icon_state = "weasel8" - else - user.visible_message("[user] removes the peripherals control module from [holder].", "You remove the peripherals control module from [holder].") - new /obj/item/weapon/circuitboard/mecha/weasel/peripherals(get_turf(holder)) - holder.icon_state = "weasel6" - if(12) - if(diff==FORWARD) - user.visible_message("[user] installs the weapon control module into [holder].", "You install the weapon control module into [holder].") - qdel(used_atom) - holder.icon_state = "weasel9" - else - user.visible_message("[user] unfastens the peripherals control module.", "You unfasten the peripherals control module.") - holder.icon_state = "weasel7" - if(11) - if(diff==FORWARD) - user.visible_message("[user] secures the weapon control module.", "You secure the weapon control module.") - holder.icon_state = "weasel10" - else - user.visible_message("[user] removes the weapon control module from [holder].", "You remove the weapon control module from [holder].") - new /obj/item/weapon/circuitboard/mecha/weasel/targeting(get_turf(holder)) - holder.icon_state = "weasel8" - if(10) - if(diff==FORWARD) - user.visible_message("[user] installs advanced scanner module to [holder].", "You install advanced scanner module to [holder].") - qdel(used_atom) - holder.icon_state = "weasel11" - else - user.visible_message("[user] unfastens the weapon control module.", "You unfasten the weapon control module.") - holder.icon_state = "weasel9" - if(9) - if(diff==FORWARD) - user.visible_message("[user] secures the advanced scanner module.", "You secure the advanced scanner module.") - holder.icon_state = "weasel12" - else - user.visible_message("[user] removes the advanced scanner module from [holder].", "You remove the advanced scanner module from [holder].") - new /obj/item/weapon/stock_parts/scanning_module/adv(get_turf(holder)) - holder.icon_state = "weasel10" - if(8) - if(diff==FORWARD) - user.visible_message("[user] installs advanced capacitor to [holder].", "You install advanced capacitor to [holder].") - qdel(used_atom) - holder.icon_state = "weasel13" - else - user.visible_message("[user] unfastens the advanced scanner module.", "You unfasten the advanced scanner module.") - holder.icon_state = "weasel11" - if(7) - if(diff==FORWARD) - user.visible_message("[user] secures the advanced capacitor.", "You secure the advanced capacitor.") - holder.icon_state = "weasel14" - else - user.visible_message("[user] removes the advanced capacitor from [holder].", "You remove the advanced capacitor from [holder].") - new /obj/item/weapon/stock_parts/capacitor/adv(get_turf(holder)) - holder.icon_state = "weasel12" - if(6) - if(diff==FORWARD) - user.visible_message("[user] installs internal armor layer to [holder].", "You install internal armor layer to [holder].") - holder.icon_state = "weasel15" - else - user.visible_message("[user] unfastens the advanced capacitor.", "You unfasten the advanced capacitor.") - holder.icon_state = "weasel13" - if(5) - if(diff==FORWARD) - user.visible_message("[user] secures internal armor layer.", "You secure internal armor layer.") - holder.icon_state = "weasel16" - else - user.visible_message("[user] pries internal armor layer from [holder].", "You prie internal armor layer from [holder].") - var/obj/item/stack/material/steel/MS = new /obj/item/stack/material/steel(get_turf(holder)) - MS.amount = 3 - holder.icon_state = "weasel14" - if(4) - if(diff==FORWARD) - user.visible_message("[user] welds internal armor layer to [holder].", "You weld the internal armor layer to [holder].") - holder.icon_state = "weasel17" - else - user.visible_message("[user] unfastens the internal armor layer.", "You unfasten the internal armor layer.") - holder.icon_state = "weasel15" - if(3) - if(diff==FORWARD) - user.visible_message("[user] installs external reinforced armor layer to [holder].", "You install external reinforced armor layer to [holder].") - holder.icon_state = "weasel18" - else - user.visible_message("[user] cuts internal armor layer from [holder].", "You cut the internal armor layer from [holder].") - holder.icon_state = "weasel16" - if(2) - if(diff==FORWARD) - user.visible_message("[user] secures external armor layer.", "You secure external reinforced armor layer.") - holder.icon_state = "weasel19" - else - user.visible_message("[user] pries external armor layer from [holder].", "You prie external armor layer from [holder].") - var/obj/item/stack/material/plasteel/MS = new /obj/item/stack/material/plasteel(get_turf(holder)) - MS.amount = 3 - holder.icon_state = "weasel17" - if(1) - if(diff==FORWARD) - user.visible_message("[user] welds external armor layer to [holder].", "You weld external armor layer to [holder].") - else - user.visible_message("[user] unfastens the external armor layer.", "You unfasten the external armor layer.") - holder.icon_state = "weasel18" - return 1 + if(17) + if(diff==FORWARD) + user.visible_message("[user] adjusts the wiring of [holder].", "You adjust the wiring of [holder].") + holder.icon_state = "weasel4" + else + user.visible_message("[user] removes the wiring from [holder].", "You remove the wiring from [holder].") + var/obj/item/stack/cable_coil/coil = new /obj/item/stack/cable_coil(get_turf(holder)) + coil.amount = 4 + holder.icon_state = "weasel2" + if(16) + if(diff==FORWARD) + user.visible_message("[user] installs the central control module into [holder].", "You install the central computer mainboard into [holder].") + qdel(used_atom) + holder.icon_state = "weasel5" + else + user.visible_message("[user] disconnects the wiring of [holder].", "You disconnect the wiring of [holder].") + holder.icon_state = "weasel3" + if(15) + if(diff==FORWARD) + user.visible_message("[user] secures the mainboard.", "You secure the mainboard.") + holder.icon_state = "weasel6" + else + user.visible_message("[user] removes the central control module from [holder].", "You remove the central computer mainboard from [holder].") + new /obj/item/weapon/circuitboard/mecha/weasel/main(get_turf(holder)) + holder.icon_state = "weasel4" + if(14) + if(diff==FORWARD) + user.visible_message("[user] installs the peripherals control module into [holder].", "You install the peripherals control module into [holder].") + qdel(used_atom) + holder.icon_state = "weasel7" + else + user.visible_message("[user] unfastens the mainboard.", "You unfasten the mainboard.") + holder.icon_state = "weasel5" + if(13) + if(diff==FORWARD) + user.visible_message("[user] secures the peripherals control module.", "You secure the peripherals control module.") + holder.icon_state = "weasel8" + else + user.visible_message("[user] removes the peripherals control module from [holder].", "You remove the peripherals control module from [holder].") + new /obj/item/weapon/circuitboard/mecha/weasel/peripherals(get_turf(holder)) + holder.icon_state = "weasel6" + if(12) + if(diff==FORWARD) + user.visible_message("[user] installs the weapon control module into [holder].", "You install the weapon control module into [holder].") + qdel(used_atom) + holder.icon_state = "weasel9" + else + user.visible_message("[user] unfastens the peripherals control module.", "You unfasten the peripherals control module.") + holder.icon_state = "weasel7" + if(11) + if(diff==FORWARD) + user.visible_message("[user] secures the weapon control module.", "You secure the weapon control module.") + holder.icon_state = "weasel10" + else + user.visible_message("[user] removes the weapon control module from [holder].", "You remove the weapon control module from [holder].") + new /obj/item/weapon/circuitboard/mecha/weasel/targeting(get_turf(holder)) + holder.icon_state = "weasel8" + if(10) + if(diff==FORWARD) + user.visible_message("[user] installs advanced scanner module to [holder].", "You install advanced scanner module to [holder].") + qdel(used_atom) + holder.icon_state = "weasel11" + else + user.visible_message("[user] unfastens the weapon control module.", "You unfasten the weapon control module.") + holder.icon_state = "weasel9" + if(9) + if(diff==FORWARD) + user.visible_message("[user] secures the advanced scanner module.", "You secure the advanced scanner module.") + holder.icon_state = "weasel12" + else + user.visible_message("[user] removes the advanced scanner module from [holder].", "You remove the advanced scanner module from [holder].") + new /obj/item/weapon/stock_parts/scanning_module/adv(get_turf(holder)) + holder.icon_state = "weasel10" + if(8) + if(diff==FORWARD) + user.visible_message("[user] installs advanced capacitor to [holder].", "You install advanced capacitor to [holder].") + qdel(used_atom) + holder.icon_state = "weasel13" + else + user.visible_message("[user] unfastens the advanced scanner module.", "You unfasten the advanced scanner module.") + holder.icon_state = "weasel11" + if(7) + if(diff==FORWARD) + user.visible_message("[user] secures the advanced capacitor.", "You secure the advanced capacitor.") + holder.icon_state = "weasel14" + else + user.visible_message("[user] removes the advanced capacitor from [holder].", "You remove the advanced capacitor from [holder].") + new /obj/item/weapon/stock_parts/capacitor/adv(get_turf(holder)) + holder.icon_state = "weasel12" + if(6) + if(diff==FORWARD) + user.visible_message("[user] installs internal armor layer to [holder].", "You install internal armor layer to [holder].") + holder.icon_state = "weasel15" + else + user.visible_message("[user] unfastens the advanced capacitor.", "You unfasten the advanced capacitor.") + holder.icon_state = "weasel13" + if(5) + if(diff==FORWARD) + user.visible_message("[user] secures internal armor layer.", "You secure internal armor layer.") + holder.icon_state = "weasel16" + else + user.visible_message("[user] pries internal armor layer from [holder].", "You prie internal armor layer from [holder].") + var/obj/item/stack/material/steel/MS = new /obj/item/stack/material/steel(get_turf(holder)) + MS.amount = 3 + holder.icon_state = "weasel14" + if(4) + if(diff==FORWARD) + user.visible_message("[user] welds internal armor layer to [holder].", "You weld the internal armor layer to [holder].") + holder.icon_state = "weasel17" + else + user.visible_message("[user] unfastens the internal armor layer.", "You unfasten the internal armor layer.") + holder.icon_state = "weasel15" + if(3) + if(diff==FORWARD) + user.visible_message("[user] installs external reinforced armor layer to [holder].", "You install external reinforced armor layer to [holder].") + holder.icon_state = "weasel18" + else + user.visible_message("[user] cuts internal armor layer from [holder].", "You cut the internal armor layer from [holder].") + holder.icon_state = "weasel16" + if(2) + if(diff==FORWARD) + user.visible_message("[user] secures external armor layer.", "You secure external reinforced armor layer.") + holder.icon_state = "weasel19" + else + user.visible_message("[user] pries external armor layer from [holder].", "You prie external armor layer from [holder].") + var/obj/item/stack/material/plasteel/MS = new /obj/item/stack/material/plasteel(get_turf(holder)) + MS.amount = 3 + holder.icon_state = "weasel17" + if(1) + if(diff==FORWARD) + user.visible_message("[user] welds external armor layer to [holder].", "You weld external armor layer to [holder].") + else + user.visible_message("[user] unfastens the external armor layer.", "You unfasten the external armor layer.") + holder.icon_state = "weasel18" + return 1 - spawn_result() - ..() - feedback_inc("mecha_weasel_created",1) - return +/datum/construction/reversible/mecha/weasel/spawn_result() + ..() + feedback_inc("mecha_weasel_created",1) + return diff --git a/code/game/mecha/micro/mecha_parts_vr.dm b/code/game/mecha/micro/mecha_parts_vr.dm index 59f6714351..fa07c8d8c4 100644 --- a/code/game/mecha/micro/mecha_parts_vr.dm +++ b/code/game/mecha/micro/mecha_parts_vr.dm @@ -7,26 +7,27 @@ w_class = ITEMSIZE_NORMAL -/obj/item/mecha_parts/micro/chassis/ +/obj/item/mecha_parts/micro/chassis name="Mecha Chassis" 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/micro/chassis/attackby(obj/item/W as obj, mob/user as mob) + if(!construct || !construct.action(W, user)) + ..() + return + +/obj/item/mecha_parts/micro/chassis/attack_hand() + return - attack_hand() - return //Gopher /obj/item/mecha_parts/micro/chassis/gopher name = "Gopher Chassis" icon_state = "gopher-chassis" - New() - ..() - construct = new /datum/construction/mecha/gopher_chassis(src) +/obj/item/mecha_parts/micro/chassis/gopher/New() + ..() + construct = new /datum/construction/mecha/gopher_chassis(src) /obj/item/mecha_parts/micro/part/gopher_torso name="Gopher Torso" @@ -62,9 +63,10 @@ /obj/item/mecha_parts/micro/chassis/polecat name = "Polecat Chassis" icon_state = "polecat-chassis" - New() - ..() - construct = new /datum/construction/mecha/polecat_chassis(src) + +/obj/item/mecha_parts/micro/chassis/polecat/New() + ..() + construct = new /datum/construction/mecha/polecat_chassis(src) /obj/item/mecha_parts/micro/part/polecat_torso name="Polecat Torso" @@ -100,9 +102,10 @@ /obj/item/mecha_parts/micro/chassis/weasel name = "Weasel Chassis" icon_state = "weasel-chassis" - New() - ..() - construct = new /datum/construction/mecha/weasel_chassis(src) + +/obj/item/mecha_parts/micro/chassis/weasel/New() + ..() + construct = new /datum/construction/mecha/weasel_chassis(src) /obj/item/mecha_parts/micro/part/weasel_torso name="Weasel Torso" diff --git a/code/game/mecha/micro/micro_equipment.dm b/code/game/mecha/micro/micro_equipment.dm index d36f9fa0a3..127f5b9323 100644 --- a/code/game/mecha/micro/micro_equipment.dm +++ b/code/game/mecha/micro/micro_equipment.dm @@ -61,25 +61,25 @@ equip_type = EQUIP_MICRO_WEAPON required_type = list(/obj/mecha/micro/sec) - Topic(href,href_list) - ..() - if(href_list["mode"]) - mode = text2num(href_list["mode"]) - switch(mode) - if(0) - occupant_message("Now firing buckshot.") - projectile = /obj/item/projectile/bullet/pellet/shotgun - if(1) - occupant_message("Now firing beanbags.") - projectile = /obj/item/projectile/bullet/shotgun/beanbag - if(2) - occupant_message("Now firing slugs.") - projectile = /obj/item/projectile/bullet/shotgun +/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/microshotgun/Topic(href,href_list) + ..() + if(href_list["mode"]) + mode = text2num(href_list["mode"]) + switch(mode) + if(0) + occupant_message("Now firing buckshot.") + projectile = /obj/item/projectile/bullet/pellet/shotgun + if(1) + occupant_message("Now firing beanbags.") + projectile = /obj/item/projectile/bullet/shotgun/beanbag + if(2) + occupant_message("Now firing slugs.") + projectile = /obj/item/projectile/bullet/shotgun - return + return - get_equip_info() - return "[..()] \[BS|BB|S\]" +/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/microshotgun/get_equip_info() + return "[..()] \[BS|BB|S\]" /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/grenade/microflashbang @@ -113,44 +113,44 @@ equip_type = EQUIP_MICRO_UTILITY required_type = list(/obj/mecha/micro/utility) - action(atom/target) - if(!action_checks(target)) return - if(isobj(target)) - var/obj/target_obj = target - if(!target_obj.vars.Find("unacidable") || target_obj.unacidable) return - set_ready_state(0) - chassis.use_power(energy_drain) - chassis.visible_message("[chassis] starts to drill [target]", "You hear the drill.") - occupant_message("You start to drill [target]") - var/T = chassis.loc - var/C = target.loc //why are these backwards? we may never know -Pete - if(do_after_cooldown(target)) - if(T == chassis.loc && src == chassis.selected) - if(istype(target, /turf/simulated/wall)) - var/turf/simulated/wall/W = target - if(W.reinf_material) - occupant_message("[target] is too durable to drill through.") - else - log_message("Drilled through [target]") - target.ex_act(2) - else if(istype(target, /turf/simulated/mineral)) - for(var/turf/simulated/mineral/M in range(chassis,1)) - if(get_dir(chassis,M)&chassis.dir) - M.GetDrilled() - log_message("Drilled through [target]") - var/obj/item/mecha_parts/mecha_equipment/tool/micro/orescoop/ore_box = (locate(/obj/item/mecha_parts/mecha_equipment/tool/micro/orescoop) in chassis.equipment) - if(ore_box) - for(var/obj/item/weapon/ore/ore in range(chassis,1)) - if(get_dir(chassis,ore)&chassis.dir) - if (ore_box.contents.len >= ore_box.orecapacity) - occupant_message("The ore compartment is full.") - return 1 - else - ore.forceMove(ore_box) - else if(target.loc == C) +/obj/item/mecha_parts/mecha_equipment/tool/drill/micro/action(atom/target) + if(!action_checks(target)) return + if(isobj(target)) + var/obj/target_obj = target + if(!target_obj.vars.Find("unacidable") || target_obj.unacidable) return + set_ready_state(0) + chassis.use_power(energy_drain) + chassis.visible_message("[chassis] starts to drill [target]", "You hear the drill.") + occupant_message("You start to drill [target]") + var/T = chassis.loc + var/C = target.loc //why are these backwards? we may never know -Pete + if(do_after_cooldown(target)) + if(T == chassis.loc && src == chassis.selected) + if(istype(target, /turf/simulated/wall)) + var/turf/simulated/wall/W = target + if(W.reinf_material) + occupant_message("[target] is too durable to drill through.") + else log_message("Drilled through [target]") target.ex_act(2) - return 1 + else if(istype(target, /turf/simulated/mineral)) + for(var/turf/simulated/mineral/M in range(chassis,1)) + if(get_dir(chassis,M)&chassis.dir) + M.GetDrilled() + log_message("Drilled through [target]") + var/obj/item/mecha_parts/mecha_equipment/tool/micro/orescoop/ore_box = (locate(/obj/item/mecha_parts/mecha_equipment/tool/micro/orescoop) in chassis.equipment) + if(ore_box) + for(var/obj/item/weapon/ore/ore in range(chassis,1)) + if(get_dir(chassis,ore)&chassis.dir) + if (ore_box.contents.len >= ore_box.orecapacity) + occupant_message("The ore compartment is full.") + return 1 + else + ore.forceMove(ore_box) + else if(target.loc == C) + log_message("Drilled through [target]") + target.ex_act(2) + return 1 /obj/item/mecha_parts/mecha_equipment/tool/micro/orescoop @@ -165,38 +165,38 @@ required_type = list(/obj/mecha/micro/utility) var/orecapacity = 500 - action(atom/target) - if(!action_checks(target)) return - set_ready_state(0) - chassis.use_power(energy_drain) - chassis.visible_message("[chassis] sweeps around with its ore scoop.") - occupant_message("You sweep around the area with the scoop.") - var/T = chassis.loc - //var/C = target.loc //why are these backwards? we may never know -Pete - if(do_after_cooldown(target)) - if(T == chassis.loc && src == chassis.selected) - for(var/obj/item/weapon/ore/ore in range(chassis,1)) - if(get_dir(chassis,ore)&chassis.dir) - if (contents.len >= orecapacity) - occupant_message("The ore compartment is full.") - return 1 - else - ore.Move(src) - return 1 +/obj/item/mecha_parts/mecha_equipment/tool/micro/orescoop/action(atom/target) + if(!action_checks(target)) return + set_ready_state(0) + chassis.use_power(energy_drain) + chassis.visible_message("[chassis] sweeps around with its ore scoop.") + occupant_message("You sweep around the area with the scoop.") + var/T = chassis.loc + //var/C = target.loc //why are these backwards? we may never know -Pete + if(do_after_cooldown(target)) + if(T == chassis.loc && src == chassis.selected) + for(var/obj/item/weapon/ore/ore in range(chassis,1)) + if(get_dir(chassis,ore)&chassis.dir) + if (contents.len >= orecapacity) + occupant_message("The ore compartment is full.") + return 1 + else + ore.Move(src) + return 1 - Topic(href,href_list) - ..() - if (href_list["empty_box"]) - if(contents.len < 1) - occupant_message("The ore compartment is empty.") - return - for (var/obj/item/weapon/ore/O in contents) - contents -= O - O.loc = chassis.loc - occupant_message("Ore compartment emptied.") +/obj/item/mecha_parts/mecha_equipment/tool/micro/orescoop/Topic(href,href_list) + ..() + if (href_list["empty_box"]) + if(contents.len < 1) + occupant_message("The ore compartment is empty.") + return + for (var/obj/item/weapon/ore/O in contents) + contents -= O + O.loc = chassis.loc + occupant_message("Ore compartment emptied.") - get_equip_info() - return "[..()]
Empty ore compartment" +/obj/item/mecha_parts/mecha_equipment/tool/micro/orescoop/get_equip_info() + return "[..()]
Empty ore compartment" /obj/item/mecha_parts/mecha_equipment/tool/orescoop/verb/empty_box() //so you can still get the ore out if someone detaches it from the mech set name = "Empty Ore compartment" diff --git a/code/game/objects/effects/confetti_vr.dm b/code/game/objects/effects/confetti_vr.dm index a54733c126..92e5e5bdeb 100644 --- a/code/game/objects/effects/confetti_vr.dm +++ b/code/game/objects/effects/confetti_vr.dm @@ -10,33 +10,33 @@ /datum/effect/effect/system/confetti_spread var/total_sparks = 0 // To stop it being spammed and lagging! - 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) +/datum/effect/effect/system/confetti_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/confetti = new /obj/effect/effect/sparks/confetti(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/confetti = new /obj/effect/effect/sparks/confetti(src.location) + src.total_sparks++ + var/direction + if(src.cardinals) + direction = pick(cardinal) + else + direction = pick(alldirs) + for(i=0, i>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 - add_overlay(I) - updatedtracks=0 // Clear our memory of updated tracks. + track.fresh=0 + track.overlay=I + stack[stack_idx]=track + add_overlay(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/crayon.dm b/code/game/objects/effects/decals/crayon.dm index 8ae1fd4bb0..559157af29 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) - add_overlay(mainOverlay) - add_overlay(shadeOverlay) + add_overlay(mainOverlay) + add_overlay(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 8835d58242..dab48460cd 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.\ @@ -293,7 +293,7 @@ //VOREStation Removal Start /* -/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." @@ -301,19 +301,19 @@ */ //VOREstation Removal End -/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,\ @@ -321,13 +321,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/polarisposters_vr.dm b/code/game/objects/effects/decals/posters/polarisposters_vr.dm index 2d91fe35c3..9addb1f1f5 100644 --- a/code/game/objects/effects/decals/posters/polarisposters_vr.dm +++ b/code/game/objects/effects/decals/posters/polarisposters_vr.dm @@ -1,5 +1,5 @@ -/datum/poster/nanotrasen/nt_7 //YW EDIT: SolGov, USDF - name = "SolGov" +/decl/poster/nanotrasen/nt_7 //YW EDIT: SolGov, USDF + name = "USDF" desc = "This poster showcases an USDF emblem. The outer ring reads,\ \"NIL MORTALIBUS ARDUI EST\".\ - Commonwealth of Sol-Procyon." + USDF." 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/decals/posters/voreposters_vr.dm b/code/game/objects/effects/decals/posters/voreposters_vr.dm index c08869a05f..7d999abcd5 100644 --- a/code/game/objects/effects/decals/posters/voreposters_vr.dm +++ b/code/game/objects/effects/decals/posters/voreposters_vr.dm @@ -1,108 +1,108 @@ -/datum/poster/vore_1 +/decl/poster/vore_1 icon_state = "sbsposter1" name = "Best Girl Pip" desc = "A poster of the official NT Best Girl Mascot, Pip" -/datum/poster/vore_2 +/decl/poster/vore_2 icon_state = "sbsposter2" name = "AroButt" desc = "A lewd view of KHI's cutest fops." -/datum/poster/vore_3 +/decl/poster/vore_3 icon_state = "sbsposter3" name = "Poster This Dog" desc = "Post this dog." -/datum/poster/vore_4 +/decl/poster/vore_4 icon_state = "sbsposter4" name = "PAT" desc = "A poster containing very obvious PAT propoganda." -/datum/poster/vore_5 +/decl/poster/vore_5 icon_state = "sbsposter5" name = "The Inn" desc = "A poster of a certain black-eyed shadekin." -/datum/poster/vore_6 +/decl/poster/vore_6 icon_state = "sbsposter6" name = "Mawletta" desc = "The best view in the system." -/datum/poster/vore_8 +/decl/poster/vore_8 icon_state = "sbsposter8" name = "Shitty Timbs" desc = "A special edition, brand deal, Shitty Tim Concert Poster." -/datum/poster/vore_9 +/decl/poster/vore_9 icon_state = "sbsposter9" name = "Shitty Tim" desc = "A Shitty Tim concert poster." -/datum/poster/vore_11 +/decl/poster/vore_11 icon_state = "sbsposter11" name = "Fear" desc = "Depicted on this poster is a monster crackling with crimson energy that seems to drip off its body. The word 'RUN' is printed across the bottom." -/datum/poster/vore_12 +/decl/poster/vore_12 icon_state = "sbsposter12" name = "Baa" desc = "A lewd exclusive poster of a certain security commander, taken from a old 'New Ewe' magazine!" -/datum/poster/vore_13 +/decl/poster/vore_13 icon_state = "sbsposter13" name = "Ammer" desc = "You see a blue panda on the poster. She's awfully smug about her size." -/datum/poster/vore_14 +/decl/poster/vore_14 icon_state = "dwposter1" name = "WANTED: WAR CRIMINAL" desc = "A poster bringing awareness to the distinguishing costume of a known war criminal operating in Virgo-Erigonne space." -/datum/poster/vore_15 +/decl/poster/vore_15 icon_state = "dwposter2" name = "Implanter" desc = "A poster explaining the benefits and function of back-up implanters." -/datum/poster/vore_16 +/decl/poster/vore_16 icon_state = "dwposter3" name = "Back-up implant" desc = "A poster describing the electronics implanted by back-up implanters." -/datum/poster/vore_17 +/decl/poster/vore_17 icon_state = "dwposter4" name = "We know" desc = "A poster purporting the infallibility of NanoTrasen's forensics department." -/datum/poster/vore_18 +/decl/poster/vore_18 icon_state = "dwposter5" name = "KAT" desc = "A promotional poster for popular exotube show 'Kat-Kat Korner'" -/datum/poster/vore_19 +/decl/poster/vore_19 icon_state = "dwposter6" name = "install.css" desc = "A nostalgia trip." -/datum/poster/vore_20 +/decl/poster/vore_20 icon_state = "dwposter7" name = "TALON" desc = "The logo and banner of a notable group of contractors known to trade with NanoTrasen." -/datum/poster/vore_21 +/decl/poster/vore_21 icon_state = "dwposter8" name = "GPA" desc = "A pretentious advertisement for the drink 'Galactic Panic Attack'" -/datum/poster/vore_22 +/decl/poster/vore_22 icon_state = "dwposter9" name = "Rope" desc = "A poster outlining proper pit-traversal gear." -/datum/poster/vore_23 +/decl/poster/vore_23 icon_state = "dwposter10" name = "Visit Luna" desc = "Part of a tourism campaign from SolCom encouraging people to visit Earth's moon, Luna." -/datum/poster/vore_24 +/decl/poster/vore_24 icon_state = "dwposter11" name = "Secgun" desc = "A striking, wordless advertisement for NanoTrasen's security department. It wasn't very effective and just seems to be used as a warning sign." -/datum/poster/vore_25 +/decl/poster/vore_25 icon_state = "sbsposter14" name = "Awoo" desc = "A top contender for 'images you can hear'." -/datum/poster/vore_26 +/decl/poster/vore_26 icon_state = "sbsposter15" name = "LikeEmSmall" desc = "An advertisement for a defunct dating service for normal-sized individuals to find micro partners." -/datum/poster/vore_27 +/decl/poster/vore_27 icon_state = "sbsposter16" name = "Borgar" desc = "What do you want from Space McDonalds?" -/datum/poster/vore_28 +/decl/poster/vore_28 icon_state = "sbsposter17" name = "DiveIn" desc = "A limited edition holographic poster that seems to feature subliminal suggestions and conditioning." -/datum/poster/vore_29 +/decl/poster/vore_29 icon_state = "sbsposter18" name = "Perdition" desc = "You get the feeling that whomever made this intended for you to feel very differently than you do when you look at it." diff --git a/code/game/objects/effects/effect_system.dm b/code/game/objects/effects/effect_system.dm index f18eb727eb..1a9f116789 100644 --- a/code/game/objects/effects/effect_system.dm +++ b/code/game/objects/effects/effect_system.dm @@ -23,22 +23,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 @@ -61,32 +61,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/overlays.dm b/code/game/objects/effects/overlays.dm index a7b525b652..a625a79f73 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/step_triggers.dm b/code/game/objects/effects/step_triggers.dm index a3c3c242c2..17d9a17123 100644 --- a/code/game/objects/effects/step_triggers.dm +++ b/code/game/objects/effects/step_triggers.dm @@ -35,57 +35,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 */ @@ -156,11 +156,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/bodybag.dm b/code/game/objects/items/bodybag.dm index f43ee46d16..7992f9056d 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/contraband_vr.dm b/code/game/objects/items/contraband_vr.dm index b7b70f74a6..2bb1df1dd2 100644 --- a/code/game/objects/items/contraband_vr.dm +++ b/code/game/objects/items/contraband_vr.dm @@ -59,7 +59,7 @@ /obj/item/weapon/card/emag, /obj/item/weapon/card/emag_broken, /obj/item/weapon/card/id/syndicate, - /obj/item/weapon/contraband/poster, + /obj/item/poster, /obj/item/weapon/disposable_teleporter, /obj/item/weapon/grenade/flashbang/clusterbang, /obj/item/weapon/grenade/flashbang/clusterbang, diff --git a/code/game/objects/items/devices/communicator/UI_tgui.dm b/code/game/objects/items/devices/communicator/UI_tgui.dm index 4745a02488..989d68078e 100644 --- a/code/game/objects/items/devices/communicator/UI_tgui.dm +++ b/code/game/objects/items/devices/communicator/UI_tgui.dm @@ -436,5 +436,3 @@ if("newsfeed") newsfeed_channel = text2num(params["newsfeed"]) - -#undef DEFAULT_MAP_SIZE \ No newline at end of file diff --git a/code/game/objects/items/devices/communicator/messaging.dm b/code/game/objects/items/devices/communicator/messaging.dm index 263f6d4db3..68b6022ad0 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/denecrotizer_vr.dm b/code/game/objects/items/devices/denecrotizer_vr.dm index ee48820850..12bfffbacb 100644 --- a/code/game/objects/items/devices/denecrotizer_vr.dm +++ b/code/game/objects/items/devices/denecrotizer_vr.dm @@ -116,6 +116,7 @@ if(do_after(user, revive_time, exclusive = 1, target = target)) target.faction = user.faction target.revivedby = user.name + target.ai_holder.returns_home = FALSE target.revive() target.sight = initial(target.sight) target.see_in_dark = initial(target.see_in_dark) diff --git a/code/game/objects/items/devices/powersink.dm b/code/game/objects/items/devices/powersink.dm index 477f161e07..64c312b914 100644 --- a/code/game/objects/items/devices/powersink.dm +++ b/code/game/objects/items/devices/powersink.dm @@ -9,7 +9,7 @@ throw_speed = 1 throw_range = 2 - matter = list(DEFAULT_WALL_MATERIAL = 750,"waste" = 750) + matter = list(DEFAULT_WALL_MATERIAL = 750) origin_tech = list(TECH_POWER = 3, TECH_ILLEGAL = 5) var/drain_rate = 1500000 // amount of power to drain per tick 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/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 d25e96f078..00fa10f137 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)) - cut_overlays() - 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)) + cut_overlays() + 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/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 36e20414f9..d31ed74dcf 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -430,6 +430,6 @@ /datum/stack_recipe_list var/title = "ERROR" var/list/recipes = null - New(title, recipes) - src.title = title - src.recipes = recipes +/datum/stack_recipe_list/New(title, recipes) + src.title = title + src.recipes = recipes diff --git a/code/game/objects/items/toys/toys.dm b/code/game/objects/items/toys/toys.dm index 98a689d776..61218364ad 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/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 3f7e3fc1b8..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 diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm index ab91eca500..15170138d3 100644 --- a/code/game/objects/items/weapons/cigs_lighters.dm +++ b/code/game/objects/items/weapons/cigs_lighters.dm @@ -578,10 +578,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 2f10bfce2c..8049096292 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 e4d96a0c79..285fba5bfd 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 2f79b7ef94..60a0ceef61 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" @@ -20,13 +20,13 @@ obj/item/weapon/chainsaw/Initialize() //YW edit - replaced New with Initialize s R.add_reagent("fuel", max_fuel) 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 909b3f0618..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) - cut_overlays() + 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/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/backpack_vr.dm b/code/game/objects/items/weapons/storage/backpack_vr.dm index eda37941a1..59505d3f71 100644 --- a/code/game/objects/items/weapons/storage/backpack_vr.dm +++ b/code/game/objects/items/weapons/storage/backpack_vr.dm @@ -10,13 +10,13 @@ var/taurtype = /datum/sprite_accessory/tail/taur/horse //Acceptable taur type to be wearing this var/no_message = "You aren't the appropriate taur type to wear this!" - mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = 0) - if(..()) - if(istype(H) && istype(H.tail_style, taurtype)) - return 1 - else - to_chat(H, "[no_message]") - return 0 +/obj/item/weapon/storage/backpack/saddlebag/mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = 0) + if(..()) + if(istype(H) && istype(H.tail_style, taurtype)) + return 1 + else + to_chat(H, "[no_message]") + return 0 /* If anyone wants to make some... this is how you would. /obj/item/weapon/storage/backpack/saddlebag/spider @@ -38,15 +38,15 @@ slowdown = 1 //And are slower, too... var/no_message = "You aren't the appropriate taur type to wear this!" - mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = 0) - if(..()) - if(!istype(H))//Error, non HUMAN. - log_runtime("[H] was not a valid human!") - return +/obj/item/weapon/storage/backpack/saddlebag_common/mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = 0) + if(..()) + if(!istype(H))//Error, non HUMAN. + log_runtime("[H] was not a valid human!") + return - var/datum/sprite_accessory/tail/taur/TT = H.tail_style - item_state = "[icon_base]_[TT.icon_sprite_tag]" //icon_sprite_tag is something like "deer" - return 1 + var/datum/sprite_accessory/tail/taur/TT = H.tail_style + item_state = "[icon_base]_[TT.icon_sprite_tag]" //icon_sprite_tag is something like "deer" + return 1 diff --git a/code/game/objects/items/weapons/storage/egg_vr.dm b/code/game/objects/items/weapons/storage/egg_vr.dm index f7849040db..a035ce2264 100644 --- a/code/game/objects/items/weapons/storage/egg_vr.dm +++ b/code/game/objects/items/weapons/storage/egg_vr.dm @@ -17,6 +17,8 @@ use_sound = 'sound/items/drop/flesh.ogg' /obj/item/weapon/storage/vore_egg/open(mob/user as mob) + if(isobserver(user)) + return icon = open_egg_icon ..() diff --git a/code/game/objects/items/weapons/storage/firstaid.dm b/code/game/objects/items/weapons/storage/firstaid.dm index bb6bb1032c..ca9709b3fb 100644 --- a/code/game/objects/items/weapons/storage/firstaid.dm +++ b/code/game/objects/items/weapons/storage/firstaid.dm @@ -137,7 +137,8 @@ /obj/item/stack/medical/advanced/bruise_pack, /obj/item/stack/nanopaste, /obj/item/device/healthanalyzer/advanced, - /obj/item/weapon/autopsy_scanner + /obj/item/weapon/autopsy_scanner, + /obj/item/weapon/surgical/bioregen ) starts_with = list( @@ -152,7 +153,8 @@ /obj/item/weapon/surgical/FixOVein, /obj/item/stack/medical/advanced/bruise_pack, /obj/item/device/healthanalyzer/advanced, - /obj/item/weapon/autopsy_scanner + /obj/item/weapon/autopsy_scanner, + /obj/item/weapon/surgical/bioregen ) /obj/item/weapon/storage/firstaid/clotting @@ -165,7 +167,7 @@ name = "bone repair kit" desc = "Contains chemicals to mend broken bones." max_storage_space = ITEMSIZE_COST_SMALL * 7 - starts_with = list(/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/bonemed = 8) + starts_with = list(/obj/item/weapon/reagent_containers/hypospray/autoinjector/bonemed = 8) /* * Pill Bottles 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/quickdraw.dm b/code/game/objects/items/weapons/storage/quickdraw.dm index 98cbe58d99..07b549032c 100644 --- a/code/game/objects/items/weapons/storage/quickdraw.dm +++ b/code/game/objects/items/weapons/storage/quickdraw.dm @@ -93,7 +93,16 @@ desc = "A small case for safely carrying sharps around. This one is deluxe!" max_w_class = ITEMSIZE_SMALL starts_with = list( - /obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/bonemed, - /obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/bonemed, - /obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/bonemed + /obj/item/weapon/reagent_containers/hypospray/autoinjector/bonemed, + /obj/item/weapon/reagent_containers/hypospray/autoinjector/bonemed, + /obj/item/weapon/reagent_containers/hypospray/autoinjector/bonemed + ) + +/obj/item/weapon/storage/quickdraw/syringe_case/clonemed + desc = "A small case for safely carrying sharps around. This one is deluxe!" + max_w_class = ITEMSIZE_SMALL + starts_with = list( + /obj/item/weapon/reagent_containers/hypospray/autoinjector/clonemed, + /obj/item/weapon/reagent_containers/hypospray/autoinjector/clonemed, + /obj/item/weapon/reagent_containers/hypospray/autoinjector/clonemed ) diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index 66e23467d5..9f3f4335c8 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -269,11 +269,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..368b0de98c 100644 --- a/code/game/objects/items/weapons/surgery_tools.dm +++ b/code/game/objects/items/weapons/surgery_tools.dm @@ -6,6 +6,7 @@ * Surgical Drill * Scalpel * Circular Saw + * Bio-Regenerator */ /obj/item/weapon/surgical @@ -22,6 +23,16 @@ return 0 ..() +/* + * Bio-Regenerator + */ +/obj/item/weapon/surgical/bioregen + name="bioregenerator" + desc="A special tool used in surgeries which can pull toxins from and restore oxygen to organic tissue as well as recreate missing biological structures to allow otherwise irreperable flesh to be mended." + icon='icons/obj/surgery_vr.dmi' + icon_state="bioregen" + drop_sound = 'sound/items/drop/scrap.ogg' + /* * Retractor */ @@ -73,11 +84,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 +110,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 bd6f384280..69e795cb6b 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 8fb4758c64..af7ecdc3f6 100644 --- a/code/game/objects/random/misc.dm +++ b/code/game/objects/random/misc.dm @@ -260,10 +260,8 @@ spawn_nothing_percentage = 50 /obj/random/contraband/item_to_spawn() return pick(prob(6);/obj/item/weapon/storage/pill_bottle/paracetamol, //VOREStation Edit, - 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/random/mob_vr.dm b/code/game/objects/random/mob_vr.dm index fdb41ada59..d644e9e014 100644 --- a/code/game/objects/random/mob_vr.dm +++ b/code/game/objects/random/mob_vr.dm @@ -4,88 +4,88 @@ icon = 'icons/obj/gun.dmi' icon_state = "p08" spawn_nothing_percentage = 50 - item_to_spawn() - return pick(prob(11);/obj/random/ammo_all,\ - prob(11);/obj/item/weapon/gun/energy/laser,\ - prob(11);/obj/item/weapon/gun/projectile/pirate,\ - prob(10);/obj/item/weapon/material/twohanded/spear,\ - prob(10);/obj/item/weapon/gun/energy/stunrevolver,\ - prob(10);/obj/item/weapon/gun/energy/taser,\ - prob(10);/obj/item/weapon/gun/projectile/shotgun/doublebarrel/pellet,\ - prob(10);/obj/item/weapon/material/knife,\ - prob(10);/obj/item/weapon/gun/projectile/luger,\ - /* prob(10);/obj/item/weapon/gun/projectile/pipegun,\ */ - prob(10);/obj/item/weapon/gun/projectile/revolver/detective,\ - prob(10);/obj/item/weapon/gun/projectile/revolver/judge,\ - prob(10);/obj/item/weapon/gun/projectile/colt,\ - prob(10);/obj/item/weapon/gun/projectile/shotgun/pump,\ - prob(10);/obj/item/weapon/gun/projectile/shotgun/pump/rifle,\ - prob(10);/obj/item/weapon/melee/baton,\ - prob(10);/obj/item/weapon/melee/telebaton,\ - prob(10);/obj/item/weapon/melee/classic_baton,\ - prob(9);/obj/item/weapon/gun/projectile/automatic/wt550/lethal,\ - prob(9);/obj/item/weapon/gun/projectile/automatic/pdw,\ - prob(9);/obj/item/weapon/gun/projectile/automatic/sol, \ - prob(9);/obj/item/weapon/gun/energy/crossbow/largecrossbow,\ - prob(9);/obj/item/weapon/gun/projectile/pistol,\ - prob(9);/obj/item/weapon/gun/projectile/shotgun/pump,\ - prob(9);/obj/item/weapon/cane/concealed,\ - prob(9);/obj/item/weapon/gun/energy/gun,\ - prob(8);/obj/item/weapon/gun/energy/retro,\ - prob(8);/obj/item/weapon/gun/energy/gun/eluger,\ - prob(8);/obj/item/weapon/gun/energy/xray,\ - prob(8);/obj/item/weapon/gun/projectile/automatic/c20r,\ - prob(8);/obj/item/weapon/melee/energy/sword,\ - prob(8);/obj/item/weapon/gun/projectile/derringer,\ - prob(8);/obj/item/weapon/gun/projectile/revolver/lemat,\ - /* prob(8);/obj/item/weapon/gun/projectile/shotgun/pump/rifle/mosin,\ */ - /* prob(8);/obj/item/weapon/gun/projectile/automatic/m41a,\ */ - prob(7);/obj/item/weapon/material/butterfly,\ - prob(7);/obj/item/weapon/material/butterfly/switchblade,\ - prob(7);/obj/item/weapon/gun/projectile/giskard,\ - prob(7);/obj/item/weapon/gun/projectile/automatic/p90,\ - prob(7);/obj/item/weapon/gun/projectile/automatic/sts35,\ - prob(7);/obj/item/weapon/gun/projectile/shotgun/pump/combat,\ - prob(6);/obj/item/weapon/gun/energy/sniperrifle,\ - prob(6);/obj/item/weapon/gun/projectile/automatic/z8,\ - prob(6);/obj/item/weapon/gun/energy/captain,\ - prob(6);/obj/item/weapon/material/knife/tacknife,\ - prob(5);/obj/item/weapon/gun/projectile/shotgun/pump/USDF,\ - prob(5);/obj/item/weapon/gun/projectile/giskard/olivaw,\ - prob(5);/obj/item/weapon/gun/projectile/revolver/consul,\ - prob(5);/obj/item/weapon/gun/projectile/revolver/mateba,\ - prob(5);/obj/item/weapon/gun/projectile/revolver,\ - prob(4);/obj/item/weapon/gun/projectile/deagle,\ - prob(4);/obj/item/weapon/material/knife/tacknife/combatknife,\ - prob(4);/obj/item/weapon/melee/energy/sword,\ - prob(4);/obj/item/weapon/gun/projectile/automatic/mini_uzi,\ - prob(4);/obj/item/weapon/gun/projectile/contender,\ - prob(4);/obj/item/weapon/gun/projectile/contender/tacticool,\ - prob(3);/obj/item/weapon/gun/projectile/SVD,\ - prob(3);/obj/item/weapon/gun/energy/lasercannon,\ - prob(3);/obj/item/weapon/gun/projectile/shotgun/pump/rifle/lever,\ - prob(3);/obj/item/weapon/gun/projectile/automatic/bullpup,\ - prob(2);/obj/item/weapon/gun/energy/pulse_rifle,\ - prob(2);/obj/item/weapon/gun/energy/gun/nuclear,\ - prob(2);/obj/item/weapon/gun/projectile/automatic/l6_saw,\ - prob(2);/obj/item/weapon/gun/energy/gun/burst,\ - prob(2);/obj/item/weapon/storage/box/frags,\ - prob(2);/obj/item/weapon/twohanded/fireaxe,\ - prob(2);/obj/item/weapon/gun/projectile/luger/brown,\ - prob(2);/obj/item/weapon/gun/launcher/crossbow,\ - /* prob(1);/obj/item/weapon/gun/projectile/automatic/battlerifle,\ */ // Too OP - prob(1);/obj/item/weapon/gun/projectile/deagle/gold,\ - prob(1);/obj/item/weapon/gun/energy/imperial,\ - prob(1);/obj/item/weapon/gun/projectile/automatic/as24,\ - prob(1);/obj/item/weapon/gun/launcher/rocket,\ - prob(1);/obj/item/weapon/gun/launcher/grenade,\ - prob(1);/obj/item/weapon/gun/projectile/gyropistol,\ - prob(1);/obj/item/weapon/gun/projectile/heavysniper,\ - prob(1);/obj/item/weapon/plastique,\ - prob(1);/obj/item/weapon/gun/energy/ionrifle,\ - prob(1);/obj/item/weapon/material/sword,\ - prob(1);/obj/item/weapon/cane/concealed,\ - prob(1);/obj/item/weapon/material/sword/katana) +/obj/random/weapon/item_to_spawn() + return pick(prob(11);/obj/random/ammo_all,\ + prob(11);/obj/item/weapon/gun/energy/laser,\ + prob(11);/obj/item/weapon/gun/projectile/pirate,\ + prob(10);/obj/item/weapon/material/twohanded/spear,\ + prob(10);/obj/item/weapon/gun/energy/stunrevolver,\ + prob(10);/obj/item/weapon/gun/energy/taser,\ + prob(10);/obj/item/weapon/gun/projectile/shotgun/doublebarrel/pellet,\ + prob(10);/obj/item/weapon/material/knife,\ + prob(10);/obj/item/weapon/gun/projectile/luger,\ + /* prob(10);/obj/item/weapon/gun/projectile/pipegun,\ */ + prob(10);/obj/item/weapon/gun/projectile/revolver/detective,\ + prob(10);/obj/item/weapon/gun/projectile/revolver/judge,\ + prob(10);/obj/item/weapon/gun/projectile/colt,\ + prob(10);/obj/item/weapon/gun/projectile/shotgun/pump,\ + prob(10);/obj/item/weapon/gun/projectile/shotgun/pump/rifle,\ + prob(10);/obj/item/weapon/melee/baton,\ + prob(10);/obj/item/weapon/melee/telebaton,\ + prob(10);/obj/item/weapon/melee/classic_baton,\ + prob(9);/obj/item/weapon/gun/projectile/automatic/wt550/lethal,\ + prob(9);/obj/item/weapon/gun/projectile/automatic/pdw,\ + prob(9);/obj/item/weapon/gun/projectile/automatic/sol, \ + prob(9);/obj/item/weapon/gun/energy/crossbow/largecrossbow,\ + prob(9);/obj/item/weapon/gun/projectile/pistol,\ + prob(9);/obj/item/weapon/gun/projectile/shotgun/pump,\ + prob(9);/obj/item/weapon/cane/concealed,\ + prob(9);/obj/item/weapon/gun/energy/gun,\ + prob(8);/obj/item/weapon/gun/energy/retro,\ + prob(8);/obj/item/weapon/gun/energy/gun/eluger,\ + prob(8);/obj/item/weapon/gun/energy/xray,\ + prob(8);/obj/item/weapon/gun/projectile/automatic/c20r,\ + prob(8);/obj/item/weapon/melee/energy/sword,\ + prob(8);/obj/item/weapon/gun/projectile/derringer,\ + prob(8);/obj/item/weapon/gun/projectile/revolver/lemat,\ + /* prob(8);/obj/item/weapon/gun/projectile/shotgun/pump/rifle/mosin,\ */ + /* prob(8);/obj/item/weapon/gun/projectile/automatic/m41a,\ */ + prob(7);/obj/item/weapon/material/butterfly,\ + prob(7);/obj/item/weapon/material/butterfly/switchblade,\ + prob(7);/obj/item/weapon/gun/projectile/giskard,\ + prob(7);/obj/item/weapon/gun/projectile/automatic/p90,\ + prob(7);/obj/item/weapon/gun/projectile/automatic/sts35,\ + prob(7);/obj/item/weapon/gun/projectile/shotgun/pump/combat,\ + prob(6);/obj/item/weapon/gun/energy/sniperrifle,\ + prob(6);/obj/item/weapon/gun/projectile/automatic/z8,\ + prob(6);/obj/item/weapon/gun/energy/captain,\ + prob(6);/obj/item/weapon/material/knife/tacknife,\ + prob(5);/obj/item/weapon/gun/projectile/shotgun/pump/USDF,\ + prob(5);/obj/item/weapon/gun/projectile/giskard/olivaw,\ + prob(5);/obj/item/weapon/gun/projectile/revolver/consul,\ + prob(5);/obj/item/weapon/gun/projectile/revolver/mateba,\ + prob(5);/obj/item/weapon/gun/projectile/revolver,\ + prob(4);/obj/item/weapon/gun/projectile/deagle,\ + prob(4);/obj/item/weapon/material/knife/tacknife/combatknife,\ + prob(4);/obj/item/weapon/melee/energy/sword,\ + prob(4);/obj/item/weapon/gun/projectile/automatic/mini_uzi,\ + prob(4);/obj/item/weapon/gun/projectile/contender,\ + prob(4);/obj/item/weapon/gun/projectile/contender/tacticool,\ + prob(3);/obj/item/weapon/gun/projectile/SVD,\ + prob(3);/obj/item/weapon/gun/energy/lasercannon,\ + prob(3);/obj/item/weapon/gun/projectile/shotgun/pump/rifle/lever,\ + prob(3);/obj/item/weapon/gun/projectile/automatic/bullpup,\ + prob(2);/obj/item/weapon/gun/energy/pulse_rifle,\ + prob(2);/obj/item/weapon/gun/energy/gun/nuclear,\ + prob(2);/obj/item/weapon/gun/projectile/automatic/l6_saw,\ + prob(2);/obj/item/weapon/gun/energy/gun/burst,\ + prob(2);/obj/item/weapon/storage/box/frags,\ + prob(2);/obj/item/weapon/twohanded/fireaxe,\ + prob(2);/obj/item/weapon/gun/projectile/luger/brown,\ + prob(2);/obj/item/weapon/gun/launcher/crossbow,\ + /* prob(1);/obj/item/weapon/gun/projectile/automatic/battlerifle,\ */ // Too OP + prob(1);/obj/item/weapon/gun/projectile/deagle/gold,\ + prob(1);/obj/item/weapon/gun/energy/imperial,\ + prob(1);/obj/item/weapon/gun/projectile/automatic/as24,\ + prob(1);/obj/item/weapon/gun/launcher/rocket,\ + prob(1);/obj/item/weapon/gun/launcher/grenade,\ + prob(1);/obj/item/weapon/gun/projectile/gyropistol,\ + prob(1);/obj/item/weapon/gun/projectile/heavysniper,\ + prob(1);/obj/item/weapon/plastique,\ + prob(1);/obj/item/weapon/gun/energy/ionrifle,\ + prob(1);/obj/item/weapon/material/sword,\ + prob(1);/obj/item/weapon/cane/concealed,\ + prob(1);/obj/item/weapon/material/sword/katana) /obj/random/weapon/guarenteed spawn_nothing_percentage = 0 @@ -95,45 +95,45 @@ desc = "This is random ammunition. Spawns all ammo types." icon = 'icons/obj/ammo.dmi' icon_state = "666" - item_to_spawn() - return pick(prob(5);/obj/item/weapon/storage/box/shotgunammo,\ - prob(5);/obj/item/weapon/storage/box/shotgunshells,\ - prob(5);/obj/item/ammo_magazine/clip/c762,\ - prob(5);/obj/item/ammo_magazine/m380,\ - prob(5);/obj/item/ammo_magazine/m45,\ - prob(5);/obj/item/ammo_magazine/m9mm,\ - prob(5);/obj/item/ammo_magazine/s38,\ - prob(4);/obj/item/ammo_magazine/clip/c45,\ - prob(4);/obj/item/ammo_magazine/clip/c9mm,\ - prob(4);/obj/item/ammo_magazine/m45uzi,\ - prob(4);/obj/item/ammo_magazine/m9mml,\ - prob(4);/obj/item/ammo_magazine/m9mmt,\ - prob(4);/obj/item/ammo_magazine/m9mmp90,\ - prob(4);/obj/item/ammo_magazine/m10mm,\ - prob(4);/obj/item/ammo_magazine/m545/small,\ - prob(3);/obj/item/ammo_magazine/clip/c10mm,\ - prob(3);/obj/item/ammo_magazine/clip/c44,\ - prob(3);/obj/item/ammo_magazine/s44,\ - prob(3);/obj/item/ammo_magazine/m762,\ - prob(3);/obj/item/ammo_magazine/m545,\ - prob(3);/obj/item/weapon/cell/device/weapon,\ - prob(2);/obj/item/ammo_magazine/m44,\ - prob(2);/obj/item/ammo_magazine/s357,\ - prob(2);/obj/item/ammo_magazine/m762m,\ - prob(2);/obj/item/ammo_magazine/clip/c12g, - prob(2);/obj/item/ammo_magazine/clip/c12g/pellet,\ - prob(1);/obj/item/ammo_magazine/m45tommy,\ - /* prob(1);/obj/item/ammo_magazine/m95,\ */ - prob(1);/obj/item/ammo_casing/rocket,\ - prob(1);/obj/item/weapon/storage/box/sniperammo,\ - prob(1);/obj/item/weapon/storage/box/flashshells,\ - prob(1);/obj/item/weapon/storage/box/beanbags,\ - prob(1);/obj/item/weapon/storage/box/stunshells,\ - prob(1);/obj/item/ammo_magazine/mtg,\ - prob(1);/obj/item/ammo_magazine/m12gdrum,\ - prob(1);/obj/item/ammo_magazine/m12gdrum/pellet,\ - prob(1);/obj/item/ammo_magazine/m45tommydrum - ) +/obj/random/ammo_all/item_to_spawn() + return pick(prob(5);/obj/item/weapon/storage/box/shotgunammo,\ + prob(5);/obj/item/weapon/storage/box/shotgunshells,\ + prob(5);/obj/item/ammo_magazine/clip/c762,\ + prob(5);/obj/item/ammo_magazine/m380,\ + prob(5);/obj/item/ammo_magazine/m45,\ + prob(5);/obj/item/ammo_magazine/m9mm,\ + prob(5);/obj/item/ammo_magazine/s38,\ + prob(4);/obj/item/ammo_magazine/clip/c45,\ + prob(4);/obj/item/ammo_magazine/clip/c9mm,\ + prob(4);/obj/item/ammo_magazine/m45uzi,\ + prob(4);/obj/item/ammo_magazine/m9mml,\ + prob(4);/obj/item/ammo_magazine/m9mmt,\ + prob(4);/obj/item/ammo_magazine/m9mmp90,\ + prob(4);/obj/item/ammo_magazine/m10mm,\ + prob(4);/obj/item/ammo_magazine/m545/small,\ + prob(3);/obj/item/ammo_magazine/clip/c10mm,\ + prob(3);/obj/item/ammo_magazine/clip/c44,\ + prob(3);/obj/item/ammo_magazine/s44,\ + prob(3);/obj/item/ammo_magazine/m762,\ + prob(3);/obj/item/ammo_magazine/m545,\ + prob(3);/obj/item/weapon/cell/device/weapon,\ + prob(2);/obj/item/ammo_magazine/m44,\ + prob(2);/obj/item/ammo_magazine/s357,\ + prob(2);/obj/item/ammo_magazine/m762m,\ + prob(2);/obj/item/ammo_magazine/clip/c12g, + prob(2);/obj/item/ammo_magazine/clip/c12g/pellet,\ + prob(1);/obj/item/ammo_magazine/m45tommy,\ + /* prob(1);/obj/item/ammo_magazine/m95,\ */ + prob(1);/obj/item/ammo_casing/rocket,\ + prob(1);/obj/item/weapon/storage/box/sniperammo,\ + prob(1);/obj/item/weapon/storage/box/flashshells,\ + prob(1);/obj/item/weapon/storage/box/beanbags,\ + prob(1);/obj/item/weapon/storage/box/stunshells,\ + prob(1);/obj/item/ammo_magazine/mtg,\ + prob(1);/obj/item/ammo_magazine/m12gdrum,\ + prob(1);/obj/item/ammo_magazine/m12gdrum/pellet,\ + prob(1);/obj/item/ammo_magazine/m45tommydrum + ) /obj/random/cargopod name = "Random Cargo Item" @@ -143,7 +143,7 @@ spawn_nothing_percentage = 0 /obj/random/cargopod/item_to_spawn() - return pick(prob(10);/obj/item/weapon/contraband/poster,\ + return pick(prob(10);/obj/item/poster,\ prob(8);/obj/item/weapon/haircomb,\ prob(6);/obj/item/weapon/storage/pill_bottle/paracetamol,\ prob(6);/obj/item/weapon/material/butterflyblade,\ diff --git a/code/game/objects/random/unidentified/medicine.dm b/code/game/objects/random/unidentified/medicine.dm index f779d75a0f..ffd134384a 100644 --- a/code/game/objects/random/unidentified/medicine.dm +++ b/code/game/objects/random/unidentified/medicine.dm @@ -19,6 +19,8 @@ much more likely to show up. This is done for several purposes; /obj/random/unidentified_medicine/item_to_spawn() return pick( + /obj/item/weapon/reagent_containers/hypospray/autoinjector/bonemed/unidentified, + /obj/item/weapon/reagent_containers/hypospray/autoinjector/clonemed/unidentified, /obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/brute/unidentified, /obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/burn/unidentified, /obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/toxin/unidentified, @@ -27,7 +29,6 @@ much more likely to show up. This is done for several purposes; /obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/pain/unidentified, /obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/organ/unidentified, /obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/clotting/unidentified, - /obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/bonemed/unidentified, /obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/combat/unidentified, /obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/healing_nanites/unidentified, /obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/stimm/unidentified, @@ -62,9 +63,11 @@ much more likely to show up. This is done for several purposes; // Medicine belonging to a place still being occupied (or was recently), meaning the goods might still be fresh, and better. /obj/random/unidentified_medicine/fresh_medicine/item_to_spawn() // More likely to get something good, and a chance to get rare medicines. - // 75 Good, 25 Bad. 75% chance of getting something good. + // 80 Good, 25 Bad. 76% chance of getting something good. // Good odds, but the contents aren't super great unless someone gets lucky. return pick( + prob(5);/obj/item/weapon/reagent_containers/hypospray/autoinjector/bonemed/unidentified, + prob(5);/obj/item/weapon/reagent_containers/hypospray/autoinjector/clonemed/unidentified, prob(10);/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/brute/unidentified, prob(10);/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/burn/unidentified, prob(10);/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/toxin/unidentified, @@ -73,7 +76,6 @@ much more likely to show up. This is done for several purposes; prob(10);/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/pain/unidentified, prob(5);/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/organ/unidentified, prob(5);/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/clotting/unidentified, - prob(5);/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/bonemed/unidentified, prob(25);/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/expired/unidentified) // For military PoIs like BSD. High odds of good loot since those PoIs are really hard. @@ -82,12 +84,13 @@ much more likely to show up. This is done for several purposes; // 75 Good, 30 Bad, roughly 71.4% chance to get something good. // Very high but very hard to reach and still has a chance of ending poorly if injecting blind. return pick( + prob(5);/obj/item/weapon/reagent_containers/hypospray/autoinjector/bonemed/unidentified, + prob(5);/obj/item/weapon/reagent_containers/hypospray/autoinjector/clonemed/unidentified, prob(5);/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/brute/unidentified, prob(5);/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/burn/unidentified, prob(5);/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/pain/unidentified, prob(10);/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/organ/unidentified, prob(10);/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/clotting/unidentified, - prob(10);/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/bonemed/unidentified, prob(30);/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/combat/unidentified, prob(10);/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/soporific/unidentified, prob(30);/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/cyanide/unidentified) @@ -95,13 +98,14 @@ much more likely to show up. This is done for several purposes; // Hyposprays found inside various illicit places. /obj/random/unidentified_medicine/drug_den/item_to_spawn() // Combat stims are common, but so are nasty drugs. - // 65 Good, 160 Bad, roughly 28.8% to get something good. + // 70 Good, 160 Bad, roughly 30% to get something good. // Poor odds, but there are a lot of these scattered in the drug dens and illegal chem labs. return pick( + prob(5);/obj/item/weapon/reagent_containers/hypospray/autoinjector/bonemed/unidentified, + prob(5);/obj/item/weapon/reagent_containers/hypospray/autoinjector/clonemed/unidentified, prob(10);/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/pain/unidentified, prob(5);/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/organ/unidentified, prob(5);/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/clotting/unidentified, - prob(5);/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/bonemed/unidentified, prob(40);/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/combat/unidentified, prob(20);/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/stimm/unidentified, prob(20);/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/space_drugs/unidentified, @@ -120,9 +124,10 @@ much more likely to show up. This is done for several purposes; // 45 Good, 45 Bad, 50% chance to get something good. // Do you feel lucky? return pick( + prob(5);/obj/item/weapon/reagent_containers/hypospray/autoinjector/bonemed/unidentified, + prob(5);/obj/item/weapon/reagent_containers/hypospray/autoinjector/clonemed/unidentified, prob(10);/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/organ/unidentified, prob(10);/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/clotting/unidentified, - prob(10);/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/bonemed/unidentified, prob(10);/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/combat/unidentified, prob(5);/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/healing_nanites/unidentified, prob(20);/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/contaminated/unidentified, 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 78c0e3ba7a..d0ed80bc4a 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/security.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/security.dm @@ -202,7 +202,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() @@ -276,11 +276,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 17ea6845e3..18a07462fc 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/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 0461c8ee25..4443fb6da3 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/stool_bed_chair_nest/bed.dm b/code/game/objects/structures/stool_bed_chair_nest/bed.dm index 639db4191b..25ca2cbd01 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm @@ -198,7 +198,7 @@ icon = 'icons/obj/rollerbed.dmi' icon_state = "rollerbed" anchored = 0 - surgery_odds = 75 + surgery_odds = 50 //VOREStation Edit var/bedtype = /obj/structure/bed/roller var/rollertype = /obj/item/roller 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/trash_pile_vr.dm b/code/game/objects/structures/trash_pile_vr.dm index 5c1f3da494..317dca8729 100644 --- a/code/game/objects/structures/trash_pile_vr.dm +++ b/code/game/objects/structures/trash_pile_vr.dm @@ -188,7 +188,7 @@ prob(2);/obj/item/device/flashlight/glowstick/blue, prob(2);/obj/item/weapon/card/emag_broken, prob(2);/obj/item/weapon/cell/super, - prob(2);/obj/item/weapon/contraband/poster, + prob(2);/obj/item/poster, prob(2);/obj/item/weapon/reagent_containers/glass/rag, prob(2);/obj/item/weapon/storage/box/sinpockets, prob(2);/obj/item/weapon/storage/secure/briefcase, diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index 47a3733443..8a7c8c9d5f 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -179,7 +179,7 @@ add_fingerprint(user) /obj/machinery/shower/update_icon() //this is terribly unreadable, but basically it makes the shower mist up - cut_overlay() //once it's been on for a while, in addition to handling the water overlay. + cut_overlays() //once it's been on for a while, in addition to handling the water overlay. if(mymist) qdel(mymist) mymist = null 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 a16d155268..108f7a747e 100644 --- a/code/game/response_team.dm +++ b/code/game/response_team.dm @@ -41,7 +41,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" @@ -65,7 +65,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) @@ -77,7 +77,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) @@ -90,7 +90,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 @@ -109,7 +109,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 31889dfff7..a788be683e 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 3820b6c03a..6ea20863dd 100644 --- a/code/game/turfs/flooring/flooring_premade.dm +++ b/code/game/turfs/flooring/flooring_premade.dm @@ -436,24 +436,16 @@ initial_flooring = /decl/flooring/snow/plating/drift movement_cost = 0 -#define FOOTSTEP_SPRITE_AMT 2 - -/turf/snow/Entered(atom/A) - if(isliving(A) && !istype(A, /mob/living/simple_mob)) - var/mdir = "[A.dir]" - if(crossed_dirs[mdir]) - crossed_dirs[mdir] = min(crossed_dirs[mdir] + 1, FOOTSTEP_SPRITE_AMT) - else - crossed_dirs[mdir] = 1 - - update_icon() - - . = ..() - -/turf/snow/update_icon() - cut_overlays() - for(var/d in crossed_dirs) - var/amt = crossed_dirs[d] +// 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)) + var/mob/living/L = A + if(L.hovering) // Flying things shouldn't make footprints. + return ..() + var/mdir = "[A.dir]" + crossed_dirs[mdir] = 1 + update_icon() + . = ..() for(var/i in 1 to amt) add_overlay(image(icon, "footprint[i]", text2num(d))) diff --git a/code/game/turfs/flooring/flooring_vr.dm b/code/game/turfs/flooring/flooring_vr.dm index 787c6bd10c..5ba1dfffb5 100644 --- a/code/game/turfs/flooring/flooring_vr.dm +++ b/code/game/turfs/flooring/flooring_vr.dm @@ -26,4 +26,37 @@ icon_base = "grass-dark" /turf/simulated/floor/tiled/freezer/cold - temperature = T0C - 5 \ No newline at end of file + temperature = T0C - 5 + +/turf/simulated/floor/redgrid + name = "processing strata" + icon = 'icons/turf/flooring/circuit_vr.dmi' + icon_state = "rcircuit" + initial_flooring = /decl/flooring/reinforced/circuit/red + +/decl/flooring/reinforced/circuit/red + name = "processing strata" + icon = 'icons/turf/flooring/circuit_vr.dmi' + icon_base = "rcircuit" + +/turf/simulated/floor/redgrid/animated + name = "pulsing pattern" + icon = 'icons/turf/flooring/circuit_vr.dmi' + icon_state = "rcircuitanim" + initial_flooring = /decl/flooring/reinforced/circuit/red/animated + +/decl/flooring/reinforced/circuit/red/animated + name = "pulsing pattern" + icon = 'icons/turf/flooring/circuit_vr.dmi' + icon_base = "rcircuitanim" + +/turf/simulated/floor/redgrid/off + name = "dark pattern" + icon = 'icons/turf/flooring/circuit_vr.dmi' + icon_state = "rcircuitanim_broken" + initial_flooring = /decl/flooring/reinforced/circuit/red/off + +/decl/flooring/reinforced/circuit/red/off + name = "dark pattern" + icon = 'icons/turf/flooring/circuit_vr.dmi' + icon_base = "rcircuitanim_broken" diff --git a/code/game/turfs/simulated/floor_types.dm b/code/game/turfs/simulated/floor_types.dm index e5c4391e64..71c25b0755 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/outdoors/ironsand_vr.dm b/code/game/turfs/simulated/outdoors/ironsand_vr.dm new file mode 100644 index 0000000000..3a3f5be828 --- /dev/null +++ b/code/game/turfs/simulated/outdoors/ironsand_vr.dm @@ -0,0 +1,45 @@ +/turf/simulated/floor/outdoors/ironsand + name = "iron sand" + desc = "Red and gritty." + icon = 'icons/turf/flooring/ironsand_vr.dmi' + icon_state = "ironsand1" + edge_blending_priority = 1 + initial_flooring = /decl/flooring/outdoors/ironsand + +/decl/flooring/outdoors/ironsand + name = "iron sand" + desc = "Red and gritty." + icon = 'icons/turf/flooring/ironsand_vr.dmi' + icon_base = "ironsand1" + footstep_sounds = list("human" = list( + 'sound/effects/footstep/asteroid1.ogg', + 'sound/effects/footstep/asteroid2.ogg', + 'sound/effects/footstep/asteroid3.ogg', + 'sound/effects/footstep/asteroid4.ogg', + 'sound/effects/footstep/asteroid5.ogg', + 'sound/effects/footstep/MedDirt1.ogg', + 'sound/effects/footstep/MedDirt2.ogg', + 'sound/effects/footstep/MedDirt3.ogg', + 'sound/effects/footstep/MedDirt4.ogg')) + +/turf/simulated/floor/outdoors/ironsand/Initialize(mapload) + var/possiblesands = list( + "ironsand1" = 50, + "ironsand2" = 1, + "ironsand3" = 1, + "ironsand4" = 1, + "ironsand5" = 1, + "ironsand6" = 1, + "ironsand7" = 1, + "ironsand8" = 1, + "ironsand9" = 1, + "ironsand10" = 1, + "ironsand11" = 1, + "ironsand12" = 1, + "ironsand13" = 1, + "ironsand14" = 1, + "ironsand15" = 1 + + ) + flooring_override = pickweight(possiblesands) + return ..() diff --git a/code/game/turfs/simulated/wall_attacks.dm b/code/game/turfs/simulated/wall_attacks.dm index 2268315f96..c3d1f1aa31 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 9a5c0c4b48..eaef2357b8 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 01c375e317..0df618d856 100644 --- a/code/game/turfs/snow/snow.dm +++ b/code/game/turfs/snow/snow.dm @@ -10,8 +10,6 @@ temperature = TN60C var/list/crossed_dirs = list() -/* Disabled by RF. Currently broke for the new map, and I'd rather it not be used for new map launch. Something to fix later. -#define FOOTSTEP_SPRITE_AMT 2 /turf/snow/Entered(atom/A) if(ismob(A)) diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index db8947b056..c6a2728108 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -95,7 +95,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 2895a191db..98ad8d05a8 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -571,7 +571,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 @@ -596,7 +596,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 @@ -616,7 +616,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 @@ -641,7 +641,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 7a96219a0c..a9abaae9ad 100644 --- a/code/global_init.dm +++ b/code/global_init.dm @@ -23,6 +23,7 @@ var/global/datum/global_init/init = new () debug_log = file("[log_path]-debug.log") debug_log << "[log_end]\n[log_end]\nStarting up. [time_stamp()][log_end]\n---------------------[log_end]" */ //VOREStation Removal 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 9edad6c4d0..a32ddc578d 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 @@ -88,7 +88,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 @@ -152,7 +152,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 @@ -208,7 +208,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 9676143751..482044e4af 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) @@ -1576,7 +1576,7 @@ var/datum/announcement/minor/admin_min_announcer = new 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/holder2.dm b/code/modules/admin/holder2.dm index 90a5c26e54..cff69baffc 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 882205d467..a029f116d6 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 d8b13b452c..fec11f3c4c 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1979,13 +1979,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 df28238177..ab84316054 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 8ef297eb05..d3ca51ea78 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 4acf3a54c1..b1d26ec179 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 26e3001129..01f024b542 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/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 30f002de7d..5a0109a031 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 c08ee1fa06..de22b807de 100644 --- a/code/modules/awaymissions/gateway.dm +++ b/code/modules/awaymissions/gateway.dm @@ -51,7 +51,7 @@ density = 1 */ //VOREStation Removal End -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 ee065d41d7..fea781da8b 100644 --- a/code/modules/awaymissions/zlevel.dm +++ b/code/modules/awaymissions/zlevel.dm @@ -1,4 +1,4 @@ -proc/createRandomZlevel() +/proc/createRandomZlevel() if(awaydestinations.len || UNIT_TEST) //crude, but it saves another var! //VOREStation Edit - No loading away missions during CI testing return diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index 423c011d57..43b7e1676d 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -404,7 +404,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 @@ -434,17 +433,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 0dfb61c8e5..ace9c8d6a9 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" , html_decode(pref.metadata)) as message, extra = 0) //VOREStation Edit + var/new_metadata = sanitize(input(user, "Enter any information you'd like others to see, such as Roleplay-preferences:", "Game Preference" , html_decode(pref.metadata)) as message|null, extra = 0) //VOREStation Edit 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 a542128f65..bb4198fd08 100644 --- a/code/modules/client/preference_setup/general/03_body.dm +++ b/code/modules/client/preference_setup/general/03_body.dm @@ -363,6 +363,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/loadout/loadout_fluffitems_vr.dm b/code/modules/client/preference_setup/loadout/loadout_fluffitems_vr.dm index 5725f397b5..de10fa271d 100644 --- a/code/modules/client/preference_setup/loadout/loadout_fluffitems_vr.dm +++ b/code/modules/client/preference_setup/loadout/loadout_fluffitems_vr.dm @@ -770,6 +770,12 @@ ckeywhitelist = list("pandora029") character_name = list("Evelyn Tareen") +/datum/gear/fluff/evelyn_coat + path = /obj/item/clothing/suit/storage/hooded/wintercoat/security/fluff/evelyn/ + display_name = "warden's navy winter coat" + ckeywhitelist = list("pandora029") + character_name = list("Evelyn Tareen") + /datum/gear/fluff/lily_medal path = /obj/item/clothing/accessory/medal/silver/unity display_name = "Lily's Unity Medal" @@ -848,6 +854,12 @@ display_name = "LUNA's Distinguished Conduct Medal" ckeywhitelist = list("residentcody") character_name = list("LUNA") + +/datum/gear/fluff/pathfinder_id + path = /obj/item/weapon/card/id/event/polymorphic/itg + display_name = "Pathfinder's ITG ID" + ckeywhitelist = list("residentcody") + character_name = list("Pathfinder") /datum/gear/fluff/nikki_dorky_outfit path = /obj/item/weapon/storage/box/fluff @@ -1199,6 +1211,12 @@ ckeywhitelist = list("verysoft") character_name = list("Harmony") +/datum/gear/fluff/shinerunner_id + path = /obj/item/weapon/card/id/event/polymorphic/itg + display_name = "Shine-Runner's ITG-ID card" + ckeywhitelist = list("verysoft") + character_name = list("Shine-Runner") + // W CKEYS /datum/gear/fluff/sthasha_bracer path = /obj/item/clothing/accessory/bracer/fluff/xander_sthasha diff --git a/code/modules/client/preference_setup/loadout/loadout_suit.dm b/code/modules/client/preference_setup/loadout/loadout_suit.dm index 6e090c90ae..738ee9bce2 100644 --- a/code/modules/client/preference_setup/loadout/loadout_suit.dm +++ b/code/modules/client/preference_setup/loadout/loadout_suit.dm @@ -100,7 +100,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 da4bae455b..f18b4f649a 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 097f03b857..272eb18870 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 e990ee1793..06f7aa5e06 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/verbs/who.dm b/code/modules/client/verbs/who.dm index 6c309a6566..0bf564fb27 100644 --- a/code/modules/client/verbs/who.dm +++ b/code/modules/client/verbs/who.dm @@ -6,55 +6,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) - if(C.holder && C.holder.fakekey) - Lines += C.holder.fakekey - else - Lines += C.key + entry += " (?)" + Lines += entry for(var/line in sortList(Lines)) msg += "[line]\n" @@ -66,11 +57,6 @@ set category = "Admin" set name = "Staffwho" - var/message = get_staffwho_message(holder) - to_chat(src, message) - -// VOREStation Edit - This whole proc has various vorestation edits throughout. Practically every other line. -/proc/get_staffwho_message(datum/admins/holder) var/msg = "" var/modmsg = "" var/devmsg = "" @@ -79,117 +65,50 @@ var/num_admins_online = 0 var/num_devs_online = 0 var/num_event_managers_online = 0 - - if(holder) - for(var/client/C in GLOB.admins) - if(R_ADMIN & C.holder.rights && R_BAN & C.holder.rights) - - if(C.holder.fakekey && !((R_ADMIN & holder.rights) || (R_MOD & holder.rights))) //Event Managerss can't see stealthmins - continue - - 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_ADMIN & C.holder.rights && !(R_SERVER & C.holder.rights)) - modmsg += "\t[C] is a [C.holder.rank]" - - if(C.holder.fakekey && !((R_ADMIN & holder.rights) || (R_MOD & holder.rights))) - continue - if(C.holder.fakekey) - msg += " (as [C.holder.fakekey])" - - 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) - if(C.holder.fakekey && !((R_ADMIN & holder.rights) || (R_MOD & holder.rights))) - continue - devmsg += "\t[C] is a [C.holder.rank]" - if(C.holder.fakekey) - devmsg += " (as [C.holder.fakekey])" - 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++ + for(var/client/C in GLOB.admins) // VOREStation Edit - GLOB + var/temp = "" + var/category = R_ADMIN + // VOREStation Edit - Apply stealthmin protection to all levels + if(C.holder.fakekey && check_rights(R_ADMIN|R_MOD, FALSE, src)) // Only admins and mods can see stealthmins + continue + // VOREStation Edit End + if(check_rights(R_BAN, FALSE, C)) // admins //VOREStation Edit + num_admins_online++ + else if(check_rights(R_ADMIN, FALSE, C) && !check_rights(R_SERVER, FALSE, C)) // mods //VOREStation Edit: Game masters + 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_STEALTH, FALSE, C)) // event managers //VOREStation Edit: Retired Staff + 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(isobserver(C.mob)) + temp += " - Observing" + else if(istype(C.mob,/mob/new_player)) + temp += " - Lobby" else - if(C.holder.fakekey && !((R_ADMIN & holder.rights) || (R_MOD & holder.rights))) - continue - eventMmsg += "\t[C] is a [C.holder.rank]" - if(C.holder.fakekey) - eventMmsg += " (as [C.holder.fakekey])" - if(isobserver(C.mob)) - eventMmsg += " - Observing" - else if(istype(C.mob,/mob/new_player)) - eventMmsg += " - Lobby" - else - eventMmsg += " - Playing" + temp += " - 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 GLOB.admins) - if(R_ADMIN & C.holder.rights && R_BAN & C.holder.rights) - if(!C.holder.fakekey) - msg += "\t[C] is a [C.holder.rank]\n" - num_admins_online++ - else if(R_ADMIN & C.holder.rights && !(R_SERVER & C.holder.rights)) - if(!C.holder.fakekey) - modmsg += "\t[C] is a [C.holder.rank]\n" - num_mods_online++ - else if(R_SERVER & C.holder.rights) - if(!C.holder.fakekey) - devmsg += "\t[C] is a [C.holder.rank]\n" - num_devs_online++ - else - if(!C.holder.fakekey) - 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 msg = "Current Admins ([num_admins_online]):\n" + msg @@ -204,5 +123,4 @@ msg += "\nAdminhelps are also sent to Discord. If no admins are available in game try anyway and an admin on Discord may see it and respond." - return msg - + to_chat(src, msg) diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 6d76e44777..d415ee7b2e 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -1,1096 +1,1096 @@ -/obj/item/clothing - name = "clothing" - siemens_coefficient = 0.9 - drop_sound = 'sound/items/drop/clothing.ogg' - pickup_sound = 'sound/items/pickup/clothing.ogg' - var/list/species_restricted = null //Only these species can wear this kit. - var/gunshot_residue //Used by forensics. - - var/list/accessories - var/list/valid_accessory_slots - var/list/restricted_accessory_slots - var/list/starting_accessories - - var/flash_protection = FLASH_PROTECTION_NONE - var/tint = TINT_NONE - var/list/enables_planes //Enables these planes in the wearing mob's plane_holder - var/list/plane_slots //But only if it's equipped into this specific slot - - /* - Sprites used when the clothing item is refit. This is done by setting icon_override. - For best results, if this is set then sprite_sheets should be null and vice versa, but that is by no means necessary. - Ideally, sprite_sheets_refit should be used for "hard" clothing items that can't change shape very well to fit the wearer (e.g. helmets, hardsuits), - while sprite_sheets should be used for "flexible" clothing items that do not need to be refitted (e.g. aliens wearing jumpsuits). - */ - var/list/sprite_sheets_refit = null - var/ear_protection = 0 - var/blood_sprite_state - - var/index //null by default, if set, will change which dmi it uses - - var/update_icon_define = null // Only needed if you've got multiple files for the same type of clothing - - var/polychromic = FALSE //VOREStation edit - -//Updates the icons of the mob wearing the clothing item, if any. -/obj/item/clothing/proc/update_clothing_icon() - return - -// Aurora forensics port. -/obj/item/clothing/clean_blood() - . = ..() - gunshot_residue = null - - -/obj/item/clothing/New() - ..() - if(starting_accessories) - for(var/T in starting_accessories) - var/obj/item/clothing/accessory/tie = new T(src) - src.attach_accessory(null, tie) - set_clothing_index() - - //VOREStation edit start - if(polychromic) - verbs |= /obj/item/clothing/proc/change_color - //VOREStation edit start - -/obj/item/clothing/update_icon() - cut_overlays() //This removes all the overlays on the sprite and then goes down a checklist adding them as required. - if(blood_DNA) - add_blood() - . = ..() - -/obj/item/clothing/equipped(var/mob/user,var/slot) - ..() - if(enables_planes) - user.recalculate_vis() - -/obj/item/clothing/dropped(var/mob/user) - ..() - if(enables_planes) - user.recalculate_vis() - -//BS12: Species-restricted clothing check. -/obj/item/clothing/mob_can_equip(M as mob, slot, disable_warning = FALSE) - - //if we can't equip the item anyway, don't bother with species_restricted (cuts down on spam) - if (!..()) - return 0 - - if(LAZYLEN(species_restricted) && istype(M,/mob/living/carbon/human)) - var/exclusive = null - var/wearable = null - var/mob/living/carbon/human/H = M - - if("exclude" in species_restricted) - exclusive = 1 - - if(H.species) - if(exclusive) - if(!(H.species.get_bodytype(H) in species_restricted)) - wearable = 1 - else - if(H.species.get_bodytype(H) in species_restricted) - wearable = 1 - - if(!wearable && !(slot in list(slot_l_store, slot_r_store, slot_s_store))) - to_chat(H, "Your species cannot wear [src].") - return 0 - return 1 - -/obj/item/clothing/handle_shield(mob/user, var/damage, atom/damage_source = null, mob/attacker = null, var/def_zone = null, var/attack_text = "the attack") - . = ..() - if((. == 0) && LAZYLEN(accessories)) - for(var/obj/item/I in accessories) - var/check = I.handle_shield(user, damage, damage_source, attacker, def_zone, attack_text) - - if(check != 0) // Projectiles sometimes use negatives IIRC, 0 is only returned if something is not blocked. - . = check - break - -// For now, these two temp procs only return TRUE or FALSE if they can provide resistance to a given temperature. -/obj/item/clothing/proc/handle_low_temperature(var/tempcheck = T20C) - . = FALSE - if(LAZYLEN(accessories)) - for(var/obj/item/clothing/C in accessories) - if(C.handle_low_temperature(tempcheck)) - . = TRUE - - if(min_cold_protection_temperature && min_cold_protection_temperature <= tempcheck) - . = TRUE - -/obj/item/clothing/proc/handle_high_temperature(var/tempcheck = T20C) - . = FALSE - if(LAZYLEN(accessories)) - for(var/obj/item/clothing/C in accessories) - if(C.handle_high_temperature(tempcheck)) - . = TRUE - - if(max_heat_protection_temperature && max_heat_protection_temperature >= tempcheck) - . = TRUE - -// Returns the relative flag-vars for covered protection. -/obj/item/clothing/proc/get_cold_protection_flags() - . = cold_protection - - if(LAZYLEN(accessories)) - for(var/obj/item/clothing/C in accessories) - . |= C.get_cold_protection_flags() - -/obj/item/clothing/proc/get_heat_protection_flags() - . = heat_protection - - if(LAZYLEN(accessories)) - for(var/obj/item/clothing/C in accessories) - . |= C.get_heat_protection_flags() - -/obj/item/clothing/proc/refit_for_species(var/target_species) - if(!species_restricted) - return //this item doesn't use the species_restricted system - - //Set species_restricted list - switch(target_species) - //VOREStation Edit Start - if(SPECIES_HUMAN, SPECIES_SKRELL) //humanoid bodytypes - species_restricted = list(SPECIES_HUMAN, SPECIES_SKRELL, SPECIES_RAPALA, SPECIES_VASILISSAN, SPECIES_ALRAUNE, SPECIES_PROMETHEAN, SPECIES_XENOCHIMERA) - if(SPECIES_UNATHI) - species_restricted = list(SPECIES_UNATHI, SPECIES_XENOHYBRID) - if(SPECIES_VULPKANIN) - species_restricted = list(SPECIES_VULPKANIN, SPECIES_ZORREN_HIGH, SPECIES_FENNEC) - if(SPECIES_SERGAL) - species_restricted = list(SPECIES_SERGAL, SPECIES_NEVREAN) - //VOREStation Edit End - else - species_restricted = list(target_species) - - //Set icon - if (sprite_sheets_refit && (target_species in sprite_sheets_refit)) - sprite_sheets[target_species] = sprite_sheets_refit[target_species] - - if (sprite_sheets_obj && (target_species in sprite_sheets_obj)) - icon = sprite_sheets_obj[target_species] - else - icon = initial(icon) - -//VOREStation edit start -/obj/item/clothing/proc/change_color() - set name = "Change Color" - set category = "Object" - set desc = "Change the color of the clothing." - set src in usr - - if(usr.stat || usr.restrained() || usr.incapacitated()) - return - - var/new_color = input(usr, "Pick a new color", "Color", color) as color|null - - if(new_color && (new_color != color)) - color = new_color - update_icon() - update_clothing_icon() -//VOREStation edit end - -/obj/item/clothing/head/helmet/refit_for_species(var/target_species) - if(!species_restricted) - return //this item doesn't use the species_restricted system - - //Set species_restricted list - switch(target_species) - //VOREStation Edit Start - if(SPECIES_HUMAN) - species_restricted = list(SPECIES_HUMAN, SPECIES_RAPALA, SPECIES_VASILISSAN, SPECIES_ALRAUNE, SPECIES_PROMETHEAN, SPECIES_XENOCHIMERA) - if(SPECIES_SKRELL) - species_restricted = list(SPECIES_HUMAN, SPECIES_SKRELL, SPECIES_RAPALA, SPECIES_VASILISSAN, SPECIES_ALRAUNE, SPECIES_PROMETHEAN, SPECIES_XENOCHIMERA) - if(SPECIES_UNATHI) - species_restricted = list(SPECIES_UNATHI, SPECIES_XENOHYBRID) - if(SPECIES_VULPKANIN) - species_restricted = list(SPECIES_VULPKANIN, SPECIES_ZORREN_HIGH, SPECIES_FENNEC) - if(SPECIES_SERGAL) - species_restricted = list(SPECIES_SERGAL, SPECIES_NEVREAN) - //VOREStation Edit End - else - species_restricted = list(target_species) - - //Set icon - if (sprite_sheets_refit && (target_species in sprite_sheets_refit)) - sprite_sheets[target_species] = sprite_sheets_refit[target_species] - - if (sprite_sheets_obj && (target_species in sprite_sheets_obj)) - icon = sprite_sheets_obj[target_species] - else - icon = initial(icon) - -/////////////////////////////////////////////////////////////////////// -// Ears: headsets, earmuffs and tiny objects -/obj/item/clothing/ears - name = "ears" - w_class = ITEMSIZE_TINY - throwforce = 2 - slot_flags = SLOT_EARS - sprite_sheets = list( - SPECIES_TESHARI = 'icons/mob/species/teshari/ears.dmi') - -/obj/item/clothing/ears/attack_hand(mob/user as mob) - if (!user) return - - if (src.loc != user || !istype(user,/mob/living/carbon/human)) - ..() - return - - var/mob/living/carbon/human/H = user - if(H.l_ear != src && H.r_ear != src) - ..() - return - - if(!canremove) - return - - var/obj/item/clothing/ears/O - if(slot_flags & SLOT_TWOEARS ) - O = (H.l_ear == src ? H.r_ear : H.l_ear) - user.u_equip(O) - if(!istype(src,/obj/item/clothing/ears/offear)) - qdel(O) - O = src - else - O = src - - user.unEquip(src) - - if (O) - user.put_in_hands(O) - O.add_fingerprint(user) - - if(istype(src,/obj/item/clothing/ears/offear)) - qdel(src) - -/obj/item/clothing/ears/update_clothing_icon() - if (ismob(src.loc)) - var/mob/M = src.loc - M.update_inv_ears() - -/obj/item/clothing/ears/MouseDrop(var/obj/over_object) - if(ishuman(usr)) - var/mob/living/carbon/human/H = usr - // If this covers both ears, we want to return the result of unequipping the primary object, and kill the off-ear one - if(slot_flags & SLOT_TWOEARS) - var/obj/item/clothing/ears/O = (H.l_ear == src ? H.r_ear : H.l_ear) - if(istype(src, /obj/item/clothing/ears/offear)) - . = O.MouseDrop(over_object) - H.drop_from_inventory(src) - qdel(src) - else - . = ..() - H.drop_from_inventory(O) - qdel(O) - else - . = ..() - - -/obj/item/clothing/ears/offear - name = "Other ear" - w_class = ITEMSIZE_HUGE - icon = 'icons/mob/screen1_Midnight.dmi' - icon_state = "block" - slot_flags = SLOT_EARS | SLOT_TWOEARS - -/obj/item/clothing/ears/offear/New(var/obj/O) - name = O.name - desc = O.desc - icon = O.icon - icon_state = O.icon_state - set_dir(O.dir) - -//////////////////////////////////////////////////////////////////////////////////////// -//Gloves -/obj/item/clothing/gloves - name = "gloves" - item_icons = list( - slot_l_hand_str = 'icons/mob/items/lefthand_gloves.dmi', - slot_r_hand_str = 'icons/mob/items/righthand_gloves.dmi', - ) - gender = PLURAL //Carn: for grammarically correct text-parsing - w_class = ITEMSIZE_SMALL - icon = 'icons/obj/clothing/gloves.dmi' - siemens_coefficient = 0.9 - blood_sprite_state = "bloodyhands" - var/wired = 0 - var/obj/item/weapon/cell/cell = 0 - var/fingerprint_chance = 0 //How likely the glove is to let fingerprints through - var/obj/item/clothing/gloves/ring = null //Covered ring - var/mob/living/carbon/human/wearer = null //Used for covered rings when dropping - var/glove_level = 2 //What "layer" the glove is on - var/overgloves = 0 //Used by gauntlets and arm_guards - var/punch_force = 0 //How much damage do these gloves add to a punch? - var/punch_damtype = BRUTE //What type of damage does this make fists be? - body_parts_covered = HANDS - slot_flags = SLOT_GLOVES - attack_verb = list("challenged") - sprite_sheets = list( - SPECIES_TESHARI = 'icons/mob/species/teshari/gloves.dmi', - SPECIES_VOX = 'icons/mob/species/vox/gloves.dmi' - ) - drop_sound = 'sound/items/drop/gloves.ogg' - pickup_sound = 'sound/items/pickup/gloves.ogg' - -/obj/item/clothing/proc/set_clothing_index() - return - -/obj/item/clothing/gloves/update_clothing_icon() - if (ismob(src.loc)) - var/mob/M = src.loc - M.update_inv_gloves() - -/obj/item/clothing/gloves/emp_act(severity) - if(cell) - cell.emp_act(severity) - if(ring) - ring.emp_act(severity) - ..() - -// Called just before an attack_hand(), in mob/UnarmedAttack() -/obj/item/clothing/gloves/proc/Touch(var/atom/A, var/proximity) - return 0 // return 1 to cancel attack_hand() - -/*/obj/item/clothing/gloves/attackby(obj/item/weapon/W, mob/user) - if(W.is_wirecutter() || istype(W, /obj/item/weapon/scalpel)) - if (clipped) - to_chat(user, "The [src] have already been clipped!") - update_icon() - return - - playsound(src, W.usesound, 50, 1) - user.visible_message("[user] cuts the fingertips off of the [src].","You cut the fingertips off of the [src].") - - clipped = 1 - name = "modified [name]" - desc = "[desc]
They have had the fingertips cut off of them." - if("exclude" in species_restricted) - species_restricted -= SPECIES_UNATHI - species_restricted -= SPECIES_TAJ - return -*/ - -/obj/item/clothing/gloves/clean_blood() - . = ..() - transfer_blood = 0 - update_icon() - -/obj/item/clothing/gloves/mob_can_equip(mob/user, slot, disable_warning = FALSE) - var/mob/living/carbon/human/H = user - - if(slot && slot == slot_gloves) - var/obj/item/clothing/gloves/G = H.gloves - if(istype(G)) - ring = H.gloves - if(ring.glove_level >= src.glove_level) - to_chat(user, "You are unable to wear \the [src] as \the [H.gloves] are in the way.") - ring = null - return 0 - else - H.drop_from_inventory(ring) //Remove the ring (or other under-glove item in the hand slot?) so you can put on the gloves. - ring.forceMove(src) - to_chat(user, "You slip \the [src] on over \the [src.ring].") - if(!(flags & THICKMATERIAL)) - punch_force += ring.punch_force - else - ring = null - - if(!..()) - if(ring) //Put the ring back on if the check fails. - if(H.equip_to_slot_if_possible(ring, slot_gloves)) - src.ring = null - punch_force = initial(punch_force) - return 0 - - wearer = H //TODO clean this when magboots are cleaned - return 1 - -/obj/item/clothing/gloves/dropped() - ..() - - if(!wearer) - return - - var/mob/living/carbon/human/H = wearer - if(ring && istype(H)) - if(!H.equip_to_slot_if_possible(ring, slot_gloves)) - ring.forceMove(get_turf(src)) - src.ring = null - punch_force = initial(punch_force) - wearer = null - -/obj/item/clothing/gloves - var/datum/unarmed_attack/special_attack = null //do the gloves have a special unarmed attack? - var/special_attack_type = null - -/obj/item/clothing/gloves/New() - ..() - if(special_attack_type && ispath(special_attack_type)) - special_attack = new special_attack_type - - - -///////////////////////////////////////////////////////////////////// -//Rings - -/obj/item/clothing/gloves/ring - name = "ring" - w_class = ITEMSIZE_TINY - icon = 'icons/obj/clothing/rings.dmi' - gender = NEUTER - species_restricted = list("exclude", SPECIES_DIONA) - siemens_coefficient = 1 - glove_level = 1 - fingerprint_chance = 100 - punch_force = 2 - body_parts_covered = 0 - drop_sound = 'sound/items/drop/ring.ogg' - pickup_sound = 'sound/items/pickup/ring.ogg' - -/////////////////////////////////////////////////////////////////////// -//Head -/obj/item/clothing/head - name = "head" - icon = 'icons/obj/clothing/hats.dmi' - item_icons = list( - slot_l_hand_str = 'icons/mob/items/lefthand_hats.dmi', - slot_r_hand_str = 'icons/mob/items/righthand_hats.dmi', - ) - body_parts_covered = HEAD - slot_flags = SLOT_HEAD - w_class = ITEMSIZE_SMALL - blood_sprite_state = "helmetblood" - - light_system = MOVABLE_LIGHT_DIRECTIONAL - light_cone_y_offset = 11 - - var/light_overlay = "helmet_light" - var/image/helmet_light - - sprite_sheets = list( - SPECIES_TESHARI = 'icons/mob/species/teshari/head.dmi', - SPECIES_VOX = 'icons/mob/species/vox/head.dmi' - ) - drop_sound = 'sound/items/drop/hat.ogg' - pickup_sound = 'sound/items/pickup/hat.ogg' - -/obj/item/clothing/head/attack_self(mob/user) - if(light_range) - if(!isturf(user.loc)) - to_chat(user, "You cannot toggle the light while in this [user.loc]") - return - update_flashlight(user) - to_chat(user, "You [light_on ? "enable" : "disable"] the helmet light.") - else - return ..(user) - -/obj/item/clothing/head/proc/update_flashlight(var/mob/user = null) - set_light_on(!light_on) - - if(light_system == STATIC_LIGHT) - update_light() - - update_icon(user) - user.update_action_buttons() - -/obj/item/clothing/head/attack_ai(var/mob/user) - if(!mob_wear_hat(user)) - return ..() - -/obj/item/clothing/head/attack_generic(var/mob/user) - if(!mob_wear_hat(user)) - return ..() - -/obj/item/clothing/head/proc/mob_wear_hat(var/mob/user) - if(!Adjacent(user)) - return 0 - var/success - if(istype(user, /mob/living/silicon/robot/drone)) - var/mob/living/silicon/robot/drone/D = user - if(D.hat) - success = 2 - else - D.wear_hat(src) - success = 1 - else if(istype(user, /mob/living/carbon/alien/diona)) - var/mob/living/carbon/alien/diona/D = user - if(D.hat) - success = 2 - else - D.wear_hat(src) - success = 1 - - if(!success) - return 0 - else if(success == 2) - to_chat(user, "You are already wearing a hat.") - else if(success == 1) - to_chat(user, "You crawl under \the [src].") - return 1 - -/obj/item/clothing/head/update_icon(var/mob/user) - var/mob/living/carbon/human/H - if(ishuman(user)) - H = user - - if(light_on) - // Generate object icon. - if(!light_overlay_cache["[light_overlay]_icon"]) - light_overlay_cache["[light_overlay]_icon"] = image(icon = 'icons/obj/light_overlays.dmi', icon_state = "[light_overlay]") - helmet_light = light_overlay_cache["[light_overlay]_icon"] - add_overlay(helmet_light) - - // Generate and cache the on-mob icon, which is used in update_inv_head(). - var/body_type = (H && H.species.get_bodytype(H)) - var/cache_key = "[light_overlay][body_type && sprite_sheets[body_type] ? "_[body_type]" : ""]" - if(!light_overlay_cache[cache_key]) - var/use_icon = LAZYACCESS(sprite_sheets,body_type) || 'icons/mob/light_overlays.dmi' - light_overlay_cache[cache_key] = image(icon = use_icon, icon_state = "[light_overlay]") - - else if(helmet_light) - cut_overlay(helmet_light) - helmet_light = null - - user.update_inv_head() //Will redraw the helmet with the light on the mob - -/obj/item/clothing/head/update_clothing_icon() - if (ismob(src.loc)) - var/mob/M = src.loc - M.update_inv_head() - -/////////////////////////////////////////////////////////////////////// -//Mask -/obj/item/clothing/mask - name = "mask" - icon = 'icons/obj/clothing/masks.dmi' - item_icons = list( - slot_l_hand_str = 'icons/mob/items/lefthand_masks.dmi', - slot_r_hand_str = 'icons/mob/items/righthand_masks.dmi', - ) - body_parts_covered = HEAD - slot_flags = SLOT_MASK - body_parts_covered = FACE|EYES - blood_sprite_state = "maskblood" - sprite_sheets = list( - SPECIES_TESHARI = 'icons/mob/species/teshari/masks.dmi', - SPECIES_VOX = 'icons/mob/species/vox/masks.dmi', - SPECIES_TAJ = 'icons/mob/species/tajaran/mask.dmi', - SPECIES_UNATHI = 'icons/mob/species/unathi/mask.dmi', - SPECIES_GREY_YW = 'icons/mob/species/grey/mask.dmi'/*ywedit*/ - ) - - var/voicechange = 0 - var/list/say_messages - var/list/say_verbs - - drop_sound = "generic_drop" - pickup_sound = "generic_pickup" - -/obj/item/clothing/mask/update_clothing_icon() - if (ismob(src.loc)) - var/mob/M = src.loc - M.update_inv_wear_mask() - -/obj/item/clothing/mask/proc/filter_air(datum/gas_mixture/air) - return - -/////////////////////////////////////////////////////////////////////// -//Shoes -/obj/item/clothing/shoes - name = "shoes" - icon = 'icons/obj/clothing/shoes.dmi' - item_icons = list( - slot_l_hand_str = 'icons/mob/items/lefthand_shoes.dmi', - slot_r_hand_str = 'icons/mob/items/righthand_shoes.dmi', - ) - desc = "Comfortable-looking shoes." - gender = PLURAL //Carn: for grammarically correct text-parsing - siemens_coefficient = 0.9 - body_parts_covered = FEET - slot_flags = SLOT_FEET - blood_sprite_state = "shoeblood" - - var/can_hold_knife = 0 - var/obj/item/holding - - var/shoes_under_pants = 0 - - var/water_speed = 0 //Speed boost/decrease in water, lower/negative values mean more speed - var/snow_speed = 0 //Speed boost/decrease on snow, lower/negative values mean more speed - var/rock_climbing = FALSE // If true, allows climbing cliffs with clickdrag. - - var/step_volume_mod = 1 //How quiet or loud footsteps in this shoe are - - permeability_coefficient = 0.50 - slowdown = SHOES_SLOWDOWN - force = 2 - var/overshoes = 0 - species_restricted = list("exclude",SPECIES_TESHARI, SPECIES_VOX) - sprite_sheets = list( - SPECIES_TESHARI = 'icons/mob/species/teshari/shoes.dmi', - SPECIES_VOX = 'icons/mob/species/vox/shoes.dmi' - ) - drop_sound = 'sound/items/drop/shoes.ogg' - pickup_sound = 'sound/items/pickup/shoes.ogg' - -/obj/item/clothing/shoes/proc/draw_knife() - set name = "Draw Boot Knife" - set desc = "Pull out your boot knife." - set category = "IC" - set src in usr - - if(usr.stat || usr.restrained() || usr.incapacitated()) - return - - holding.forceMove(get_turf(usr)) - - if(usr.put_in_hands(holding)) - usr.visible_message("\The [usr] pulls a knife out of their boot!") - playsound(src, 'sound/weapons/holster/sheathout.ogg', 25) - holding = null - cut_overlay("[icon_state]_knife") - else - to_chat(usr, "Your need an empty, unbroken hand to do that.") - holding.forceMove(src) - - if(!holding) - verbs -= /obj/item/clothing/shoes/proc/draw_knife - - update_icon() - return - -/obj/item/clothing/shoes/attack_hand(var/mob/living/M) - if(can_hold_knife == 1 && holding && src.loc == M) - draw_knife() - return - ..() - -/obj/item/clothing/shoes/attackby(var/obj/item/I, var/mob/user) - if((can_hold_knife == 1) && (istype(I, /obj/item/weapon/material/shard) || \ - istype(I, /obj/item/weapon/material/butterfly) || \ - istype(I, /obj/item/weapon/material/kitchen/utensil) || \ - istype(I, /obj/item/weapon/material/knife/tacknife))) - if(holding) - to_chat(user, "\The [src] is already holding \a [holding].") - return - user.unEquip(I) - I.forceMove(src) - holding = I - user.visible_message("\The [user] shoves \the [I] into \the [src].") - verbs |= /obj/item/clothing/shoes/proc/draw_knife - update_icon() - else - return ..() - -/obj/item/clothing/shoes/verb/toggle_layer() - set name = "Switch Shoe Layer" - set category = "Object" - - if(shoes_under_pants == -1) - to_chat(usr, "\The [src] cannot be worn above your suit!") - return - shoes_under_pants = !shoes_under_pants - update_icon() - -/obj/item/clothing/shoes/update_icon() - . = ..() - if(holding) - add_overlay("[icon_state]_knife") - if(contaminated) - add_overlay(contamination_overlay) - if(gurgled) //VOREStation Edit Start - decontaminate() - gurgle_contaminate() //VOREStation Edit End - if(ismob(usr)) - var/mob/M = usr - M.update_inv_shoes() - -/obj/item/clothing/shoes/clean_blood() - update_icon() - return ..() - -/obj/item/clothing/shoes/proc/handle_movement(var/turf/walking, var/running) - if(prob(1) && !recent_squish) //VOREStation edit begin - recent_squish = 1 - spawn(100) - recent_squish = 0 - for(var/mob/living/M in contents) - var/emote = pick(inside_emotes) - to_chat(M,emote) //VOREStation edit end - return - -/obj/item/clothing/shoes/update_clothing_icon() - if (ismob(src.loc)) - var/mob/M = src.loc - M.update_inv_shoes() - - -/////////////////////////////////////////////////////////////////////// -//Suit -/obj/item/clothing/suit - icon = 'icons/obj/clothing/suits.dmi' - item_icons = list( - slot_l_hand_str = 'icons/mob/items/lefthand_suits.dmi', - slot_r_hand_str = 'icons/mob/items/righthand_suits.dmi', - ) - name = "suit" - var/fire_resist = T0C+100 - body_parts_covered = UPPER_TORSO|LOWER_TORSO|ARMS|LEGS - allowed = list(/obj/item/weapon/tank/emergency/oxygen) - armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0) - slot_flags = SLOT_OCLOTHING - var/blood_overlay_type = "suit" - blood_sprite_state = "suitblood" //Defaults to the suit's blood overlay, so that some blood renders instead of no blood. - - var/taurized = FALSE - siemens_coefficient = 0.9 - w_class = ITEMSIZE_NORMAL - preserve_item = 1 - equip_sound = 'sound/items/jumpsuit_equip.ogg' - - - sprite_sheets = list( - SPECIES_TESHARI = 'icons/mob/species/teshari/suit.dmi', - SPECIES_VOX = 'icons/mob/species/vox/suit.dmi' - ) - - valid_accessory_slots = (ACCESSORY_SLOT_OVER | ACCESSORY_SLOT_ARMBAND) - restricted_accessory_slots = (ACCESSORY_SLOT_ARMBAND) - -/obj/item/clothing/suit/set_clothing_index() - ..() - - if(index && !icon_override) - icon = new /icon("icons/obj/clothing/suits_[index].dmi") - item_icons = list( - slot_l_hand_str = new /icon("icons/mob/items/lefthand_suits_[index].dmi"), - slot_r_hand_str = new /icon("icons/mob/items/righthand_suits_[index].dmi"), - ) - - return 1 - - return 0 - -/obj/item/clothing/suit/update_clothing_icon() - if (ismob(src.loc)) - var/mob/M = src.loc - M.update_inv_wear_suit() - - set_clothing_index() - -/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))) - taurize(user) - - return ..() - -/obj/item/clothing/suit/proc/taurize(var/mob/living/carbon/human/Taur) - 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 - taurized = TRUE - - if(!taurized) - icon_override = initial(icon_override) - taurized = FALSE - -// Taur suits need to be shifted so its centered on their taur half. -/obj/item/clothing/suit/make_worn_icon(var/body_type,var/slot_name,var/inhands,var/default_icon,var/default_layer = 0,var/icon/clip_mask) - var/image/standing = ..() - if(taurized) //Special snowflake var on suits - standing.pixel_x = -16 - standing.layer = BODY_LAYER + 15 // 15 is above tail layer, so will not be covered by taurbody. - return standing - -/obj/item/clothing/suit/apply_accessories(var/image/standing) - if(LAZYLEN(accessories) && taurized) - for(var/obj/item/clothing/accessory/A in accessories) - var/image/I = new(A.get_mob_overlay()) - I.pixel_x = 16 //Opposite of the pixel_x on the suit (-16) from taurization to cancel it out and puts the accessory in the correct place on the body. - standing.add_overlay(I) - else - return ..() - - -/////////////////////////////////////////////////////////////////////// -//Under clothing -/obj/item/clothing/under - icon = 'icons/obj/clothing/uniforms.dmi' - item_icons = list( - slot_l_hand_str = 'icons/mob/items/lefthand_uniforms.dmi', - slot_r_hand_str = 'icons/mob/items/righthand_uniforms.dmi', - ) - name = "under" - body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|ARMS - permeability_coefficient = 0.90 - slot_flags = SLOT_ICLOTHING - armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0) - equip_sound = 'sound/items/jumpsuit_equip.ogg' - w_class = ITEMSIZE_NORMAL - show_messages = 1 - blood_sprite_state = "uniformblood" - - var/has_sensor = 1 //For the crew computer 2 = unable to change mode - var/sensor_mode = 0 - /* - 1 = Report living/dead - 2 = Report detailed damages - 3 = Report location - */ - var/displays_id = 1 - var/rolled_down = -1 //0 = unrolled, 1 = rolled, -1 = cannot be toggled - var/rolled_sleeves = -1 //0 = unrolled, 1 = rolled, -1 = cannot be toggled - sprite_sheets = list( - SPECIES_TESHARI = 'icons/mob/species/teshari/uniform.dmi', - SPECIES_VOX = 'icons/mob/species/vox/uniform.dmi', - SPECIES_GREY_YW = 'icons/mob/species/grey/uniform.dmi'/*YWedit*/ - ) - - //convenience var for defining the icon state for the overlay used when the clothing is worn. - //Also used by rolling/unrolling. - var/worn_state = null - valid_accessory_slots = (\ - ACCESSORY_SLOT_UTILITY\ - |ACCESSORY_SLOT_WEAPON\ - |ACCESSORY_SLOT_ARMBAND\ - |ACCESSORY_SLOT_DECOR\ - |ACCESSORY_SLOT_MEDAL\ - |ACCESSORY_SLOT_INSIGNIA\ - |ACCESSORY_SLOT_TIE\ - |ACCESSORY_SLOT_RANK\ - |ACCESSORY_SLOT_DEPT\ - |ACCESSORY_SLOT_OVER) - restricted_accessory_slots = (\ - ACCESSORY_SLOT_UTILITY\ - |ACCESSORY_SLOT_WEAPON\ - |ACCESSORY_SLOT_ARMBAND\ - |ACCESSORY_SLOT_TIE\ - |ACCESSORY_SLOT_RANK\ - |ACCESSORY_SLOT_DEPT\ - |ACCESSORY_SLOT_OVER) - - var/icon/rolled_down_icon = 'icons/mob/uniform_rolled_down.dmi' - var/icon/rolled_down_sleeves_icon = 'icons/mob/uniform_sleeves_rolled.dmi' - -/obj/item/clothing/under/attack_hand(var/mob/user) - if(LAZYLEN(accessories)) - ..() - if ((ishuman(usr) || issmall(usr)) && src.loc == user) - return - ..() - -/obj/item/clothing/under/New() - ..() - if(worn_state) - if(!item_state_slots) - item_state_slots = list() - item_state_slots[slot_w_uniform_str] = worn_state - else - worn_state = icon_state - - //autodetect rollability - if(rolled_down < 0) - if(("[worn_state]_d_s" in cached_icon_states(icon)) || ("[worn_state]_s" in cached_icon_states(rolled_down_icon)) || ("[worn_state]_d_s" in cached_icon_states(icon_override))) - rolled_down = 0 - - if(rolled_down == -1) - verbs -= /obj/item/clothing/under/verb/rollsuit - if(rolled_sleeves == -1) - verbs -= /obj/item/clothing/under/verb/rollsleeves - -/obj/item/clothing/under/set_clothing_index() - ..() - - if(index && !icon_override) - icon = new /icon("icons/obj/clothing/uniforms_[index].dmi") - - item_icons = list( - slot_l_hand_str = new /icon("icons/mob/items/lefthand_uniforms_[index].dmi"), - slot_r_hand_str = new /icon("icons/mob/items/righthand_uniforms_[index].dmi"), - ) - - rolled_down_icon = new /icon("icons/mob/uniform_rolled_down_[index].dmi") - rolled_down_sleeves_icon = new /icon("icons/mob/uniform_sleeves_rolled_[index].dmi") - return 1 - - return 0 - -/obj/item/clothing/under/proc/update_rolldown_status() - var/mob/living/carbon/human/H - if(istype(src.loc, /mob/living/carbon/human)) - H = src.loc - - var/icon/under_icon - if(icon_override) - under_icon = icon_override - else if(H && sprite_sheets && sprite_sheets[H.species.get_bodytype(H)]) - under_icon = sprite_sheets[H.species.get_bodytype(H)] - else if(item_icons && item_icons[slot_w_uniform_str]) - under_icon = item_icons[slot_w_uniform_str] - else if ("[worn_state]_s" in cached_icon_states(rolled_down_icon)) - under_icon = rolled_down_icon - - // The _s is because the icon update procs append it. - if((under_icon == rolled_down_icon && ("[worn_state]_s" in cached_icon_states(under_icon))) || ("[worn_state]_d_s" in cached_icon_states(under_icon))) - if(rolled_down != 1) - rolled_down = 0 - else - rolled_down = -1 - if(H) update_clothing_icon() - -/obj/item/clothing/under/proc/update_rollsleeves_status() - var/mob/living/carbon/human/H - if(istype(src.loc, /mob/living/carbon/human)) - H = src.loc - - var/icon/under_icon - if(icon_override) - under_icon = icon_override - else if(H && sprite_sheets && sprite_sheets[H.species.get_bodytype(H)]) - under_icon = sprite_sheets[H.species.get_bodytype(H)] - else if(item_icons && item_icons[slot_w_uniform_str]) - under_icon = item_icons[slot_w_uniform_str] - else if ("[worn_state]_s" in cached_icon_states(rolled_down_sleeves_icon)) - under_icon = rolled_down_sleeves_icon - else if(index) - under_icon = new /icon("[INV_W_UNIFORM_DEF_ICON]_[index].dmi") - - // The _s is because the icon update procs append it. - if((under_icon == rolled_down_sleeves_icon && ("[worn_state]_s" in cached_icon_states(under_icon))) || ("[worn_state]_r_s" in cached_icon_states(under_icon))) - if(rolled_sleeves != 1) - rolled_sleeves = 0 - else - rolled_sleeves = -1 - if(H) update_clothing_icon() - -/obj/item/clothing/under/update_clothing_icon() - if (ismob(src.loc)) - var/mob/M = src.loc - M.update_inv_w_uniform() - - set_clothing_index() - - -/obj/item/clothing/under/examine(mob/user) - . = ..() - switch(src.sensor_mode) - if(0) - . += "Its sensors appear to be disabled." - if(1) - . += "Its binary life sensors appear to be enabled." - if(2) - . += "Its vital tracker appears to be enabled." - if(3) - . += "Its vital tracker and tracking beacon appear to be enabled." - -/obj/item/clothing/under/proc/set_sensors(mob/usr as mob) - var/mob/M = usr - if (istype(M, /mob/observer)) return - if (usr.stat || usr.restrained()) return - if(has_sensor >= 2) - to_chat(usr, "The controls are locked.") - return 0 - if(has_sensor <= 0) - to_chat(usr, "This suit does not have any sensors.") - return 0 - - var/list/modes = list("Off", "Binary sensors", "Vitals tracker", "Tracking beacon") - var/switchMode = input("Select a sensor mode:", "Suit Sensor Mode", modes[sensor_mode + 1]) in modes - if(get_dist(usr, src) > 1) - to_chat(usr, "You have moved too far away.") - return - sensor_mode = modes.Find(switchMode) - 1 - - if (src.loc == usr) - switch(sensor_mode) - if(0) - usr.visible_message("[usr] adjusts their sensors.", "You disable your suit's remote sensing equipment.") - if(1) - usr.visible_message("[usr] adjusts their sensors.", "Your suit will now report whether you are live or dead.") - if(2) - usr.visible_message("[usr] adjusts their sensors.", "Your suit will now report your vital lifesigns.") - if(3) - usr.visible_message("[usr] adjusts their sensors.", "Your suit will now report your vital lifesigns as well as your coordinate position.") - - else if (istype(src.loc, /mob)) - usr.visible_message("[usr] adjusts [src.loc]'s sensors.", "You adjust [src.loc]'s sensors.") - -/obj/item/clothing/under/verb/toggle() - set name = "Toggle Suit Sensors" - set category = "Object" - set src in usr - set_sensors(usr) - -/obj/item/clothing/under/verb/rollsuit() - set name = "Roll Down Jumpsuit" - set category = "Object" - set src in usr - if(!istype(usr, /mob/living)) return - if(usr.stat) return - - update_rolldown_status() - if(rolled_down == -1) - to_chat(usr, "You cannot roll down [src]!") - return - if((rolled_sleeves == 1) && !(rolled_down)) - rolled_sleeves = 0 - - rolled_down = !rolled_down - if(rolled_down) - body_parts_covered = initial(body_parts_covered) - body_parts_covered &= ~(UPPER_TORSO|ARMS) - if("[worn_state]_s" in cached_icon_states(rolled_down_icon)) - icon_override = rolled_down_icon - item_state_slots[slot_w_uniform_str] = "[worn_state]" - else - item_state_slots[slot_w_uniform_str] = "[worn_state]_d" - - to_chat(usr, "You roll down your [src].") - else - body_parts_covered = initial(body_parts_covered) - if(icon_override == rolled_down_icon) - icon_override = initial(icon_override) - item_state_slots[slot_w_uniform_str] = "[worn_state]" - to_chat(usr, "You roll up your [src].") - update_clothing_icon() - -/obj/item/clothing/under/verb/rollsleeves() - set name = "Roll Up Sleeves" - set category = "Object" - set src in usr - if(!istype(usr, /mob/living)) return - if(usr.stat) return - - update_rollsleeves_status() - if(rolled_sleeves == -1) - to_chat(usr, "You cannot roll up your [src]'s sleeves!") - return - if(rolled_down == 1) - to_chat(usr, "You must roll up your [src] first!") - return - - rolled_sleeves = !rolled_sleeves - if(rolled_sleeves) - body_parts_covered &= ~(ARMS) - if("[worn_state]_s" in cached_icon_states(rolled_down_sleeves_icon)) - icon_override = rolled_down_sleeves_icon - item_state_slots[slot_w_uniform_str] = "[worn_state]" - else - item_state_slots[slot_w_uniform_str] = "[worn_state]_r" - to_chat(usr, "You roll up your [src]'s sleeves.") - else - body_parts_covered = initial(body_parts_covered) - if(icon_override == rolled_down_sleeves_icon) - icon_override = initial(icon_override) - item_state_slots[slot_w_uniform_str] = "[worn_state]" - to_chat(usr, "You roll down your [src]'s sleeves.") - update_clothing_icon() - -/obj/item/clothing/under/rank/New() - sensor_mode = pick(0,1,2,3) - ..() +/obj/item/clothing + name = "clothing" + siemens_coefficient = 0.9 + drop_sound = 'sound/items/drop/clothing.ogg' + pickup_sound = 'sound/items/pickup/clothing.ogg' + var/list/species_restricted = null //Only these species can wear this kit. + var/gunshot_residue //Used by forensics. + + var/list/accessories + var/list/valid_accessory_slots + var/list/restricted_accessory_slots + var/list/starting_accessories + + var/flash_protection = FLASH_PROTECTION_NONE + var/tint = TINT_NONE + var/list/enables_planes //Enables these planes in the wearing mob's plane_holder + var/list/plane_slots //But only if it's equipped into this specific slot + + /* + Sprites used when the clothing item is refit. This is done by setting icon_override. + For best results, if this is set then sprite_sheets should be null and vice versa, but that is by no means necessary. + Ideally, sprite_sheets_refit should be used for "hard" clothing items that can't change shape very well to fit the wearer (e.g. helmets, hardsuits), + while sprite_sheets should be used for "flexible" clothing items that do not need to be refitted (e.g. aliens wearing jumpsuits). + */ + var/list/sprite_sheets_refit = null + var/ear_protection = 0 + var/blood_sprite_state + + var/index //null by default, if set, will change which dmi it uses + + var/update_icon_define = null // Only needed if you've got multiple files for the same type of clothing + + var/polychromic = FALSE //VOREStation edit + +//Updates the icons of the mob wearing the clothing item, if any. +/obj/item/clothing/proc/update_clothing_icon() + return + +// Aurora forensics port. +/obj/item/clothing/clean_blood() + . = ..() + gunshot_residue = null + + +/obj/item/clothing/New() + ..() + if(starting_accessories) + for(var/T in starting_accessories) + var/obj/item/clothing/accessory/tie = new T(src) + src.attach_accessory(null, tie) + set_clothing_index() + + //VOREStation edit start + if(polychromic) + verbs |= /obj/item/clothing/proc/change_color + //VOREStation edit start + +/obj/item/clothing/update_icon() + cut_overlays() //This removes all the overlays on the sprite and then goes down a checklist adding them as required. + if(blood_DNA) + add_blood() + . = ..() + +/obj/item/clothing/equipped(var/mob/user,var/slot) + ..() + if(enables_planes) + user.recalculate_vis() + +/obj/item/clothing/dropped(var/mob/user) + ..() + if(enables_planes) + user.recalculate_vis() + +//BS12: Species-restricted clothing check. +/obj/item/clothing/mob_can_equip(M as mob, slot, disable_warning = FALSE) + + //if we can't equip the item anyway, don't bother with species_restricted (cuts down on spam) + if (!..()) + return 0 + + if(LAZYLEN(species_restricted) && istype(M,/mob/living/carbon/human)) + var/exclusive = null + var/wearable = null + var/mob/living/carbon/human/H = M + + if("exclude" in species_restricted) + exclusive = 1 + + if(H.species) + if(exclusive) + if(!(H.species.get_bodytype(H) in species_restricted)) + wearable = 1 + else + if(H.species.get_bodytype(H) in species_restricted) + wearable = 1 + + if(!wearable && !(slot in list(slot_l_store, slot_r_store, slot_s_store))) + to_chat(H, "Your species cannot wear [src].") + return 0 + return 1 + +/obj/item/clothing/handle_shield(mob/user, var/damage, atom/damage_source = null, mob/attacker = null, var/def_zone = null, var/attack_text = "the attack") + . = ..() + if((. == 0) && LAZYLEN(accessories)) + for(var/obj/item/I in accessories) + var/check = I.handle_shield(user, damage, damage_source, attacker, def_zone, attack_text) + + if(check != 0) // Projectiles sometimes use negatives IIRC, 0 is only returned if something is not blocked. + . = check + break + +// For now, these two temp procs only return TRUE or FALSE if they can provide resistance to a given temperature. +/obj/item/clothing/proc/handle_low_temperature(var/tempcheck = T20C) + . = FALSE + if(LAZYLEN(accessories)) + for(var/obj/item/clothing/C in accessories) + if(C.handle_low_temperature(tempcheck)) + . = TRUE + + if(min_cold_protection_temperature && min_cold_protection_temperature <= tempcheck) + . = TRUE + +/obj/item/clothing/proc/handle_high_temperature(var/tempcheck = T20C) + . = FALSE + if(LAZYLEN(accessories)) + for(var/obj/item/clothing/C in accessories) + if(C.handle_high_temperature(tempcheck)) + . = TRUE + + if(max_heat_protection_temperature && max_heat_protection_temperature >= tempcheck) + . = TRUE + +// Returns the relative flag-vars for covered protection. +/obj/item/clothing/proc/get_cold_protection_flags() + . = cold_protection + + if(LAZYLEN(accessories)) + for(var/obj/item/clothing/C in accessories) + . |= C.get_cold_protection_flags() + +/obj/item/clothing/proc/get_heat_protection_flags() + . = heat_protection + + if(LAZYLEN(accessories)) + for(var/obj/item/clothing/C in accessories) + . |= C.get_heat_protection_flags() + +/obj/item/clothing/proc/refit_for_species(var/target_species) + if(!species_restricted) + return //this item doesn't use the species_restricted system + + //Set species_restricted list + switch(target_species) + //VOREStation Edit Start + if(SPECIES_HUMAN, SPECIES_SKRELL) //humanoid bodytypes + species_restricted = list(SPECIES_HUMAN, SPECIES_SKRELL, SPECIES_RAPALA, SPECIES_VASILISSAN, SPECIES_ALRAUNE, SPECIES_PROMETHEAN, SPECIES_XENOCHIMERA) + if(SPECIES_UNATHI) + species_restricted = list(SPECIES_UNATHI, SPECIES_XENOHYBRID) + if(SPECIES_VULPKANIN) + species_restricted = list(SPECIES_VULPKANIN, SPECIES_ZORREN_HIGH, SPECIES_FENNEC) + if(SPECIES_SERGAL) + species_restricted = list(SPECIES_SERGAL, SPECIES_NEVREAN) + //VOREStation Edit End + else + species_restricted = list(target_species) + + //Set icon + if (sprite_sheets_refit && (target_species in sprite_sheets_refit)) + sprite_sheets[target_species] = sprite_sheets_refit[target_species] + + if (sprite_sheets_obj && (target_species in sprite_sheets_obj)) + icon = sprite_sheets_obj[target_species] + else + icon = initial(icon) + +//VOREStation edit start +/obj/item/clothing/proc/change_color() + set name = "Change Color" + set category = "Object" + set desc = "Change the color of the clothing." + set src in usr + + if(usr.stat || usr.restrained() || usr.incapacitated()) + return + + var/new_color = input(usr, "Pick a new color", "Color", color) as color|null + + if(new_color && (new_color != color)) + color = new_color + update_icon() + update_clothing_icon() +//VOREStation edit end + +/obj/item/clothing/head/helmet/refit_for_species(var/target_species) + if(!species_restricted) + return //this item doesn't use the species_restricted system + + //Set species_restricted list + switch(target_species) + //VOREStation Edit Start + if(SPECIES_HUMAN) + species_restricted = list(SPECIES_HUMAN, SPECIES_RAPALA, SPECIES_VASILISSAN, SPECIES_ALRAUNE, SPECIES_PROMETHEAN, SPECIES_XENOCHIMERA) + if(SPECIES_SKRELL) + species_restricted = list(SPECIES_HUMAN, SPECIES_SKRELL, SPECIES_RAPALA, SPECIES_VASILISSAN, SPECIES_ALRAUNE, SPECIES_PROMETHEAN, SPECIES_XENOCHIMERA) + if(SPECIES_UNATHI) + species_restricted = list(SPECIES_UNATHI, SPECIES_XENOHYBRID) + if(SPECIES_VULPKANIN) + species_restricted = list(SPECIES_VULPKANIN, SPECIES_ZORREN_HIGH, SPECIES_FENNEC) + if(SPECIES_SERGAL) + species_restricted = list(SPECIES_SERGAL, SPECIES_NEVREAN) + //VOREStation Edit End + else + species_restricted = list(target_species) + + //Set icon + if (sprite_sheets_refit && (target_species in sprite_sheets_refit)) + sprite_sheets[target_species] = sprite_sheets_refit[target_species] + + if (sprite_sheets_obj && (target_species in sprite_sheets_obj)) + icon = sprite_sheets_obj[target_species] + else + icon = initial(icon) + +/////////////////////////////////////////////////////////////////////// +// Ears: headsets, earmuffs and tiny objects +/obj/item/clothing/ears + name = "ears" + w_class = ITEMSIZE_TINY + throwforce = 2 + slot_flags = SLOT_EARS + sprite_sheets = list( + SPECIES_TESHARI = 'icons/mob/species/teshari/ears.dmi') + +/obj/item/clothing/ears/attack_hand(mob/user as mob) + if (!user) return + + if (src.loc != user || !istype(user,/mob/living/carbon/human)) + ..() + return + + var/mob/living/carbon/human/H = user + if(H.l_ear != src && H.r_ear != src) + ..() + return + + if(!canremove) + return + + var/obj/item/clothing/ears/O + if(slot_flags & SLOT_TWOEARS ) + O = (H.l_ear == src ? H.r_ear : H.l_ear) + user.u_equip(O) + if(!istype(src,/obj/item/clothing/ears/offear)) + qdel(O) + O = src + else + O = src + + user.unEquip(src) + + if (O) + user.put_in_hands(O) + O.add_fingerprint(user) + + if(istype(src,/obj/item/clothing/ears/offear)) + qdel(src) + +/obj/item/clothing/ears/update_clothing_icon() + if (ismob(src.loc)) + var/mob/M = src.loc + M.update_inv_ears() + +/obj/item/clothing/ears/MouseDrop(var/obj/over_object) + if(ishuman(usr)) + var/mob/living/carbon/human/H = usr + // If this covers both ears, we want to return the result of unequipping the primary object, and kill the off-ear one + if(slot_flags & SLOT_TWOEARS) + var/obj/item/clothing/ears/O = (H.l_ear == src ? H.r_ear : H.l_ear) + if(istype(src, /obj/item/clothing/ears/offear)) + . = O.MouseDrop(over_object) + H.drop_from_inventory(src) + qdel(src) + else + . = ..() + H.drop_from_inventory(O) + qdel(O) + else + . = ..() + + +/obj/item/clothing/ears/offear + name = "Other ear" + w_class = ITEMSIZE_HUGE + icon = 'icons/mob/screen1_Midnight.dmi' + icon_state = "block" + slot_flags = SLOT_EARS | SLOT_TWOEARS + +/obj/item/clothing/ears/offear/New(var/obj/O) + name = O.name + desc = O.desc + icon = O.icon + icon_state = O.icon_state + set_dir(O.dir) + +//////////////////////////////////////////////////////////////////////////////////////// +//Gloves +/obj/item/clothing/gloves + name = "gloves" + item_icons = list( + slot_l_hand_str = 'icons/mob/items/lefthand_gloves.dmi', + slot_r_hand_str = 'icons/mob/items/righthand_gloves.dmi', + ) + gender = PLURAL //Carn: for grammarically correct text-parsing + w_class = ITEMSIZE_SMALL + icon = 'icons/obj/clothing/gloves.dmi' + siemens_coefficient = 0.9 + blood_sprite_state = "bloodyhands" + var/wired = 0 + var/obj/item/weapon/cell/cell = 0 + var/fingerprint_chance = 0 //How likely the glove is to let fingerprints through + var/obj/item/clothing/gloves/ring = null //Covered ring + var/mob/living/carbon/human/wearer = null //Used for covered rings when dropping + var/glove_level = 2 //What "layer" the glove is on + var/overgloves = 0 //Used by gauntlets and arm_guards + var/punch_force = 0 //How much damage do these gloves add to a punch? + var/punch_damtype = BRUTE //What type of damage does this make fists be? + body_parts_covered = HANDS + slot_flags = SLOT_GLOVES + attack_verb = list("challenged") + sprite_sheets = list( + SPECIES_TESHARI = 'icons/mob/species/teshari/gloves.dmi', + SPECIES_VOX = 'icons/mob/species/vox/gloves.dmi' + ) + drop_sound = 'sound/items/drop/gloves.ogg' + pickup_sound = 'sound/items/pickup/gloves.ogg' + +/obj/item/clothing/proc/set_clothing_index() + return + +/obj/item/clothing/gloves/update_clothing_icon() + if (ismob(src.loc)) + var/mob/M = src.loc + M.update_inv_gloves() + +/obj/item/clothing/gloves/emp_act(severity) + if(cell) + cell.emp_act(severity) + if(ring) + ring.emp_act(severity) + ..() + +// Called just before an attack_hand(), in mob/UnarmedAttack() +/obj/item/clothing/gloves/proc/Touch(var/atom/A, var/proximity) + return 0 // return 1 to cancel attack_hand() + +/*/obj/item/clothing/gloves/attackby(obj/item/weapon/W, mob/user) + if(W.is_wirecutter() || istype(W, /obj/item/weapon/scalpel)) + if (clipped) + to_chat(user, "The [src] have already been clipped!") + update_icon() + return + + playsound(src, W.usesound, 50, 1) + user.visible_message("[user] cuts the fingertips off of the [src].","You cut the fingertips off of the [src].") + + clipped = 1 + name = "modified [name]" + desc = "[desc]
They have had the fingertips cut off of them." + if("exclude" in species_restricted) + species_restricted -= SPECIES_UNATHI + species_restricted -= SPECIES_TAJ + return +*/ + +/obj/item/clothing/gloves/clean_blood() + . = ..() + transfer_blood = 0 + update_icon() + +/obj/item/clothing/gloves/mob_can_equip(mob/user, slot, disable_warning = FALSE) + var/mob/living/carbon/human/H = user + + if(slot && slot == slot_gloves) + var/obj/item/clothing/gloves/G = H.gloves + if(istype(G)) + ring = H.gloves + if(ring.glove_level >= src.glove_level) + to_chat(user, "You are unable to wear \the [src] as \the [H.gloves] are in the way.") + ring = null + return 0 + else + H.drop_from_inventory(ring) //Remove the ring (or other under-glove item in the hand slot?) so you can put on the gloves. + ring.forceMove(src) + to_chat(user, "You slip \the [src] on over \the [src.ring].") + if(!(flags & THICKMATERIAL)) + punch_force += ring.punch_force + else + ring = null + + if(!..()) + if(ring) //Put the ring back on if the check fails. + if(H.equip_to_slot_if_possible(ring, slot_gloves)) + src.ring = null + punch_force = initial(punch_force) + return 0 + + wearer = H //TODO clean this when magboots are cleaned + return 1 + +/obj/item/clothing/gloves/dropped() + ..() + + if(!wearer) + return + + var/mob/living/carbon/human/H = wearer + if(ring && istype(H)) + if(!H.equip_to_slot_if_possible(ring, slot_gloves)) + ring.forceMove(get_turf(src)) + src.ring = null + punch_force = initial(punch_force) + wearer = null + +/obj/item/clothing/gloves + var/datum/unarmed_attack/special_attack = null //do the gloves have a special unarmed attack? + var/special_attack_type = null + +/obj/item/clothing/gloves/New() + ..() + if(special_attack_type && ispath(special_attack_type)) + special_attack = new special_attack_type + + + +///////////////////////////////////////////////////////////////////// +//Rings + +/obj/item/clothing/gloves/ring + name = "ring" + w_class = ITEMSIZE_TINY + icon = 'icons/obj/clothing/rings.dmi' + gender = NEUTER + species_restricted = list("exclude", SPECIES_DIONA) + siemens_coefficient = 1 + glove_level = 1 + fingerprint_chance = 100 + punch_force = 2 + body_parts_covered = 0 + drop_sound = 'sound/items/drop/ring.ogg' + pickup_sound = 'sound/items/pickup/ring.ogg' + +/////////////////////////////////////////////////////////////////////// +//Head +/obj/item/clothing/head + name = "head" + icon = 'icons/obj/clothing/hats.dmi' + item_icons = list( + slot_l_hand_str = 'icons/mob/items/lefthand_hats.dmi', + slot_r_hand_str = 'icons/mob/items/righthand_hats.dmi', + ) + body_parts_covered = HEAD + slot_flags = SLOT_HEAD + w_class = ITEMSIZE_SMALL + blood_sprite_state = "helmetblood" + + light_system = MOVABLE_LIGHT_DIRECTIONAL + light_cone_y_offset = 11 + + var/light_overlay = "helmet_light" + var/image/helmet_light + + sprite_sheets = list( + SPECIES_TESHARI = 'icons/mob/species/teshari/head.dmi', + SPECIES_VOX = 'icons/mob/species/vox/head.dmi' + ) + drop_sound = 'sound/items/drop/hat.ogg' + pickup_sound = 'sound/items/pickup/hat.ogg' + +/obj/item/clothing/head/attack_self(mob/user) + if(light_range) + if(!isturf(user.loc)) + to_chat(user, "You cannot toggle the light while in this [user.loc]") + return + update_flashlight(user) + to_chat(user, "You [light_on ? "enable" : "disable"] the helmet light.") + else + return ..(user) + +/obj/item/clothing/head/proc/update_flashlight(var/mob/user = null) + set_light_on(!light_on) + + if(light_system == STATIC_LIGHT) + update_light() + + update_icon(user) + user.update_action_buttons() + +/obj/item/clothing/head/attack_ai(var/mob/user) + if(!mob_wear_hat(user)) + return ..() + +/obj/item/clothing/head/attack_generic(var/mob/user) + if(!mob_wear_hat(user)) + return ..() + +/obj/item/clothing/head/proc/mob_wear_hat(var/mob/user) + if(!Adjacent(user)) + return 0 + var/success + if(istype(user, /mob/living/silicon/robot/drone)) + var/mob/living/silicon/robot/drone/D = user + if(D.hat) + success = 2 + else + D.wear_hat(src) + success = 1 + else if(istype(user, /mob/living/carbon/alien/diona)) + var/mob/living/carbon/alien/diona/D = user + if(D.hat) + success = 2 + else + D.wear_hat(src) + success = 1 + + if(!success) + return 0 + else if(success == 2) + to_chat(user, "You are already wearing a hat.") + else if(success == 1) + to_chat(user, "You crawl under \the [src].") + return 1 + +/obj/item/clothing/head/update_icon(var/mob/user) + var/mob/living/carbon/human/H + if(ishuman(user)) + H = user + + if(light_on) + // Generate object icon. + if(!light_overlay_cache["[light_overlay]_icon"]) + light_overlay_cache["[light_overlay]_icon"] = image(icon = 'icons/obj/light_overlays.dmi', icon_state = "[light_overlay]") + helmet_light = light_overlay_cache["[light_overlay]_icon"] + add_overlay(helmet_light) + + // Generate and cache the on-mob icon, which is used in update_inv_head(). + var/body_type = (H && H.species.get_bodytype(H)) + var/cache_key = "[light_overlay][body_type && sprite_sheets[body_type] ? "_[body_type]" : ""]" + if(!light_overlay_cache[cache_key]) + var/use_icon = LAZYACCESS(sprite_sheets,body_type) || 'icons/mob/light_overlays.dmi' + light_overlay_cache[cache_key] = image(icon = use_icon, icon_state = "[light_overlay]") + + else if(helmet_light) + cut_overlay(helmet_light) + helmet_light = null + + user.update_inv_head() //Will redraw the helmet with the light on the mob + +/obj/item/clothing/head/update_clothing_icon() + if (ismob(src.loc)) + var/mob/M = src.loc + M.update_inv_head() + +/////////////////////////////////////////////////////////////////////// +//Mask +/obj/item/clothing/mask + name = "mask" + icon = 'icons/obj/clothing/masks.dmi' + item_icons = list( + slot_l_hand_str = 'icons/mob/items/lefthand_masks.dmi', + slot_r_hand_str = 'icons/mob/items/righthand_masks.dmi', + ) + body_parts_covered = HEAD + slot_flags = SLOT_MASK + body_parts_covered = FACE|EYES + blood_sprite_state = "maskblood" + sprite_sheets = list( + SPECIES_TESHARI = 'icons/mob/species/teshari/masks.dmi', + SPECIES_VOX = 'icons/mob/species/vox/masks.dmi', + SPECIES_TAJ = 'icons/mob/species/tajaran/mask.dmi', + SPECIES_UNATHI = 'icons/mob/species/unathi/mask.dmi', + SPECIES_GREY_YW = 'icons/mob/species/grey/mask.dmi'/*ywedit*/ + ) + + var/voicechange = 0 + var/list/say_messages + var/list/say_verbs + + drop_sound = "generic_drop" + pickup_sound = "generic_pickup" + +/obj/item/clothing/mask/update_clothing_icon() + if (ismob(src.loc)) + var/mob/M = src.loc + M.update_inv_wear_mask() + +/obj/item/clothing/mask/proc/filter_air(datum/gas_mixture/air) + return + +/////////////////////////////////////////////////////////////////////// +//Shoes +/obj/item/clothing/shoes + name = "shoes" + icon = 'icons/obj/clothing/shoes.dmi' + item_icons = list( + slot_l_hand_str = 'icons/mob/items/lefthand_shoes.dmi', + slot_r_hand_str = 'icons/mob/items/righthand_shoes.dmi', + ) + desc = "Comfortable-looking shoes." + gender = PLURAL //Carn: for grammarically correct text-parsing + siemens_coefficient = 0.9 + body_parts_covered = FEET + slot_flags = SLOT_FEET + blood_sprite_state = "shoeblood" + + var/can_hold_knife = 0 + var/obj/item/holding + + var/shoes_under_pants = 0 + + var/water_speed = 0 //Speed boost/decrease in water, lower/negative values mean more speed + var/snow_speed = 0 //Speed boost/decrease on snow, lower/negative values mean more speed + var/rock_climbing = FALSE // If true, allows climbing cliffs with clickdrag. + + var/step_volume_mod = 1 //How quiet or loud footsteps in this shoe are + + permeability_coefficient = 0.50 + slowdown = SHOES_SLOWDOWN + force = 2 + var/overshoes = 0 + species_restricted = list("exclude",SPECIES_TESHARI, SPECIES_VOX) + sprite_sheets = list( + SPECIES_TESHARI = 'icons/mob/species/teshari/shoes.dmi', + SPECIES_VOX = 'icons/mob/species/vox/shoes.dmi' + ) + drop_sound = 'sound/items/drop/shoes.ogg' + pickup_sound = 'sound/items/pickup/shoes.ogg' + +/obj/item/clothing/shoes/proc/draw_knife() + set name = "Draw Boot Knife" + set desc = "Pull out your boot knife." + set category = "IC" + set src in usr + + if(usr.stat || usr.restrained() || usr.incapacitated()) + return + + holding.forceMove(get_turf(usr)) + + if(usr.put_in_hands(holding)) + usr.visible_message("\The [usr] pulls a knife out of their boot!") + playsound(src, 'sound/weapons/holster/sheathout.ogg', 25) + holding = null + cut_overlay("[icon_state]_knife") + else + to_chat(usr, "Your need an empty, unbroken hand to do that.") + holding.forceMove(src) + + if(!holding) + verbs -= /obj/item/clothing/shoes/proc/draw_knife + + update_icon() + return + +/obj/item/clothing/shoes/attack_hand(var/mob/living/M) + if(can_hold_knife == 1 && holding && src.loc == M) + draw_knife() + return + ..() + +/obj/item/clothing/shoes/attackby(var/obj/item/I, var/mob/user) + if((can_hold_knife == 1) && (istype(I, /obj/item/weapon/material/shard) || \ + istype(I, /obj/item/weapon/material/butterfly) || \ + istype(I, /obj/item/weapon/material/kitchen/utensil) || \ + istype(I, /obj/item/weapon/material/knife/tacknife))) + if(holding) + to_chat(user, "\The [src] is already holding \a [holding].") + return + user.unEquip(I) + I.forceMove(src) + holding = I + user.visible_message("\The [user] shoves \the [I] into \the [src].") + verbs |= /obj/item/clothing/shoes/proc/draw_knife + update_icon() + else + return ..() + +/obj/item/clothing/shoes/verb/toggle_layer() + set name = "Switch Shoe Layer" + set category = "Object" + + if(shoes_under_pants == -1) + to_chat(usr, "\The [src] cannot be worn above your suit!") + return + shoes_under_pants = !shoes_under_pants + update_icon() + +/obj/item/clothing/shoes/update_icon() + . = ..() + if(holding) + add_overlay("[icon_state]_knife") + if(contaminated) + add_overlay(contamination_overlay) + if(gurgled) //VOREStation Edit Start + decontaminate() + gurgle_contaminate() //VOREStation Edit End + if(ismob(usr)) + var/mob/M = usr + M.update_inv_shoes() + +/obj/item/clothing/shoes/clean_blood() + update_icon() + return ..() + +/obj/item/clothing/shoes/proc/handle_movement(var/turf/walking, var/running) + if(prob(1) && !recent_squish) //VOREStation edit begin + recent_squish = 1 + spawn(100) + recent_squish = 0 + for(var/mob/living/M in contents) + var/emote = pick(inside_emotes) + to_chat(M,emote) //VOREStation edit end + return + +/obj/item/clothing/shoes/update_clothing_icon() + if (ismob(src.loc)) + var/mob/M = src.loc + M.update_inv_shoes() + + +/////////////////////////////////////////////////////////////////////// +//Suit +/obj/item/clothing/suit + icon = 'icons/obj/clothing/suits.dmi' + item_icons = list( + slot_l_hand_str = 'icons/mob/items/lefthand_suits.dmi', + slot_r_hand_str = 'icons/mob/items/righthand_suits.dmi', + ) + name = "suit" + var/fire_resist = T0C+100 + body_parts_covered = UPPER_TORSO|LOWER_TORSO|ARMS|LEGS + allowed = list(/obj/item/weapon/tank/emergency/oxygen) + armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0) + slot_flags = SLOT_OCLOTHING + var/blood_overlay_type = "suit" + blood_sprite_state = "suitblood" //Defaults to the suit's blood overlay, so that some blood renders instead of no blood. + + var/taurized = FALSE + siemens_coefficient = 0.9 + w_class = ITEMSIZE_NORMAL + preserve_item = 1 + equip_sound = 'sound/items/jumpsuit_equip.ogg' + + + sprite_sheets = list( + SPECIES_TESHARI = 'icons/mob/species/teshari/suit.dmi', + SPECIES_VOX = 'icons/mob/species/vox/suit.dmi' + ) + + valid_accessory_slots = (ACCESSORY_SLOT_OVER | ACCESSORY_SLOT_ARMBAND) + restricted_accessory_slots = (ACCESSORY_SLOT_ARMBAND) + +/obj/item/clothing/suit/set_clothing_index() + ..() + + if(index && !icon_override) + icon = new /icon("icons/obj/clothing/suits_[index].dmi") + item_icons = list( + slot_l_hand_str = new /icon("icons/mob/items/lefthand_suits_[index].dmi"), + slot_r_hand_str = new /icon("icons/mob/items/righthand_suits_[index].dmi"), + ) + + return 1 + + return 0 + +/obj/item/clothing/suit/update_clothing_icon() + if (ismob(src.loc)) + var/mob/M = src.loc + M.update_inv_wear_suit() + + set_clothing_index() + +/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))) + taurize(user) + + return ..() + +/obj/item/clothing/suit/proc/taurize(var/mob/living/carbon/human/Taur) + 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 + taurized = TRUE + + if(!taurized) + icon_override = initial(icon_override) + taurized = FALSE + +// Taur suits need to be shifted so its centered on their taur half. +/obj/item/clothing/suit/make_worn_icon(var/body_type,var/slot_name,var/inhands,var/default_icon,var/default_layer = 0,var/icon/clip_mask) + var/image/standing = ..() + if(taurized) //Special snowflake var on suits + standing.pixel_x = -16 + standing.layer = BODY_LAYER + 15 // 15 is above tail layer, so will not be covered by taurbody. + return standing + +/obj/item/clothing/suit/apply_accessories(var/image/standing) + if(LAZYLEN(accessories) && taurized) + for(var/obj/item/clothing/accessory/A in accessories) + var/image/I = new(A.get_mob_overlay()) + I.pixel_x = 16 //Opposite of the pixel_x on the suit (-16) from taurization to cancel it out and puts the accessory in the correct place on the body. + standing.add_overlay(I) + else + return ..() + + +/////////////////////////////////////////////////////////////////////// +//Under clothing +/obj/item/clothing/under + icon = 'icons/obj/clothing/uniforms.dmi' + item_icons = list( + slot_l_hand_str = 'icons/mob/items/lefthand_uniforms.dmi', + slot_r_hand_str = 'icons/mob/items/righthand_uniforms.dmi', + ) + name = "under" + body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|ARMS + permeability_coefficient = 0.90 + slot_flags = SLOT_ICLOTHING + armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0) + equip_sound = 'sound/items/jumpsuit_equip.ogg' + w_class = ITEMSIZE_NORMAL + show_messages = 1 + blood_sprite_state = "uniformblood" + + var/has_sensor = 1 //For the crew computer 2 = unable to change mode + var/sensor_mode = 0 + /* + 1 = Report living/dead + 2 = Report detailed damages + 3 = Report location + */ + var/displays_id = 1 + var/rolled_down = -1 //0 = unrolled, 1 = rolled, -1 = cannot be toggled + var/rolled_sleeves = -1 //0 = unrolled, 1 = rolled, -1 = cannot be toggled + sprite_sheets = list( + SPECIES_TESHARI = 'icons/mob/species/teshari/uniform.dmi', + SPECIES_VOX = 'icons/mob/species/vox/uniform.dmi', + SPECIES_GREY_YW = 'icons/mob/species/grey/uniform.dmi'/*YWedit*/ + ) + + //convenience var for defining the icon state for the overlay used when the clothing is worn. + //Also used by rolling/unrolling. + var/worn_state = null + valid_accessory_slots = (\ + ACCESSORY_SLOT_UTILITY\ + |ACCESSORY_SLOT_WEAPON\ + |ACCESSORY_SLOT_ARMBAND\ + |ACCESSORY_SLOT_DECOR\ + |ACCESSORY_SLOT_MEDAL\ + |ACCESSORY_SLOT_INSIGNIA\ + |ACCESSORY_SLOT_TIE\ + |ACCESSORY_SLOT_RANK\ + |ACCESSORY_SLOT_DEPT\ + |ACCESSORY_SLOT_OVER) + restricted_accessory_slots = (\ + ACCESSORY_SLOT_UTILITY\ + |ACCESSORY_SLOT_WEAPON\ + |ACCESSORY_SLOT_ARMBAND\ + |ACCESSORY_SLOT_TIE\ + |ACCESSORY_SLOT_RANK\ + |ACCESSORY_SLOT_DEPT\ + |ACCESSORY_SLOT_OVER) + + var/icon/rolled_down_icon = 'icons/mob/uniform_rolled_down.dmi' + var/icon/rolled_down_sleeves_icon = 'icons/mob/uniform_sleeves_rolled.dmi' + +/obj/item/clothing/under/attack_hand(var/mob/user) + if(LAZYLEN(accessories)) + ..() + if ((ishuman(usr) || issmall(usr)) && src.loc == user) + return + ..() + +/obj/item/clothing/under/New() + ..() + if(worn_state) + if(!item_state_slots) + item_state_slots = list() + item_state_slots[slot_w_uniform_str] = worn_state + else + worn_state = icon_state + + //autodetect rollability + if(rolled_down < 0) + if(("[worn_state]_d_s" in cached_icon_states(icon)) || ("[worn_state]_s" in cached_icon_states(rolled_down_icon)) || ("[worn_state]_d_s" in cached_icon_states(icon_override))) + rolled_down = 0 + + if(rolled_down == -1) + verbs -= /obj/item/clothing/under/verb/rollsuit + if(rolled_sleeves == -1) + verbs -= /obj/item/clothing/under/verb/rollsleeves + +/obj/item/clothing/under/set_clothing_index() + ..() + + if(index && !icon_override) + icon = new /icon("icons/obj/clothing/uniforms_[index].dmi") + + item_icons = list( + slot_l_hand_str = new /icon("icons/mob/items/lefthand_uniforms_[index].dmi"), + slot_r_hand_str = new /icon("icons/mob/items/righthand_uniforms_[index].dmi"), + ) + + rolled_down_icon = new /icon("icons/mob/uniform_rolled_down_[index].dmi") + rolled_down_sleeves_icon = new /icon("icons/mob/uniform_sleeves_rolled_[index].dmi") + return 1 + + return 0 + +/obj/item/clothing/under/proc/update_rolldown_status() + var/mob/living/carbon/human/H + if(istype(src.loc, /mob/living/carbon/human)) + H = src.loc + + var/icon/under_icon + if(icon_override) + under_icon = icon_override + else if(H && sprite_sheets && sprite_sheets[H.species.get_bodytype(H)]) + under_icon = sprite_sheets[H.species.get_bodytype(H)] + else if(item_icons && item_icons[slot_w_uniform_str]) + under_icon = item_icons[slot_w_uniform_str] + else if ("[worn_state]_s" in cached_icon_states(rolled_down_icon)) + under_icon = rolled_down_icon + + // The _s is because the icon update procs append it. + if((under_icon == rolled_down_icon && ("[worn_state]_s" in cached_icon_states(under_icon))) || ("[worn_state]_d_s" in cached_icon_states(under_icon))) + if(rolled_down != 1) + rolled_down = 0 + else + rolled_down = -1 + if(H) update_clothing_icon() + +/obj/item/clothing/under/proc/update_rollsleeves_status() + var/mob/living/carbon/human/H + if(istype(src.loc, /mob/living/carbon/human)) + H = src.loc + + var/icon/under_icon + if(icon_override) + under_icon = icon_override + else if(H && sprite_sheets && sprite_sheets[H.species.get_bodytype(H)]) + under_icon = sprite_sheets[H.species.get_bodytype(H)] + else if(item_icons && item_icons[slot_w_uniform_str]) + under_icon = item_icons[slot_w_uniform_str] + else if ("[worn_state]_s" in cached_icon_states(rolled_down_sleeves_icon)) + under_icon = rolled_down_sleeves_icon + else if(index) + under_icon = new /icon("[INV_W_UNIFORM_DEF_ICON]_[index].dmi") + + // The _s is because the icon update procs append it. + if((under_icon == rolled_down_sleeves_icon && ("[worn_state]_s" in cached_icon_states(under_icon))) || ("[worn_state]_r_s" in cached_icon_states(under_icon))) + if(rolled_sleeves != 1) + rolled_sleeves = 0 + else + rolled_sleeves = -1 + if(H) update_clothing_icon() + +/obj/item/clothing/under/update_clothing_icon() + if (ismob(src.loc)) + var/mob/M = src.loc + M.update_inv_w_uniform() + + set_clothing_index() + + +/obj/item/clothing/under/examine(mob/user) + . = ..() + switch(src.sensor_mode) + if(0) + . += "Its sensors appear to be disabled." + if(1) + . += "Its binary life sensors appear to be enabled." + if(2) + . += "Its vital tracker appears to be enabled." + if(3) + . += "Its vital tracker and tracking beacon appear to be enabled." + +/obj/item/clothing/under/proc/set_sensors(mob/usr as mob) + var/mob/M = usr + if (istype(M, /mob/observer)) return + if (usr.stat || usr.restrained()) return + if(has_sensor >= 2) + to_chat(usr, "The controls are locked.") + return 0 + if(has_sensor <= 0) + to_chat(usr, "This suit does not have any sensors.") + return 0 + + var/list/modes = list("Off", "Binary sensors", "Vitals tracker", "Tracking beacon") + var/switchMode = input("Select a sensor mode:", "Suit Sensor Mode", modes[sensor_mode + 1]) in modes + if(get_dist(usr, src) > 1) + to_chat(usr, "You have moved too far away.") + return + sensor_mode = modes.Find(switchMode) - 1 + + if (src.loc == usr) + switch(sensor_mode) + if(0) + usr.visible_message("[usr] adjusts their sensors.", "You disable your suit's remote sensing equipment.") + if(1) + usr.visible_message("[usr] adjusts their sensors.", "Your suit will now report whether you are live or dead.") + if(2) + usr.visible_message("[usr] adjusts their sensors.", "Your suit will now report your vital lifesigns.") + if(3) + usr.visible_message("[usr] adjusts their sensors.", "Your suit will now report your vital lifesigns as well as your coordinate position.") + + else if (istype(src.loc, /mob)) + usr.visible_message("[usr] adjusts [src.loc]'s sensors.", "You adjust [src.loc]'s sensors.") + +/obj/item/clothing/under/verb/toggle() + set name = "Toggle Suit Sensors" + set category = "Object" + set src in usr + set_sensors(usr) + +/obj/item/clothing/under/verb/rollsuit() + set name = "Roll Down Jumpsuit" + set category = "Object" + set src in usr + if(!istype(usr, /mob/living)) return + if(usr.stat) return + + update_rolldown_status() + if(rolled_down == -1) + to_chat(usr, "You cannot roll down [src]!") + return + if((rolled_sleeves == 1) && !(rolled_down)) + rolled_sleeves = 0 + + rolled_down = !rolled_down + if(rolled_down) + body_parts_covered = initial(body_parts_covered) + body_parts_covered &= ~(UPPER_TORSO|ARMS) + if("[worn_state]_s" in cached_icon_states(rolled_down_icon)) + icon_override = rolled_down_icon + item_state_slots[slot_w_uniform_str] = "[worn_state]" + else + item_state_slots[slot_w_uniform_str] = "[worn_state]_d" + + to_chat(usr, "You roll down your [src].") + else + body_parts_covered = initial(body_parts_covered) + if(icon_override == rolled_down_icon) + icon_override = initial(icon_override) + item_state_slots[slot_w_uniform_str] = "[worn_state]" + to_chat(usr, "You roll up your [src].") + update_clothing_icon() + +/obj/item/clothing/under/verb/rollsleeves() + set name = "Roll Up Sleeves" + set category = "Object" + set src in usr + if(!istype(usr, /mob/living)) return + if(usr.stat) return + + update_rollsleeves_status() + if(rolled_sleeves == -1) + to_chat(usr, "You cannot roll up your [src]'s sleeves!") + return + if(rolled_down == 1) + to_chat(usr, "You must roll up your [src] first!") + return + + rolled_sleeves = !rolled_sleeves + if(rolled_sleeves) + body_parts_covered &= ~(ARMS) + if("[worn_state]_s" in cached_icon_states(rolled_down_sleeves_icon)) + icon_override = rolled_down_sleeves_icon + item_state_slots[slot_w_uniform_str] = "[worn_state]" + else + item_state_slots[slot_w_uniform_str] = "[worn_state]_r" + to_chat(usr, "You roll up your [src]'s sleeves.") + else + body_parts_covered = initial(body_parts_covered) + if(icon_override == rolled_down_sleeves_icon) + icon_override = initial(icon_override) + item_state_slots[slot_w_uniform_str] = "[worn_state]" + to_chat(usr, "You roll down your [src]'s sleeves.") + update_clothing_icon() + +/obj/item/clothing/under/rank/New() + sensor_mode = pick(0,1,2,3) + ..() diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm index c806371e60..5d7b1d8abc 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/glasses/hud_vr.dm b/code/modules/clothing/glasses/hud_vr.dm index 9efb686731..c5ea5d5044 100644 --- a/code/modules/clothing/glasses/hud_vr.dm +++ b/code/modules/clothing/glasses/hud_vr.dm @@ -135,10 +135,10 @@ tgarscreen_path = /datum/tgui_module/crew_monitor/glasses enables_planes = list(VIS_CH_ID,VIS_CH_HEALTH_VR,VIS_CH_STATUS_R,VIS_CH_BACKUP,VIS_AUGMENTED) - ar_interact(var/mob/living/carbon/human/user) - if(tgarscreen) - tgarscreen.tgui_interact(user) - return 1 +/obj/item/clothing/glasses/omnihud/med/ar_interact(var/mob/living/carbon/human/user) + if(tgarscreen) + tgarscreen.tgui_interact(user) + return 1 /obj/item/clothing/glasses/omnihud/sec name = "\improper AR-S glasses" @@ -151,10 +151,10 @@ tgarscreen_path = /datum/tgui_module/alarm_monitor/security/glasses enables_planes = list(VIS_CH_ID,VIS_CH_HEALTH_VR,VIS_CH_WANTED,VIS_AUGMENTED) - ar_interact(var/mob/living/carbon/human/user) - if(tgarscreen) - tgarscreen.tgui_interact(user) - return 1 +/obj/item/clothing/glasses/omnihud/sec/ar_interact(var/mob/living/carbon/human/user) + if(tgarscreen) + tgarscreen.tgui_interact(user) + return 1 /obj/item/clothing/glasses/omnihud/eng name = "\improper AR-E glasses" @@ -166,10 +166,10 @@ action_button_name = "AR Console (Station Alerts)" tgarscreen_path = /datum/tgui_module/alarm_monitor/engineering/glasses - ar_interact(var/mob/living/carbon/human/user) - if(tgarscreen) - tgarscreen.tgui_interact(user) - return 1 +/obj/item/clothing/glasses/omnihud/eng/ar_interact(var/mob/living/carbon/human/user) + if(tgarscreen) + tgarscreen.tgui_interact(user) + return 1 /obj/item/clothing/glasses/omnihud/rnd name = "\improper AR-R glasses" @@ -226,10 +226,10 @@ action_button_name = "AR Console (All Alerts)" tgarscreen_path = /datum/tgui_module/alarm_monitor/all/glasses - ar_interact(var/mob/living/carbon/human/user) - if(tgarscreen) - tgarscreen.tgui_interact(user) - return 1 +/obj/item/clothing/glasses/omnihud/all/ar_interact(var/mob/living/carbon/human/user) + if(tgarscreen) + tgarscreen.tgui_interact(user) + return 1 /obj/item/clothing/glasses/hud/security/eyepatch name = "Security Hudpatch" diff --git a/code/modules/clothing/gloves/color.dm b/code/modules/clothing/gloves/color.dm index a9cec00a5f..aa0f8055f5 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 dbb5f6d939..f2465ab58c 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/head/misc_vr.dm b/code/modules/clothing/head/misc_vr.dm index 0b63416887..991afd077e 100644 --- a/code/modules/clothing/head/misc_vr.dm +++ b/code/modules/clothing/head/misc_vr.dm @@ -114,7 +114,7 @@ icon_state = "talon_captain_cap" item_state = "taloncaptaincap" -obj/item/clothing/head/beret/talon +/obj/item/clothing/head/beret/talon name = "ITV beret" desc = "It's a basic baret colored to match ITV's uniforms." icon = 'icons/obj/clothing/hats_vr.dmi' @@ -122,7 +122,7 @@ obj/item/clothing/head/beret/talon icon_state = "beret_talon" item_state = "baret_talon" -obj/item/clothing/head/beret/talon/command +/obj/item/clothing/head/beret/talon/command name = "ITV officer beret" desc = "It's a basic baret colored to match ITV's uniforms with a badge pinned on the front. Perfect for commanders." icon = 'icons/obj/clothing/hats_vr.dmi' 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/suits/armor_vr.dm b/code/modules/clothing/suits/armor_vr.dm index f14e05dcf8..ba7afecefb 100644 --- a/code/modules/clothing/suits/armor_vr.dm +++ b/code/modules/clothing/suits/armor_vr.dm @@ -19,13 +19,13 @@ icon = 'icons/mob/taursuits_wolf_vr.dmi' icon_state = "wolf_item" item_state = "heavy_wolf_armor" - mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = 0) - if(..()) - if(istype(H) && istype(H.tail_style, /datum/sprite_accessory/tail/taur/wolf)) - return ..() - else - to_chat(H,"You need to have a wolf-taur half to wear this.") - return 0 +/obj/item/clothing/suit/armor/vest/wolftaur/mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = 0) + if(..()) + if(istype(H) && istype(H.tail_style, /datum/sprite_accessory/tail/taur/wolf)) + return ..() + else + to_chat(H,"You need to have a wolf-taur half to wear this.") + return 0 // HoS armor improved by Vorestation to be slightly better than normal security stuff. /obj/item/clothing/suit/storage/vest/hoscoat diff --git a/code/modules/clothing/suits/miscellaneous.dm b/code/modules/clothing/suits/miscellaneous.dm index 07853ca79d..0e80d23cb4 100644 --- a/code/modules/clothing/suits/miscellaneous.dm +++ b/code/modules/clothing/suits/miscellaneous.dm @@ -268,13 +268,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/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 he’s 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 clones’s school photo.",\ - "Clone accused of stealing other clones’s 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 d84132ca86..c67ddac088 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_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/events/viral_infection.dm b/code/modules/events/viral_infection.dm index c1fc054a3a..9be0589077 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 da620aca6f..f03580dde0 100644 --- a/code/modules/flufftext/Dreaming.dm +++ b/code/modules/flufftext/Dreaming.dm @@ -22,7 +22,7 @@ var/list/dreams = list( "swallowed whole","a fox","a wolf","a cat","a tiger","a dog","a taur","a xenochimera" ) -mob/living/carbon/proc/dream() +/mob/living/carbon/proc/dream() dreaming = 1 spawn(0) @@ -35,8 +35,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/drinkingglass/metaglass_vr.dm b/code/modules/food/drinkingglass/metaglass_vr.dm index a718acf86d..06abdba8c1 100644 --- a/code/modules/food/drinkingglass/metaglass_vr.dm +++ b/code/modules/food/drinkingglass/metaglass_vr.dm @@ -118,8 +118,8 @@ glass_center_of_mass = list("x"=16, "y"=8) glass_icon_file = 'icons/obj/drinks_vr.dmi' -/datum/reagent/ethanol/pink_moo - glass_icon_state = "pinkmooglass" +/datum/reagent/ethanol/pink_russian + glass_icon_state = "pinkrussianglass" glass_center_of_mass = list("x"=16, "y"=9) glass_icon_file = 'icons/obj/drinks_vr.dmi' 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 85e8de0705..b818663d86 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() cut_overlays() + 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() - add_overlay(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() + add_overlay(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 2f70dd9bee..d6779781b5 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) @@ -175,32 +175,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.cut_overlays() - U.loaded = "[src]" - var/image/I = new(U.icon, "loadedfood") - I.color = src.filling_color - U.add_overlay(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)) @@ -277,15 +271,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. @@ -299,12 +293,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" @@ -312,11 +306,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" @@ -327,11 +321,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" @@ -341,12 +335,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" @@ -379,12 +373,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" @@ -401,12 +395,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" @@ -420,15 +414,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) @@ -460,12 +454,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" @@ -479,12 +473,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" @@ -498,12 +492,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" @@ -517,12 +511,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" @@ -602,13 +596,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" @@ -627,12 +621,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" @@ -642,10 +636,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" @@ -655,11 +646,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" @@ -669,9 +660,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 @@ -680,6 +668,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 @@ -688,7 +677,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." @@ -711,11 +699,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" @@ -723,11 +711,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" @@ -737,11 +725,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" @@ -751,10 +739,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" @@ -762,12 +747,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" @@ -775,12 +760,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" @@ -788,12 +773,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" @@ -801,11 +786,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" @@ -813,11 +798,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" @@ -826,23 +811,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() @@ -877,12 +860,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" @@ -892,9 +875,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 @@ -907,11 +887,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" @@ -933,11 +913,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" @@ -945,11 +925,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" @@ -959,9 +939,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 @@ -972,9 +949,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 @@ -984,9 +958,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 @@ -995,11 +966,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" @@ -1009,23 +980,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 @@ -1035,11 +1000,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" @@ -1049,10 +1014,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 @@ -1065,11 +1026,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) . = ..() @@ -1085,9 +1046,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() @@ -1107,9 +1065,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 @@ -1121,9 +1076,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 @@ -1133,11 +1085,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" @@ -1148,9 +1100,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 @@ -1160,11 +1109,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" @@ -1175,9 +1124,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 @@ -1188,12 +1134,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" @@ -1203,17 +1149,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" @@ -1222,11 +1166,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" @@ -1235,11 +1179,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" @@ -1248,11 +1192,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" @@ -1261,11 +1205,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" @@ -1273,15 +1217,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!" @@ -1291,12 +1231,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" @@ -1308,12 +1248,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? @@ -1329,11 +1269,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" @@ -1344,9 +1284,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 @@ -1358,11 +1295,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" @@ -1373,11 +1310,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" @@ -1385,12 +1322,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" @@ -1401,9 +1338,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 @@ -1414,9 +1348,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 @@ -1428,11 +1359,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" @@ -1442,9 +1373,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 @@ -1453,12 +1381,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" @@ -1515,9 +1443,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 @@ -1622,25 +1547,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) @@ -1649,10 +1574,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) @@ -1795,9 +1720,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 @@ -1978,9 +1900,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() @@ -1999,9 +1918,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() @@ -2034,9 +1950,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 @@ -2048,9 +1961,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 @@ -2062,9 +1972,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 @@ -2076,9 +1983,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 @@ -2177,9 +2081,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 @@ -2190,9 +2091,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 @@ -2203,9 +2101,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 @@ -2217,9 +2112,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 @@ -2231,9 +2123,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() @@ -2305,9 +2194,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 @@ -2325,9 +2211,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" @@ -2366,9 +2250,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 @@ -2448,11 +2329,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" @@ -2477,11 +2358,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" @@ -2507,11 +2388,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" @@ -2536,9 +2417,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 @@ -2624,11 +2502,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" @@ -2653,11 +2531,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" @@ -2805,11 +2683,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" @@ -2829,11 +2707,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" @@ -2858,9 +2736,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 @@ -2887,11 +2762,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" @@ -2991,12 +2866,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" @@ -3050,12 +2925,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" @@ -3078,11 +2953,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" @@ -3134,13 +3009,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" @@ -3351,11 +3226,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" @@ -3386,12 +3261,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" @@ -3405,9 +3281,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." @@ -3418,9 +3291,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)) @@ -3474,9 +3344,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!" @@ -3555,9 +3422,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)) @@ -3581,9 +3445,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." @@ -3594,9 +3455,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." @@ -3724,9 +3582,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 @@ -3740,9 +3595,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 @@ -3769,11 +3621,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" @@ -3781,11 +3633,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" @@ -3794,9 +3647,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 @@ -3806,9 +3656,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 @@ -3819,10 +3666,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() @@ -3841,21 +3684,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" @@ -3865,12 +3702,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" @@ -3884,7 +3720,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 @@ -3894,10 +3729,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 @@ -3907,10 +3738,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 @@ -3918,13 +3745,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 @@ -3935,23 +3761,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 @@ -3964,7 +3785,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 @@ -3977,7 +3797,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 @@ -3986,25 +3805,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" @@ -4072,63 +3877,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!" @@ -4404,9 +4192,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 @@ -4419,9 +4204,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 @@ -4459,12 +4241,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" @@ -5156,11 +4938,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" @@ -5168,12 +4950,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" @@ -5195,12 +4976,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" @@ -5329,11 +5109,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" @@ -5346,12 +5126,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" @@ -5364,11 +5144,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" @@ -5377,11 +5157,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" @@ -5394,6 +5174,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() . = ..() @@ -5401,7 +5182,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" @@ -5413,6 +5193,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() . = ..() @@ -5421,7 +5202,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" @@ -5433,11 +5213,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" @@ -5450,11 +5230,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" @@ -5467,9 +5247,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 @@ -5481,11 +5258,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" @@ -5497,12 +5274,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" @@ -5515,12 +5292,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" @@ -5531,11 +5308,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" @@ -5548,11 +5325,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" @@ -5563,10 +5340,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 @@ -5578,11 +5355,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" @@ -5593,11 +5370,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" @@ -5610,11 +5387,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" @@ -5627,11 +5404,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" @@ -5644,11 +5421,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" @@ -5661,9 +5438,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 @@ -5676,9 +5450,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 @@ -5691,12 +5462,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" @@ -5708,6 +5479,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() . = ..() @@ -5715,7 +5487,6 @@ reagents.add_reagent("triglyceride", 2) reagents.add_reagent("blackpepper", 1) reagents.add_reagent("honey", 5) - bitesize = 4 //Sliceables @@ -5796,11 +5567,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" @@ -5833,6 +5604,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() . = ..() @@ -5841,7 +5613,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" @@ -5878,12 +5649,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." @@ -5902,14 +5671,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" @@ -5927,15 +5697,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" @@ -5952,12 +5723,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 @@ -5968,8 +5740,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 @@ -5979,12 +5751,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 @@ -5995,8 +5768,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 @@ -6005,10 +5778,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 @@ -6025,10 +5796,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/////////////////////////////////////////////////////////////// @@ -6109,12 +5878,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" @@ -6124,16 +5893,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" @@ -6145,9 +5910,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 @@ -6157,14 +5919,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)/////////////////////////////////////////////////////////////// @@ -6178,11 +5939,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" @@ -6194,11 +5955,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" @@ -6210,11 +5971,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" @@ -6226,11 +5987,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" @@ -6242,11 +6003,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" @@ -6258,11 +6019,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" @@ -6274,11 +6035,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" @@ -6290,11 +6051,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" @@ -6306,12 +6067,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" @@ -6323,10 +6084,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) @@ -6343,9 +6104,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 @@ -6369,9 +6127,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 @@ -6385,9 +6140,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 @@ -6536,10 +6288,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' @@ -6565,9 +6313,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 @@ -6931,13 +6676,9 @@ filling_color = "#ff6633" center_of_mass = list("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" @@ -6964,12 +6705,12 @@ trash = /obj/item/trash/spinach filling_color = "#003300" center_of_mass = list("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) @@ -7080,13 +6821,10 @@ //trash = /obj/item/trash/lunacakewrap //need to add code that drops trash but keeps -open state filling_color = "#ffffff" center_of_mass = list("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" @@ -7094,13 +6832,10 @@ //trash = /obj/item/trash/mooncakewrap //need to add code that drops trash but keeps -open state filling_color = "#ffffff" center_of_mass = list("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" @@ -7108,13 +6843,10 @@ //trash = /obj/item/trash/mochicakewrap //need to add code that drops trash but keeps -open state filling_color = "#ffffff" center_of_mass = list("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 @@ -7126,6 +6858,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 @@ -7141,13 +6874,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' @@ -7156,6 +6886,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 @@ -7171,13 +6902,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/kitchen/icecream.dm b/code/modules/food/kitchen/icecream.dm index 02335c8a9e..9887bc7bd7 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 9680444dab..8e553bf532 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 6780a72fe4..a84e4cae1b 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 4766f5c1ef..35d7ee2fef 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/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/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 4454ea3a1a..3de7d81ced 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/lighting/lighting_source.dm b/code/modules/lighting/lighting_source.dm index 4f863bf34a..df60dc7ca8 100644 --- a/code/modules/lighting/lighting_source.dm +++ b/code/modules/lighting/lighting_source.dm @@ -371,5 +371,4 @@ #undef LUM_FALLOFF #undef REMOVE_CORNER #undef APPLY_CORNER -#undef REMOVE_CORNER_SIMPLE #undef APPLY_CORNER_SIMPLE \ No newline at end of file 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/blank_vr.dm b/code/modules/mob/living/carbon/human/species/station/blank_vr.dm index 72e49694d3..57b83fddcb 100644 --- a/code/modules/mob/living/carbon/human/species/station/blank_vr.dm +++ b/code/modules/mob/living/carbon/human/species/station/blank_vr.dm @@ -56,7 +56,8 @@ //Called when face-down in the water or otherwise over their head. // Return: TRUE for able to breathe fine in water. /datum/species/custom/can_breathe_water() - return ..() + return /datum/trait/positive/water_breather in traits + //Called during handle_environment in Life() ticks. // Return: Not used. @@ -64,19 +65,18 @@ return ..() //Called when spawning to equip them with special things. -/datum/species/custom/equip_survival_gear(var/mob/living/carbon/human/H) - /* Example, from Vox: - H.equip_to_slot_or_del(new /obj/item/clothing/mask/breath(H), slot_wear_mask) - if(H.backbag == 1) - H.equip_to_slot_or_del(new /obj/item/weapon/tank/vox(H), slot_back) - H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/vox(H), slot_r_hand) - H.internal = H.back - else - H.equip_to_slot_or_del(new /obj/item/weapon/tank/vox(H), slot_r_hand) - H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/vox(H.back), slot_in_backpack) - H.internal = H.r_hand - H.internal = locate(/obj/item/weapon/tank) in H.contents - if(istype(H.internal,/obj/item/weapon/tank) && H.internals) - H.internals.icon_state = "internal1" - */ - return ..() +/datum/species/custom/equip_survival_gear(var/mob/living/carbon/human/H, var/extendedtank = 0, var/comprehensive = 0) + . = ..() + if(breath_type != "oxygen") + H.equip_to_slot_or_del(new /obj/item/clothing/mask/breath(H), slot_wear_mask) + var/obj/item/weapon/tank/tankpath + if(breath_type == "phoron") + tankpath = /obj/item/weapon/tank/vox + else + tankpath = text2path("/obj/item/weapon/tank/" + breath_type) + + if(tankpath) + H.equip_to_slot_or_del(new tankpath(H), slot_r_hand) + H.internal = H.r_hand + if(istype(H.internal,/obj/item/weapon/tank) && H.internals) + H.internals.icon_state = "internal1" 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 9cc2d0ef73..db708a5cde 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 @@ -338,7 +338,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/station/station_vr.dm b/code/modules/mob/living/carbon/human/species/station/station_vr.dm index bb14babd1a..e098e172fc 100644 --- a/code/modules/mob/living/carbon/human/species/station/station_vr.dm +++ b/code/modules/mob/living/carbon/human/species/station/station_vr.dm @@ -337,7 +337,7 @@ ) wikilink="https://yawn.izac.live/Vox" -datum/species/harpy +/datum/species/harpy name = SPECIES_RAPALA name_plural = "Rapalans" icobase = 'icons/mob/human_races/r_harpy_vr.dmi' diff --git a/code/modules/mob/living/carbon/human/species/station/traits_vr/negative.dm b/code/modules/mob/living/carbon/human/species/station/traits_vr/negative.dm index 1b6f6c8dd5..ba79546d02 100644 --- a/code/modules/mob/living/carbon/human/species/station/traits_vr/negative.dm +++ b/code/modules/mob/living/carbon/human/species/station/traits_vr/negative.dm @@ -1,6 +1,3 @@ -#define ORGANICS 1 -#define SYNTHETICS 2 - /datum/trait/negative category = -1 @@ -34,9 +31,9 @@ cost = -2 var_changes = list("total_health" = 75) - apply(var/datum/species/S,var/mob/living/carbon/human/H) - ..(S,H) - H.setMaxHealth(S.total_health) +/datum/trait/negative/endurance_low/apply(var/datum/species/S,var/mob/living/carbon/human/H) + ..(S,H) + H.setMaxHealth(S.total_health) /datum/trait/negative/endurance_very_low name = "Extremely Low Endurance" @@ -44,9 +41,9 @@ cost = -3 //Teshari HP. This makes the person a lot more suseptable to getting stunned, killed, etc. var_changes = list("total_health" = 50) - apply(var/datum/species/S,var/mob/living/carbon/human/H) - ..(S,H) - H.setMaxHealth(S.total_health) +/datum/trait/negative/endurance_very_low/apply(var/datum/species/S,var/mob/living/carbon/human/H) + ..(S,H) + H.setMaxHealth(S.total_health) //YW ADDITIONS: START /datum/trait/negative/endurance_glass @@ -172,6 +169,27 @@ cost = -2 var_changes = list("lightweight" = 1) +/datum/trait/negative/neural_hypersensitivity + name = "Neural Hypersensitivity" + desc = "Your nerves are particularly sensitive to physical changes, leading to experiencing twice the intensity of pain and pleasure alike. Doubles traumatic shock." + cost = -1 + var_changes = list("trauma_mod" = 2) + can_take = ORGANICS + +/datum/trait/negative/breathes + cost = -2 + can_take = ORGANICS + +/datum/trait/negative/breathes/phoron + name = "Phoron Breather" + desc = "You breathe phoron instead of oxygen (which is poisonous to you), much like a Vox." + var_changes = list("breath_type" = "phoron", "poison_type" = "oxygen") + +/datum/trait/negative/breathes/nitrogen + name = "Nitrogen Breather" + desc = "You breathe nitrogen instead of oxygen (which is poisonous to you). Incidentally, phoron isn't poisonous to breathe to you." + var_changes = list("breath_type" = "nitrogen", "poison_type" = "oxygen") + //YW ADDITIONS: START /datum/trait/negative/light_sensitivity name = "Photosensitivity" @@ -184,11 +202,4 @@ desc = "You have trouble dealing with sudden flashes of light, taking quite a long time for you to be able to recover. The effects of flashes from cameras and security equipment leave you stunned for some time." cost = -2 var_changes = list("flash_mod" = 2.0) -//YW ADDITIONS: END - -/datum/trait/negative/neural_hypersensitivity - name = "Neural Hypersensitivity" - desc = "Your nerves are particularly sensitive to physical changes, leading to experiencing twice the intensity of pain and pleasure alike. Doubles traumatic shock." - cost = -1 - var_changes = list("trauma_mod" = 2) - can_take = ORGANICS +//YW ADDITIONS: END \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/species/station/traits_vr/neutral.dm b/code/modules/mob/living/carbon/human/species/station/traits_vr/neutral.dm index 308e93f42a..2383a2c06c 100644 --- a/code/modules/mob/living/carbon/human/species/station/traits_vr/neutral.dm +++ b/code/modules/mob/living/carbon/human/species/station/traits_vr/neutral.dm @@ -1,6 +1,3 @@ -#define ORGANICS 1 -#define SYNTHETICS 2 - /datum/trait/neutral /datum/trait/neutral/metabolism_up @@ -237,7 +234,7 @@ YW change end */ desc = "You're highly allergic to gluten proteins, which are found in most common grains." cost = 0 custom_only = FALSE - var/allergen = GRAINS + var/allergen = ALLERGEN_GRAINS /datum/trait/neutral/allergy/apply(var/datum/species/S,var/mob/living/carbon/human/H) S.allergens |= allergen @@ -248,63 +245,63 @@ YW change end */ desc = "You're highly allergic to just about any form of meat. You're probably better off just sticking to vegetables. NB: By taking this trait, you acknowledge there is a risk your character may suffer a fatal reaction if exposed to this substance." cost = 0 custom_only = FALSE - allergen = MEAT + allergen = ALLERGEN_MEAT /datum/trait/neutral/allergy/fish name = "Allergy: Fish" desc = "You're highly allergic to fish. It's probably best to avoid seafood in general. NB: By taking this trait, you acknowledge there is a risk your character may suffer a fatal reaction if exposed to this substance." cost = 0 custom_only = FALSE - allergen = FISH + allergen = ALLERGEN_FISH /datum/trait/neutral/allergy/fruit name = "Allergy: Fruit" desc = "You're highly allergic to fruit. Vegetables are fine, but you should probably read up on how to tell the difference. Remember, tomatoes are a fruit. NB: By taking this trait, you acknowledge there is a risk your character may suffer a fatal reaction if exposed to this substance." cost = 0 custom_only = FALSE - allergen = FRUIT + allergen = ALLERGEN_FRUIT /datum/trait/neutral/allergy/vegetable name = "Allergy: Vegetable" desc = "You're highly allergic to vegetables. Fruit are fine, but you should probably read up on how to tell the difference. NB: By taking this trait, you acknowledge there is a risk your character may suffer a fatal reaction if exposed to this substance." cost = 0 custom_only = FALSE - allergen = VEGETABLE + allergen = ALLERGEN_VEGETABLE /datum/trait/neutral/allergy/nuts name = "Allergy: Nuts" desc = "You're highly allergic to hard-shell seeds, such as peanuts. NB: By taking this trait, you acknowledge there is a risk your character may suffer a fatal reaction if exposed to this substance." cost = 0 custom_only = FALSE - allergen = SEEDS + allergen = ALLERGEN_SEEDS /datum/trait/neutral/allergy/soy name = "Allergy: Soy" desc = "You're highly allergic to soybeans, and some other kinds of bean. NB: By taking this trait, you acknowledge there is a risk your character may suffer a fatal reaction if exposed to this substance." cost = 0 custom_only = FALSE - allergen = BEANS + allergen = ALLERGEN_BEANS /datum/trait/neutral/allergy/dairy name = "Allergy: Lactose" desc = "You're highly allergic to lactose, and consequently, just about all forms of dairy. NB: By taking this trait, you acknowledge there is a risk your character may suffer a fatal reaction if exposed to this substance." cost = 0 custom_only = FALSE - allergen = DAIRY + allergen = ALLERGEN_DAIRY /datum/trait/neutral/allergy/fungi name = "Allergy: Fungi" desc = "You're highly allergic to fungi such as mushrooms. NB: By taking this trait, you acknowledge there is a risk your character may suffer a fatal reaction if exposed to this substance." cost = 0 custom_only = FALSE - allergen = FUNGI + allergen = ALLERGEN_FUNGI /datum/trait/neutral/allergy/coffee name = "Allergy: Coffee" desc = "You're highly allergic to coffee in specific. NB: By taking this trait, you acknowledge there is a risk your character may suffer a fatal reaction if exposed to this substance." cost = 0 custom_only = FALSE - allergen = COFFEE + allergen = ALLERGEN_COFFEE /datum/trait/neutral/allergen_reduced_effect name = "Reduced Allergen Reaction" diff --git a/code/modules/mob/living/carbon/human/species/station/traits_vr/positive.dm b/code/modules/mob/living/carbon/human/species/station/traits_vr/positive.dm index 29f96a797b..ad555df187 100644 --- a/code/modules/mob/living/carbon/human/species/station/traits_vr/positive.dm +++ b/code/modules/mob/living/carbon/human/species/station/traits_vr/positive.dm @@ -1,6 +1,3 @@ -#define ORGANICS 1 -#define SYNTHETICS 2 - /datum/trait/positive category = 1 @@ -36,9 +33,9 @@ cost = 2 //YW EDIT var_changes = list("total_health" = 125) - apply(var/datum/species/S,var/mob/living/carbon/human/H) - ..(S,H) - H.setMaxHealth(S.total_health) +/datum/trait/positive/endurance_high/apply(var/datum/species/S,var/mob/living/carbon/human/H) + ..(S,H) + H.setMaxHealth(S.total_health) //YW ADDITION: START /datum/trait/positive/endurance_very_high @@ -281,3 +278,8 @@ H.verbs |= /mob/living/carbon/human/proc/weave_structure H.verbs |= /mob/living/carbon/human/proc/weave_item H.verbs |= /mob/living/carbon/human/proc/set_silk_color + +/datum/trait/positive/water_breather + name = "Water Breather" + desc = "You can breathe under water." + cost = 1 diff --git a/code/modules/mob/living/carbon/human/species/station/traits_vr/trait.dm b/code/modules/mob/living/carbon/human/species/station/traits_vr/trait.dm index 9c841429d0..d01d016b2c 100644 --- a/code/modules/mob/living/carbon/human/species/station/traits_vr/trait.dm +++ b/code/modules/mob/living/carbon/human/species/station/traits_vr/trait.dm @@ -1,6 +1,3 @@ -#define ORGANICS 1 -#define SYNTHETICS 2 - /datum/trait var/name var/desc = "Contact a developer if you see this trait." 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 8f57d6443d..7f8d44a742 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) @@ -92,7 +92,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() #define TAIL_LAYER_ALT 30 //Modified tail-sprite layer. Tend to be larger. #define MODIFIER_EFFECTS_LAYER 31 //Effects drawn by modifiers #define FIRE_LAYER 32 //'Mob on fire' overlay layer -#define WATER_LAYER 33 //'Mob submerged' overlay layer +#define MOB_WATER_LAYER 33 //'Mob submerged' overlay layer #define TARGETED_LAYER 34 //'Aimed at' overlay layer #define TOTAL_LAYERS 34 //VOREStation edit. <---- KEEP THIS UPDATED, should always equal the highest number here, used to initialize a list. ////////////////////////////////// @@ -172,7 +172,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 = "" @@ -188,7 +188,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) @@ -209,8 +209,8 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() standing_image.add_overlay(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() @@ -1098,18 +1098,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)) @@ -1193,7 +1193,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) @@ -1225,7 +1225,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() if(tail_style.em_block) working.overlays += em_block_image_generic(working) // Leaving this as overlays += - if(isTaurTail(tail_style)) + if(istaurtail(tail_style)) var/datum/sprite_accessory/tail/taur/taurtype = tail_style working.pixel_x = -16 if(taurtype.can_ride && !riding_datum) @@ -1251,7 +1251,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 @@ -1271,7 +1271,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 a2041951e5..2abe2cc145 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -62,7 +62,7 @@ var/list/department_radio_keys = list( 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) 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 bd608ca006..e08db4b575 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone_items.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone_items.dm @@ -265,7 +265,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/robot/robot_vr.dm b/code/modules/mob/living/silicon/robot/robot_vr.dm index 95ec15e52b..0b52ecde10 100644 --- a/code/modules/mob/living/silicon/robot/robot_vr.dm +++ b/code/modules/mob/living/silicon/robot/robot_vr.dm @@ -236,7 +236,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 if(M.loc != src.loc) diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/shadekin/_defines.dm b/code/modules/mob/living/simple_mob/subtypes/vore/shadekin/_defines.dm deleted file mode 100644 index 1567134c4d..0000000000 --- a/code/modules/mob/living/simple_mob/subtypes/vore/shadekin/_defines.dm +++ /dev/null @@ -1,13 +0,0 @@ -#define NOT_WHILE_SHIFTED 1 -#define ONLY_WHILE_SHIFTED 2 -#define SHIFTED_OR_NOT 3 - -#define BLUE_EYES 1 -#define RED_EYES 2 -#define PURPLE_EYES 3 -#define YELLOW_EYES 4 -#define GREEN_EYES 5 -#define ORANGE_EYES 6 - -#define AB_PHASE_SHIFTED 0x1 -#define AB_SHADE_REGEN 0x2 \ No newline at end of file diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/shadekin/~defines.dm b/code/modules/mob/living/simple_mob/subtypes/vore/shadekin/~defines.dm deleted file mode 100644 index 28ce75c50b..0000000000 --- a/code/modules/mob/living/simple_mob/subtypes/vore/shadekin/~defines.dm +++ /dev/null @@ -1,11 +0,0 @@ -#undef NOT_WHILE_SHIFTED -#undef ONLY_WHILE_SHIFTED -#undef SHIFTED_OR_NOT - -#undef BLUE_EYES -#undef RED_EYES -#undef PURPLE_EYES -#undef YELLOW_EYES - -#undef AB_PHASE_SHIFTED -#undef AB_SHADE_REGEN \ No newline at end of file diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 29abaeace3..0bfff5d83f 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -853,7 +853,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." @@ -1038,7 +1038,7 @@ mob/proc/yank_out_object() pixel_x-- is_shifted = TRUE -mob/verb/shifteast() +/mob/verb/shifteast() set hidden = TRUE if(!canface()) return FALSE diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 27d8ae4ed2..5b6490c6be 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 59f8f8f4d7..5a96b1fd03 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/mob/new_player/sprite_accessories_vr.dm b/code/modules/mob/new_player/sprite_accessories_vr.dm index 1b7142a368..48d1bd193d 100644 --- a/code/modules/mob/new_player/sprite_accessories_vr.dm +++ b/code/modules/mob/new_player/sprite_accessories_vr.dm @@ -8,600 +8,599 @@ species_allowed = list(SPECIES_HUMAN, SPECIES_SKRELL, SPECIES_UNATHI, SPECIES_TAJ, SPECIES_TESHARI, SPECIES_NEVREAN, SPECIES_AKULA, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_XENOHYBRID, SPECIES_VASILISSAN, SPECIES_RAPALA, SPECIES_PROTEAN, SPECIES_ALRAUNE, SPECIES_WEREBEAST, SPECIES_SHADEKIN, SPECIES_SHADEKIN_CREW, SPECIES_SHADEKIN_YW) //This lets all races use the default hairstyles. - astolfo - name = "Astolfo" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "hair_astolfo" +/datum/sprite_accessory/hair/astolfo + name = "Astolfo" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "hair_astolfo" - awoohair - name = "Shoulder-length Messy" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "momijihair" +/datum/sprite_accessory/hair/awoohair + name = "Shoulder-length Messy" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "momijihair" - citheronia - name = "Citheronia Hair (Kira72)" - icon = 'icons/mob/human_face_vr.dmi' - icon_state = "citheronia_hair" - ckeys_allowed = list("Kira72") - do_colouration = 0 +/datum/sprite_accessory/hair/citheronia + name = "Citheronia Hair (Kira72)" + icon = 'icons/mob/human_face_vr.dmi' + icon_state = "citheronia_hair" + ckeys_allowed = list("Kira72") + do_colouration = 0 - taramaw - name = "Hairmaw (Liquidfirefly)" - icon = 'icons/mob/human_face_vr.dmi' - icon_state = "maw_hair" - ckeys_allowed = list("liquidfirefly") - do_colouration = 0 +/datum/sprite_accessory/hair/taramaw + name = "Hairmaw (Liquidfirefly)" + icon = 'icons/mob/human_face_vr.dmi' + icon_state = "maw_hair" + ckeys_allowed = list("liquidfirefly") + do_colouration = 0 - citheronia_colorable - name = "Citheronia Hair" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "citheronia_hair_c" - do_colouration = 1 +/datum/sprite_accessory/hair/citheronia_colorable + name = "Citheronia Hair" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "citheronia_hair_c" + do_colouration = 1 - sergal_plain - name = "Sergal Plain" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "serg_plain" - species_allowed = list(SPECIES_SERGAL) +/datum/sprite_accessory/hair/sergal_plain + name = "Sergal Plain" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "serg_plain" + species_allowed = list(SPECIES_SERGAL) - sergal_medicore - name = "Sergal Medicore" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "serg_medicore" - species_allowed = list(SPECIES_SERGAL) +/datum/sprite_accessory/hair/sergal_medicore + name = "Sergal Medicore" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "serg_medicore" + species_allowed = list(SPECIES_SERGAL) - sergal_tapered - name = "Sergal Tapered" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "serg_tapered" - species_allowed = list(SPECIES_SERGAL) +/datum/sprite_accessory/hair/sergal_tapered + name = "Sergal Tapered" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "serg_tapered" + species_allowed = list(SPECIES_SERGAL) - sergal_fairytail - name = "Sergal Fairytail" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "serg_fairytail" - species_allowed = list(SPECIES_SERGAL) +/datum/sprite_accessory/hair/sergal_fairytail + name = "Sergal Fairytail" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "serg_fairytail" + species_allowed = list(SPECIES_SERGAL) - braid - name = "Floorlength Braid" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "hair_braid" +/datum/sprite_accessory/hair/braid + name = "Floorlength Braid" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "hair_braid" - twindrills - name = "Twin Drills" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "hair_twincurl" +/datum/sprite_accessory/hair/twindrills + name = "Twin Drills" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "hair_twincurl" - crescent_moon - name = "Crescent-Moon" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "crescent_moon" +/datum/sprite_accessory/hair/crescent_moon + name = "Crescent-Moon" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "crescent_moon" - bald - name = "Bald" - icon_state = "bald" - gender = MALE - species_allowed = list(SPECIES_HUMAN, SPECIES_SKRELL, SPECIES_UNATHI, SPECIES_TAJ, SPECIES_TESHARI, SPECIES_NEVREAN, SPECIES_AKULA, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_XENOHYBRID, SPECIES_VASILISSAN, SPECIES_RAPALA, SPECIES_PROTEAN, SPECIES_ALRAUNE, SPECIES_WEREBEAST) //Lets all the races be bald if they want. +/datum/sprite_accessory/hair/bald + name = "Bald" + icon_state = "bald" + gender = MALE + species_allowed = list(SPECIES_HUMAN, SPECIES_SKRELL, SPECIES_UNATHI, SPECIES_TAJ, SPECIES_TESHARI, SPECIES_NEVREAN, SPECIES_AKULA, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_XENOHYBRID, SPECIES_VASILISSAN, SPECIES_RAPALA, SPECIES_PROTEAN, SPECIES_ALRAUNE, SPECIES_WEREBEAST) //Lets all the races be bald if they want. - ponytail6_fixed //Eggnerd's done with waiting for upstream fixes lmao. - name = "Ponytail 6 but fixed" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "hair_ponytail6" - species_allowed = list(SPECIES_HUMAN, SPECIES_SKRELL, SPECIES_UNATHI, SPECIES_TAJ, SPECIES_NEVREAN, SPECIES_AKULA,SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_XENOHYBRID, SPECIES_VASILISSAN, SPECIES_RAPALA, SPECIES_PROTEAN, SPECIES_ALRAUNE, SPECIES_WEREBEAST) +/datum/sprite_accessory/hair/ponytail6_fixed + name = "Ponytail 6 but fixed" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "hair_ponytail6" + species_allowed = list(SPECIES_HUMAN, SPECIES_SKRELL, SPECIES_UNATHI, SPECIES_TAJ, SPECIES_NEVREAN, SPECIES_AKULA,SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_XENOHYBRID, SPECIES_VASILISSAN, SPECIES_RAPALA, SPECIES_PROTEAN, SPECIES_ALRAUNE, SPECIES_WEREBEAST) - una_hood - name = "Cobra Hood" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "soghun_hood" +/datum/sprite_accessory/hair/una_hood + name = "Cobra Hood" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "soghun_hood" - una_spines_long - name = "Long Unathi Spines" - icon_state = "soghun_longspines" - species_allowed = list(SPECIES_UNATHI, SPECIES_XENOCHIMERA, SPECIES_PROTEAN) //Xenochimera get most hairstyles since they're abominations. +/datum/sprite_accessory/hair/una_spines_long + name = "Long Unathi Spines" + icon_state = "soghun_longspines" + species_allowed = list(SPECIES_UNATHI, SPECIES_XENOCHIMERA, SPECIES_PROTEAN) //Xenochimera get most hairstyles since they're abominations. - una_spines_short - name = "Short Unathi Spines" - icon_state = "soghun_shortspines" - species_allowed = list(SPECIES_UNATHI, SPECIES_XENOCHIMERA, SPECIES_PROTEAN) +/datum/sprite_accessory/hair/una_spines_short + name = "Short Unathi Spines" + icon_state = "soghun_shortspines" + species_allowed = list(SPECIES_UNATHI, SPECIES_XENOCHIMERA, SPECIES_PROTEAN) +/datum/sprite_accessory/hair/una_frills_long + name = "Long Unathi Frills" + icon_state = "soghun_longfrills" + species_allowed = list(SPECIES_UNATHI, SPECIES_XENOCHIMERA, SPECIES_PROTEAN) - una_frills_long - name = "Long Unathi Frills" - icon_state = "soghun_longfrills" - species_allowed = list(SPECIES_UNATHI, SPECIES_XENOCHIMERA, SPECIES_PROTEAN) +/datum/sprite_accessory/hair/una_frills_short + name = "Short Unathi Frills" + icon_state = "soghun_shortfrills" + species_allowed = list(SPECIES_UNATHI, SPECIES_XENOCHIMERA, SPECIES_PROTEAN) - una_frills_short - name = "Short Unathi Frills" - icon_state = "soghun_shortfrills" - species_allowed = list(SPECIES_UNATHI, SPECIES_XENOCHIMERA, SPECIES_PROTEAN) +/datum/sprite_accessory/hair/una_horns + name = "Unathi Horns" + icon_state = "soghun_horns" + species_allowed = list(SPECIES_UNATHI, SPECIES_XENOCHIMERA, SPECIES_PROTEAN) - una_horns - name = "Unathi Horns" - icon_state = "soghun_horns" - species_allowed = list(SPECIES_UNATHI, SPECIES_XENOCHIMERA, SPECIES_PROTEAN) +/datum/sprite_accessory/hair/una_bighorns + name = "Unathi Big Horns" + icon_state = "unathi_bighorn" + species_allowed = list(SPECIES_UNATHI, SPECIES_XENOCHIMERA, SPECIES_PROTEAN) - una_bighorns - name = "Unathi Big Horns" - icon_state = "unathi_bighorn" - species_allowed = list(SPECIES_UNATHI, SPECIES_XENOCHIMERA, SPECIES_PROTEAN) +/datum/sprite_accessory/hair/una_smallhorns + name = "Unathi Small Horns" + icon_state = "unathi_smallhorn" + species_allowed = list(SPECIES_UNATHI, SPECIES_XENOCHIMERA, SPECIES_PROTEAN) - una_smallhorns - name = "Unathi Small Horns" - icon_state = "unathi_smallhorn" - species_allowed = list(SPECIES_UNATHI, SPECIES_XENOCHIMERA, SPECIES_PROTEAN) +/datum/sprite_accessory/hair/una_ramhorns + name = "Unathi Ram Horns" + icon_state = "unathi_ramhorn" + species_allowed = list(SPECIES_UNATHI, SPECIES_XENOCHIMERA, SPECIES_PROTEAN) - una_ramhorns - name = "Unathi Ram Horns" - icon_state = "unathi_ramhorn" - species_allowed = list(SPECIES_UNATHI, SPECIES_XENOCHIMERA, SPECIES_PROTEAN) +/datum/sprite_accessory/hair/una_sidefrills + name = "Unathi Side Frills" + icon_state = "unathi_sidefrills" + species_allowed = list(SPECIES_UNATHI, SPECIES_XENOCHIMERA, SPECIES_PROTEAN) - una_sidefrills - name = "Unathi Side Frills" - icon_state = "unathi_sidefrills" - species_allowed = list(SPECIES_UNATHI, SPECIES_XENOCHIMERA, SPECIES_PROTEAN) +/datum/sprite_accessory/hair/una_doublehorns + name = "Double Unathi Horns" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "soghun_dubhorns" + species_allowed = list(SPECIES_UNATHI, SPECIES_XENOCHIMERA, SPECIES_PROTEAN) - una_doublehorns - name = "Double Unathi Horns" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "soghun_dubhorns" - species_allowed = list(SPECIES_UNATHI, SPECIES_XENOCHIMERA, SPECIES_PROTEAN) +/datum/sprite_accessory/hair/taj_ears + name = "Tajaran Ears" + icon_state = "ears_plain" + species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) - taj_ears - name = "Tajaran Ears" - icon_state = "ears_plain" - species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) +/datum/sprite_accessory/hair/taj_ears_clean + name = "Tajara Clean" + icon_state = "hair_clean" + species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) - taj_ears_clean - name = "Tajara Clean" - icon_state = "hair_clean" - species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) +/datum/sprite_accessory/hair/taj_ears_bangs + name = "Tajara Bangs" + icon_state = "hair_bangs" + species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) - taj_ears_bangs - name = "Tajara Bangs" - icon_state = "hair_bangs" - species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) +/datum/sprite_accessory/hair/taj_ears_braid + name = "Tajara Braid" + icon_state = "hair_tbraid" + species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) - taj_ears_braid - name = "Tajara Braid" - icon_state = "hair_tbraid" - species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) +/datum/sprite_accessory/hair/taj_ears_shaggy + name = "Tajara Shaggy" + icon_state = "hair_shaggy" + species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) - taj_ears_shaggy - name = "Tajara Shaggy" - icon_state = "hair_shaggy" - species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) +/datum/sprite_accessory/hair/taj_ears_mohawk + name = "Tajaran Mohawk" + icon_state = "hair_mohawk" + species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) - taj_ears_mohawk - name = "Tajaran Mohawk" - icon_state = "hair_mohawk" - species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) +/datum/sprite_accessory/hair/taj_ears_plait + name = "Tajara Plait" + icon_state = "hair_plait" + species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) - taj_ears_plait - name = "Tajara Plait" - icon_state = "hair_plait" - species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) +/datum/sprite_accessory/hair/taj_ears_straight + name = "Tajara Straight" + icon_state = "hair_straight" + species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) - taj_ears_straight - name = "Tajara Straight" - icon_state = "hair_straight" - species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) +/datum/sprite_accessory/hair/taj_ears_long + name = "Tajara Long" + icon_state = "hair_long" + species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) - taj_ears_long - name = "Tajara Long" - icon_state = "hair_long" - species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) +/datum/sprite_accessory/hair/taj_ears_rattail + name = "Tajara Rat Tail" + icon_state = "hair_rattail" + species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) - taj_ears_rattail - name = "Tajara Rat Tail" - icon_state = "hair_rattail" - species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) +/datum/sprite_accessory/hair/taj_ears_spiky + name = "Tajara Spiky" + icon_state = "hair_tajspiky" + species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) - taj_ears_spiky - name = "Tajara Spiky" - icon_state = "hair_tajspiky" - species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) +/datum/sprite_accessory/hair/taj_ears_messy + name = "Tajara Messy" + icon_state = "hair_messy" + species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) - taj_ears_messy - name = "Tajara Messy" - icon_state = "hair_messy" - species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) +/datum/sprite_accessory/hair/taj_ears_curls + name = "Tajaran Curly" + icon_state = "hair_curly" + species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) - taj_ears_curls - name = "Tajaran Curly" - icon_state = "hair_curly" - species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) +/datum/sprite_accessory/hair/taj_ears_wife + name = "Tajaran Housewife" + icon_state = "hair_wife" + species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) - taj_ears_wife - name = "Tajaran Housewife" - icon_state = "hair_wife" - species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) +/datum/sprite_accessory/hair/taj_ears_victory + name = "Tajaran Victory Curls" + icon_state = "hair_victory" + species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) - taj_ears_victory - name = "Tajaran Victory Curls" - icon_state = "hair_victory" - species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) +/datum/sprite_accessory/hair/taj_ears_bob + name = "Tajaran Bob" + icon_state = "hair_tbob" + species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) - taj_ears_bob - name = "Tajaran Bob" - icon_state = "hair_tbob" - species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) - - taj_ears_fingercurl - name = "Tajaran Finger Curls" - icon_state = "hair_fingerwave" - species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) +/datum/sprite_accessory/hair/taj_ears_fingercurl + name = "Tajaran Finger Curls" + icon_state = "hair_fingerwave" + species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) //Teshari things - teshari - icon_add = 'icons/mob/human_face_vr_add.dmi' +/datum/sprite_accessory/hair/teshari + icon_add = 'icons/mob/human_face_vr_add.dmi' - teshari_altdefault - icon_add = 'icons/mob/human_face_vr_add.dmi' +/datum/sprite_accessory/hair/teshari_altdefault + icon_add = 'icons/mob/human_face_vr_add.dmi' - teshari_tight - icon_add = 'icons/mob/human_face_vr_add.dmi' +/datum/sprite_accessory/hair/teshari_tight + icon_add = 'icons/mob/human_face_vr_add.dmi' - teshari_excited - icon_add = 'icons/mob/human_face_vr_add.dmi' +/datum/sprite_accessory/hair/teshari_excited + icon_add = 'icons/mob/human_face_vr_add.dmi' - teshari_spike - icon_add = 'icons/mob/human_face_vr_add.dmi' +/datum/sprite_accessory/hair/teshari_spike + icon_add = 'icons/mob/human_face_vr_add.dmi' - teshari_long - icon_add = 'icons/mob/human_face_vr_add.dmi' +/datum/sprite_accessory/hair/teshari_long + icon_add = 'icons/mob/human_face_vr_add.dmi' - teshari_burst - icon_add = 'icons/mob/human_face_vr_add.dmi' +/datum/sprite_accessory/hair/teshari_burst + icon_add = 'icons/mob/human_face_vr_add.dmi' - teshari_shortburst - icon_add = 'icons/mob/human_face_vr_add.dmi' +/datum/sprite_accessory/hair/teshari_shortburst + icon_add = 'icons/mob/human_face_vr_add.dmi' - teshari_mohawk - icon_add = 'icons/mob/human_face_vr_add.dmi' +/datum/sprite_accessory/hair/teshari_mohawk + icon_add = 'icons/mob/human_face_vr_add.dmi' - teshari_pointy - icon_add = 'icons/mob/human_face_vr_add.dmi' +/datum/sprite_accessory/hair/teshari_pointy + icon_add = 'icons/mob/human_face_vr_add.dmi' - teshari_upright - icon_add = 'icons/mob/human_face_vr_add.dmi' +/datum/sprite_accessory/hair/teshari_upright + icon_add = 'icons/mob/human_face_vr_add.dmi' - teshari_mane - icon_add = 'icons/mob/human_face_vr_add.dmi' +/datum/sprite_accessory/hair/teshari_mane + icon_add = 'icons/mob/human_face_vr_add.dmi' - teshari_droopy - icon_add = 'icons/mob/human_face_vr_add.dmi' +/datum/sprite_accessory/hair/teshari_droopy + icon_add = 'icons/mob/human_face_vr_add.dmi' - teshari_mushroom - icon_add = 'icons/mob/human_face_vr_add.dmi' +/datum/sprite_accessory/hair/teshari_mushroom + icon_add = 'icons/mob/human_face_vr_add.dmi' - teshari_twies - icon_add = 'icons/mob/human_face_vr_add.dmi' +/datum/sprite_accessory/hair/teshari_twies + icon_add = 'icons/mob/human_face_vr_add.dmi' - teshari_backstrafe - icon_add = 'icons/mob/human_face_vr_add.dmi' +/datum/sprite_accessory/hair/teshari_backstrafe + icon_add = 'icons/mob/human_face_vr_add.dmi' - teshari_longway - icon_add = 'icons/mob/human_face_vr_add.dmi' +/datum/sprite_accessory/hair/teshari_longway + icon_add = 'icons/mob/human_face_vr_add.dmi' - teshari_tree - icon_add = 'icons/mob/human_face_vr_add.dmi' +/datum/sprite_accessory/hair/teshari_tree + icon_add = 'icons/mob/human_face_vr_add.dmi' - teshari_fluffymohawk - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' +/datum/sprite_accessory/hair/teshari_fluffymohawk + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' //Skrell 'hairstyles' - these were requested for a chimera and screw it, if one wants to eat seafood, go nuts - skr_tentacle_veryshort - name = "Skrell Very Short Tentacles" - icon_state = "skrell_hair_veryshort" - species_allowed = list(SPECIES_SKRELL, SPECIES_XENOCHIMERA, SPECIES_PROTEAN) - gender = MALE +/datum/sprite_accessory/hair/skr_tentacle_veryshort + name = "Skrell Very Short Tentacles" + icon_state = "skrell_hair_veryshort" + species_allowed = list(SPECIES_SKRELL, SPECIES_XENOCHIMERA, SPECIES_PROTEAN) + gender = MALE - skr_tentacle_short - name = "Skrell Short Tentacles" - icon_state = "skrell_hair_short" - species_allowed = list(SPECIES_SKRELL, SPECIES_XENOCHIMERA, SPECIES_PROTEAN) +/datum/sprite_accessory/hair/skr_tentacle_short + name = "Skrell Short Tentacles" + icon_state = "skrell_hair_short" + species_allowed = list(SPECIES_SKRELL, SPECIES_XENOCHIMERA, SPECIES_PROTEAN) - skr_tentacle_average - name = "Skrell Average Tentacles" - icon_state = "skrell_hair_average" - species_allowed = list(SPECIES_SKRELL, SPECIES_XENOCHIMERA, SPECIES_PROTEAN) +/datum/sprite_accessory/hair/skr_tentacle_average + name = "Skrell Average Tentacles" + icon_state = "skrell_hair_average" + species_allowed = list(SPECIES_SKRELL, SPECIES_XENOCHIMERA, SPECIES_PROTEAN) - skr_tentacle_verylong - name = "Skrell Long Tentacles" - icon_state = "skrell_hair_verylong" - species_allowed = list(SPECIES_SKRELL, SPECIES_XENOCHIMERA, SPECIES_PROTEAN) - gender = FEMALE +/datum/sprite_accessory/hair/skr_tentacle_verylong + name = "Skrell Long Tentacles" + icon_state = "skrell_hair_verylong" + species_allowed = list(SPECIES_SKRELL, SPECIES_XENOCHIMERA, SPECIES_PROTEAN) + gender = FEMALE // Vulpa stuffs - vulp_hair_none - name = "None" - icon_state = "bald" - species_allowed = list(SPECIES_VULPKANIN) - gender = NEUTER +/datum/sprite_accessory/hair/vulp_hair_none + name = "None" + icon_state = "bald" + species_allowed = list(SPECIES_VULPKANIN) + gender = NEUTER - vulp_hair_kajam - name = "Kajam" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "kajam" - species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) - gender = NEUTER +/datum/sprite_accessory/hair/vulp_hair_kajam + name = "Kajam" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "kajam" + species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) + gender = NEUTER - vulp_hair_keid - name = "Keid" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "keid" - species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) - gender = NEUTER +/datum/sprite_accessory/hair/vulp_hair_keid + name = "Keid" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "keid" + species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) + gender = NEUTER - vulp_hair_adhara - name = "Adhara" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "adhara" - species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) - gender = NEUTER +/datum/sprite_accessory/hair/vulp_hair_adhara + name = "Adhara" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "adhara" + species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) + gender = NEUTER - vulp_hair_kleeia - name = "Kleeia" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "kleeia" - species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) - gender = NEUTER +/datum/sprite_accessory/hair/vulp_hair_kleeia + name = "Kleeia" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "kleeia" + species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) + gender = NEUTER - vulp_hair_mizar - name = "Mizar" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "mizar" - species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) - gender = NEUTER +/datum/sprite_accessory/hair/vulp_hair_mizar + name = "Mizar" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "mizar" + species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) + gender = NEUTER - vulp_hair_apollo - name = "Apollo" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "apollo" - species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) - gender = NEUTER +/datum/sprite_accessory/hair/vulp_hair_apollo + name = "Apollo" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "apollo" + species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) + gender = NEUTER - vulp_hair_belle - name = "Belle" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "belle" - species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) - gender = NEUTER +/datum/sprite_accessory/hair/vulp_hair_belle + name = "Belle" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "belle" + species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) + gender = NEUTER - vulp_hair_bun - name = "Vulp Bun" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "bun" - species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) - gender = NEUTER +/datum/sprite_accessory/hair/vulp_hair_bun + name = "Vulp Bun" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "bun" + species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) + gender = NEUTER - vulp_hair_jagged - name = "Jagged" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "jagged" - species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) - gender = NEUTER +/datum/sprite_accessory/hair/vulp_hair_jagged + name = "Jagged" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "jagged" + species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) + gender = NEUTER - vulp_hair_curl - name = "Curl" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "curl" - species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) - gender = NEUTER +/datum/sprite_accessory/hair/vulp_hair_curl + name = "Curl" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "curl" + species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) + gender = NEUTER - vulp_hair_hawk - name = "Hawk" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "hawk" - species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) - gender = NEUTER +/datum/sprite_accessory/hair/vulp_hair_hawk + name = "Hawk" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "hawk" + species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) + gender = NEUTER - vulp_hair_anita - name = "Anita" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "anita" - species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) - gender = NEUTER +/datum/sprite_accessory/hair/vulp_hair_anita + name = "Anita" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "anita" + species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) + gender = NEUTER - vulp_hair_short - name = "Short" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "short" - species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) - gender = NEUTER +/datum/sprite_accessory/hair/vulp_hair_short + name = "Short" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "short" + species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) + gender = NEUTER - vulp_hair_spike - name = "Spike" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "spike" - species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) - gender = NEUTER +/datum/sprite_accessory/hair/vulp_hair_spike + name = "Spike" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "spike" + species_allowed = list(SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_TAJ, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_PROTEAN) + gender = NEUTER //xeno stuffs - xeno_head_drone_color - name = "Drone dome" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "cxeno_drone" - species_allowed = list(SPECIES_XENOHYBRID) - gender = NEUTER +/datum/sprite_accessory/hair/xeno_head_drone_color + name = "Drone dome" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "cxeno_drone" + species_allowed = list(SPECIES_XENOHYBRID) + gender = NEUTER // figure this one out for better coloring - xeno_head_sentinel_color - name = "Sentinal dome" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "cxeno_sentinel" - species_allowed = list(SPECIES_XENOHYBRID) - gender = NEUTER +/datum/sprite_accessory/hair/xeno_head_sentinel_color + name = "Sentinal dome" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "cxeno_sentinel" + species_allowed = list(SPECIES_XENOHYBRID) + gender = NEUTER - xeno_head_queen_color - name = "Queen dome" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "cxeno_queen" - species_allowed = list(SPECIES_XENOHYBRID) - gender = NEUTER +/datum/sprite_accessory/hair/xeno_head_queen_color + name = "Queen dome" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "cxeno_queen" + species_allowed = list(SPECIES_XENOHYBRID) + gender = NEUTER - xeno_head_hunter_color - name = "Hunter dome" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "cxeno_hunter" - species_allowed = list(SPECIES_XENOHYBRID) - gender = NEUTER +/datum/sprite_accessory/hair/xeno_head_hunter_color + name = "Hunter dome" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "cxeno_hunter" + species_allowed = list(SPECIES_XENOHYBRID) + gender = NEUTER - xeno_head_praetorian_color - name = "Praetorian dome" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "cxeno_praetorian" - species_allowed = list(SPECIES_XENOHYBRID) - gender = NEUTER +/datum/sprite_accessory/hair/xeno_head_praetorian_color + name = "Praetorian dome" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "cxeno_praetorian" + species_allowed = list(SPECIES_XENOHYBRID) + gender = NEUTER // Shadekin stuffs - shadekin_hair_short - name = "Shadekin Short Hair" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "shadekin_short" +/datum/sprite_accessory/hair/shadekin_hair_short + name = "Shadekin Short Hair" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "shadekin_short" species_allowed = list(SPECIES_SHADEKIN, SPECIES_SHADEKIN_CREW, SPECIES_SHADEKIN_YW) //YW Edits - gender = NEUTER + gender = NEUTER - shadekin_hair_poofy - name = "Shadekin Poofy Hair" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "shadekin_poofy" +/datum/sprite_accessory/hair/shadekin_hair_poofy + name = "Shadekin Poofy Hair" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "shadekin_poofy" species_allowed = list(SPECIES_SHADEKIN, SPECIES_SHADEKIN_CREW, SPECIES_SHADEKIN_YW) //YW Edits - gender = NEUTER + gender = NEUTER - shadekin_hair_long - name = "Shadekin Long Hair" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "shadekin_long" +/datum/sprite_accessory/hair/shadekin_hair_long + name = "Shadekin Long Hair" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "shadekin_long" species_allowed = list(SPECIES_SHADEKIN, SPECIES_SHADEKIN_CREW, SPECIES_SHADEKIN_YW) //YW Edits - gender = NEUTER + gender = NEUTER - shadekin_hair_rivyr - name = "Rivyr Hair" - icon = 'icons/mob/human_face_vr.dmi' - icon_add = 'icons/mob/human_face_vr_add.dmi' - icon_state = "shadekin_rivyr" - ckeys_allowed = list("verysoft") +/datum/sprite_accessory/hair/shadekin_hair_rivyr + name = "Rivyr Hair" + icon = 'icons/mob/human_face_vr.dmi' + icon_add = 'icons/mob/human_face_vr_add.dmi' + icon_state = "shadekin_rivyr" + ckeys_allowed = list("verysoft") species_allowed = list(SPECIES_SHADEKIN, SPECIES_SHADEKIN_CREW, SPECIES_SHADEKIN_YW) //YW Edits - gender = NEUTER + gender = NEUTER /datum/sprite_accessory/facial_hair icon = 'icons/mob/human_face_or_vr.dmi' color_blend_mode = ICON_MULTIPLY species_allowed = list(SPECIES_HUMAN, SPECIES_SKRELL, SPECIES_UNATHI, SPECIES_TAJ, SPECIES_TESHARI, SPECIES_NEVREAN, SPECIES_AKULA, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_XENOHYBRID, SPECIES_VASILISSAN, SPECIES_RAPALA, SPECIES_PROTEAN, SPECIES_ALRAUNE, SPECIES_WEREBEAST) //This lets all races use the facial hair styles. - shaved - name = "Shaved" - icon_state = "bald" - gender = NEUTER - species_allowed = list(SPECIES_HUMAN, SPECIES_SKRELL, SPECIES_UNATHI, SPECIES_TAJ, SPECIES_TESHARI, SPECIES_NEVREAN, SPECIES_AKULA, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_XENOHYBRID, SPECIES_VASILISSAN, SPECIES_RAPALA, SPECIES_PROTEAN, SPECIES_ALRAUNE, SPECIES_WEREBEAST) //This needed to be manually defined, apparantly. +/datum/sprite_accessory/facial_hair/shaved + name = "Shaved" + icon_state = "bald" + gender = NEUTER + species_allowed = list(SPECIES_HUMAN, SPECIES_SKRELL, SPECIES_UNATHI, SPECIES_TAJ, SPECIES_TESHARI, SPECIES_NEVREAN, SPECIES_AKULA, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_XENOHYBRID, SPECIES_VASILISSAN, SPECIES_RAPALA, SPECIES_PROTEAN, SPECIES_ALRAUNE, SPECIES_WEREBEAST) //This needed to be manually defined, apparantly. - neck_fluff - name = "Neck Fluff" - icon = 'icons/mob/human_face_or_vr.dmi' - icon_state = "facial_neckfluff" - gender = NEUTER - species_allowed = list(SPECIES_HUMAN, SPECIES_SKRELL, SPECIES_UNATHI, SPECIES_TAJ, SPECIES_TESHARI, SPECIES_NEVREAN, SPECIES_AKULA, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_XENOHYBRID, SPECIES_VASILISSAN, SPECIES_RAPALA, SPECIES_PROTEAN, SPECIES_ALRAUNE, SPECIES_WEREBEAST) +/datum/sprite_accessory/facial_hair/neck_fluff + name = "Neck Fluff" + icon = 'icons/mob/human_face_or_vr.dmi' + icon_state = "facial_neckfluff" + gender = NEUTER + species_allowed = list(SPECIES_HUMAN, SPECIES_SKRELL, SPECIES_UNATHI, SPECIES_TAJ, SPECIES_TESHARI, SPECIES_NEVREAN, SPECIES_AKULA, SPECIES_SERGAL, SPECIES_FENNEC, SPECIES_ZORREN_HIGH, SPECIES_VULPKANIN, SPECIES_XENOCHIMERA, SPECIES_XENOHYBRID, SPECIES_VASILISSAN, SPECIES_RAPALA, SPECIES_PROTEAN, SPECIES_ALRAUNE, SPECIES_WEREBEAST) - vulp_none - name = "None" - icon = 'icons/mob/human_face_vr.dmi' - icon_state = "none" - species_allowed = list(SPECIES_VULPKANIN) - gender = NEUTER +/datum/sprite_accessory/facial_hair/vulp_none + name = "None" + icon = 'icons/mob/human_face_vr.dmi' + icon_state = "none" + species_allowed = list(SPECIES_VULPKANIN) + gender = NEUTER - vulp_blaze - name = "Blaze" - icon = 'icons/mob/human_face_vr.dmi' - icon_state = "vulp_facial_blaze" - species_allowed = list(SPECIES_VULPKANIN) - gender = NEUTER +/datum/sprite_accessory/facial_hair/vulp_blaze + name = "Blaze" + icon = 'icons/mob/human_face_vr.dmi' + icon_state = "vulp_facial_blaze" + species_allowed = list(SPECIES_VULPKANIN) + gender = NEUTER - vulp_vulpine - name = "Vulpine" - icon = 'icons/mob/human_face_vr.dmi' - icon_state = "vulp_facial_vulpine" - species_allowed = list(SPECIES_VULPKANIN) - gender = NEUTER +/datum/sprite_accessory/facial_hair/vulp_vulpine + name = "Vulpine" + icon = 'icons/mob/human_face_vr.dmi' + icon_state = "vulp_facial_vulpine" + species_allowed = list(SPECIES_VULPKANIN) + gender = NEUTER - vulp_earfluff - name = "Earfluff" - icon = 'icons/mob/human_face_vr.dmi' - icon_state = "vulp_facial_earfluff" - species_allowed = list(SPECIES_VULPKANIN) - gender = NEUTER +/datum/sprite_accessory/facial_hair/vulp_earfluff + name = "Earfluff" + icon = 'icons/mob/human_face_vr.dmi' + icon_state = "vulp_facial_earfluff" + species_allowed = list(SPECIES_VULPKANIN) + gender = NEUTER - vulp_mask - name = "Mask" - icon = 'icons/mob/human_face_vr.dmi' - icon_state = "vulp_facial_mask" - species_allowed = list(SPECIES_VULPKANIN) - gender = NEUTER +/datum/sprite_accessory/facial_hair/vulp_mask + name = "Mask" + icon = 'icons/mob/human_face_vr.dmi' + icon_state = "vulp_facial_mask" + species_allowed = list(SPECIES_VULPKANIN) + gender = NEUTER - vulp_patch - name = "Patch" - icon = 'icons/mob/human_face_vr.dmi' - icon_state = "vulp_facial_patch" - species_allowed = list(SPECIES_VULPKANIN) - gender = NEUTER +/datum/sprite_accessory/facial_hair/vulp_patch + name = "Patch" + icon = 'icons/mob/human_face_vr.dmi' + icon_state = "vulp_facial_patch" + species_allowed = list(SPECIES_VULPKANIN) + gender = NEUTER - vulp_ruff - name = "Ruff" - icon = 'icons/mob/human_face_vr.dmi' - icon_state = "vulp_facial_ruff" - species_allowed = list(SPECIES_VULPKANIN) - gender = NEUTER +/datum/sprite_accessory/facial_hair/vulp_ruff + name = "Ruff" + icon = 'icons/mob/human_face_vr.dmi' + icon_state = "vulp_facial_ruff" + species_allowed = list(SPECIES_VULPKANIN) + gender = NEUTER - vulp_kita - name = "Kita" - icon = 'icons/mob/human_face_vr.dmi' - icon_state = "vulp_facial_kita" - species_allowed = list(SPECIES_VULPKANIN) - gender = NEUTER +/datum/sprite_accessory/facial_hair/vulp_kita + name = "Kita" + icon = 'icons/mob/human_face_vr.dmi' + icon_state = "vulp_facial_kita" + species_allowed = list(SPECIES_VULPKANIN) + gender = NEUTER - vulp_swift - name = "Swift" - icon = 'icons/mob/human_face_vr.dmi' - icon_state = "vulp_facial_swift" - species_allowed = list(SPECIES_VULPKANIN) - gender = NEUTER +/datum/sprite_accessory/facial_hair/vulp_swift + name = "Swift" + icon = 'icons/mob/human_face_vr.dmi' + icon_state = "vulp_facial_swift" + species_allowed = list(SPECIES_VULPKANIN) + gender = NEUTER /* //////////////////////////// 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 62ffc46518..af6f1de418 100644 --- a/code/modules/multiz/basic.dm +++ b/code/modules/multiz/basic.dm @@ -43,7 +43,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/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 f0d1c826ec..264ef3d6b7 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) //Vorestation Edit Start - We're not going to splatter at all because we're in something and that's silly. if(istype(source,/atom/movable)) 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 d70269b391..18429b1de9 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/disperser/disperser_console.dm b/code/modules/overmap/disperser/disperser_console.dm index 5f97785341..cb2a8cea32 100644 --- a/code/modules/overmap/disperser/disperser_console.dm +++ b/code/modules/overmap/disperser/disperser_console.dm @@ -61,7 +61,7 @@ return TRUE return FALSE -obj/machinery/computer/ship/disperser/proc/is_valid_setup() +/obj/machinery/computer/ship/disperser/proc/is_valid_setup() if(front && middle && back) var/everything_in_range = (get_dist(src, front) < link_range) && (get_dist(src, middle) < link_range) && (get_dist(src, back) < link_range) var/everything_in_order = (middle.Adjacent(front) && middle.Adjacent(back)) && (front.dir == middle.dir && middle.dir == back.dir) diff --git a/code/modules/overmap/spacetravel.dm b/code/modules/overmap/spacetravel.dm index 473fcc1ab5..5a3e8ed477 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 353090efed..143635c001 100644 --- a/code/modules/paperwork/adminpaper.dm +++ b/code/modules/paperwork/adminpaper.dm @@ -75,7 +75,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/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 5c39d8e150..428a95b365 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 0c78f105e3..693226ecfe 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 32f213f95f..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)) - cut_overlays() - else - cut_overlays() - - if(lastgenlev != 0) - add_overlay("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/power/lighting.dm b/code/modules/power/lighting.dm index 1443d20f92..09761cfac8 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -399,25 +399,33 @@ var/global/list/light_type_cache = list() ..() //VOREStation Edit Start /obj/machinery/light/proc/set_alert_atmos() - if(shows_alerts) - current_alert = "atmos" - brightness_color = "#6D6DFC" - if(on) - update() + if(!shows_alerts) + return + current_alert = "atmos" + brightness_color = "#6D6DFC" + update() /obj/machinery/light/proc/set_alert_fire() - if(shows_alerts) - current_alert = "fire" - brightness_color = "#FF3030" - if(on) - update() + if(!shows_alerts) + return + current_alert = "fire" + brightness_color = "#FF3030" + update() /obj/machinery/light/proc/reset_alert() - if(shows_alerts) - current_alert = null - brightness_color = initial(brightness_color) || "" // Workaround for BYOND stupidity. Can't set it to null or it won't clear. - if(on) - update() + if(!shows_alerts) + return + + current_alert = null + var/obj/item/weapon/light/L = get_light_type_instance(light_type) + + if(L) + update_from_bulb(L) + else + brightness_color = nightshift_enabled ? initial(brightness_color_ns) : initial(brightness_color) + + update() + //VOREstation Edit End // update lighting /obj/machinery/light/proc/update(var/trigger = 1) diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm index ea8b5cd230..f67fb4f4c4 100644 --- a/code/modules/power/singularity/emitter.dm +++ b/code/modules/power/singularity/emitter.dm @@ -169,6 +169,7 @@ disconnect_from_network() if(2) to_chat(user, "\The [src] needs to be unwelded from the floor.") + update_icon() // VOREStation Add return if(istype(W, /obj/item/weapon/weldingtool)) @@ -205,6 +206,7 @@ disconnect_from_network() else to_chat(user, "You need more welding fuel to complete this task.") + update_icon() // VOREStation Add return if(istype(W, /obj/item/stack/material) && W.get_material_name() == DEFAULT_WALL_MATERIAL) @@ -233,6 +235,7 @@ if(src.allowed(user)) src.locked = !src.locked to_chat(user, "The controls are now [src.locked ? "locked." : "unlocked."]") + update_icon() // VOREStation Add else to_chat(user, "Access denied.") return diff --git a/code/modules/power/singularity/emitter_vr.dm b/code/modules/power/singularity/emitter_vr.dm new file mode 100644 index 0000000000..b50769dbdf --- /dev/null +++ b/code/modules/power/singularity/emitter_vr.dm @@ -0,0 +1,37 @@ +/obj/machinery/power/emitter + icon = 'icons/obj/singularity_vr.dmi' // New emitter sprite + var/previous_state = 0 + +/obj/machinery/power/emitter/Initialize() + . = ..() + previous_state = state + +/obj/machinery/power/emitter/update_icon() + cut_overlays() + icon_state = "emitter[state]" + if (state != previous_state) + flick("emitterflick-[previous_state][state]",src) + previous_state = state + + if(powered && powernet && avail(active_power_usage) && active) + var/image/emitterbeam = image(icon,"emitter-beam") + emitterbeam.plane = PLANE_LIGHTING_ABOVE + add_overlay(emitterbeam) + + if(locked) + var/image/emitterlock = image(icon,"emitter-lock") + emitterlock.plane = PLANE_LIGHTING_ABOVE + add_overlay(emitterlock) + +// The old emitter sprite +/obj/machinery/power/emitter/antique + name = "antique emitter" + desc = "An old fashioned heavy duty industrial laser." + icon_state = "emitter" + +/obj/machinery/power/emitter/antique/update_icon() + if(powered && powernet && avail(active_power_usage) && active) + icon_state = "emitter_+a" + else + icon_state = "emitter" + diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index 365fda6b50..ac091a9fdb 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -460,8 +460,7 @@ GLOBAL_LIST_EMPTY(smeses) ..() /obj/machinery/power/smes/bullet_act(var/obj/item/projectile/Proj) - if(Proj.damage_type == BRUTE || Proj.damage_type == BURN) - take_damage(Proj.damage) + take_damage(Proj.get_structure_damage()) /obj/machinery/power/smes/ex_act(var/severity) // Two strong explosions will destroy a SMES. diff --git a/code/modules/projectiles/guns/energy/laser_vr.dm b/code/modules/projectiles/guns/energy/laser_vr.dm index 500239e8e0..b7e4fe3a66 100644 --- a/code/modules/projectiles/guns/energy/laser_vr.dm +++ b/code/modules/projectiles/guns/energy/laser_vr.dm @@ -214,7 +214,7 @@ modifystate = "phaserkill" firemodes = list( list(mode_name="lethal", fire_delay=12, projectile_type=/obj/item/projectile/beam/blue, modifystate="phaserkill", charge_cost = 300), - list(mode_name="low-power", fire_delay=8, projectile_type=/obj/item/projectile/beam/weaklaser/blue, modifystate="phaserstun", charge_cost = 80), + list(mode_name="low-power", fire_delay=8, projectile_type=/obj/item/projectile/beam/weaklaser/blue, modifystate="phaserstun", charge_cost = 100), ) /obj/item/weapon/gun/energy/locked/frontier/unload_ammo(var/mob/user) @@ -268,7 +268,7 @@ modifystate = "carbinekill" firemodes = list( list(mode_name="lethal", fire_delay=8, projectile_type=/obj/item/projectile/beam/blue, modifystate="carbinekill", charge_cost = 300), - list(mode_name="low-power", fire_delay=5, projectile_type=/obj/item/projectile/beam/weaklaser/blue, modifystate="carbinestun", charge_cost = 80), + list(mode_name="low-power", fire_delay=5, projectile_type=/obj/item/projectile/beam/weaklaser/blue, modifystate="carbinestun", charge_cost = 100), ) /obj/item/weapon/gun/energy/locked/frontier/carbine/update_icon() @@ -299,7 +299,7 @@ modifystate = "holdoutkill" firemodes = list( list(mode_name="lethal", fire_delay=12, projectile_type=/obj/item/projectile/beam/blue, modifystate="holdoutkill", charge_cost = 600), - list(mode_name="low-power", fire_delay=8, projectile_type=/obj/item/projectile/beam/weaklaser/blue, modifystate="holdoutstun", charge_cost = 160), + list(mode_name="low-power", fire_delay=8, projectile_type=/obj/item/projectile/beam/weaklaser/blue, modifystate="holdoutstun", charge_cost = 200), list(mode_name="stun", fire_delay=12, projectile_type=/obj/item/projectile/beam/stun/med, modifystate="holdoutshock", charge_cost = 300), ) @@ -361,7 +361,7 @@ /obj/item/weapon/gun/energy/locked/frontier/handbow name = "phaser handbow" - desc = "An minaturized weapon that fires a bolt of engery. Includes a built-in crank charger for recharging away from civilization. This one has a safety interlock that prevents firing while in proximity to the facility." + desc = "An minaturized weapon that fires a bolt of energy. Includes a built-in crank charger for recharging away from civilization. This one has a safety interlock that prevents firing while in proximity to the facility." icon = 'icons/obj/gun_vr.dmi' icon_state = "handbowkill" item_state = null @@ -371,12 +371,12 @@ charge_cost = 600 modifystate = "handbowkill" firemodes = list( - list(mode_name="lethal", fire_delay=12, projectile_type=/obj/item/projectile/energy/bolt/heavy, modifystate="handbowkill", charge_cost = 600), - list(mode_name="low-power", fire_delay=8, projectile_type=/obj/item/projectile/energy/bolt, modifystate="handbowstun", charge_cost = 160), + list(mode_name="lethal", fire_delay=12, projectile_type=/obj/item/projectile/energy/bow/heavy, modifystate="handbowkill", charge_cost = 600), + list(mode_name="low-power", fire_delay=8, projectile_type=/obj/item/projectile/energy/bow, modifystate="handbowstun", charge_cost = 200), ) -/obj/item/weapon/gun/energy/locked/frontier/holdout/unlocked - desc = "An minaturized weapon that fires a bolt of engery. Includes a built-in crank charger for recharging away from civilization." +/obj/item/weapon/gun/energy/locked/frontier/handbow/unlocked + desc = "An minaturized weapon that fires a bolt of energy. Includes a built-in crank charger for recharging away from civilization." req_access = newlist() //for toggling safety locked = 0 lockable = 0 \ No newline at end of file diff --git a/code/modules/projectiles/guns/energy/netgun_vr.dm b/code/modules/projectiles/guns/energy/netgun_vr.dm index f041c9ff0e..d072be2c55 100644 --- a/code/modules/projectiles/guns/energy/netgun_vr.dm +++ b/code/modules/projectiles/guns/energy/netgun_vr.dm @@ -1,15 +1,45 @@ +//Contains the Energy Net Gun code and information/lore + /obj/item/weapon/gun/energy/netgun - name = "\"Varmint Catcher\" energy net gun" - desc = "A Hephaestus-designed, usually dubbed 'non-lethal capture device' energy net launcher, \ - for when you wanna capture feracious predators." //YW edit - small change to description - catalogue_data = list(/datum/category_item/catalogue/information/organization/hephaestus) + name = "energy net gun" + desc = "Specially made-to-order by Hephaestus, the \"Varmint Catcher\" is designed to trap even the most unruly of creatures for safe transport." //YW edit - small change to description + description_fluff = "The Hephaestus Brand XX-1 Energy Net Cannon is a marvel of technology that is used heavily by several departments within NanoTrasen. \ + Whether by scientific departments when capturing specimens on alien worlds to study or by security forces to detain unruly crew, NanoTrasen is deeply \ + appreciative of the \"Varmint Catcher\" Netgun System. WARNING!: Hephaestus and NanoTrasen are not responsible for any injuries caused by the device \ + in any aspect, thank you for understanding." //YW edit - small change to description icon = 'icons/obj/gun_vr.dmi' icon_state = "netgun" item_state = "gun" // Placeholder - charge_meter = 0 fire_sound = 'sound/weapons/eluger.ogg' origin_tech = list(TECH_COMBAT = 3, TECH_MATERIAL = 5, TECH_MAGNET = 3) projectile_type = /obj/item/projectile/beam/energy_net charge_cost = 800 fire_delay = 50 + +/obj/item/weapon/gun/energy/netgun/update_icon() + if(power_supply == null) + if(modifystate) + icon_state = "[modifystate]_open" + else + icon_state = "[initial(icon_state)]_open" + return + else if(charge_meter) + var/ratio = power_supply.charge / power_supply.maxcharge + + //make sure that rounding down will not give us the empty state even if we have charge for a shot left. + if(power_supply.charge < charge_cost) + ratio = 0 + else + ratio = max(round(ratio, 0.25) * 100, 25) + + if(modifystate) + icon_state = "[modifystate][ratio]" + else + icon_state = "[initial(icon_state)][ratio]" + + else if(power_supply) + if(modifystate) + icon_state = "[modifystate]" + else + icon_state = "[initial(icon_state)]" \ 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 3b272f8d11..404562ae1d 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/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/projectile/energy_vr.dm b/code/modules/projectiles/projectile/energy_vr.dm index b0e9bebb69..5bc690c1b5 100644 --- a/code/modules/projectiles/projectile/energy_vr.dm +++ b/code/modules/projectiles/projectile/energy_vr.dm @@ -10,16 +10,16 @@ /obj/item/projectile/energy/flash/flare flash_range = 2 -/obj/item/projectile/energy/bolt +/obj/item/projectile/energy/bow name = "engergy bolt" icon_state = "cbbolt" damage = 20 -/obj/item/projectile/energy/bolt/heavy +/obj/item/projectile/energy/bow/heavy damage = 30 icon_state = "cbbolt" - -/obj/item/projectile/energy/bolt/stun + +/obj/item/projectile/energy/bow/stun name = "stun bolt" agony = 30 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/reactions/instant/instant_vr.dm b/code/modules/reagents/reactions/instant/instant_vr.dm index 6128b79826..a014c0d45f 100644 --- a/code/modules/reagents/reactions/instant/instant_vr.dm +++ b/code/modules/reagents/reactions/instant/instant_vr.dm @@ -200,36 +200,26 @@ /////////////////////////////// //SLIME CORES BELOW HERE/////// /////////////////////////////// - - - /decl/chemical_reaction/instant/slime_food name = "Slime Bork" id = "m_tele2" result = null required_reagents = list("phoron" = 10, "slimejelly" = 5, "nutriment" = 20) result_amount = 1 - on_reaction(var/datum/reagents/holder) - - var/list/borks = typesof(/obj/item/weapon/reagent_containers/food/snacks) - /obj/item/weapon/reagent_containers/food/snacks // BORK BORK BORK - - playsound(holder.my_atom, 'sound/effects/phasein.ogg', 100, 1) -/* Removed at some point, unsure what to replace with - for(var/mob/living/carbon/human/M in viewers(get_turf(holder.my_atom), null)) - if(M:eyecheck() <= 0) - flick("e_flash", M.flash) -*/ - for(var/i = 1, i <= 4 + rand(1,2), i++) - var/chosen = pick(borks) - var/obj/B = new chosen - if(B) - B.loc = get_turf(holder.my_atom) - if(prob(50)) - for(var/j = 1, j <= rand(1, 3), j++) - step(B, pick(NORTH,SOUTH,EAST,WEST)) +/decl/chemical_reaction/instant/slime_food/on_reaction(var/datum/reagents/holder) + var/list/borks = typesof(/obj/item/weapon/reagent_containers/food/snacks) - /obj/item/weapon/reagent_containers/food/snacks // BORK BORK BORK + playsound(holder.my_atom, 'sound/effects/phasein.ogg', 100, 1) + for(var/i = 1, i <= 4 + rand(1,2), i++) + var/chosen = pick(borks) + var/obj/B = new chosen + if(B) + B.loc = get_turf(holder.my_atom) + if(prob(50)) + for(var/j = 1, j <= rand(1, 3), j++) + step(B, pick(NORTH,SOUTH,EAST,WEST)) /decl/chemical_reaction/instant/materials name = "Slime materials" @@ -237,56 +227,52 @@ result = null required_reagents = list("phoron" = 20, "slimejelly" = 40, "aluminum" = 20) //Woah there! You have the possibility of making diamonds! 8 ground up slimes required for one of these, and you still have a 10% chance for it to fail. result_amount = 1 - on_reaction(var/datum/reagents/holder) - var/fail_chance = rand(1,1000) - if(fail_chance == 1) // 0.1% chance of exploding, so scientists don't exclusively abuse this to obtain materials. - for(var/mob/O in viewers(get_turf(holder.my_atom), null)) - O.show_message(text("The solution begins to vibrate violently!"), 1) // It was at this moment, the Xenobiologist knew... he fucked up. - sleep(30) - playsound(holder.my_atom, 'sound/items/Welder2.ogg', 100, 1) - for(var/mob/O in viewers(get_turf(holder.my_atom), null)) - O.show_message(text("The reaction begins to rapidly sizzle and swell outwards!"), 1) - sleep(20) - explosion(get_turf(holder.my_atom), 0 ,4, 8) //Enough to cause severe damage in the area, but not so much that it'll instantly gib the person. - empulse(get_turf(holder.my_atom), 3, 7) //Uh oh, it produced some uranium, too! EMP blast! - return - if(fail_chance < 101) // 10% chance of it not working at all. - playsound(holder.my_atom, 'sound/items/Welder.ogg', 100, 1) - for(var/mob/O in viewers(get_turf(holder.my_atom), null)) - O.show_message(text("The slime core fizzles disappointingly."), 1) - return +/decl/chemical_reaction/instant/materials/on_reaction(var/datum/reagents/holder) + var/fail_chance = rand(1,1000) + if(fail_chance == 1) // 0.1% chance of exploding, so scientists don't exclusively abuse this to obtain materials. + for(var/mob/O in viewers(get_turf(holder.my_atom), null)) + O.show_message(text("The solution begins to vibrate violently!"), 1) // It was at this moment, the Xenobiologist knew... he fucked up. + sleep(30) + playsound(holder.my_atom, 'sound/items/Welder2.ogg', 100, 1) + for(var/mob/O in viewers(get_turf(holder.my_atom), null)) + O.show_message(text("The reaction begins to rapidly sizzle and swell outwards!"), 1) + sleep(20) + explosion(get_turf(holder.my_atom), 0 ,4, 8) //Enough to cause severe damage in the area, but not so much that it'll instantly gib the person. + empulse(get_turf(holder.my_atom), 3, 7) //Uh oh, it produced some uranium, too! EMP blast! + return - var/blocked = list( - /obj/item/stack/material, //Technical stacks - /obj/item/stack/hairlesshide, //Useless leather production steps - /obj/item/stack/wetleather, - /obj/item/stack/material/algae/ten) //Why is this one even a separate thing - blocked += typesof(/obj/item/stack/material/cyborg) //Borg matter synths, should only exist in borgs - blocked += typesof(/obj/item/stack/animalhide) //Hides which are only used for leather production anyway + if(fail_chance < 101) // 10% chance of it not working at all. + playsound(holder.my_atom, 'sound/items/Welder.ogg', 100, 1) + for(var/mob/O in viewers(get_turf(holder.my_atom), null)) + O.show_message(text("The slime core fizzles disappointingly."), 1) + return - var/rare_types = list( - /obj/item/stack/material/morphium, //Complex materials requiring Particle Smasher to create - /obj/item/stack/material/morphium/hull, - /obj/item/stack/material/valhollide, - /obj/item/stack/material/supermatter) + var/blocked = list( + /obj/item/stack/material, //Technical stacks + /obj/item/stack/hairlesshide, //Useless leather production steps + /obj/item/stack/wetleather, + /obj/item/stack/material/algae/ten) //Why is this one even a separate thing + blocked += typesof(/obj/item/stack/material/cyborg) //Borg matter synths, should only exist in borgs + blocked += typesof(/obj/item/stack/animalhide) //Hides which are only used for leather production anyway - var/list/material = typesof(/obj/item/stack/material) - blocked + var/rare_types = list( + /obj/item/stack/material/morphium, //Complex materials requiring Particle Smasher to create + /obj/item/stack/material/morphium/hull, + /obj/item/stack/material/valhollide, + /obj/item/stack/material/supermatter) - playsound(holder.my_atom, 'sound/effects/phasein.ogg', 100, 1) -/* Removed at some point, unsure what to replace with - for(var/mob/living/carbon/human/M in viewers(get_turf(holder.my_atom), null)) - if(M:eyecheck() <= 0) - flick("e_flash", M.flash) -*/ - var/spawn_amount = rand(1,50) - var/chosen = pick(material) - if(chosen in rare_types) - spawn_amount = rand(1,15) - var/obj/item/stack/material/C = new chosen - C.amount = spawn_amount - C.loc = get_turf(holder.my_atom) + var/list/material = typesof(/obj/item/stack/material) - blocked + playsound(holder.my_atom, 'sound/effects/phasein.ogg', 100, 1) + + var/spawn_amount = rand(1,50) + var/chosen = pick(material) + if(chosen in rare_types) + spawn_amount = rand(1,15) + var/obj/item/stack/material/C = new chosen + C.amount = spawn_amount + C.loc = get_turf(holder.my_atom) /decl/chemical_reaction/instant/slimelight name = "Slime Glow" @@ -294,11 +280,12 @@ result = null required_reagents = list("phoron" = 5, "slimejelly" = 5, "water" = 10) //Takes 10 water so it doesn't mess with the frost oil. result_amount = 1 - on_reaction(var/datum/reagents/holder) - for(var/mob/O in viewers(get_turf(holder.my_atom), null)) - O.show_message(text(" The contents of the slime core harden and begin to emit a warm, bright light."), 1) - var/obj/item/device/flashlight/slime/F = new /obj/item/device/flashlight/slime - F.loc = get_turf(holder.my_atom) + +/decl/chemical_reaction/instant/slimelight/on_reaction(var/datum/reagents/holder) + for(var/mob/O in viewers(get_turf(holder.my_atom), null)) + O.show_message(text(" The contents of the slime core harden and begin to emit a warm, bright light."), 1) + var/obj/item/device/flashlight/slime/F = new /obj/item/device/flashlight/slime + F.loc = get_turf(holder.my_atom) /decl/chemical_reaction/instant/slimephoron @@ -307,10 +294,11 @@ result = null required_reagents = list("phoron" = 20, "uranium" = 20, "slimejelly" = 20) result_amount = 1 - on_reaction(var/datum/reagents/holder) - var/obj/item/stack/material/phoron/P = new /obj/item/stack/material/phoron - P.amount = 10 - P.loc = get_turf(holder.my_atom) + +/decl/chemical_reaction/instant/slimephoron/on_reaction(var/datum/reagents/holder) + var/obj/item/stack/material/phoron/P = new /obj/item/stack/material/phoron + P.amount = 10 + P.loc = get_turf(holder.my_atom) /decl/chemical_reaction/instant/slimefreeze name = "Slime Freeze" @@ -318,17 +306,15 @@ result = null required_reagents = list("phoron" = 10, "coolant" = 10, "slimejelly" = 10) result_amount = 1 - on_reaction(var/datum/reagents/holder) - for(var/mob/O in viewers(get_turf(holder.my_atom), null)) - O.show_message(text("The slime extract begins to vibrate violently!"), 1) - sleep(50) - playsound(holder.my_atom, 'sound/effects/phasein.ogg', 100, 1) - for(var/mob/living/M in range (get_turf(holder.my_atom), 7)) - M.bodytemperature -= 140 - to_chat(M, " You suddenly feel a chill!") - - +/decl/chemical_reaction/instant/slimefreeze/on_reaction(var/datum/reagents/holder) + for(var/mob/O in viewers(get_turf(holder.my_atom), null)) + O.show_message(text("The slime extract begins to vibrate violently!"), 1) + sleep(50) + playsound(holder.my_atom, 'sound/effects/phasein.ogg', 100, 1) + for(var/mob/living/M in range (get_turf(holder.my_atom), 7)) + M.bodytemperature -= 140 + to_chat(M, " You suddenly feel a chill!") /decl/chemical_reaction/instant/slimefrost name = "Slime Frost Oil" @@ -337,24 +323,21 @@ required_reagents = list("phoron" = 5, "slimejelly" = 5, "water" = 5, "coolant" = 5) result_amount = 10 - - - /decl/chemical_reaction/instant/slimefire name = "Slime fire" id = "m_fire" result = null required_reagents = list("phoron" = 60, "slimejelly" = 30, "potassium" = 30) result_amount = 1 - on_reaction(var/datum/reagents/holder) - for(var/mob/O in viewers(get_turf(holder.my_atom), null)) - O.show_message(text("The slime extract begins to vibrate violently!"), 1) - sleep(50) - var/turf/location = get_turf(holder.my_atom.loc) - for(var/turf/simulated/floor/target_tile in range(0,location)) - target_tile.assume_gas("phoron", 25, 1400) - spawn (0) target_tile.hotspot_expose(700, 400) +/decl/chemical_reaction/instant/slimefire/on_reaction(var/datum/reagents/holder) + for(var/mob/O in viewers(get_turf(holder.my_atom), null)) + O.show_message(text("The slime extract begins to vibrate violently!"), 1) + sleep(50) + var/turf/location = get_turf(holder.my_atom.loc) + for(var/turf/simulated/floor/target_tile in range(0,location)) + target_tile.assume_gas("phoron", 25, 1400) + spawn (0) target_tile.hotspot_expose(700, 400) /decl/chemical_reaction/instant/slimeify name = "Advanced Mutation Toxin" @@ -363,25 +346,22 @@ required_reagents = list("phoron" = 15, "slimejelly" = 15, "mutationtoxin" = 15) //In case a xenobiologist wants to become a fully fledged slime person. result_amount = 1 - - - - /decl/chemical_reaction/instant/slimeheal //A slime healing mixture. Why not. name = "Slime Health" id = "slimeheal" result = "null" required_reagents = list("phoron" = 10, "bicaridine" = 10, "kelotane" = 10, "inaprovaline" = 10, "slimejelly" = 10) - on_reaction(var/datum/reagents/holder, var/created_volume) - for (var/mob/living/carbon/C in viewers(get_turf(holder.my_atom), null)) - to_chat(C, "A wave of energy suddenly invigorates you.") - C.adjustBruteLoss(-25) - C.adjustFireLoss(-25) - C.adjustToxLoss(-25) - C.adjustOxyLoss(-25) - C.adjustBrainLoss(-25) - C.adjustCloneLoss(-25) - C.updatehealth() + +/decl/chemical_reaction/instant/slimeheal/on_reaction(var/datum/reagents/holder, var/created_volume) + for (var/mob/living/carbon/C in viewers(get_turf(holder.my_atom), null)) + to_chat(C, "A wave of energy suddenly invigorates you.") + C.adjustBruteLoss(-25) + C.adjustFireLoss(-25) + C.adjustToxLoss(-25) + C.adjustOxyLoss(-25) + C.adjustBrainLoss(-25) + C.adjustCloneLoss(-25) + C.updatehealth() /decl/chemical_reaction/instant/slimejelly name = "Slime Jam" @@ -396,62 +376,58 @@ result = null required_reagents = list("phoron" = 20, "nutriment" = 20, "sugar" = 20, "mutationtoxin" = 20) //Can't do slime jelly as it'll conflict with another, but mutation toxin will do. result_amount = 1 - on_reaction(var/datum/reagents/holder) - var/mob_path = /mob/living/simple_mob - var/blocked = list( //List of things we do NOT want to spawn - /mob/living/simple_mob, //Technical parent mobs - /mob/living/simple_mob/animal, - /mob/living/simple_mob/animal/passive, - /mob/living/simple_mob/animal/space, - /mob/living/simple_mob/blob, - /mob/living/simple_mob/mechanical, - /mob/living/simple_mob/mechanical/mecha, - /mob/living/simple_mob/slime, - /mob/living/simple_mob/vore, - /mob/living/simple_mob/vore/aggressive, - /mob/living/simple_mob/illusion, //Other technical mobs - /mob/living/simple_mob/animal/passive/crab/Coffee, //Unique pets/named mobs - /mob/living/simple_mob/animal/passive/cat/runtime, - /mob/living/simple_mob/animal/passive/cat/bones, - /mob/living/simple_mob/animal/passive/cat/tabiranth, - /mob/living/simple_mob/animal/passive/dog/corgi/puppy/Bockscar, - /mob/living/simple_mob/animal/passive/dog/corgi/Ian, - /mob/living/simple_mob/animal/passive/dog/corgi/Lisa, - /mob/living/simple_mob/animal/passive/dog/tamaskan/Spice, - /mob/living/simple_mob/animal/passive/fox/renault, - /mob/living/simple_mob/animal/passive/bird/azure_tit/tweeter, - /mob/living/simple_mob/animal/passive/bird/parrot/poly, - /mob/living/simple_mob/animal/sif/fluffy, - /mob/living/simple_mob/animal/sif/fluffy/silky, - /mob/living/simple_mob/animal/passive/snake/noodle, - /mob/living/simple_mob/slime/xenobio/rainbow/kendrick, - /mob/living/simple_mob/animal/space/space_worm, //Space Worm parts that aren't proper heads - /mob/living/simple_mob/animal/space/space_worm/head/severed, - /mob/living/simple_mob/animal/borer, //Event/player-control-only mobs - /mob/living/simple_mob/vore/hostile/morph - )//exclusion list for things you don't want the reaction to create. - blocked += typesof(/mob/living/simple_mob/mechanical/ward) //Wards that should be created with ward items, are mobs mostly on technicalities - blocked += typesof(/mob/living/simple_mob/construct) //Should only exist - blocked += typesof(/mob/living/simple_mob/vore/demon) //as player-controlled - blocked += typesof(/mob/living/simple_mob/shadekin) //and/or event things - blocked += typesof(/mob/living/simple_mob/horror) - var/list/voremobs = typesof(mob_path) - blocked // list of possible hostile mobs - playsound(holder.my_atom, 'sound/effects/phasein.ogg', 100, 1) -/* Removed at some point, unsure what to replace with - for(var/mob/living/carbon/human/M in viewers(get_turf(holder.my_atom), null)) - if(M:eyecheck() <= 0) - flick("e_flash", M.flash) -*/ - var/spawn_count = rand(1,3) - for(var/i = 1, i <= spawn_count, i++) - var/chosen = pick(voremobs) - var/mob/living/simple_mob/C = new chosen - C.faction = "slimesummon" - C.loc = get_turf(holder.my_atom) - if(prob(50)) - for(var/j = 1, j <= rand(1, 3), j++) - step(C, pick(NORTH,SOUTH,EAST,WEST)) +/decl/chemical_reaction/instant/slimevore/on_reaction(var/datum/reagents/holder) + var/mob_path = /mob/living/simple_mob + var/blocked = list( //List of things we do NOT want to spawn + /mob/living/simple_mob, //Technical parent mobs + /mob/living/simple_mob/animal, + /mob/living/simple_mob/animal/passive, + /mob/living/simple_mob/animal/space, + /mob/living/simple_mob/blob, + /mob/living/simple_mob/mechanical, + /mob/living/simple_mob/mechanical/mecha, + /mob/living/simple_mob/slime, + /mob/living/simple_mob/vore, + /mob/living/simple_mob/vore/aggressive, + /mob/living/simple_mob/illusion, //Other technical mobs + /mob/living/simple_mob/animal/passive/crab/Coffee, //Unique pets/named mobs + /mob/living/simple_mob/animal/passive/cat/runtime, + /mob/living/simple_mob/animal/passive/cat/bones, + /mob/living/simple_mob/animal/passive/cat/tabiranth, + /mob/living/simple_mob/animal/passive/dog/corgi/puppy/Bockscar, + /mob/living/simple_mob/animal/passive/dog/corgi/Ian, + /mob/living/simple_mob/animal/passive/dog/corgi/Lisa, + /mob/living/simple_mob/animal/passive/dog/tamaskan/Spice, + /mob/living/simple_mob/animal/passive/fox/renault, + /mob/living/simple_mob/animal/passive/bird/azure_tit/tweeter, + /mob/living/simple_mob/animal/passive/bird/parrot/poly, + /mob/living/simple_mob/animal/sif/fluffy, + /mob/living/simple_mob/animal/sif/fluffy/silky, + /mob/living/simple_mob/animal/passive/snake/noodle, + /mob/living/simple_mob/slime/xenobio/rainbow/kendrick, + /mob/living/simple_mob/animal/space/space_worm, //Space Worm parts that aren't proper heads + /mob/living/simple_mob/animal/space/space_worm/head/severed, + /mob/living/simple_mob/animal/borer, //Event/player-control-only mobs + /mob/living/simple_mob/vore/hostile/morph + )//exclusion list for things you don't want the reaction to create. + blocked += typesof(/mob/living/simple_mob/mechanical/ward) //Wards that should be created with ward items, are mobs mostly on technicalities + blocked += typesof(/mob/living/simple_mob/construct) //Should only exist + blocked += typesof(/mob/living/simple_mob/vore/demon) //as player-controlled + blocked += typesof(/mob/living/simple_mob/shadekin) //and/or event things + blocked += typesof(/mob/living/simple_mob/horror) + var/list/voremobs = typesof(mob_path) - blocked // list of possible hostile mobs + + playsound(holder.my_atom, 'sound/effects/phasein.ogg', 100, 1) + var/spawn_count = rand(1,3) + for(var/i = 1, i <= spawn_count, i++) + var/chosen = pick(voremobs) + var/mob/living/simple_mob/C = new chosen + C.faction = "slimesummon" + C.loc = get_turf(holder.my_atom) + if(prob(50)) + for(var/j = 1, j <= rand(1, 3), j++) + step(C, pick(NORTH,SOUTH,EAST,WEST)) /decl/chemical_reaction/instant/slime/sapphire_mutation name = "Slime Mutation Toxins" diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index 906b8411b7..12b4694e21 100644 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -310,7 +310,7 @@ if (!is_open_container()) add_overlay("lid_[initial(icon_state)]") -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/reagent_containers/hypospray.dm b/code/modules/reagents/reagent_containers/hypospray.dm index 80d0e1e34d..5f05faeb70 100644 --- a/code/modules/reagents/reagent_containers/hypospray.dm +++ b/code/modules/reagents/reagent_containers/hypospray.dm @@ -186,6 +186,17 @@ icon_state = "green" filled_reagents = list("anti_toxin" = 5) +//Special autoinjectors, while having potent chems like the 15u ones, the chems are usually potent enough that 5u is enough +/obj/item/weapon/reagent_containers/hypospray/autoinjector/bonemed + name = "bone repair injector" + desc = "A rapid and safe way to administer small amounts of drugs by untrained or trained personnel. This one excels at treating damage to bones." + filled_reagents = list("osteodaxon" = 5) + +/obj/item/weapon/reagent_containers/hypospray/autoinjector/clonemed + name = "clone injector" + desc = "A rapid and safe way to administer small amounts of drugs by untrained or trained personnel. This one excels at treating genetic damage." + filled_reagents = list("rezadone" = 5) + // These have a 15u capacity, somewhat higher tech level, and generally more useful chems, but are otherwise the same as the regular autoinjectors. /obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector name = "empty hypo" @@ -247,11 +258,6 @@ desc = "A refined version of the standard autoinjector, allowing greater capacity. This variant excels at treating bleeding wounds and internal bleeding." filled_reagents = list("inaprovaline" = 5, "myelamine" = 10) -/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/bonemed - name = "bone repair injector" - desc = "A refined version of the standard autoinjector, allowing greater capacity. This one excels at treating damage to bones." - filled_reagents = list("inaprovaline" = 5, "osteodaxon" = 10) - /obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/glucose name = "glucose hypo" desc = "A hypoinjector filled with glucose, used for critically malnourished patients and voidsuited workers." diff --git a/code/modules/reagents/reagent_containers/unidentified_hypospray.dm b/code/modules/reagents/reagent_containers/unidentified_hypospray.dm index 496e694cbc..1a3412dbe7 100644 --- a/code/modules/reagents/reagent_containers/unidentified_hypospray.dm +++ b/code/modules/reagents/reagent_containers/unidentified_hypospray.dm @@ -5,6 +5,14 @@ identity_type = /datum/identification/hypo // The good. +/obj/item/weapon/reagent_containers/hypospray/autoinjector/bonemed/unidentified + init_hide_identity = TRUE + flags = 0 + +/obj/item/weapon/reagent_containers/hypospray/autoinjector/clonemed/unidentified + init_hide_identity = TRUE + flags = 0 + /obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/brute/unidentified init_hide_identity = TRUE flags = 0 @@ -37,10 +45,6 @@ init_hide_identity = TRUE flags = 0 -/obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/bonemed/unidentified - init_hide_identity = TRUE - flags = 0 - /obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/combat/unidentified init_hide_identity = TRUE flags = 0 diff --git a/code/modules/reagents/reagents/_reagents.dm b/code/modules/reagents/reagents/_reagents.dm index 2fbcfe340c..038fddf9a3 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 a921f41064..53fcef6448 100644 --- a/code/modules/reagents/reagents/food_drinks.dm +++ b/code/modules/reagents/reagents/food_drinks.dm @@ -124,7 +124,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" @@ -135,7 +135,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) ..() @@ -239,7 +239,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" @@ -249,7 +249,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 @@ -266,7 +266,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) @@ -286,35 +286,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" @@ -352,7 +352,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" @@ -370,7 +370,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)) @@ -384,7 +384,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" @@ -411,7 +411,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" @@ -450,7 +450,7 @@ reagent_state = LIQUID nutriment_factor = 2 color = "#792300" - allergen_type = BEANS //Soy (beans) + allergen_type = ALLERGEN_BEANS //Soy (beans) /datum/reagent/nutriment/ketchup @@ -461,7 +461,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" @@ -491,7 +491,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" @@ -502,7 +502,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" @@ -548,7 +548,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" @@ -917,7 +917,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" @@ -928,7 +928,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" @@ -939,7 +939,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" @@ -950,7 +950,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) ..() @@ -966,7 +966,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) ..() @@ -1000,7 +1000,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 @@ -1013,7 +1013,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" @@ -1025,7 +1025,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) ..() @@ -1042,7 +1042,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) ..() @@ -1072,7 +1072,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" @@ -1084,7 +1084,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) ..() @@ -1101,7 +1101,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 @@ -1118,7 +1118,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" @@ -1164,7 +1164,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" @@ -1179,7 +1179,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" @@ -1264,7 +1264,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" @@ -1278,7 +1278,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" @@ -1292,7 +1292,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" @@ -1306,7 +1306,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" @@ -1353,7 +1353,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) @@ -1425,7 +1425,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) ..() @@ -1445,7 +1445,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) ..() @@ -1466,7 +1466,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" @@ -1510,7 +1510,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" @@ -1538,7 +1538,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" @@ -1551,7 +1551,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" @@ -1564,7 +1564,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" @@ -1577,7 +1577,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" @@ -1590,7 +1590,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" @@ -1602,7 +1602,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" @@ -1614,7 +1614,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) ..() @@ -1647,7 +1647,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" @@ -1659,7 +1659,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" @@ -1674,7 +1674,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) @@ -1688,7 +1688,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" @@ -1700,7 +1700,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) ..() @@ -1765,7 +1765,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" @@ -1790,7 +1790,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" @@ -1803,7 +1803,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" @@ -1860,7 +1860,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" @@ -1873,7 +1873,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" @@ -1886,7 +1886,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" @@ -1899,7 +1899,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) ..() @@ -2008,7 +2008,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" @@ -2020,7 +2020,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" @@ -2031,7 +2031,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" @@ -2042,7 +2042,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" @@ -2055,7 +2055,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" @@ -2068,7 +2068,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" @@ -2079,7 +2079,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" @@ -2093,7 +2093,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) ..() @@ -2119,7 +2119,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) ..() @@ -2149,7 +2149,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" @@ -2160,7 +2160,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" @@ -2172,7 +2172,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" @@ -2184,7 +2184,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" @@ -2196,7 +2196,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" @@ -2209,7 +2209,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" @@ -2222,7 +2222,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 */ @@ -2252,7 +2252,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" @@ -2266,7 +2266,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) ..() @@ -2286,7 +2286,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" @@ -2300,7 +2300,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" @@ -2314,7 +2314,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" @@ -2356,12 +2356,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) @@ -2415,7 +2415,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" @@ -2429,7 +2429,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" @@ -2465,7 +2465,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" @@ -2510,7 +2510,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" @@ -2523,7 +2523,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) ..() @@ -2540,7 +2540,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" @@ -2553,7 +2553,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" @@ -2565,7 +2565,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" @@ -2579,7 +2579,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 @@ -2596,7 +2596,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" @@ -2609,7 +2609,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" @@ -2622,7 +2622,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" @@ -2636,7 +2636,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" @@ -2649,7 +2649,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" @@ -2664,7 +2664,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" @@ -2679,7 +2679,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" @@ -2693,7 +2693,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" @@ -2706,7 +2706,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" @@ -2720,7 +2720,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" @@ -2733,7 +2733,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" @@ -2748,7 +2748,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) ..() @@ -2766,7 +2766,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" @@ -2779,7 +2779,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" @@ -2792,7 +2792,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" @@ -2805,7 +2805,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" @@ -2830,7 +2830,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" @@ -2843,7 +2843,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" @@ -2867,7 +2867,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" @@ -2879,7 +2879,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" @@ -2892,7 +2892,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" @@ -2905,7 +2905,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" @@ -2930,7 +2930,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" @@ -2946,7 +2946,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" @@ -2959,7 +2959,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" @@ -2973,7 +2973,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" @@ -2988,7 +2988,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 @@ -3016,7 +3016,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" @@ -3029,7 +3029,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" @@ -3042,7 +3042,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" @@ -3055,7 +3055,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" @@ -3068,7 +3068,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" @@ -3081,7 +3081,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" @@ -3094,7 +3094,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" @@ -3107,7 +3107,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" @@ -3120,7 +3120,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" @@ -3161,7 +3161,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) ..() @@ -3189,7 +3189,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) ..() @@ -3228,7 +3228,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" @@ -3241,7 +3241,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" @@ -3255,7 +3255,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" @@ -3268,7 +3268,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" @@ -3281,7 +3281,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" @@ -3294,7 +3294,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" @@ -3307,7 +3307,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" @@ -3332,7 +3332,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" @@ -3348,7 +3348,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" @@ -3361,7 +3361,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" @@ -3374,7 +3374,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" @@ -3387,7 +3387,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" @@ -3400,7 +3400,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" @@ -3413,7 +3413,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" @@ -3426,7 +3426,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" @@ -3464,7 +3464,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" @@ -3477,7 +3477,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" @@ -3490,7 +3490,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" @@ -3503,7 +3503,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" @@ -3516,7 +3516,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" @@ -3529,7 +3529,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" @@ -3542,7 +3542,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" @@ -3555,7 +3555,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" @@ -3569,7 +3569,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" @@ -3582,7 +3582,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" @@ -3595,7 +3595,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" @@ -3607,7 +3607,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" @@ -3620,7 +3620,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" @@ -3644,7 +3644,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" @@ -3668,7 +3668,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) ..() @@ -3687,7 +3687,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" @@ -3700,7 +3700,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" @@ -3713,7 +3713,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" @@ -3726,7 +3726,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" @@ -3759,7 +3759,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" @@ -3772,7 +3772,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" @@ -3785,7 +3785,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" @@ -3798,7 +3798,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" @@ -3811,7 +3811,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) ..() @@ -3830,7 +3830,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" @@ -3843,7 +3843,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" @@ -3856,7 +3856,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" @@ -3869,7 +3869,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" @@ -3882,7 +3882,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" @@ -3896,7 +3896,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" @@ -3910,7 +3910,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" @@ -3923,7 +3923,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" @@ -3938,7 +3938,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" @@ -3975,7 +3975,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) ..() @@ -4005,7 +4005,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" @@ -4018,7 +4018,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" @@ -4034,7 +4034,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" @@ -4047,7 +4047,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" @@ -4060,7 +4060,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" @@ -4084,7 +4084,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" @@ -4097,7 +4097,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" @@ -4121,7 +4121,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" @@ -4137,7 +4137,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/medicine.dm b/code/modules/reagents/reagents/medicine.dm index 5dcce09312..08b9430d53 100644 --- a/code/modules/reagents/reagents/medicine.dm +++ b/code/modules/reagents/reagents/medicine.dm @@ -8,7 +8,7 @@ reagent_state = LIQUID color = "#00BFFF" overdose = REAGENTS_OVERDOSE * 2 - metabolism = REM * 0.5 + metabolism = REM * 0.2 scannable = 1 /datum/reagent/inaprovaline/affect_blood(var/mob/living/carbon/M, var/alien, var/removed) @@ -24,9 +24,9 @@ reagent_state = LIQUID color = "#00BFFF" overdose = REAGENTS_OVERDOSE * 2 - metabolism = REM * 0.5 + metabolism = REM * 0.2 scannable = 1 - touch_met = REM * 0.75 + touch_met = REM * 0.3 can_overdose_touch = TRUE /datum/reagent/inaprovaline/topical/affect_blood(var/mob/living/carbon/M, var/alien, var/removed) @@ -60,7 +60,7 @@ /datum/reagent/bicaridine/overdose(var/mob/living/carbon/M, var/alien, var/removed) ..() - var/wound_heal = 1.5 * removed + var/wound_heal = 2.5 * removed M.eye_blurry = min(M.eye_blurry + wound_heal, 250) if(ishuman(M)) var/mob/living/carbon/human/H = M @@ -738,7 +738,7 @@ overdose = REAGENTS_OVERDOSE * 0.5 overdose_mod = 1.5 scannable = 1 - var/repair_strength = 3 + var/repair_strength = 5 /datum/reagent/myelamine/affect_blood(var/mob/living/carbon/M, var/alien, var/removed) if(alien == IS_DIONA) diff --git a/code/modules/reagents/reagents/other.dm b/code/modules/reagents/reagents/other.dm index 6f005999b6..48315802c8 100644 --- a/code/modules/reagents/reagents/other.dm +++ b/code/modules/reagents/reagents/other.dm @@ -167,7 +167,7 @@ taste_description = "bwoink" reagent_state = LIQUID color = "#C8A5DC" - affects_dead = 1 //This can even heal dead people. + affects_dead = TRUE //This can even heal dead people. metabolism = 0.1 mrate_static = TRUE //Just in case @@ -178,11 +178,10 @@ affect_blood(M, alien, removed) /datum/reagent/adminordrazine/affect_blood(var/mob/living/carbon/M, var/alien, var/removed) - M.setCloneLoss(0) - M.setOxyLoss(0) - M.radiation = 0 - M.heal_organ_damage(20,20) - M.adjustToxLoss(-20) + M.heal_organ_damage(40,40) + M.adjustCloneLoss(-40) + M.adjustToxLoss(-40) + M.adjustOxyLoss(-300) M.hallucination = 0 M.setBrainLoss(0) M.disabilities = 0 @@ -202,6 +201,10 @@ M.radiation = 0 M.ExtinguishMob() M.fire_stacks = 0 + M.add_chemical_effect(CE_ANTIBIOTIC, ANTIBIO_SUPER) + M.add_chemical_effect(CE_STABLE, 15) + M.add_chemical_effect(CE_PAINKILLER, 200) + M.remove_a_modifier_of_type(/datum/modifier/poisoned) if(M.bodytemperature > 310) M.bodytemperature = max(310, M.bodytemperature - (40 * TEMPERATURE_DAMAGE_COEFFICIENT)) else if(M.bodytemperature < 311) @@ -209,6 +212,9 @@ if(ishuman(M)) var/mob/living/carbon/human/H = M var/wound_heal = 5 + for(var/obj/item/organ/I in H.internal_organs) + if(I.damage > 0) //Adminordrazine heals even robits, it is magic + I.damage = max(I.damage - wound_heal, 0) for(var/obj/item/organ/external/O in H.bad_external_organs) if(O.status & ORGAN_BROKEN) O.mend_fracture() //Only works if the bone won't rebreak, as usual 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 7127ed9ff5..610fb85e54 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -589,146 +589,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) @@ -753,275 +753,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 @@ -1059,116 +1060,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 @@ -1178,45 +1179,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 @@ -1225,46 +1226,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" @@ -1281,103 +1282,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" @@ -1491,18 +1494,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 2bfab50bbb..05f7f28a0d 100755 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -379,12 +379,11 @@ var/c_mode = 0 -/obj/machinery/disposal/deliveryChute/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 /obj/machinery/disposal/deliveryChute/interact() return @@ -439,34 +438,27 @@ 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) + 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 + 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 + if(!W.remove_fuel(0,user)) 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/message_server.dm b/code/modules/research/message_server.dm index be884e2c46..3614ba60be 100644 --- a/code/modules/research/message_server.dm +++ b/code/modules/research/message_server.dm @@ -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/resleeving/infocore_records.dm b/code/modules/resleeving/infocore_records.dm index 25844ec765..1ee1c3fdfb 100644 --- a/code/modules/resleeving/infocore_records.dm +++ b/code/modules/resleeving/infocore_records.dm @@ -84,6 +84,7 @@ var/sizemult var/weight var/aflags + var/breath_type = "oxygen" /datum/transhuman/body_record/New(var/copyfrom, var/add_to_db = 0, var/ckeylock = 0) ..() @@ -120,6 +121,7 @@ sizemult = M.size_multiplier weight = M.weight aflags = M.appearance_flags + breath_type = M.species.breath_type //Probably should M.dna.check_integrity() diff --git a/code/modules/resleeving/infomorph_software.dm b/code/modules/resleeving/infomorph_software.dm index 67a2bd47f9..34f9c4ddd4 100644 --- a/code/modules/resleeving/infomorph_software.dm +++ b/code/modules/resleeving/infomorph_software.dm @@ -301,25 +301,25 @@ ram_cost = 15 id = "ar_hud" - toggle(mob/living/silicon/infomorph/user) - user.arHUD = !user.arHUD - if(user.plane_holder) - user.plane_holder.set_vis(VIS_CH_ID,user.arHUD) - user.plane_holder.set_vis(VIS_CH_HEALTH_VR,user.arHUD) +/datum/infomorph_software/ar_hud/toggle(mob/living/silicon/infomorph/user) + user.arHUD = !user.arHUD + if(user.plane_holder) + user.plane_holder.set_vis(VIS_CH_ID,user.arHUD) + user.plane_holder.set_vis(VIS_CH_HEALTH_VR,user.arHUD) - is_active(mob/living/silicon/infomorph/user) - return user.arHUD +/datum/infomorph_software/ar_hud/is_active(mob/living/silicon/infomorph/user) + return user.arHUD /datum/infomorph_software/translator name = "Universal Translator" ram_cost = 15 id = "translator" - toggle(mob/living/silicon/infomorph/user) - user.translator.attack_self(user) +/datum/infomorph_software/translator/toggle(mob/living/silicon/infomorph/user) + user.translator.attack_self(user) - is_active(mob/living/silicon/infomorph/user) - return user.translator.listening +/datum/infomorph_software/translator/is_active(mob/living/silicon/infomorph/user) + return user.translator.listening /datum/infomorph_software/signaller diff --git a/code/modules/resleeving/machines.dm b/code/modules/resleeving/machines.dm index b84a8784a6..5f34f00cd5 100644 --- a/code/modules/resleeving/machines.dm +++ b/code/modules/resleeving/machines.dm @@ -69,6 +69,21 @@ else if(status == 3) //Digital organ I.digitize() + //Give breathing equipment if needed + if(current_project.breath_type != "oxygen") + H.equip_to_slot_or_del(new /obj/item/clothing/mask/breath(H), slot_wear_mask) + var/obj/item/weapon/tank/tankpath + if(current_project.breath_type == "phoron") + tankpath = /obj/item/weapon/tank/vox + else + tankpath = text2path("/obj/item/weapon/tank/" + current_project.breath_type) + + if(tankpath) + H.equip_to_slot_or_del(new tankpath(H), slot_back) + H.internal = H.back + if(istype(H.internal,/obj/item/weapon/tank) && H.internals) + H.internals.icon_state = "internal1" + occupant = H //Set the name or generate one diff --git a/code/modules/rogueminer_vr/asteroid.dm b/code/modules/rogueminer_vr/asteroid.dm index d1e046cfb1..c056eae02f 100644 --- a/code/modules/rogueminer_vr/asteroid.dm +++ b/code/modules/rogueminer_vr/asteroid.dm @@ -92,28 +92,28 @@ type_wall = /turf/simulated/wall type_under = /turf/simulated/floor/plating - New() - ..() - spot_add(1,1,type_wall) //Bottom left corner - spot_add(1,2,type_wall) - spot_add(1,3,type_wall) - spot_add(2,1,type_wall) - spot_add(2,2,type_under) //Center floor - spot_add(2,2,/obj/random/roguemineloot) //Loot! - spot_add(2,3,type_wall) - spot_add(3,1,type_wall) - spot_add(3,2,type_wall) - spot_add(3,3,type_wall) //Bottom right corner +/datum/rogue/asteroid/predef/cargo/New() + ..() + spot_add(1,1,type_wall) //Bottom left corner + spot_add(1,2,type_wall) + spot_add(1,3,type_wall) + spot_add(2,1,type_wall) + spot_add(2,2,type_under) //Center floor + spot_add(2,2,/obj/random/roguemineloot) //Loot! + spot_add(2,3,type_wall) + spot_add(3,1,type_wall) + spot_add(3,2,type_wall) + spot_add(3,3,type_wall) //Bottom right corner //Abandoned 1-tile hollow cargo box (ANGRY). /datum/rogue/asteroid/predef/cargo/angry type_wall = /turf/simulated/wall type_under = /turf/simulated/floor/plating - New() - ..() - spot_add(2,2,/obj/random/roguemineloot) //EXTRA loot! - spot_add(2,2,/mob/living/simple_mob/animal/space/alien) //GRRR +/datum/rogue/asteroid/predef/cargo/angry/New() + ..() + spot_add(2,2,/obj/random/roguemineloot) //EXTRA loot! + spot_add(2,2,/mob/living/simple_mob/animal/space/alien) //GRRR //Longer cargo container for higher difficulties /datum/rogue/asteroid/predef/cargo_large @@ -121,30 +121,30 @@ type_wall = /turf/simulated/wall type_under = /turf/simulated/floor/plating - New() - ..() - spot_add(1,2,type_wall) //-- - spot_add(1,3,type_wall) //Left end of cargo container - spot_add(1,4,type_wall) //-- +/datum/rogue/asteroid/predef/cargo_large/New() + ..() + spot_add(1,2,type_wall) //-- + spot_add(1,3,type_wall) //Left end of cargo container + spot_add(1,4,type_wall) //-- - spot_add(5,2,type_wall) //-- - spot_add(5,3,type_wall) //Right end of cargo container - spot_add(5,4,type_wall) //-- + spot_add(5,2,type_wall) //-- + spot_add(5,3,type_wall) //Right end of cargo container + spot_add(5,4,type_wall) //-- - spot_add(2,4,type_wall) //-- - spot_add(3,4,type_wall) //Top and - spot_add(4,4,type_wall) //bottom of - spot_add(2,2,type_wall) //cargo - spot_add(3,2,type_wall) //container - spot_add(4,2,type_wall) //-- + spot_add(2,4,type_wall) //-- + spot_add(3,4,type_wall) //Top and + spot_add(4,4,type_wall) //bottom of + spot_add(2,2,type_wall) //cargo + spot_add(3,2,type_wall) //container + spot_add(4,2,type_wall) //-- - spot_add(2,3,type_under) //Left floor - spot_add(3,3,type_under) //Mid floor - spot_add(4,3,type_under) //Right floor + spot_add(2,3,type_under) //Left floor + spot_add(3,3,type_under) //Mid floor + spot_add(4,3,type_under) //Right floor - spot_add(2,3,/obj/random/roguemineloot) //Left loot - spot_add(3,3,/obj/random/roguemineloot) //Mid loot - spot_add(4,3,/obj/random/roguemineloot) //Right loot + spot_add(2,3,/obj/random/roguemineloot) //Left loot + spot_add(3,3,/obj/random/roguemineloot) //Mid loot + spot_add(4,3,/obj/random/roguemineloot) //Right loot - if(prob(30)) - spot_add(3,3,/mob/living/simple_mob/animal/space/alien/sentinel/praetorian) //And maybe a big friend for big loot. + if(prob(30)) + spot_add(3,3,/mob/living/simple_mob/animal/space/alien/sentinel/praetorian) //And maybe a big friend for big loot. diff --git a/code/modules/rogueminer_vr/zone_console.dm b/code/modules/rogueminer_vr/zone_console.dm index 29fddd99d9..289d8aa598 100644 --- a/code/modules/rogueminer_vr/zone_console.dm +++ b/code/modules/rogueminer_vr/zone_console.dm @@ -151,11 +151,6 @@ build_path = /obj/machinery/computer/roguezones origin_tech = list(TECH_DATA = 3, TECH_BLUESPACE = 1) -// Undefine our constants to not pollute namespace -#undef OUTPOST_Z -#undef TRANSIT_Z -#undef BELT_Z - /obj/item/weapon/paper/rogueminer name = "R-38 Scanner Console Guide" info = {"

Getting Started

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 ffe15da21d..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_to_multilingual(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_to_multilingual(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 828db3f6cb..2677a56536 100644 --- a/code/modules/shieldgen/directional_shield.dm +++ b/code/modules/shieldgen/directional_shield.dm @@ -363,15 +363,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 b1d3efdc0c..3f5d113289 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 valid_actions = list("toggle_override", "force_door") /obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod/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(), @@ -79,15 +79,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 valid_actions = list("toggle_override", "force_door") /obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod_berth/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 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 . = list( @@ -102,44 +102,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 cf6a76cb5c..6d1249a8ad 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/shuttle_supply.dm b/code/modules/shuttles/shuttle_supply.dm index a51fe50d56..55ee7d83b4 100644 --- a/code/modules/shuttles/shuttle_supply.dm +++ b/code/modules/shuttles/shuttle_supply.dm @@ -84,8 +84,13 @@ //returns the ETA in minutes /datum/shuttle/autodock/ferry/supply/proc/eta_minutes() - return round((arrive_time - world.time) / (1 MINUTE), 1) // Floor, so it's an actual timer + return round((arrive_time - world.time) / (1 MINUTE)) // Floor, so it's an actual timer // returns the ETA in seconds /datum/shuttle/autodock/ferry/supply/proc/eta_seconds() return round((arrive_time - world.time) / (1 SECOND)) // Floor, so it's an actual timer + +//returns the ETA in deciseconds +/datum/shuttle/autodock/ferry/supply/proc/eta_deciseconds() + return round(arrive_time - world.time) + \ No newline at end of file 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/surgery/other.dm b/code/modules/surgery/other.dm index fe7d004dc4..9cde26f240 100644 --- a/code/modules/surgery/other.dm +++ b/code/modules/surgery/other.dm @@ -232,3 +232,157 @@ /datum/surgery_step/hardsuit/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) user.visible_message("[user]'s [tool] can't quite seem to get through the metal...", \ "\The [tool] can't quite seem to get through the metal. It's weakening, though - try again.") + +/////////////////////////////////////////// +// De-Husking Surgery // +///////////////////////////////////////// + +/datum/surgery_status/ + var/dehusk = 0 + +/datum/surgery_step/dehusk/ + priority = 1 + can_infect = 0 + blood_level = 1 + +/datum/surgery_step/dehusk/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + if (!hasorgans(target)) + return 0 + var/obj/item/organ/external/affected = target.get_organ(target_zone) + if (!affected || (affected.robotic >= ORGAN_ROBOT)) + return 0 + if(coverage_check(user,target,affected,tool)) + return 0 + return target_zone == BP_TORSO && (HUSK in target.mutations) + +/datum/surgery_step/dehusk/structinitial + allowed_tools = list( + /obj/item/weapon/surgical/bioregen = 100 + ) + min_duration = 90 + max_duration = 120 + +/datum/surgery_step/dehusk/structinitial/can_use(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + return ..() && target.op_stage.dehusk == 0 + +/datum/surgery_step/dehusk/structinitial/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + user.visible_message("[user] begins to create a fleshy but rigid looking mesh over gaps in [target]'s flesh with \the [tool].", \ + "You begin to create a fleshy but rigid looking mesh over gaps in [target]'s flesh with \the [tool].") + ..() + +/datum/surgery_step/dehusk/structinitial/end_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + user.visible_message("[user] creates a fleshy but rigid looking mesh over gaps in [target]'s flesh with \the [tool].", \ + "You create a fleshy but rigid looking mesh over gaps in [target]'s flesh with \the [tool].") + target.op_stage.dehusk = 1 + ..() + +/datum/surgery_step/dehusk/structinitial/fail_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + var/obj/item/organ/external/affected = target.get_organ(target_zone) + user.visible_message("[user]'s hand slips, and the mesh falls, with \the [tool] scraping [target]'s body.", \ + "Your hand slips, and the mesh falls, with \the [tool] scraping [target]'s body.") + affected.createwound(CUT, 15) + affected.createwound(BRUISE, 10) + ..() + +/datum/surgery_step/dehusk/relocateflesh + allowed_tools = list( + /obj/item/weapon/surgical/hemostat = 100, \ + /obj/item/stack/cable_coil = 75, \ + /obj/item/device/assembly/mousetrap = 20 + ) + min_duration = 90 + max_duration = 120 + +/datum/surgery_step/dehusk/relocateflesh/can_use(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + return ..() && target.op_stage.dehusk == 1 + +/datum/surgery_step/dehusk/relocateflesh/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + user.visible_message("[user] begins to relocate some of [target]'s flesh with \the [tool], using it to fill in gaps.", \ + "You begin to relocate some of [target]'s flesh with \the [tool], using it to fill in gaps.") + ..() + +/datum/surgery_step/dehusk/relocateflesh/end_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + user.visible_message("[user] relocates some of [target]'s flesh with \the [tool], using it to fill in gaps.", \ + "You relocate some of [target]'s flesh with \the [tool], using it to fill in gaps.") + target.op_stage.dehusk = 2 + ..() + +/datum/surgery_step/dehusk/relocateflesh/fail_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + var/obj/item/organ/external/affected = target.get_organ(target_zone) + user.visible_message("[user] accidentally rips a massive chunk out of [target]'s flesh with \the [tool], causing massive damage.", \ + "You accidentally rip a massive chunk out of [target]'s flesh with \the [tool], causing massive damage.") + affected.createwound(CUT, 25) + affected.createwound(BRUISE, 10) + ..() + +/datum/surgery_step/dehusk/structfinish + allowed_tools = list( + /obj/item/weapon/surgical/bioregen = 100, \ + /obj/item/weapon/surgical/FixOVein = 30 + ) + min_duration = 90 + max_duration = 120 + +/datum/surgery_step/dehusk/structfinish/can_use(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + return ..() && target.op_stage.dehusk == 2 + +/datum/surgery_step/dehusk/structfinish/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + if(istype(tool,/obj/item/weapon/surgical/bioregen)) + user.visible_message("[user] begins to recreate blood vessels and fill in the gaps in [target]'s flesh with \the [tool].", \ + "You begin to recreate blood vessels and fill in the gaps in [target]'s flesh with \the [tool].") + else if(istype(tool,/obj/item/weapon/surgical/FixOVein)) + user.visible_message("[user] attempts to recreate blood vessels and fill in the gaps in [target]'s flesh with \the [tool].", \ + "You attempt to recreate blood vessels and fill in the gaps in [target]'s flesh with \the [tool].") + ..() + +/datum/surgery_step/dehusk/structfinish/end_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + user.visible_message("[user] finishes recreating the missing biological structures and filling in gaps in [target]'s flesh with \the [tool].", \ + "You finish recreating the missing biological structures and filling in gaps in [target]'s flesh with \the [tool].") + target.op_stage.dehusk = 0 + target.mutations.Remove(HUSK) + target.status_flags &= ~DISFIGURED + target.update_icons_body() + ..() + +/datum/surgery_step/dehusk/structfinish/fail_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + var/obj/item/organ/external/affected = target.get_organ(target_zone) + if(istype(tool,/obj/item/weapon/surgical/bioregen)) + user.visible_message("[user]'s hand slips, causing \the [tool] to scrape [target]'s body.", \ + "Your hand slips, causing \the [tool] to scrape [target]'s body.") + else if(istype(tool,/obj/item/weapon/surgical/FixOVein)) + user.visible_message("[user] fails to finish the structure over the gaps in [target]'s flesh, doing more damage than good.", \ + "You fail to finish the structure over the gaps in [target]'s flesh, doing more damage than good.") + affected.createwound(CUT, 15) + affected.createwound(BRUISE, 10) + ..() + +/datum/surgery_step/internal/detoxify + blood_level = 1 + allowed_tools = list(/obj/item/weapon/surgical/bioregen=100) + min_duration = 90 + max_duration = 120 + +/datum/surgery_step/internal/detoxify/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + return ..() && target_zone == BP_TORSO && (target.toxloss > 25 || target.oxyloss > 25) + +/datum/surgery_step/internal/detoxify/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + user.visible_message("[user] begins to pull toxins from, and restore oxygen to [target]'s musculature and organs with \the [tool].", \ + "You begin to pull toxins from, and restore oxygen to [target]'s musculature and organs with \the [tool].") + ..() + +/datum/surgery_step/internal/detoxify/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + user.visible_message("[user] finishes pulling toxins from, and restoring oxygen to [target]'s musculature and organs with \the [tool].", \ + "You finish pulling toxins from, and restoring oxygen to [target]'s musculature and organs with \the [tool].") + if(target.toxloss>25) + target.adjustToxLoss(-20) + if(target.oxyloss>25) + target.adjustOxyLoss(-20) + ..() + +/datum/surgery_step/internal/detoxify/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + var/obj/item/organ/external/affected = target.get_organ(target_zone) + user.visible_message("[user]'s hand slips, failing to finish the surgery, and damaging [target] with \the [tool].", \ + "Your hand slips, failing to finish the surgery, and damaging [target] with \the [tool].") + affected.createwound(CUT, 15) + affected.createwound(BRUISE, 10) + ..() \ No newline at end of file diff --git a/code/modules/tables/tables.dm b/code/modules/tables/tables.dm index 952e7af45a..e37b684d3d 100644 --- a/code/modules/tables/tables.dm +++ b/code/modules/tables/tables.dm @@ -10,7 +10,7 @@ var/list/table_icon_cache = list() climbable = 1 layer = TABLE_LAYER throwpass = 1 - surgery_odds = 66 + surgery_odds = 50 //VOREStation Edit var/flipped = 0 var/maxhealth = 10 var/health = 10 diff --git a/code/modules/vehicles/bike.dm b/code/modules/vehicles/bike.dm index ebfde69976..298d0f06d6 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 80348c7699..3ae52380d6 100644 --- a/code/modules/ventcrawl/ventcrawl_atmospherics.dm +++ b/code/modules/ventcrawl/ventcrawl_atmospherics.dm @@ -82,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 67d76a8177..9a4076ef73 100644 --- a/code/modules/virus2/disease2.dm +++ b/code/modules/virus2/disease2.dm @@ -280,7 +280,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) @@ -293,7 +293,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) @@ -305,7 +305,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/effect_vr.dm b/code/modules/virus2/effect_vr.dm index 39155ea0fa..eee9d2da8a 100644 --- a/code/modules/virus2/effect_vr.dm +++ b/code/modules/virus2/effect_vr.dm @@ -5,24 +5,25 @@ name = "Mlemington's Syndrome" stage = 1 chance_maxm = 25 - activate(var/mob/living/carbon/mob,var/multiplier) - mob.say("[pick("Mlem.","MLEM!","Mlem?")]") + +/datum/disease2/effect/mlem/activate(var/mob/living/carbon/mob,var/multiplier) + mob.say("[pick("Mlem.","MLEM!","Mlem?")]") /datum/disease2/effect/spin name = "Spyndrome" stage = 1 chance_maxm = 7 - var/list/directions = list(2,4,1,8,2,4,1,8,2,4,1,8,2,4,1,8,2,4,1,8) - activate(var/mob/living/carbon/mob,var/multiplier) - if(mob.buckled()) - to_chat(viewers(mob),"[mob.name] struggles violently against their restraints!") - else - to_chat(viewers(mob),"[mob.name] spins around violently!") - for(var/D in directions) - mob.dir = D - sleep(1) - mob.dir = pick(2,4,1,8) //For that added annoyance + +/datum/disease2/effect/spin/activate(var/mob/living/carbon/mob,var/multiplier) + if(mob.buckled()) + to_chat(viewers(mob),"[mob.name] struggles violently against their restraints!") + else + to_chat(viewers(mob),"[mob.name] spins around violently!") + for(var/D in directions) + mob.dir = D + sleep(1) + mob.dir = pick(2,4,1,8) //For that added annoyance /////////////////////////////////////////////// /////////////////// Stage 2 /////////////////// @@ -32,8 +33,8 @@ stage = 2 chance_maxm = 2 - activate(var/mob/living/carbon/mob,var/multiplier) - mob.set_default_language(pick(mob.languages)) +/datum/disease2/effect/lang/activate(var/mob/living/carbon/mob,var/multiplier) + mob.set_default_language(pick(mob.languages)) /////////////////////////////////////////////// /////////////////// Stage 3 /////////////////// @@ -43,20 +44,20 @@ stage = 3 chance_maxm = 1 - activate(var/mob/living/carbon/mob,var/multiplier) - var/newsize = rand (25, 200) - mob.resize(newsize/100) - to_chat(viewers(mob),"[mob.name] suddenly changes size!") +/datum/disease2/effect/size/activate(var/mob/living/carbon/mob,var/multiplier) + var/newsize = rand (25, 200) + mob.resize(newsize/100) + to_chat(viewers(mob),"[mob.name] suddenly changes size!") /datum/disease2/effect/flip name = "Flipponov's Disease" stage = 3 chance_maxm = 5 - activate(var/mob/living/carbon/mob,var/multiplier) //Remind me why mob is carbon...? - if(ishuman(mob)) - var/mob/living/carbon/human/H = mob - H.emote("flip") - else - to_chat(viewers(mob),"[mob.name] does a backflip!") - mob.SpinAnimation(7,1) +/datum/disease2/effect/flip/activate(var/mob/living/carbon/mob,var/multiplier) //Remind me why mob is carbon...? + if(ishuman(mob)) + var/mob/living/carbon/human/H = mob + H.emote("flip") + else + to_chat(viewers(mob),"[mob.name] does a backflip!") + mob.SpinAnimation(7,1) 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/vore/fluffstuff/custom_boxes_vr.dm b/code/modules/vore/fluffstuff/custom_boxes_vr.dm index b718453f2e..3c20b5dd6a 100644 --- a/code/modules/vore/fluffstuff/custom_boxes_vr.dm +++ b/code/modules/vore/fluffstuff/custom_boxes_vr.dm @@ -100,13 +100,13 @@ name = "Ivy's Courier" desc = "A bag resembling something used by college students. Contains items for ''MooMoo''." - New() - ..() - new /obj/item/clothing/head/beretg(src) - new /obj/item/device/fluff/id_kit_ivy(src) - new /obj/item/weapon/storage/fancy/cigarettes/dromedaryco(src) - new /obj/item/weapon/storage/box/matches(src) - new /obj/item/weapon/reagent_containers/food/snacks/sliceable/plaincake(src) +/obj/item/weapon/storage/backpack/messenger/sec/fluff/ivymoomoo/New() + ..() + new /obj/item/clothing/head/beretg(src) + new /obj/item/device/fluff/id_kit_ivy(src) + new /obj/item/weapon/storage/fancy/cigarettes/dromedaryco(src) + new /obj/item/weapon/storage/box/matches(src) + new /obj/item/weapon/reagent_containers/food/snacks/sliceable/plaincake(src) // jemli:Cirra Mayhem /obj/item/weapon/storage/box/fluff/cirra @@ -139,16 +139,16 @@ item_state = "duffle_med" slowdown = 0 - New() - ..() - new /obj/item/clothing/accessory/holster/hip(src) - new /obj/item/clothing/suit/storage/fluff/modernfedcoat(src) - new /obj/item/clothing/head/caphat/formal/fedcover(src) - new /obj/item/clothing/suit/armor/det_suit(src) - new /obj/item/weapon/flame/lighter/zippo/fluff/joan(src) - new /obj/item/clothing/under/rank/internalaffairs/fluff/joan(src) - new /obj/item/clothing/head/helmet/space/fluff/joan(src) - new /obj/item/clothing/suit/space/fluff/joan(src) +/obj/item/weapon/storage/backpack/dufflebag/sec/fluff/joanrisu/New() + ..() + new /obj/item/clothing/accessory/holster/hip(src) + new /obj/item/clothing/suit/storage/fluff/modernfedcoat(src) + new /obj/item/clothing/head/caphat/formal/fedcover(src) + new /obj/item/clothing/suit/armor/det_suit(src) + new /obj/item/weapon/flame/lighter/zippo/fluff/joan(src) + new /obj/item/clothing/under/rank/internalaffairs/fluff/joan(src) + new /obj/item/clothing/head/helmet/space/fluff/joan(src) + new /obj/item/clothing/suit/space/fluff/joan(src) //joanrisu:Katarina Eine /obj/item/weapon/storage/backpack/dufflebag/sec/fluff/katarina @@ -156,14 +156,14 @@ desc = "A duffle bag Katarina uses to carry her tools." slowdown = 0 - New() - ..() - new /obj/item/clothing/accessory/holster/hip(src) - new /obj/item/clothing/suit/storage/fluff/fedcoat(src) - new /obj/item/clothing/suit/armor/det_suit(src) - new /obj/item/clothing/accessory/storage/black_vest(src) - new /obj/item/weapon/material/knife/tacknife/combatknife/fluff/katarina(src) - new /obj/item/clothing/under/rank/internalaffairs/fluff/joan(src) +/obj/item/weapon/storage/backpack/dufflebag/sec/fluff/katarina/New() + ..() + new /obj/item/clothing/accessory/holster/hip(src) + new /obj/item/clothing/suit/storage/fluff/fedcoat(src) + new /obj/item/clothing/suit/armor/det_suit(src) + new /obj/item/clothing/accessory/storage/black_vest(src) + new /obj/item/weapon/material/knife/tacknife/combatknife/fluff/katarina(src) + new /obj/item/clothing/under/rank/internalaffairs/fluff/joan(src) //Razerwing:Archer Maximus /obj/item/weapon/storage/box/fluff/archermaximus diff --git a/code/modules/vore/fluffstuff/custom_clothes_vr.dm b/code/modules/vore/fluffstuff/custom_clothes_vr.dm index 23e24a0260..6dbf8e493c 100644 --- a/code/modules/vore/fluffstuff/custom_clothes_vr.dm +++ b/code/modules/vore/fluffstuff/custom_clothes_vr.dm @@ -1763,13 +1763,13 @@ Departamental Swimsuits, for general use item_state = "hasd_helm" species_restricted = null - mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = 0) - if(..()) - if(H.ckey != "silencedmp5a5") - to_chat(H, "...The faceplate is clearly not made for your anatomy, thus, does not fit.") - return 0 - else - return 1 +/obj/item/clothing/head/helmet/space/void/security/hasd/mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = 0) + if(..()) + if(H.ckey != "silencedmp5a5") + to_chat(H, "...The faceplate is clearly not made for your anatomy, thus, does not fit.") + return 0 + else + return 1 /obj/item/clothing/suit/space/void/security/hasd name = "HASD EVA bodyplates" @@ -1781,12 +1781,12 @@ Departamental Swimsuits, for general use item_state = "hasd_suit" pixel_x = -16 - mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = 0) - if(..() && istype(H) && H.ckey == "silencedmp5a5") - return 1 - else - to_chat(H, "This suit is not designed for you.") - return 0 +/obj/item/clothing/suit/space/void/security/hasd/mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = 0) + if(..() && istype(H) && H.ckey == "silencedmp5a5") + return 1 + else + to_chat(H, "This suit is not designed for you.") + return 0 //Zigfe:Zaoozaoo Xrimxuqmqixzix /obj/item/clothing/head/fluff/zao @@ -2330,4 +2330,51 @@ Departamental Swimsuits, for general use if(!istype(usr, /mob/living)) return if(usr.stat) return - colorswap(usr) \ No newline at end of file + colorswap(usr) + +//Pandora029 : Evelyn Tareen +/obj/item/clothing/suit/storage/hooded/wintercoat/security/fluff/evelyn + name = "warden's navy winter coat" + desc = "A custom tailored security winter coat in navy blue colors, this one has the rank markings of a warden on it." + icon = 'icons/vore/custom_clothes_vr.dmi' + icon_state = "evelyncoat" + + icon_override = 'icons/vore/custom_onmob_vr.dmi' + item_state = "evelyncoat_mob" + +/obj/item/clothing/suit/storage/hooded/wintercoat/security/fluff/evelyn/ui_action_click() + ToggleHood_evelyn() + +/obj/item/clothing/suit/storage/hooded/wintercoat/security/fluff/evelyn/equipped(mob/user, slot) + if(slot != slot_wear_suit) + RemoveHood_evelyn() + ..() + +/obj/item/clothing/suit/storage/hooded/wintercoat/security/fluff/evelyn/proc/RemoveHood_evelyn() + icon_state = "evelyncoat" + item_state = "evelyncoat_mob" + hood_up = 0 + if(ishuman(hood.loc)) + var/mob/living/carbon/H = hood.loc + H.unEquip(hood, 1) + H.update_inv_wear_suit() + hood.loc = src + +/obj/item/clothing/suit/storage/hooded/wintercoat/security/fluff/evelyn/proc/ToggleHood_evelyn() + if(!hood_up) + if(ishuman(loc)) + var/mob/living/carbon/human/H = loc + if(H.wear_suit != src) + to_chat(H, "You must be wearing [src] to put up the hood!") + return + if(H.head) + to_chat(H, "You're already wearing something on your head!") + return + else + H.equip_to_slot_if_possible(hood,slot_head,0,0,1) + hood_up = 1 + icon_state = "evelyncoat_t" + item_state = "evelyncoat_mob_t" + H.update_inv_wear_suit() + else + RemoveHood_evelyn() \ No newline at end of file diff --git a/code/modules/vore/fluffstuff/custom_items_vr.dm b/code/modules/vore/fluffstuff/custom_items_vr.dm index 537715610f..9603b78e44 100644 --- a/code/modules/vore/fluffstuff/custom_items_vr.dm +++ b/code/modules/vore/fluffstuff/custom_items_vr.dm @@ -769,11 +769,12 @@ icon_state = "dragor_dot" w_class = ITEMSIZE_SMALL - attack_self(mob/user as mob) - if(user.ckey == "pontifexminimus") - user.verbs |= /mob/living/carbon/human/proc/shapeshifter_select_gender - else - return +/obj/item/weapon/fluff/dragor_dot/attack_self(mob/user as mob) + if(user.ckey == "pontifexminimus") + user.verbs |= /mob/living/carbon/human/proc/shapeshifter_select_gender + else + return + //LuminescentRing: Briana Moore /obj/item/weapon/storage/backpack/messenger/black/fluff/briana name = "2561 graduation bag" diff --git a/code/modules/vore/resizing/resize_vr.dm b/code/modules/vore/resizing/resize_vr.dm index 8dc575ce20..3c7e5b7089 100644 --- a/code/modules/vore/resizing/resize_vr.dm +++ b/code/modules/vore/resizing/resize_vr.dm @@ -213,7 +213,7 @@ var/mob/living/carbon/human/H = src if(H.flying) return TRUE //Silently pass without a message. - if(isTaurTail(H.tail_style)) + if(istaurtail(H.tail_style)) var/datum/sprite_accessory/tail/taur/tail = H.tail_style src_message = tail.msg_owner_help_run tmob_message = tail.msg_prey_help_run @@ -223,7 +223,7 @@ src_message = "You run between [tmob]'s legs." tmob_message = "[src] runs between your legs." var/mob/living/carbon/human/H = tmob - if(isTaurTail(H.tail_style)) + if(istaurtail(H.tail_style)) var/datum/sprite_accessory/tail/taur/tail = H.tail_style src_message = tail.msg_prey_stepunder tmob_message = tail.msg_owner_stepunder @@ -304,7 +304,7 @@ var/message_pred = null var/message_prey = null var/datum/sprite_accessory/tail/taur/tail = null - if(isTaurTail(pred.tail_style)) + if(istaurtail(pred.tail_style)) tail = pred.tail_style if(a_intent == I_GRAB) 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 1480c700d9..3bbdae1530 100644 --- a/code/stylesheet.dm +++ b/code/stylesheet.dm @@ -1,4 +1,4 @@ -client/script = {"