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 b8d7476abd..b278c1115a 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 a0eede2f42..3054e94702 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 aed07bb0ec..0c26095401 100644 --- a/code/__defines/is_helpers.dm +++ b/code/__defines/is_helpers.dm @@ -58,3 +58,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 9f34e4aa55..25fb343136 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 dedc360f28..5781543089 100644 --- a/code/_helpers/game.dm +++ b/code/_helpers/game.dm @@ -322,39 +322,35 @@ var/mobs_radio_range_fired = 1 //CHOMPEdit 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 43ed714786..dc5c92f708 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/text.dm b/code/_helpers/text.dm index 91dd5901e1..6bf02bf77f 100644 --- a/code/_helpers/text.dm +++ b/code/_helpers/text.dm @@ -321,7 +321,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 0564d5e3f7..a989dcbede 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 @@ -1480,8 +1480,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 6a85d7075f..a1aedad119 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 844dce89b2..f847f06908 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 * 2) //CHOMPStation Edit //Change this "1" to how many extend votes you want there to be. //Note: Fuck you whoever just slapped a number here instead of using the FUCKING CONFIG LIKE ALL THE OTHER NUMBERS HERE 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 89ba7d2dc6..3fc7f8b706 100644 --- a/code/controllers/subsystems/machines.dm +++ b/code/controllers/subsystems/machines.dm @@ -174,5 +174,4 @@ SUBSYSTEM_DEF(machines) #undef SSMACHINES_PIPENETS #undef SSMACHINES_MACHINERY -#undef SSMACHINES_POWER #undef SSMACHINES_POWER_OBJECTS 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 6f85193173..debc08c2c4 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/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/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/underwear/underwear.dm b/code/datums/underwear/underwear.dm index f418f3e8d1..e3bf9d37ea 100644 --- a/code/datums/underwear/underwear.dm +++ b/code/datums/underwear/underwear.dm @@ -12,7 +12,7 @@ var/display_name // For displaying in text var/gender = NEUTER -datum/category_group/underwear/dd_SortValue() +/datum/category_group/underwear/dd_SortValue() return sort_order /datum/category_group/underwear/top diff --git a/code/datums/uplink/uplink_categories.dm b/code/datums/uplink/uplink_categories.dm index f7236ddbb0..e075021c52 100644 --- a/code/datums/uplink/uplink_categories.dm +++ b/code/datums/uplink/uplink_categories.dm @@ -6,7 +6,7 @@ ..() items = list() -datum/uplink_category/ammunition +/datum/uplink_category/ammunition name = "Ammunition" /datum/uplink_category/services diff --git a/code/datums/uplink/uplink_items.dm b/code/datums/uplink/uplink_items.dm index 966884aaff..2abb5a1d1a 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 05ab212535..bc33fb2e5a 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 @@ -17,16 +17,16 @@ proc/sql_poll_population() log_game("SQL ERROR during population polling. Error : \[[err]\]\n") qdel(query) //CHOMPEdit TGSQL -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) @@ -61,7 +61,7 @@ proc/sql_report_death(var/mob/living/carbon/human/H) qdel(query) //CHOMPEdit TGSQL -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) @@ -96,7 +96,7 @@ proc/sql_report_cyborg_death(var/mob/living/silicon/robot/H) qdel(query) //CHOMPEdit TGSQL -proc/statistic_cycle() +/proc/statistic_cycle() set waitfor = 0 if(!sqllogging) return @@ -105,7 +105,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 93becacd94..2ee1f3e348 100755 --- a/code/game/area/Space Station 13 areas.dm +++ b/code/game/area/Space Station 13 areas.dm @@ -1440,29 +1440,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 60015e8427..e910bdf77e 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 17de38aae3..a7559052bc 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -497,7 +497,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) @@ -549,7 +549,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 dfc22c5a02..135a3bc4b5 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,179 +458,177 @@ 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. +<<<<<<< HEAD datum/objective/heist proc/choose_target() return @@ -676,7 +671,73 @@ datum/objective/heist/kidnap return 1 //They're restrained on the shuttle. Success. else return 0 +||||||| parent of 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 +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() + + 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(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/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() + + 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) +>>>>>>> 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 + +<<<<<<< HEAD datum/objective/heist/loot choose_target() @@ -732,9 +793,85 @@ datum/objective/heist/loot for(var/obj/O in raider.current.get_contents()) if(istype(O,target)) total_amount++ if(total_amount >= target_amount) return 1 +||||||| parent of 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 +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 +======= + 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 +>>>>>>> 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 + +/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 +<<<<<<< HEAD datum/objective/heist/salvage choose_target() @@ -776,31 +913,170 @@ datum/objective/heist/salvage if(istype(O,/obj/item/stack/material)) if(O.name == target) S = O +||||||| parent of 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 +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]." + + 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 +======= +/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." + + +/datum/objective/heist/loot/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 + + 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 +>>>>>>> 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 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 abf3b5712c..10dfdb27bd 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 2f68ed7791..8909683495 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() //YW UNCOMMENTINGSTART: INSTATE LOYALTY IMPLANT /datum/job/centcom_officer/equip(var/mob/living/carbon/human/H) @@ -69,9 +69,17 @@ return 1 +<<<<<<< HEAD get_access() var/access = get_all_accesses() return access*/ +||||||| parent of 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 + get_access() + return get_all_accesses().Copy() +======= +/datum/job/emergency_responder/get_access() + return get_all_accesses().Copy() +>>>>>>> 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 /datum/job/clown title = "Clown" diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm index 263a108de6..d4b378d2ab 100644 --- a/code/game/jobs/job_controller.dm +++ b/code/game/jobs/job_controller.dm @@ -14,499 +14,442 @@ 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]") + //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") + + //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. + + // 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 + 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 - assistant_candidates -= player - Debug("DO, AC1 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") + //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 - // 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. +/datum/controller/occupations/proc/EquipRank(var/mob/living/carbon/human/H, var/rank, var/joined_late = 0) + if(!H) return null - // 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) + var/datum/job/job = GetJob(rank) + var/list/spawn_in_storage = list() - // 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 - 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 - - - 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) + 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 +<<<<<<< HEAD var/turf/T = get_turf(pick(latejoin)) 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) +||||||| parent of 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 + 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) +======= + H.forceMove(T) +>>>>>>> 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 - // 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) + // 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) + 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) + //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.slot in custom_equip_slots) - spawn_in_storage += 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(H.equip_to_slot_or_del(G.spawn_item(H, metadata), G.slot)) + 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]!") - custom_equip_slots.Add(G.slot) + if(G.slot != slot_tie) + 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) + custom_equip_leftovers.Add(thing) else +<<<<<<< HEAD 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. @@ -579,72 +522,293 @@ var/global/datum/controller/occupations/job_master proc/LoadJobs(jobsfile) //ran during round setup, reads info from jobs.txt -- Urist if(!config.load_jobs_from_txt) return 0 +||||||| parent of 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 + 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.") - var/list/jobEntries = file2list(jobsfile) + 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) - for(var/job in jobEntries) - if(!job) - continue + to_chat(H, "You are [job.total_positions == 1 ? "the" : "a"] [alt_title ? alt_title : rank].") - job = trim(job) - if (!length(job)) - continue + 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.") - var/pos = findtext(job, "=") - var/name = null - var/value = null + 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.") - if(pos) - name = copytext(job, 1, pos) - value = copytext(job, pos + 1) + // 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 +======= + spawn_in_storage += thing +>>>>>>> 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 + + // 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 - if(name && value) - var/datum/job/J = GetJob(name) - if(!J) continue - J.total_positions = text2num(value) - J.spawn_positions = text2num(value) - if(J.mob_type & JOB_SILICON) - J.total_positions = 0 - - return 1 - - - proc/HandleFeedbackGathering() - for(var/datum/job/job in occupations) - var/tmp_str = "|[job.title]|" - - var/level1 = 0 //high - var/level2 = 0 //medium - var/level3 = 0 //low - var/level4 = 0 //never - var/level5 = 0 //banned - var/level6 = 0 //account too young - for(var/mob/new_player/player in player_list) - if(!(player.ready && player.mind && !player.mind.assigned_role)) - continue //This player is not ready - if(jobban_isbanned(player, job.title)) - level5++ - continue - if(!job.player_old_enough(player.client)) - level6++ - continue - //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) + 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/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/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/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/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 e9649fbbcb..3776d5ce6a 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/mecha.dm b/code/game/mecha/mecha.dm index a36fbda176..9d944ced48 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -2825,16 +2825,8 @@ /obj/mecha/proc/start_process(process) current_processes |= process -///////////////////////////////////////////////// -//////// Mecha process() subcomponents //////// -///////////////////////////////////////////////// - -// Handles the internal alarms for a mech. -// Called every 16 iterations (80 deciseconds). - ///////////// - /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 4b6ad5e9df..4d049186be 100644 --- a/code/game/mecha/micro/mecha_construction_paths_vr.dm +++ b/code/game/mecha/micro/mecha_construction_paths_vr.dm @@ -1,769 +1,784 @@ /* //CHOMPedit commented micromech stuff, because fuck this trash /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 +<<<<<<< HEAD spawn_result() ..() feedback_inc("mecha_weasel_created",1) return -*/ \ No newline at end of file +*/ +||||||| parent of 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 + spawn_result() + ..() + feedback_inc("mecha_weasel_created",1) + return +======= +/datum/construction/reversible/mecha/weasel/spawn_result() + ..() + feedback_inc("mecha_weasel_created",1) + return +>>>>>>> 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 diff --git a/code/game/mecha/micro/mecha_parts_vr.dm b/code/game/mecha/micro/mecha_parts_vr.dm index d0c45ccb38..80b23842ab 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 8426766449..2c947e8134 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/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 e9f12dfdf8..7c38a264fb 100644 --- a/code/game/objects/effects/overlays.dm +++ b/code/game/objects/effects/overlays.dm @@ -1,3 +1,4 @@ +<<<<<<< HEAD /obj/effect/overlay name = "overlay" unacidable = 1 @@ -164,3 +165,341 @@ stack_trace("Directional light cone deleted, but not by our component") return QDEL_HINT_LETMELIVE return ..() +||||||| parent of 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 +/obj/effect/overlay + name = "overlay" + unacidable = 1 + var/i_attached//Added for possible image attachments to objects. For hallucinations and the like. + +/obj/effect/overlay/beam//Not actually a projectile, just an effect. + name="beam" + icon='icons/effects/beam.dmi' + icon_state="b_beam" + var/tmp/atom/BeamSource + New() + ..() + spawn(10) qdel(src) + +/obj/effect/overlay/palmtree_r + name = "Palm tree" + icon = 'icons/misc/beach2.dmi' + icon_state = "palm1" + density = 1 + plane = MOB_PLANE + layer = ABOVE_MOB_LAYER + anchored = 1 + +/obj/effect/overlay/palmtree_l + name = "Palm tree" + icon = 'icons/misc/beach2.dmi' + icon_state = "palm2" + density = 1 + plane = MOB_PLANE + layer = ABOVE_MOB_LAYER + anchored = 1 + +/obj/effect/overlay/coconut + name = "Coconuts" + icon = 'icons/misc/beach.dmi' + icon_state = "coconuts" + +/obj/effect/overlay/bluespacify + name = "Bluespace" + icon = 'icons/turf/space_vr.dmi' //VOREStation Edit + icon_state = "bluespacify" + plane = ABOVE_PLANE + +/obj/effect/overlay/wallrot + name = "wallrot" + desc = "Ick..." + icon = 'icons/effects/wallrot.dmi' + anchored = 1 + density = 1 + plane = MOB_PLANE + layer = ABOVE_MOB_LAYER + mouse_opacity = 0 + +/obj/effect/overlay/wallrot/New() + ..() + pixel_x += rand(-10, 10) + pixel_y += rand(-10, 10) + +/obj/effect/overlay/snow + name = "snow" + icon = 'icons/turf/overlays.dmi' + icon_state = "snow" + anchored = 1 + +// Todo: Add a version that gradually reaccumulates over time by means of alpha transparency. -Spades +/obj/effect/overlay/snow/attackby(obj/item/W as obj, mob/user as mob) + if (istype(W, /obj/item/weapon/shovel)) + user.visible_message("[user] begins to shovel away \the [src].") + if(do_after(user, 40)) + to_chat(user, "You have finished shoveling!") + qdel(src) + return + +/obj/effect/overlay/snow/floor + icon_state = "snowfloor" + plane = TURF_PLANE + layer = ABOVE_TURF_LAYER + mouse_opacity = 0 //Don't block underlying tile interactions + +/obj/effect/overlay/snow/floor/edges + icon_state = "snow_edges" + +/obj/effect/overlay/snow/floor/surround + icon_state = "snow_surround" + +/obj/effect/overlay/snow/airlock + icon_state = "snowairlock" + layer = DOOR_CLOSED_LAYER+0.01 + +/obj/effect/overlay/snow/floor/pointy + icon_state = "snowfloorpointy" + +/obj/effect/overlay/snow/wall + icon_state = "snowwall" + plane = MOB_PLANE + layer = ABOVE_MOB_LAYER + +/obj/effect/overlay/holographic + mouse_opacity = FALSE + anchored = TRUE + plane = ABOVE_PLANE + +// Similar to the tesla ball but doesn't actually do anything and is purely visual. +/obj/effect/overlay/energy_ball + name = "energy ball" + desc = "An energy ball." + icon = 'icons/obj/tesla_engine/energy_ball.dmi' + icon_state = "energy_ball" + plane = PLANE_LIGHTING_ABOVE + pixel_x = -32 + pixel_y = -32 + +/obj/effect/overlay/vis + mouse_opacity = MOUSE_OPACITY_TRANSPARENT + anchored = TRUE + vis_flags = VIS_INHERIT_DIR + ///When detected to be unused it gets set to world.time, after a while it gets removed + var/unused = 0 + ///overlays which go unused for this amount of time get cleaned up + var/cache_expiration = 2 MINUTES + +/* +/obj/effect/overlay/atmos_excited + name = "excited group" + icon = null + icon_state = null + anchored = TRUE // should only appear in vis_contents, but to be safe + appearance_flags = RESET_TRANSFORM | TILE_BOUND + invisibility = INVISIBILITY_ABSTRACT + mouse_opacity = MOUSE_OPACITY_TRANSPARENT + + plane = ATMOS_GROUP_PLANE +*/ + +/obj/effect/overlay/light_visible + name = "" + icon = 'icons/effects/light_overlays/light_32.dmi' + icon_state = "light" + plane = PLANE_O_LIGHTING_VISUAL + appearance_flags = RESET_COLOR | RESET_ALPHA | RESET_TRANSFORM + mouse_opacity = MOUSE_OPACITY_TRANSPARENT + alpha = 0 + vis_flags = NONE + blocks_emissive = FALSE + +/obj/effect/overlay/light_visible/Destroy(force) + if(!force) + stack_trace("Movable light visible mask deleted, but not by our component") + return QDEL_HINT_LETMELIVE + return ..() + +/obj/effect/overlay/light_cone + name = "" + icon = 'icons/effects/light_overlays/light_cone.dmi' + icon_state = "light" + plane = PLANE_O_LIGHTING_VISUAL + appearance_flags = RESET_COLOR | RESET_ALPHA | RESET_TRANSFORM + mouse_opacity = MOUSE_OPACITY_TRANSPARENT + vis_flags = NONE + alpha = 110 + blocks_emissive = FALSE + +/obj/effect/overlay/light_cone/Destroy(force) + if(!force) + stack_trace("Directional light cone deleted, but not by our component") + return QDEL_HINT_LETMELIVE + return ..() +======= +/obj/effect/overlay + name = "overlay" + unacidable = 1 + var/i_attached//Added for possible image attachments to objects. For hallucinations and the like. + +/obj/effect/overlay/beam//Not actually a projectile, just an effect. + name="beam" + icon='icons/effects/beam.dmi' + icon_state="b_beam" + var/tmp/atom/BeamSource + +/obj/effect/overlay/beam/New() + ..() + spawn(10) qdel(src) + +/obj/effect/overlay/palmtree_r + name = "Palm tree" + icon = 'icons/misc/beach2.dmi' + icon_state = "palm1" + density = 1 + plane = MOB_PLANE + layer = ABOVE_MOB_LAYER + anchored = 1 + +/obj/effect/overlay/palmtree_l + name = "Palm tree" + icon = 'icons/misc/beach2.dmi' + icon_state = "palm2" + density = 1 + plane = MOB_PLANE + layer = ABOVE_MOB_LAYER + anchored = 1 + +/obj/effect/overlay/coconut + name = "Coconuts" + icon = 'icons/misc/beach.dmi' + icon_state = "coconuts" + +/obj/effect/overlay/bluespacify + name = "Bluespace" + icon = 'icons/turf/space_vr.dmi' //VOREStation Edit + icon_state = "bluespacify" + plane = ABOVE_PLANE + +/obj/effect/overlay/wallrot + name = "wallrot" + desc = "Ick..." + icon = 'icons/effects/wallrot.dmi' + anchored = 1 + density = 1 + plane = MOB_PLANE + layer = ABOVE_MOB_LAYER + mouse_opacity = 0 + +/obj/effect/overlay/wallrot/New() + ..() + pixel_x += rand(-10, 10) + pixel_y += rand(-10, 10) + +/obj/effect/overlay/snow + name = "snow" + icon = 'icons/turf/overlays.dmi' + icon_state = "snow" + anchored = 1 + +// Todo: Add a version that gradually reaccumulates over time by means of alpha transparency. -Spades +/obj/effect/overlay/snow/attackby(obj/item/W as obj, mob/user as mob) + if (istype(W, /obj/item/weapon/shovel)) + user.visible_message("[user] begins to shovel away \the [src].") + if(do_after(user, 40)) + to_chat(user, "You have finished shoveling!") + qdel(src) + return + +/obj/effect/overlay/snow/floor + icon_state = "snowfloor" + plane = TURF_PLANE + layer = ABOVE_TURF_LAYER + mouse_opacity = 0 //Don't block underlying tile interactions + +/obj/effect/overlay/snow/floor/edges + icon_state = "snow_edges" + +/obj/effect/overlay/snow/floor/surround + icon_state = "snow_surround" + +/obj/effect/overlay/snow/airlock + icon_state = "snowairlock" + layer = DOOR_CLOSED_LAYER+0.01 + +/obj/effect/overlay/snow/floor/pointy + icon_state = "snowfloorpointy" + +/obj/effect/overlay/snow/wall + icon_state = "snowwall" + plane = MOB_PLANE + layer = ABOVE_MOB_LAYER + +/obj/effect/overlay/holographic + mouse_opacity = FALSE + anchored = TRUE + plane = ABOVE_PLANE + +// Similar to the tesla ball but doesn't actually do anything and is purely visual. +/obj/effect/overlay/energy_ball + name = "energy ball" + desc = "An energy ball." + icon = 'icons/obj/tesla_engine/energy_ball.dmi' + icon_state = "energy_ball" + plane = PLANE_LIGHTING_ABOVE + pixel_x = -32 + pixel_y = -32 + +/obj/effect/overlay/vis + mouse_opacity = MOUSE_OPACITY_TRANSPARENT + anchored = TRUE + vis_flags = VIS_INHERIT_DIR + ///When detected to be unused it gets set to world.time, after a while it gets removed + var/unused = 0 + ///overlays which go unused for this amount of time get cleaned up + var/cache_expiration = 2 MINUTES + +/* +/obj/effect/overlay/atmos_excited + name = "excited group" + icon = null + icon_state = null + anchored = TRUE // should only appear in vis_contents, but to be safe + appearance_flags = RESET_TRANSFORM | TILE_BOUND + invisibility = INVISIBILITY_ABSTRACT + mouse_opacity = MOUSE_OPACITY_TRANSPARENT + + plane = ATMOS_GROUP_PLANE +*/ + +/obj/effect/overlay/light_visible + name = "" + icon = 'icons/effects/light_overlays/light_32.dmi' + icon_state = "light" + plane = PLANE_O_LIGHTING_VISUAL + appearance_flags = RESET_COLOR | RESET_ALPHA | RESET_TRANSFORM + mouse_opacity = MOUSE_OPACITY_TRANSPARENT + alpha = 0 + vis_flags = NONE + blocks_emissive = FALSE + +/obj/effect/overlay/light_visible/Destroy(force) + if(!force) + stack_trace("Movable light visible mask deleted, but not by our component") + return QDEL_HINT_LETMELIVE + return ..() + +/obj/effect/overlay/light_cone + name = "" + icon = 'icons/effects/light_overlays/light_cone.dmi' + icon_state = "light" + plane = PLANE_O_LIGHTING_VISUAL + appearance_flags = RESET_COLOR | RESET_ALPHA | RESET_TRANSFORM + mouse_opacity = MOUSE_OPACITY_TRANSPARENT + vis_flags = NONE + alpha = 110 + blocks_emissive = FALSE + +/obj/effect/overlay/light_cone/Destroy(force) + if(!force) + stack_trace("Directional light cone deleted, but not by our component") + return QDEL_HINT_LETMELIVE + return ..() +>>>>>>> 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 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/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/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 03c252be0e..08f725a5b9 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/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..d5c5729a0c 100644 --- a/code/game/objects/items/weapons/material/chainsaw.dm +++ b/code/game/objects/items/weapons/material/chainsaw.dm @@ -1,4 +1,4 @@ -obj/item/weapon/chainsaw +/obj/item/weapon/chainsaw name = "chainsaw" desc = "Vroom vroom." icon_state = "chainsaw0" @@ -12,21 +12,27 @@ obj/item/weapon/chainsaw var/active_force = 55 var/inactive_force = 10 +<<<<<<< HEAD obj/item/weapon/chainsaw/Initialize() //YW edit - replaced New with Initialize so chainsaws can be mapped in . = ..() +||||||| parent of 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 +obj/item/weapon/chainsaw/New() +======= +/obj/item/weapon/chainsaw/New() +>>>>>>> 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 var/datum/reagents/R = new/datum/reagents(max_fuel) reagents = R R.my_atom = src 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 +55,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 +66,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 +104,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 +115,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/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/lockbox.dm b/code/game/objects/items/weapons/storage/lockbox.dm index b10caa3610..b3fbc758b3 100644 --- a/code/game/objects/items/weapons/storage/lockbox.dm +++ b/code/game/objects/items/weapons/storage/lockbox.dm @@ -17,44 +17,44 @@ var/icon_broken = "lockbox+b" - attackby(obj/item/weapon/W as obj, mob/user as mob) - if (istype(W, /obj/item/weapon/card/id)) - if(src.broken) - to_chat(user, "It appears to be broken.") +/obj/item/weapon/storage/lockbox/attackby(obj/item/weapon/W as obj, mob/user as mob) + if (istype(W, /obj/item/weapon/card/id)) + if(src.broken) + to_chat(user, "It appears to be broken.") + return + if(src.allowed(user)) + src.locked = !( src.locked ) + if(src.locked) + src.icon_state = src.icon_locked + to_chat(user, "You lock \the [src]!") + close_all() return - if(src.allowed(user)) - src.locked = !( src.locked ) - if(src.locked) - src.icon_state = src.icon_locked - to_chat(user, "You lock \the [src]!") - close_all() - return - else - src.icon_state = src.icon_closed - to_chat(user, "You unlock \the [src]!") - return else - to_chat(user, "Access Denied") - else if(istype(W, /obj/item/weapon/melee/energy/blade)) - if(emag_act(INFINITY, user, W, "The locker has been sliced open by [user] with an energy blade!", "You hear metal being sliced and sparks flying.")) - var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread() - spark_system.set_up(5, 0, src.loc) - spark_system.start() - playsound(src, 'sound/weapons/blade1.ogg', 50, 1) - playsound(src, "sparks", 50, 1) - if(!locked) - ..() + src.icon_state = src.icon_closed + to_chat(user, "You unlock \the [src]!") + return else - to_chat(user, "It's locked!") - return + to_chat(user, "Access Denied") + else if(istype(W, /obj/item/weapon/melee/energy/blade)) + if(emag_act(INFINITY, user, W, "The locker has been sliced open by [user] with an energy blade!", "You hear metal being sliced and sparks flying.")) + var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread() + spark_system.set_up(5, 0, src.loc) + spark_system.start() + playsound(src, 'sound/weapons/blade1.ogg', 50, 1) + playsound(src, "sparks", 50, 1) + if(!locked) + ..() + else + to_chat(user, "It's locked!") + return - show_to(mob/user as mob) - if(locked) - to_chat(user, "It's locked!") - else - ..() - return +/obj/item/weapon/storage/lockbox/show_to(mob/user as mob) + if(locked) + to_chat(user, "It's locked!") + else + ..() + return /obj/item/weapon/storage/lockbox/emag_act(var/remaining_charges, var/mob/user, var/emag_source, var/visual_feedback = "", var/audible_feedback = "") if(!broken) diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index 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 22cac7c7f1..368b0de98c 100644 --- a/code/game/objects/items/weapons/surgery_tools.dm +++ b/code/game/objects/items/weapons/surgery_tools.dm @@ -84,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 @@ -110,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/mob_vr.dm b/code/game/objects/random/mob_vr.dm index 08aa96e22e..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" 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/safe.dm b/code/game/objects/structures/safe.dm index a9815a4070..22af69d08b 100644 --- a/code/game/objects/structures/safe.dm +++ b/code/game/objects/structures/safe.dm @@ -163,7 +163,7 @@ FLOOR SAFES return -obj/structure/safe/ex_act(severity) +/obj/structure/safe/ex_act(severity) return //FLOOR SAFES diff --git a/code/game/objects/structures/salvageable.dm b/code/game/objects/structures/salvageable.dm index 201b203acc..18fe7ad080 100644 --- a/code/game/objects/structures/salvageable.dm +++ b/code/game/objects/structures/salvageable.dm @@ -80,7 +80,7 @@ /obj/item/weapon/stock_parts/capacitor/adv = 30, /obj/item/weapon/computer_hardware/network_card/advanced = 20 ) -obj/structure/salvageable/computer/Initialize() +/obj/structure/salvageable/computer/Initialize() . = ..() icon_state = "computer[rand(0,7)]" @@ -136,7 +136,7 @@ obj/structure/salvageable/computer/Initialize() /obj/item/stack/material/silver{amount = 10} = 30 ) -obj/structure/salvageable/implant_container/Initialize() +/obj/structure/salvageable/implant_container/Initialize() . = ..() icon_state = "implant_container[rand(0,1)]" @@ -164,7 +164,7 @@ obj/structure/salvageable/implant_container/Initialize() /obj/item/weapon/computer_hardware/network_card/advanced = 20 ) -obj/structure/salvageable/data/Initialize() +/obj/structure/salvageable/data/Initialize() . = ..() icon_state = "data[rand(0,1)]" @@ -194,7 +194,7 @@ obj/structure/salvageable/data/Initialize() /obj/item/weapon/computer_hardware/network_card/advanced = 20 ) -obj/structure/salvageable/server/Initialize() +/obj/structure/salvageable/server/Initialize() . = ..() icon_state = "server[rand(0,1)]" @@ -219,7 +219,7 @@ obj/structure/salvageable/server/Initialize() /obj/item/weapon/computer_hardware/hard_drive/advanced = 40 ) -obj/structure/salvageable/personal/Initialize() +/obj/structure/salvageable/personal/Initialize() . = ..() icon_state = "personal[rand(0,12)]" new /obj/structure/table/reinforced (loc) @@ -234,7 +234,7 @@ obj/structure/salvageable/personal/Initialize() /obj/item/weapon/computer_hardware/hard_drive/cluster = 50 ) -obj/structure/salvageable/bliss/Initialize() +/obj/structure/salvageable/bliss/Initialize() . = ..() icon_state = "bliss[rand(0,1)]" diff --git a/code/game/objects/structures/transit_tubes.dm b/code/game/objects/structures/transit_tubes.dm index ca1f311073..6053d26ea2 100644 --- a/code/game/objects/structures/transit_tubes.dm +++ b/code/game/objects/structures/transit_tubes.dm @@ -56,7 +56,7 @@ // When destroyed by explosions, properly handle contents. -obj/structure/ex_act(severity) +/obj/structure/ex_act(severity) switch(severity) if(1.0) for(var/atom/movable/AM in contents) diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm index 400b997dc5..57734b929c 100644 --- a/code/game/objects/structures/windoor_assembly.dm +++ b/code/game/objects/structures/windoor_assembly.dm @@ -9,7 +9,7 @@ */ -obj/structure/windoor_assembly +/obj/structure/windoor_assembly name = "windoor assembly" icon = 'icons/obj/doors/windoor.dmi' icon_state = "l_windoor_assembly01" @@ -27,12 +27,12 @@ obj/structure/windoor_assembly var/state = "01" //How far the door assembly has progressed in terms of sprites var/step = null //How far the door assembly has progressed in terms of steps -obj/structure/windoor_assembly/secure +/obj/structure/windoor_assembly/secure name = "secure windoor assembly" secure = "secure_" icon_state = "l_secure_windoor_assembly01" -obj/structure/windoor_assembly/New(Loc, start_dir=NORTH, constructed=0) +/obj/structure/windoor_assembly/New(Loc, start_dir=NORTH, constructed=0) ..() if(constructed) state = "01" @@ -46,7 +46,7 @@ obj/structure/windoor_assembly/New(Loc, start_dir=NORTH, constructed=0) update_nearby_tiles(need_rebuild=1) -obj/structure/windoor_assembly/Destroy() +/obj/structure/windoor_assembly/Destroy() density = 0 update_nearby_tiles() ..() diff --git a/code/game/periodic_news.dm b/code/game/periodic_news.dm index b3c9c9d69f..a3d89313c5 100644 --- a/code/game/periodic_news.dm +++ b/code/game/periodic_news.dm @@ -2,131 +2,120 @@ // Uses BYOND's type system to put everything into a nice format /datum/news_announcement - var - round_time // time of the round at which this should be announced, in seconds - message // body of the message - author = "NanoTrasen Editor" - can_be_redacted = 0 - message_type = "Story" - channel_name = null + var/round_time // time of the round at which this should be announced, in seconds + var/message // body of the message + var/author = "NanoTrasen Editor" + var/can_be_redacted = 0 + var/message_type = "Story" + var/channel_name = null - New() // I'm sorry... - ..() - channel_name = "The [using_map.starsys_name] Times" +/datum/news_announcement/New() // I'm sorry... + ..() + channel_name = "The [using_map.starsys_name] Times" - revolution_inciting_event +/datum/news_announcement/revolution_inciting_event/paycuts_suspicion + round_time = 60*10 + message = {"Reports have leaked that NanoTrasen is planning to put paycuts into + effect on many of its Research Stations in Tau Ceti. Apparently these research + stations haven't been able to yield the expected revenue, and thus adjustments + have to be made."} + author = "Unauthorized" - paycuts_suspicion - round_time = 60*10 - message = {"Reports have leaked that NanoTrasen is planning to put paycuts into - effect on many of its Research Stations in Tau Ceti. Apparently these research - stations haven't been able to yield the expected revenue, and thus adjustments - have to be made."} - author = "Unauthorized" +/datum/news_announcement/revolution_inciting_event/paycuts_confirmation + round_time = 60*40 + message = {"Earlier rumours about paycuts on Research Stations in the Tau Ceti system have + been confirmed. Shockingly, however, the cuts will only affect lower tier + personnel. Heads of Staff will, according to our sources, not be affected."} + author = "Unauthorized" - paycuts_confirmation - round_time = 60*40 - message = {"Earlier rumours about paycuts on Research Stations in the Tau Ceti system have - been confirmed. Shockingly, however, the cuts will only affect lower tier - personnel. Heads of Staff will, according to our sources, not be affected."} - author = "Unauthorized" +/datum/news_announcement/revolution_inciting_event/human_experiments + round_time = 60*90 + message = {"Unbelievable reports about human experimentation have reached our ears. According + to a refugee from one of the Tau Ceti Research Stations, their station, in order + to increase revenue, has refactored several of their facilities to perform experiments + on live humans, including virology research, genetic manipulation, and \"feeding them + to the slimes to see what happens\". Allegedly, these test subjects were neither + humanified monkeys nor volunteers, but rather unqualified staff that were forced into + the experiments, and reported to have died in a \"work accident\" by NanoTrasen."} + author = "Unauthorized" - human_experiments - round_time = 60*90 - message = {"Unbelievable reports about human experimentation have reached our ears. According - to a refugee from one of the Tau Ceti Research Stations, their station, in order - to increase revenue, has refactored several of their facilities to perform experiments - on live humans, including virology research, genetic manipulation, and \"feeding them - to the slimes to see what happens\". Allegedly, these test subjects were neither - humanified monkeys nor volunteers, but rather unqualified staff that were forced into - the experiments, and reported to have died in a \"work accident\" by NanoTrasen."} - author = "Unauthorized" +/datum/news_announcement/bluespace_research/announcement + round_time = 60*20 + message = {"The new field of research trying to explain several interesting spacetime oddities, + also known as \"Bluespace Research\", has reached new heights. Of the several + hundred space stations now orbiting in Tau Ceti, fifteen are now specially equipped + to experiment with and research Bluespace effects. Rumours have it some of these + stations even sport functional \"travel gates\" that can instantly move a whole research + team to an alternate reality."} - bluespace_research - - announcement - round_time = 60*20 - message = {"The new field of research trying to explain several interesting spacetime oddities, - also known as \"Bluespace Research\", has reached new heights. Of the several - hundred space stations now orbiting in Tau Ceti, fifteen are now specially equipped - to experiment with and research Bluespace effects. Rumours have it some of these - stations even sport functional \"travel gates\" that can instantly move a whole research - team to an alternate reality."} - - random_junk - - cheesy_honkers +/datum/news_announcement/random_junk/cheesy_honkers author = "Assistant Editor Carl Ritz" channel_name = "The Gibson Gazette" message = {"Do cheesy honkers increase risk of having a miscarriage? Several health administrations say so!"} round_time = 60 * 15 - net_block - author = "Assistant Editor Carl Ritz" - channel_name = "The Gibson Gazette" - message = {"Several corporations banding together to block access to 'wetskrell.nt', site administrators - claiming violation of net laws."} - round_time = 60 * 50 +/datum/news_announcement/random_junk/net_block + author = "Assistant Editor Carl Ritz" + channel_name = "The Gibson Gazette" + message = {"Several corporations banding together to block access to 'wetskrell.nt', site administrators + claiming violation of net laws."} + round_time = 60 * 50 - found_ssd - author = "Doctor Eric Hanfield" +/datum/news_announcement/random_junk/found_ssd + author = "Doctor Eric Hanfield" - message = {"Several people have been found unconscious at their terminals. It is thought that it was due - to a lack of sleep or of simply migraines from staring at the screen too long. Camera footage - reveals that many of them were playing games instead of working and their pay has been docked - accordingly."} - round_time = 60 * 90 + message = {"Several people have been found unconscious at their terminals. It is thought that it was due + to a lack of sleep or of simply migraines from staring at the screen too long. Camera footage + reveals that many of them were playing games instead of working and their pay has been docked + accordingly."} + round_time = 60 * 90 - lotus_tree +/datum/news_announcement/lotus_tree/explosions + author = "Reporter Leland H. Howards" - explosions - author = "Reporter Leland H. Howards" + message = {"The newly-christened civillian transport Lotus Tree suffered two very large explosions near the + bridge today, and there are unconfirmed reports that the death toll has passed 50. The cause of + the explosions remain unknown, but there is speculation that it might have something to do with + the recent change of regulation in the Moore-Lee Corporation, a major funder of the ship, when M-L + announced that they were officially acknowledging inter-species marriage and providing couples + with marriage tax-benefits."} + round_time = 60 * 30 - message = {"The newly-christened civillian transport Lotus Tree suffered two very large explosions near the - bridge today, and there are unconfirmed reports that the death toll has passed 50. The cause of - the explosions remain unknown, but there is speculation that it might have something to do with - the recent change of regulation in the Moore-Lee Corporation, a major funder of the ship, when M-L - announced that they were officially acknowledging inter-species marriage and providing couples - with marriage tax-benefits."} - round_time = 60 * 30 +/datum/news_announcement/food_riots/breaking_news + author = "Reporter Ro'kii Ar-Raqis" + message = {"Breaking news: Food riots have broken out throughout the Refuge asteroid colony in the Tenebrae + Lupus system. This comes only hours after NanoTrasen officials announced they will no longer trade with the + colony, citing the increased presence of \"hostile factions\" on the colony has made trade too dangerous to + continue. NanoTrasen officials have not given any details about said factions. More on that at the top of + the hour."} + round_time = 60 * 10 - food_riots - - breaking_news - author = "Reporter Ro'kii Ar-Raqis" - message = {"Breaking news: Food riots have broken out throughout the Refuge asteroid colony in the Tenebrae - Lupus system. This comes only hours after NanoTrasen officials announced they will no longer trade with the - colony, citing the increased presence of \"hostile factions\" on the colony has made trade too dangerous to - continue. NanoTrasen officials have not given any details about said factions. More on that at the top of - the hour."} - round_time = 60 * 10 - - more - author = "Reporter Ro'kii Ar-Raqis" - message = {"More on the Refuge food riots: The Refuge Council has condemned NanoTrasen's withdrawal from - the colony, claiming \"there has been no increase in anti-NanoTrasen activity\", and \"\[the only] reason - NanoTrasen withdrew was because the \[Tenebrae Lupus] system's Phoron deposits have been completely mined out. - We have little to trade with them now\". NanoTrasen officials have denied these allegations, calling them - \"further proof\" of the colony's anti-NanoTrasen stance. Meanwhile, Refuge Security has been unable to quell - the riots. More on this at 6."} - round_time = 60 * 60 +/datum/news_announcement/food_riots/more + author = "Reporter Ro'kii Ar-Raqis" + message = {"More on the Refuge food riots: The Refuge Council has condemned NanoTrasen's withdrawal from + the colony, claiming \"there has been no increase in anti-NanoTrasen activity\", and \"\[the only] reason + NanoTrasen withdrew was because the \[Tenebrae Lupus] system's Phoron deposits have been completely mined out. + We have little to trade with them now\". NanoTrasen officials have denied these allegations, calling them + \"further proof\" of the colony's anti-NanoTrasen stance. Meanwhile, Refuge Security has been unable to quell + the riots. More on this at 6."} + round_time = 60 * 60 var/global/list/newscaster_standard_feeds = list(/datum/news_announcement/bluespace_research, /datum/news_announcement/lotus_tree, /datum/news_announcement/random_junk, /datum/news_announcement/food_riots) -proc/process_newscaster() +/proc/process_newscaster() check_for_newscaster_updates(ticker.mode.newscaster_announcements) var/global/tmp/announced_news_types = list() -proc/check_for_newscaster_updates(type) +/proc/check_for_newscaster_updates(type) for(var/subtype in typesof(type)-type) var/datum/news_announcement/news = new subtype() if(news.round_time * 10 <= world.time && !(subtype in announced_news_types)) announced_news_types += subtype announce_newscaster_news(news) -proc/announce_newscaster_news(datum/news_announcement/news) +/proc/announce_newscaster_news(datum/news_announcement/news) var/datum/feed_channel/sendto for(var/datum/feed_channel/FC in news_network.network_channels) if(FC.channel_name == news.channel_name) diff --git a/code/game/response_team.dm b/code/game/response_team.dm index 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 c47a94d09c..6176fb56d4 100644 --- a/code/game/turfs/flooring/flooring_premade.dm +++ b/code/game/turfs/flooring/flooring_premade.dm @@ -432,6 +432,7 @@ initial_flooring = /decl/flooring/snow/plating/drift movement_cost = 0 +<<<<<<< HEAD #define FOOTSTEP_SPRITE_AMT 2 /turf/snow/Entered(atom/A) if(isliving(A) && !istype(A, /mob/living/simple_mob)) @@ -449,6 +450,31 @@ cut_overlays() for(var/d in crossed_dirs) var/amt = crossed_dirs[d] +||||||| parent of 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 +#define FOOTSTEP_SPRITE_AMT 2 + +// TODO: Move foortprints to a datum-component signal so they can actually be applied to other turf types, like sand, or mud +/turf/simulated/floor/snow/Entered(atom/A) + if(isliving(A)) + 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() + . = ..() +======= +// 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() + . = ..() +>>>>>>> 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 for(var/i in 1 to amt) add_overlay(image(icon, "footprint[i]", text2num(d))) 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/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..0920311a4f 100644 --- a/code/game/turfs/snow/snow.dm +++ b/code/game/turfs/snow/snow.dm @@ -10,9 +10,17 @@ temperature = TN60C var/list/crossed_dirs = list() +<<<<<<< HEAD /* 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 +||||||| parent of 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 + +#define FOOTSTEP_SPRITE_AMT 2 + +======= + +>>>>>>> 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 /turf/snow/Entered(atom/A) if(ismob(A)) var/mdir = "[A.dir]" diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 62867a5dfd..76aa5985a2 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -96,7 +96,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/world.dm b/code/game/world.dm index fbf90687e3..994c03dd2f 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -603,7 +603,13 @@ var/failed_old_db_connections = 0 //CHOMPEdit End return 1 +<<<<<<< HEAD /*proc/setup_database_connection() CHOMPEdit TGSQL +||||||| parent of 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 +proc/setup_database_connection() +======= +/proc/setup_database_connection() +>>>>>>> 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 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 @@ -637,8 +643,28 @@ var/failed_old_db_connections = 0 return .*/ //This proc ensures that the connection to the feedback database (global variable dbcon) is established +<<<<<<< HEAD proc/establish_db_connection() //CHOMPEdit TGSQL return SSdbcore.Connect() +||||||| parent of 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 +proc/establish_db_connection() + if(failed_db_connections > FAILED_DB_CONNECTION_CUTOFF) + return 0 + + if(!dbcon || !dbcon.IsConnected()) + return setup_database_connection() + else + return 1 +======= +/proc/establish_db_connection() + if(failed_db_connections > FAILED_DB_CONNECTION_CUTOFF) + return 0 + + if(!dbcon || !dbcon.IsConnected()) + return setup_database_connection() + else + return 1 +>>>>>>> 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 /hook/startup/proc/connectOldDB() @@ -652,7 +678,13 @@ proc/establish_db_connection() //CHOMPEdit TGSQL 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. +<<<<<<< HEAD /*proc/setup_old_database_connection() //CHOMPStation TGSQL +||||||| parent of 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 +proc/setup_old_database_connection() +======= +/proc/setup_old_database_connection() +>>>>>>> 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 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 @@ -677,8 +709,28 @@ proc/establish_db_connection() //CHOMPEdit TGSQL return .*/ //This proc ensures that the connection to the feedback database (global variable dbcon) is established +<<<<<<< HEAD proc/establish_old_db_connection() return SSdbcore.Connect() +||||||| parent of 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 +proc/establish_old_db_connection() + if(failed_old_db_connections > FAILED_DB_CONNECTION_CUTOFF) + return 0 + + if(!dbcon_old || !dbcon_old.IsConnected()) + return setup_old_database_connection() + else + return 1 +======= +/proc/establish_old_db_connection() + if(failed_old_db_connections > FAILED_DB_CONNECTION_CUTOFF) + return 0 + + if(!dbcon_old || !dbcon_old.IsConnected()) + return setup_old_database_connection() + else + return 1 +>>>>>>> 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 // Things to do when a new z-level was just made. /world/proc/max_z_changed() 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 3dbfd191d3..5e2a0c96f8 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 @@ -90,7 +90,7 @@ datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration = qdel(query_insert) //CHOMPEdit TGSQL -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 @@ -154,7 +154,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 @@ -212,7 +212,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 56a6e71114..f4884804f0 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 67279b402e..4d9fb980fd 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) @@ -1578,7 +1578,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 9e8a99877b..c42182601a 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/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 361db6e853..e94a51b30b 100644 --- a/code/modules/awaymissions/gateway.dm +++ b/code/modules/awaymissions/gateway.dm @@ -1,3 +1,4 @@ +<<<<<<< HEAD /obj/machinery/gateway name = "gateway" desc = "A mysterious gateway built by unknown hands. It allows for faster than light travel to far-flung locations and even alternate realities." //VOREStation Edit @@ -326,3 +327,662 @@ obj/machinery/gateway/centerstation/process() to_chat(user, "Recalibration successful!: This gate's systems have been fine tuned. Travel to this gate will now be on target.") calibrated = 1 return +||||||| parent of 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 +/obj/machinery/gateway + name = "gateway" + desc = "A mysterious gateway built by unknown hands. It allows for faster than light travel to far-flung locations and even alternate realities." //VOREStation Edit + icon = 'icons/obj/machines/gateway.dmi' + icon_state = "off" + density = 1 + anchored = 1 + var/active = 0 + + +/obj/machinery/gateway/Initialize() + update_icon() + if(dir == SOUTH) + density = 0 + . = ..() + +/obj/machinery/gateway/update_icon() + if(active) + icon_state = "on" + return + icon_state = "off" + + + +//this is da important part wot makes things go +/obj/machinery/gateway/centerstation + density = 1 + icon_state = "offcenter" + use_power = USE_POWER_IDLE + + //warping vars + var/list/linked = list() + var/ready = 0 //have we got all the parts for a gateway? + var/wait = 0 //this just grabs world.time at world start + var/obj/machinery/gateway/centeraway/awaygate = null + +/obj/machinery/gateway/centerstation/Initialize() + update_icon() + wait = world.time + config.gateway_delay //+ thirty minutes default + awaygate = locate(/obj/machinery/gateway/centeraway) + . = ..() + density = 1 //VOREStation Add + +/obj/machinery/gateway/centerstation/update_icon() + if(active) + icon_state = "oncenter" + return + icon_state = "offcenter" +/* VOREStation Removal - Doesn't do anything +/obj/machinery/gateway/centerstation/New() + density = 1 +*/ //VOREStation Removal End + +obj/machinery/gateway/centerstation/process() + if(stat & (NOPOWER)) + if(active) toggleoff() + return + + if(active) + use_power(5000) + + +/obj/machinery/gateway/centerstation/proc/detect() + linked = list() //clear the list + var/turf/T = loc + + for(var/i in alldirs) + T = get_step(loc, i) + var/obj/machinery/gateway/G = locate(/obj/machinery/gateway) in T + if(G) + linked.Add(G) + continue + + //this is only done if we fail to find a part + ready = 0 + toggleoff() + break + + if(linked.len == 8) + ready = 1 + + +/obj/machinery/gateway/centerstation/proc/toggleon(mob/user as mob) + if(!ready) return + if(linked.len != 8) return + if(!powered()) return + if(!awaygate) + to_chat(user, "Error: No destination found. Please program gateway.") + return + if(world.time < wait) + to_chat(user, "Error: Warpspace triangulation in progress. Estimated time to completion: [round(((wait - world.time) / 10) / 60)] minutes.") + return + if(!awaygate.calibrated && !LAZYLEN(awaydestinations)) //VOREStation Edit + to_chat(user, "Error: Destination gate uncalibrated. Gateway unsafe to use without far-end calibration update.") + return + + for(var/obj/machinery/gateway/G in linked) + G.active = 1 + G.update_icon() + active = 1 + update_icon() + + +/obj/machinery/gateway/centerstation/proc/toggleoff() + for(var/obj/machinery/gateway/G in linked) + G.active = 0 + G.update_icon() + active = 0 + update_icon() + + +/obj/machinery/gateway/centerstation/attack_hand(mob/user as mob) + if(!ready) + detect() + return + if(!active) + toggleon(user) + return + toggleoff() + + +//okay, here's the good teleporting stuff +/obj/machinery/gateway/centerstation/Bumped(atom/movable/M as mob|obj) + if(!ready) return + if(!active) return + if(!awaygate) return + + use_power(5000) + M << 'sound/effects/phasein.ogg' + playsound(src, 'sound/effects/phasein.ogg', 100, 1) + if(awaygate.calibrated) + M.forceMove(get_step(awaygate.loc, SOUTH)) + M.set_dir(SOUTH) + return + else + //VOREStation Addition Start: Prevent abuse + if(istype(M, /obj/item/device/uav)) + var/obj/item/device/uav/L = M + L.power_down() + if(istype(M, /mob/living)) + var/mob/living/L = M + if(LAZYLEN(L.buckled_mobs)) + var/datum/riding/R = L.riding_datum + for(var/rider in L.buckled_mobs) + R.force_dismount(rider) + //VOREStation Addition End: Prevent abuse + var/obj/effect/landmark/dest = pick(awaydestinations) + if(dest) + M.forceMove(dest.loc) + M.set_dir(SOUTH) + //VOREStation Addition Start: Mcguffin time! + if(ishuman(M)) + var/mob/living/carbon/human/H = M + if(H.client) + awaygate.entrydetect() + //VOREStation Addition End: Mcguffin time! + + //VOREStation Addition Start: Abduction! + if(istype(M, /mob/living) && dest.abductor) + var/mob/living/L = M + //Situations to get the mob out of + if(L.buckled) + L.buckled.unbuckle_mob() + if(istype(L.loc,/obj/mecha)) + var/obj/mecha/ME = L.loc + ME.go_out() + else if(istype(L.loc,/obj/machinery/sleeper)) + var/obj/machinery/sleeper/SL = L.loc + SL.go_out() + else if(istype(L.loc,/obj/machinery/recharge_station)) + var/obj/machinery/recharge_station/RS = L.loc + RS.go_out() + if(!issilicon(L)) //Don't drop borg modules... + var/list/mob_contents = list() //Things which are actually drained as a result of the above not being null. + mob_contents |= L // The recursive check below does not add the object being checked to its list. + mob_contents |= recursive_content_check(L, mob_contents, recursion_limit = 3, client_check = 0, sight_check = 0, include_mobs = 1, include_objects = 1, ignore_show_messages = 1) + for(var/obj/item/weapon/holder/I in mob_contents) + var/obj/item/weapon/holder/H = I + var/mob/living/MI = H.held_mob + MI.forceMove(get_turf(H)) + if(!issilicon(MI)) //Don't drop borg modules... + for(var/obj/item/II in MI) + if(istype(II,/obj/item/weapon/implant) || istype(II,/obj/item/device/nif)) + continue + MI.drop_from_inventory(II, dest.loc) + var/obj/effect/landmark/finaldest = pick(awayabductors) + MI.forceMove(finaldest.loc) + sleep(1) + MI.Paralyse(10) + MI << 'sound/effects/bamf.ogg' + to_chat(MI,"You're starting to come to. You feel like you've been out for a few minutes, at least...") + for(var/obj/item/I in L) + if(istype(I,/obj/item/weapon/implant) || istype(I,/obj/item/device/nif)) + continue + L.drop_from_inventory(I, dest.loc) + var/obj/effect/landmark/finaldest = pick(awayabductors) + L.forceMove(finaldest.loc) + sleep(1) + L.Paralyse(10) + L << 'sound/effects/bamf.ogg' + to_chat(L,"You're starting to come to. You feel like you've been out for a few minutes, at least...") + //VOREStation Addition End + return + +/obj/machinery/gateway/centerstation/attackby(obj/item/device/W as obj, mob/user as mob) + if(istype(W,/obj/item/device/multitool)) + if(!awaygate) + awaygate = locate(/obj/machinery/gateway/centeraway) + if(!awaygate) // We still can't find the damn thing because there is no destination. + to_chat(user, "Error: Programming failed. No destination found.") + return + to_chat(user, "Startup programming successful!: A destination in another point of space and time has been detected.") + else + to_chat(user, "The gate is already calibrated, there is no work for you to do here.") + return + +/////////////////////////////////////Away//////////////////////// + + +/obj/machinery/gateway/centeraway + density = 1 + icon_state = "offcenter" + use_power = USE_POWER_OFF + var/calibrated = 1 + var/list/linked = list() //a list of the connected gateway chunks + var/ready = 0 + var/obj/machinery/gateway/centeraway/stationgate = null + + +/obj/machinery/gateway/centeraway/Initialize() + update_icon() + stationgate = locate(/obj/machinery/gateway/centerstation) + . = ..() + density = 1 //VOREStation Add + + +/obj/machinery/gateway/centeraway/update_icon() + if(active) + icon_state = "oncenter" + return + icon_state = "offcenter" + +/obj/machinery/gateway/centeraway/New() + density = 1 + + +/obj/machinery/gateway/centeraway/proc/detect() + linked = list() //clear the list + var/turf/T = loc + + for(var/i in alldirs) + T = get_step(loc, i) + var/obj/machinery/gateway/G = locate(/obj/machinery/gateway) in T + if(G) + linked.Add(G) + continue + + //this is only done if we fail to find a part + ready = 0 + toggleoff() + break + + if(linked.len == 8) + ready = 1 + + +/obj/machinery/gateway/centeraway/proc/toggleon(mob/user as mob) + if(!ready) return + if(linked.len != 8) return + if(!stationgate || !calibrated) // Vorestation edit. Not like Polaris ever touches this anyway. + to_chat(user, "Error: No destination found. Please calibrate gateway.") + return + + for(var/obj/machinery/gateway/G in linked) + G.active = 1 + G.update_icon() + active = 1 + update_icon() + + +/obj/machinery/gateway/centeraway/proc/toggleoff() + for(var/obj/machinery/gateway/G in linked) + G.active = 0 + G.update_icon() + active = 0 + update_icon() + + +/obj/machinery/gateway/centeraway/attack_hand(mob/user as mob) + if(!ready) + detect() + return + if(!active) + toggleon(user) + return + toggleoff() + + +/obj/machinery/gateway/centeraway/Bumped(atom/movable/M as mob|obj) + if(!ready) return + if(!active) return + if(istype(M, /mob/living/carbon)) + for(var/obj/item/weapon/implant/exile/E in M)//Checking that there is an exile implant in the contents + if(E.imp_in == M)//Checking that it's actually implanted vs just in their pocket + to_chat(M, "The station gate has detected your exile implant and is blocking your entry.") + return + M.forceMove(get_step(stationgate.loc, SOUTH)) + M.set_dir(SOUTH) + M << 'sound/effects/phasein.ogg' + playsound(src, 'sound/effects/phasein.ogg', 100, 1) + + +/obj/machinery/gateway/centeraway/attackby(obj/item/device/W as obj, mob/user as mob) + if(istype(W,/obj/item/device/multitool)) + if(calibrated && stationgate) + to_chat(user, "The gate is already calibrated, there is no work for you to do here.") + return + else + // VOREStation Add + stationgate = locate(/obj/machinery/gateway/centerstation) + if(!stationgate) + to_chat(user, "Error: Recalibration failed. No destination found... That can't be good.") + return + // VOREStation Add End + else + to_chat(user, "Recalibration successful!: This gate's systems have been fine tuned. Travel to this gate will now be on target.") + calibrated = 1 + return +======= +/obj/machinery/gateway + name = "gateway" + desc = "A mysterious gateway built by unknown hands. It allows for faster than light travel to far-flung locations and even alternate realities." //VOREStation Edit + icon = 'icons/obj/machines/gateway.dmi' + icon_state = "off" + density = 1 + anchored = 1 + var/active = 0 + + +/obj/machinery/gateway/Initialize() + update_icon() + if(dir == SOUTH) + density = 0 + . = ..() + +/obj/machinery/gateway/update_icon() + if(active) + icon_state = "on" + return + icon_state = "off" + + + +//this is da important part wot makes things go +/obj/machinery/gateway/centerstation + density = 1 + icon_state = "offcenter" + use_power = USE_POWER_IDLE + + //warping vars + var/list/linked = list() + var/ready = 0 //have we got all the parts for a gateway? + var/wait = 0 //this just grabs world.time at world start + var/obj/machinery/gateway/centeraway/awaygate = null + +/obj/machinery/gateway/centerstation/Initialize() + update_icon() + wait = world.time + config.gateway_delay //+ thirty minutes default + awaygate = locate(/obj/machinery/gateway/centeraway) + . = ..() + density = 1 //VOREStation Add + +/obj/machinery/gateway/centerstation/update_icon() + if(active) + icon_state = "oncenter" + return + icon_state = "offcenter" +/* VOREStation Removal - Doesn't do anything +/obj/machinery/gateway/centerstation/New() + density = 1 +*/ //VOREStation Removal End + +/obj/machinery/gateway/centerstation/process() + if(stat & (NOPOWER)) + if(active) toggleoff() + return + + if(active) + use_power(5000) + + +/obj/machinery/gateway/centerstation/proc/detect() + linked = list() //clear the list + var/turf/T = loc + + for(var/i in alldirs) + T = get_step(loc, i) + var/obj/machinery/gateway/G = locate(/obj/machinery/gateway) in T + if(G) + linked.Add(G) + continue + + //this is only done if we fail to find a part + ready = 0 + toggleoff() + break + + if(linked.len == 8) + ready = 1 + + +/obj/machinery/gateway/centerstation/proc/toggleon(mob/user as mob) + if(!ready) return + if(linked.len != 8) return + if(!powered()) return + if(!awaygate) + to_chat(user, "Error: No destination found. Please program gateway.") + return + if(world.time < wait) + to_chat(user, "Error: Warpspace triangulation in progress. Estimated time to completion: [round(((wait - world.time) / 10) / 60)] minutes.") + return + if(!awaygate.calibrated && !LAZYLEN(awaydestinations)) //VOREStation Edit + to_chat(user, "Error: Destination gate uncalibrated. Gateway unsafe to use without far-end calibration update.") + return + + for(var/obj/machinery/gateway/G in linked) + G.active = 1 + G.update_icon() + active = 1 + update_icon() + + +/obj/machinery/gateway/centerstation/proc/toggleoff() + for(var/obj/machinery/gateway/G in linked) + G.active = 0 + G.update_icon() + active = 0 + update_icon() + + +/obj/machinery/gateway/centerstation/attack_hand(mob/user as mob) + if(!ready) + detect() + return + if(!active) + toggleon(user) + return + toggleoff() + + +//okay, here's the good teleporting stuff +/obj/machinery/gateway/centerstation/Bumped(atom/movable/M as mob|obj) + if(!ready) return + if(!active) return + if(!awaygate) return + + use_power(5000) + M << 'sound/effects/phasein.ogg' + playsound(src, 'sound/effects/phasein.ogg', 100, 1) + if(awaygate.calibrated) + M.forceMove(get_step(awaygate.loc, SOUTH)) + M.set_dir(SOUTH) + return + else + //VOREStation Addition Start: Prevent abuse + if(istype(M, /obj/item/device/uav)) + var/obj/item/device/uav/L = M + L.power_down() + if(istype(M, /mob/living)) + var/mob/living/L = M + if(LAZYLEN(L.buckled_mobs)) + var/datum/riding/R = L.riding_datum + for(var/rider in L.buckled_mobs) + R.force_dismount(rider) + //VOREStation Addition End: Prevent abuse + var/obj/effect/landmark/dest = pick(awaydestinations) + if(dest) + M.forceMove(dest.loc) + M.set_dir(SOUTH) + //VOREStation Addition Start: Mcguffin time! + if(ishuman(M)) + var/mob/living/carbon/human/H = M + if(H.client) + awaygate.entrydetect() + //VOREStation Addition End: Mcguffin time! + + //VOREStation Addition Start: Abduction! + if(istype(M, /mob/living) && dest.abductor) + var/mob/living/L = M + //Situations to get the mob out of + if(L.buckled) + L.buckled.unbuckle_mob() + if(istype(L.loc,/obj/mecha)) + var/obj/mecha/ME = L.loc + ME.go_out() + else if(istype(L.loc,/obj/machinery/sleeper)) + var/obj/machinery/sleeper/SL = L.loc + SL.go_out() + else if(istype(L.loc,/obj/machinery/recharge_station)) + var/obj/machinery/recharge_station/RS = L.loc + RS.go_out() + if(!issilicon(L)) //Don't drop borg modules... + var/list/mob_contents = list() //Things which are actually drained as a result of the above not being null. + mob_contents |= L // The recursive check below does not add the object being checked to its list. + mob_contents |= recursive_content_check(L, mob_contents, recursion_limit = 3, client_check = 0, sight_check = 0, include_mobs = 1, include_objects = 1, ignore_show_messages = 1) + for(var/obj/item/weapon/holder/I in mob_contents) + var/obj/item/weapon/holder/H = I + var/mob/living/MI = H.held_mob + MI.forceMove(get_turf(H)) + if(!issilicon(MI)) //Don't drop borg modules... + for(var/obj/item/II in MI) + if(istype(II,/obj/item/weapon/implant) || istype(II,/obj/item/device/nif)) + continue + MI.drop_from_inventory(II, dest.loc) + var/obj/effect/landmark/finaldest = pick(awayabductors) + MI.forceMove(finaldest.loc) + sleep(1) + MI.Paralyse(10) + MI << 'sound/effects/bamf.ogg' + to_chat(MI,"You're starting to come to. You feel like you've been out for a few minutes, at least...") + for(var/obj/item/I in L) + if(istype(I,/obj/item/weapon/implant) || istype(I,/obj/item/device/nif)) + continue + L.drop_from_inventory(I, dest.loc) + var/obj/effect/landmark/finaldest = pick(awayabductors) + L.forceMove(finaldest.loc) + sleep(1) + L.Paralyse(10) + L << 'sound/effects/bamf.ogg' + to_chat(L,"You're starting to come to. You feel like you've been out for a few minutes, at least...") + //VOREStation Addition End + return + +/obj/machinery/gateway/centerstation/attackby(obj/item/device/W as obj, mob/user as mob) + if(istype(W,/obj/item/device/multitool)) + if(!awaygate) + awaygate = locate(/obj/machinery/gateway/centeraway) + if(!awaygate) // We still can't find the damn thing because there is no destination. + to_chat(user, "Error: Programming failed. No destination found.") + return + to_chat(user, "Startup programming successful!: A destination in another point of space and time has been detected.") + else + to_chat(user, "The gate is already calibrated, there is no work for you to do here.") + return + +/////////////////////////////////////Away//////////////////////// + + +/obj/machinery/gateway/centeraway + density = 1 + icon_state = "offcenter" + use_power = USE_POWER_OFF + var/calibrated = 1 + var/list/linked = list() //a list of the connected gateway chunks + var/ready = 0 + var/obj/machinery/gateway/centeraway/stationgate = null + + +/obj/machinery/gateway/centeraway/Initialize() + update_icon() + stationgate = locate(/obj/machinery/gateway/centerstation) + . = ..() + density = 1 //VOREStation Add + + +/obj/machinery/gateway/centeraway/update_icon() + if(active) + icon_state = "oncenter" + return + icon_state = "offcenter" + +/obj/machinery/gateway/centeraway/New() + density = 1 + + +/obj/machinery/gateway/centeraway/proc/detect() + linked = list() //clear the list + var/turf/T = loc + + for(var/i in alldirs) + T = get_step(loc, i) + var/obj/machinery/gateway/G = locate(/obj/machinery/gateway) in T + if(G) + linked.Add(G) + continue + + //this is only done if we fail to find a part + ready = 0 + toggleoff() + break + + if(linked.len == 8) + ready = 1 + + +/obj/machinery/gateway/centeraway/proc/toggleon(mob/user as mob) + if(!ready) return + if(linked.len != 8) return + if(!stationgate || !calibrated) // Vorestation edit. Not like Polaris ever touches this anyway. + to_chat(user, "Error: No destination found. Please calibrate gateway.") + return + + for(var/obj/machinery/gateway/G in linked) + G.active = 1 + G.update_icon() + active = 1 + update_icon() + + +/obj/machinery/gateway/centeraway/proc/toggleoff() + for(var/obj/machinery/gateway/G in linked) + G.active = 0 + G.update_icon() + active = 0 + update_icon() + + +/obj/machinery/gateway/centeraway/attack_hand(mob/user as mob) + if(!ready) + detect() + return + if(!active) + toggleon(user) + return + toggleoff() + + +/obj/machinery/gateway/centeraway/Bumped(atom/movable/M as mob|obj) + if(!ready) return + if(!active) return + if(istype(M, /mob/living/carbon)) + for(var/obj/item/weapon/implant/exile/E in M)//Checking that there is an exile implant in the contents + if(E.imp_in == M)//Checking that it's actually implanted vs just in their pocket + to_chat(M, "The station gate has detected your exile implant and is blocking your entry.") + return + M.forceMove(get_step(stationgate.loc, SOUTH)) + M.set_dir(SOUTH) + M << 'sound/effects/phasein.ogg' + playsound(src, 'sound/effects/phasein.ogg', 100, 1) + + +/obj/machinery/gateway/centeraway/attackby(obj/item/device/W as obj, mob/user as mob) + if(istype(W,/obj/item/device/multitool)) + if(calibrated && stationgate) + to_chat(user, "The gate is already calibrated, there is no work for you to do here.") + return + else + // VOREStation Add + stationgate = locate(/obj/machinery/gateway/centerstation) + if(!stationgate) + to_chat(user, "Error: Recalibration failed. No destination found... That can't be good.") + return + // VOREStation Add End + else + to_chat(user, "Recalibration successful!: This gate's systems have been fine tuned. Travel to this gate will now be on target.") + calibrated = 1 + return +>>>>>>> 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 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 2fffe08cfd..3b7b12fe54 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -412,7 +412,6 @@ query_accesslog.Execute() qdel(query_accesslog) //CHOMPEdit TGSQL -#undef TOPIC_SPAM_DELAY #undef UPLOAD_LIMIT #undef MIN_CLIENT_VERSION @@ -442,17 +441,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 33a6446cca..0ded789baf 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,13 @@ datum/preferences/proc/set_biological_gender(var/gender) return TOPIC_REFRESH else if(href_list["metadata"]) +<<<<<<< HEAD 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, MAX_RECORD_LENGTH, extra = 0) //VOREStation Edit +||||||| parent of 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 + 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 +>>>>>>> 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 if(new_metadata && CanUseTopic(user)) pref.metadata = new_metadata return TOPIC_REFRESH 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 06d1547506..8a097384c6 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 f32a51ad15..f67cbf76ac 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/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 2048053cce..f3947c475c 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -1,3 +1,4 @@ +<<<<<<< HEAD /obj/item/clothing name = "clothing" siemens_coefficient = 0.9 @@ -1092,3 +1093,2194 @@ /obj/item/clothing/under/rank/New() sensor_mode = pick(0,1,2,3) ..() +||||||| parent of 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 +/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' + ) + + 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' + ) + + //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' + ) + + 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' + ) + + //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) + ..() +>>>>>>> 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm index 92c63c3acd..bd08560380 100644 --- a/code/modules/clothing/glasses/glasses.dm +++ b/code/modules/clothing/glasses/glasses.dm @@ -502,19 +502,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 de56015ed7..8d55d41786 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 7ab20fbbdd..09446bb66b 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 0031a6c55b..e95147bff5 100644 --- a/code/modules/clothing/suits/miscellaneous.dm +++ b/code/modules/clothing/suits/miscellaneous.dm @@ -269,13 +269,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/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/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/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/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 5b70b4985f..57bdb7a20c 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/station.dm b/code/modules/mob/living/carbon/human/species/station/station.dm index 504dc5e3df..568196fd7d 100644 --- a/code/modules/mob/living/carbon/human/species/station/station.dm +++ b/code/modules/mob/living/carbon/human/species/station/station.dm @@ -241,7 +241,7 @@ base_color = "#333333" reagent_tag = IS_TAJARA - allergens = COFFEE + allergens = ALLERGEN_COFFEE move_trail = /obj/effect/decal/cleanable/blood/tracks/paw @@ -347,7 +347,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 ae70a439c7..42b93294f4 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 @@ -376,7 +376,7 @@ //CHOMPedit: link to our wiki wikilink="https://wiki.chompstation13.net/index.php?title=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 a610a38a93..939d9f9eae 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) /datum/trait/negative/minor_brute_weak name = "Minor Brute Weakness" 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 3c40e2e042..6002bca467 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 @@ -193,7 +190,7 @@ 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 @@ -204,63 +201,63 @@ 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 7810b5904f..9312d113de 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 @@ -28,9 +25,9 @@ cost = 2 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) /datum/trait/positive/nonconductive name = "Non-Conductive" 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 b4d467eea2..ce37ef3eda 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 c8f74dbc8e..7330c80c38 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 2e40d580cf..0757486092 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 868074f2ed..934c6d42dc 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone_items.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone_items.dm @@ -266,7 +266,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 b370f1f4b4..b42fcc8e0b 100644 --- a/code/modules/mob/living/silicon/robot/robot_vr.dm +++ b/code/modules/mob/living/silicon/robot/robot_vr.dm @@ -237,7 +237,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 d7e9dbe063..745f7fdf57 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1,3 +1,4 @@ +<<<<<<< HEAD /mob/Destroy()//This makes sure that mobs withGLOB.clients/keys are not just deleted from the game. mob_list -= src dead_mob_list -= src @@ -1230,3 +1231,2470 @@ GLOBAL_LIST_EMPTY_TYPED(living_players_by_zlevel, /list) /mob/proc/grab_ghost(force) if(mind) return mind.grab_ghost(force = force) +||||||| parent of 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 +/mob/Destroy()//This makes sure that mobs withGLOB.clients/keys are not just deleted from the game. + mob_list -= src + dead_mob_list -= src + living_mob_list -= src + unset_machine() + qdel(hud_used) + clear_fullscreen() + if(client) + for(var/obj/screen/movable/spell_master/spell_master in spell_masters) + qdel(spell_master) + remove_screen_obj_references() + client.screen = list() + if(mind && mind.current == src) + spellremove(src) + ghostize() + QDEL_NULL(plane_holder) + ..() + return QDEL_HINT_HARDDEL_NOW + +/mob/proc/remove_screen_obj_references() + hands = null + pullin = null + purged = null + internals = null + i_select = null + m_select = null + healths = null + throw_icon = null + pain = null + item_use_icon = null + gun_move_icon = null + gun_setting_icon = null + spell_masters = null + zone_sel = null + +/mob/Initialize() + mob_list += src + if(stat == DEAD) + dead_mob_list += src + else + living_mob_list += src + lastarea = get_area(src) + hook_vr("mob_new",list(src)) //VOREStation Code + update_transform() // Some mobs may start bigger or smaller than normal. + return ..() + +/mob/proc/show_message(msg, type, alt, alt_type)//Message, type of message (1 or 2), alternative message, alt message type (1 or 2) + + if(!client && !teleop) return + + if (type) + if((type & VISIBLE_MESSAGE) && (is_blind() || paralysis) )//Vision related + if (!( alt )) + return + else + msg = alt + type = alt_type + if ((type & AUDIBLE_MESSAGE) && is_deaf())//Hearing related + if (!( alt )) + return + else + msg = alt + type = alt_type + if ((type & VISIBLE_MESSAGE) && (sdisabilities & BLIND)) + return + // Added voice muffling for Issue 41. + if(stat == UNCONSCIOUS || sleeping > 0) + to_chat(src, "... You can almost hear someone talking ...") + else + to_chat(src,msg) + if(teleop) + to_chat(teleop, create_text_tag("body", "BODY:", teleop) + "[msg]") + return + +// Show a message to all mobs and objects in sight of this one +// This would be for visible actions by the src mob +// message is the message output to anyone who can see e.g. "[src] does something!" +// self_message (optional) is what the src mob sees e.g. "You do something!" +// blind_message (optional) is what blind people will hear e.g. "You hear something!" +/mob/visible_message(var/message, var/self_message, var/blind_message, var/list/exclude_mobs = null, var/range = world.view, var/runemessage) + if(self_message) + if(LAZYLEN(exclude_mobs)) + exclude_mobs |= src + else + exclude_mobs = list(src) + src.show_message(self_message, 1, blind_message, 2) + // Transfer messages about what we are doing to upstairs + if(shadow) + shadow.visible_message(message, self_message, blind_message, exclude_mobs, range) + if(isnull(runemessage)) + runemessage = -1 + . = ..(message, blind_message, exclude_mobs, range, runemessage) // Really not ideal that atom/visible_message has different arg numbering :( + +// Returns an amount of power drawn from the object (-1 if it's not viable). +// If drain_check is set it will not actually drain power, just return a value. +// If surge is set, it will destroy/damage the recipient and not return any power. +// Not sure where to define this, so it can sit here for the rest of time. +/atom/proc/drain_power(var/drain_check,var/surge, var/amount = 0) + return -1 + +// Show a message to all mobs and objects in earshot of this one +// This would be for audible actions by the src mob +// message is the message output to anyone who can hear. +// self_message (optional) is what the src mob hears. +// deaf_message (optional) is what deaf people will see. +// hearing_distance (optional) is the range, how many tiles away the message can be heard. +/mob/audible_message(var/message, var/deaf_message, var/hearing_distance, var/self_message, var/radio_message, var/runemessage) + + var/range = hearing_distance || world.view + var/list/hear = get_mobs_and_objs_in_view_fast(get_turf(src),range,remote_ghosts = FALSE) + + var/list/hearing_mobs = hear["mobs"] + var/list/hearing_objs = hear["objs"] + + if(isnull(runemessage)) + runemessage = -1 // Symmetry with mob/audible_message, despite the fact this one doesn't call parent. Maybe it should! + + if(radio_message) + for(var/obj in hearing_objs) + var/obj/O = obj + O.hear_talk(src, list(new /datum/multilingual_say_piece(GLOB.all_languages["Noise"], radio_message)), null) + else + for(var/obj in hearing_objs) + var/obj/O = obj + O.show_message(message, AUDIBLE_MESSAGE, deaf_message, VISIBLE_MESSAGE) + + for(var/mob in hearing_mobs) + var/mob/M = mob + var/msg = message + if(self_message && M==src) + msg = self_message + M.show_message(msg, AUDIBLE_MESSAGE, deaf_message, VISIBLE_MESSAGE) + if(runemessage != -1) + M.create_chat_message(src, "[runemessage || message]", FALSE, list("emote"), audible = FALSE) + +/mob/proc/findname(msg) + for(var/mob/M in mob_list) + if (M.real_name == text("[]", msg)) + return M + return 0 + +/mob/proc/Life() +// if(organStructure) +// organStructure.ProcessOrgans() + return + +#define UNBUCKLED 0 +#define PARTIALLY_BUCKLED 1 +#define FULLY_BUCKLED 2 +/mob/proc/buckled() + // Preliminary work for a future buckle rewrite, + // where one might be fully restrained (like an elecrical chair), or merely secured (shuttle chair, keeping you safe but not otherwise restrained from acting) + if(!buckled) + return UNBUCKLED + return restrained() ? FULLY_BUCKLED : PARTIALLY_BUCKLED + +/mob/proc/is_blind() + return ((sdisabilities & BLIND) || blinded || incapacitated(INCAPACITATION_KNOCKOUT)) + +/mob/proc/is_deaf() + return ((sdisabilities & DEAF) || ear_deaf || incapacitated(INCAPACITATION_KNOCKOUT)) + +/mob/proc/is_physically_disabled() + return incapacitated(INCAPACITATION_DISABLED) + +/mob/proc/cannot_stand() + return incapacitated(INCAPACITATION_KNOCKDOWN) + +/mob/proc/incapacitated(var/incapacitation_flags = INCAPACITATION_DEFAULT) + if ((incapacitation_flags & INCAPACITATION_STUNNED) && stunned) + return 1 + + if ((incapacitation_flags & INCAPACITATION_FORCELYING) && (weakened || resting)) + return 1 + + if ((incapacitation_flags & INCAPACITATION_KNOCKOUT) && (stat || paralysis || sleeping || (status_flags & FAKEDEATH))) + return 1 + + if((incapacitation_flags & INCAPACITATION_RESTRAINED) && restrained()) + return 1 + + if((incapacitation_flags & (INCAPACITATION_BUCKLED_PARTIALLY|INCAPACITATION_BUCKLED_FULLY))) + var/buckling = buckled() + if(buckling >= PARTIALLY_BUCKLED && (incapacitation_flags & INCAPACITATION_BUCKLED_PARTIALLY)) + return 1 + if(buckling == FULLY_BUCKLED && (incapacitation_flags & INCAPACITATION_BUCKLED_FULLY)) + return 1 + + return 0 + +#undef UNBUCKLED +#undef PARTIALLY_BUCKLED +#undef FULLY_BUCKLED + +/mob/proc/restrained() + return + +/mob/proc/reset_view(atom/A) + if (client) + if (istype(A, /atom/movable)) + client.perspective = EYE_PERSPECTIVE + client.eye = A + else + if (isturf(loc)) + client.eye = client.mob + client.perspective = MOB_PERSPECTIVE + else + client.perspective = EYE_PERSPECTIVE + client.eye = loc + return TRUE + +/mob/verb/pointed(atom/A as mob|obj|turf in view()) + set name = "Point To" + set category = "Object" + + if(!src || !isturf(src.loc) || !(A in view(src.loc))) + return 0 + if(istype(A, /obj/effect/decal/point)) + return 0 + + var/turf/tile = get_turf(A) + if (!tile) + return 0 + + var/turf/our_tile = get_turf(src) + var/obj/visual = new /obj/effect/decal/point(our_tile) + visual.invisibility = invisibility + visual.plane = ABOVE_PLANE + visual.layer = FLY_LAYER + + animate(visual, + pixel_x = (tile.x - our_tile.x) * world.icon_size + A.pixel_x, + pixel_y = (tile.y - our_tile.y) * world.icon_size + A.pixel_y, + time = 1.7, + easing = EASE_OUT) + + QDEL_IN(visual, 2 SECONDS) //Better qdel + + face_atom(A) + return 1 + + +/mob/proc/ret_grab(list/L, flag) + return + +/mob/verb/mode() + set name = "Activate Held Object" + set category = "Object" + set src = usr + + return + +/* +/mob/verb/dump_source() + + var/master = "
"
+	for(var/t in typesof(/area))
+		master += text("[]\n", t)
+		//Foreach goto(26)
+	src << browse(master)
+	return
+*/
+
+/mob/verb/memory()
+	set name = "Notes"
+	set category = "IC"
+	if(mind)
+		mind.show_memory(src)
+	else
+		to_chat(src, "The game appears to have misplaced your mind datum, so we can't show you your notes.")
+
+/mob/verb/add_memory(msg as message)
+	set name = "Add Note"
+	set category = "IC"
+
+	msg = sanitize(msg)
+
+	if(mind)
+		mind.store_memory(msg)
+	else
+		to_chat(src, "The game appears to have misplaced your mind datum, so we can't show you your notes.")
+
+/mob/proc/store_memory(msg as message, popup, sane = 1)
+	msg = copytext(msg, 1, MAX_MESSAGE_LEN)
+
+	if (sane)
+		msg = sanitize(msg)
+
+	if (length(memory) == 0)
+		memory += msg
+	else
+		memory += "
[msg]" + + if (popup) + memory() + +/mob/proc/update_flavor_text() + set src in usr + if(usr != src) + to_chat(usr, "No.") + var/msg = sanitize(input(usr,"Set the flavor text in your 'examine' verb.","Flavor Text",html_decode(flavor_text)) as message|null, extra = 0) //VOREStation Edit: separating out OOC notes + + if(msg != null) + flavor_text = msg + +/mob/proc/warn_flavor_changed() + if(flavor_text && flavor_text != "") // don't spam people that don't use it! + to_chat(src, "

OOC Warning:

") + to_chat(src, "Your flavor text is likely out of date! Change") + +/mob/proc/print_flavor_text() + if (flavor_text && flavor_text != "") + var/msg = replacetext(flavor_text, "\n", " ") + if(length(msg) <= 40) + return "[msg]" + else + return "[copytext_preserve_html(msg, 1, 37)]... More..." + +/* +/mob/verb/help() + set name = "Help" + src << browse('html/help.html', "window=help") + return +*/ + +/mob/proc/set_respawn_timer(var/time) + // Try to figure out what time to use + + // Special cases, can never respawn + if(ticker?.mode?.deny_respawn) + time = -1 + else if(!config.abandon_allowed) + time = -1 + else if(!config.respawn) + time = -1 + + // Special case for observing before game start + else if(ticker?.current_state <= GAME_STATE_SETTING_UP) + time = 1 MINUTE + + // Wasn't given a time, use the config time + else if(!time) + time = config.respawn_time + + var/keytouse = ckey + // Try harder to find a key to use + if(!keytouse && key) + keytouse = ckey(key) + else if(!keytouse && mind?.key) + keytouse = ckey(mind.key) + + GLOB.respawn_timers[keytouse] = world.time + time + +/mob/observer/dead/set_respawn_timer() + if(config.antag_hud_restricted && has_enabled_antagHUD) + ..(-1) + else + return // Don't set it, no need + +/mob/verb/abandon_mob() + set name = "Return to Menu" + set category = "OOC" + + if(stat != DEAD || !ticker) + to_chat(usr, "You must be dead to use this!") + return + + // Final chance to abort "respawning" + if(mind && timeofdeath) // They had spawned before + var/choice = alert(usr, "Returning to the menu will prevent your character from being revived in-round. Are you sure?", "Confirmation", "No, wait", "Yes, leave") + if(choice == "No, wait") + return + + // Beyond this point, you're going to respawn + to_chat(usr, config.respawn_message) + + if(!client) + log_game("[usr.key] AM failed due to disconnect.") + return + client.screen.Cut() + client.screen += client.void + if(!client) + log_game("[usr.key] AM failed due to disconnect.") + return + + announce_ghost_joinleave(client, 0) + + var/mob/new_player/M = new /mob/new_player() + if(!client) + log_game("[usr.key] AM failed due to disconnect.") + qdel(M) + return + + M.key = key + if(M.mind) + M.mind.reset() + return + +/client/verb/changes() + set name = "Changelog" + set category = "OOC" + src << browse('html/changelog.html', "window=changes;size=675x650") + if(prefs.lastchangelog != changelog_hash) + prefs.lastchangelog = changelog_hash + SScharacter_setup.queue_preferences_save(prefs) + winset(src, "rpane.changelog", "background-color=none;font-style=;") + +/mob/verb/observe() + set name = "Observe" + set category = "OOC" + var/is_admin = 0 + + if(client.holder && (client.holder.rights & R_ADMIN|R_EVENT)) + is_admin = 1 + else if(stat != DEAD || istype(src, /mob/new_player)) + to_chat(usr, "You must be observing to use this!") + return + + if(is_admin && stat == DEAD) + is_admin = 0 + + var/list/targets = list() + + + targets += observe_list_format(nuke_disks) + targets += observe_list_format(all_singularities) + targets += getmobs() + targets += observe_list_format(sortAtom(mechas_list)) + targets += observe_list_format(SSshuttles.ships) + + client.perspective = EYE_PERSPECTIVE + + var/eye_name = null + + var/ok = "[is_admin ? "Admin Observe" : "Observe"]" + eye_name = input("Please, select a player!", ok, null, null) as null|anything in targets + + if (!eye_name) + return + + var/mob/mob_eye = targets[eye_name] + + if(client && mob_eye) + client.eye = mob_eye + if (is_admin) + client.adminobs = 1 + if(mob_eye == client.mob || client.eye == client.mob) + client.adminobs = 0 + +/mob/verb/cancel_camera() + set name = "Cancel Camera View" + set category = "OOC" + unset_machine() + reset_view(null) + +/mob/Topic(href, href_list) + if(href_list["mach_close"]) + var/t1 = text("window=[href_list["mach_close"]]") + unset_machine() + src << browse(null, t1) + + if(href_list["flavor_more"]) + usr << browse(text("[][]", name, replacetext(flavor_text, "\n", "
")), text("window=[];size=500x200", name)) + onclose(usr, "[name]") + if(href_list["flavor_change"]) + update_flavor_text() +// ..() + return + + +/mob/proc/pull_damage() + return 0 + +/mob/verb/stop_pulling() + + set name = "Stop Pulling" + set category = "IC" + + if(pulling) + if(ishuman(pulling)) + var/mob/living/carbon/human/H = pulling + visible_message(SPAN_WARNING("\The [src] lets go of \the [H]."), SPAN_NOTICE("You let go of \the [H]."), exclude_mobs = list(H)) + if(!H.stat) + to_chat(H, SPAN_WARNING("\The [src] lets go of you.")) + pulling.pulledby = null + pulling = null + if(pullin) + pullin.icon_state = "pull0" + +/mob/proc/start_pulling(var/atom/movable/AM) + + if ( !AM || !usr || src==AM || !isturf(src.loc) ) //if there's no person pulling OR the person is pulling themself OR the object being pulled is inside something: abort! + return + + if (AM.anchored) + to_chat(src, "It won't budge!") + return + + var/mob/M = AM + if(ismob(AM)) + + if(!can_pull_mobs || !can_pull_size) + to_chat(src, "They won't budge!") + return + + if((mob_size < M.mob_size) && (can_pull_mobs != MOB_PULL_LARGER)) + to_chat(src, "[M] is too large for you to move!") + return + + if((mob_size == M.mob_size) && (can_pull_mobs == MOB_PULL_SMALLER)) + to_chat(src, "[M] is too heavy for you to move!") + return + + // If your size is larger than theirs and you have some + // kind of mob pull value AT ALL, you will be able to pull + // them, so don't bother checking that explicitly. + + if(M.grabbed_by.len) + // Only start pulling when nobody else has a grab on them + . = 1 + for(var/obj/item/weapon/grab/G in M.grabbed_by) + if(G.assailant != usr) + . = 0 + else + qdel(G) + if(!.) + to_chat(src, "Somebody has a grip on them!") + return + + if(!iscarbon(src)) + M.LAssailant = null + else + M.LAssailant = usr + + else if(isobj(AM)) + var/obj/I = AM + if(!can_pull_size || can_pull_size < I.w_class) + to_chat(src, "It won't budge!") + return + + if(pulling) + var/pulling_old = pulling + stop_pulling() + // Are we pulling the same thing twice? Just stop pulling. + if(pulling_old == AM) + return + + src.pulling = AM + AM.pulledby = src + + if(pullin) + pullin.icon_state = "pull1" + + if(ishuman(AM)) + var/mob/living/carbon/human/H = AM + if(H.lying) // If they're on the ground we're probably dragging their arms to move them + visible_message(SPAN_WARNING("\The [src] leans down and grips \the [H]'s arms."), SPAN_NOTICE("You lean down and grip \the [H]'s arms."), exclude_mobs = list(H)) + if(!H.stat) + to_chat(H, SPAN_WARNING("\The [src] leans down and grips your arms.")) + else //Otherwise we're probably just holding their arm to lead them somewhere + visible_message(SPAN_WARNING("\The [src] grips \the [H]'s arm."), SPAN_NOTICE("You grip \the [H]'s arm."), exclude_mobs = list(H)) + if(!H.stat) + to_chat(H, SPAN_WARNING("\The [src] grips your arm.")) + playsound(src.loc, 'sound/weapons/thudswoosh.ogg', 25) //Quieter than hugging/grabbing but we still want some audio feedback + + if(H.pull_damage()) + to_chat(src, "Pulling \the [H] in their current condition would probably be a bad idea.") + + //Attempted fix for people flying away through space when cuffed and dragged. + if(ismob(AM)) + var/mob/pulled = AM + pulled.inertia_dir = 0 + +/mob/proc/can_use_hands() + return + +/mob/proc/is_active() + return (0 >= usr.stat) + +/mob/proc/is_dead() + return stat == DEAD + +/mob/proc/is_mechanical() + if(mind && (mind.assigned_role == "Cyborg" || mind.assigned_role == "AI")) + return 1 + return istype(src, /mob/living/silicon) || get_species() == "Machine" + +/mob/proc/is_ready() + return client && !!mind + +/mob/proc/get_gender() + return gender + +/mob/proc/see(message) + if(!is_active()) + return 0 + to_chat(src,message) + return 1 + +/mob/proc/show_viewers(message) + for(var/mob/M in viewers()) + M.see(message) + +/mob/Stat() + ..() + . = (is_client_active(10 MINUTES)) + + if(.) + if(statpanel("Status")) + stat(null, "Time Dilation: [round(SStime_track.time_dilation_current,1)]% AVG:([round(SStime_track.time_dilation_avg_fast,1)]%, [round(SStime_track.time_dilation_avg,1)]%, [round(SStime_track.time_dilation_avg_slow,1)]%)") + if(ticker && ticker.current_state != GAME_STATE_PREGAME) + stat("Station Time", stationtime2text()) + stat("Station Date", stationdate2text()) + stat("Round Duration", roundduration2text()) + + if(client.holder) + if(statpanel("Status")) + stat("Location:", "([x], [y], [z]) [loc]") + stat("CPU:","[world.cpu]") + stat("Instances:","[world.contents.len]") + stat(null, "Time Dilation: [round(SStime_track.time_dilation_current,1)]% AVG:([round(SStime_track.time_dilation_avg_fast,1)]%, [round(SStime_track.time_dilation_avg,1)]%, [round(SStime_track.time_dilation_avg_slow,1)]%)") + + if(statpanel("MC")) + stat("Location:", "([x], [y], [z]) [loc]") + stat("CPU:","[world.cpu]") + stat("Instances:","[world.contents.len]") + stat("World Time:", world.time) + stat("Real time of day:", REALTIMEOFDAY) + stat(null) + if(GLOB) + GLOB.stat_entry() + else + stat("Globals:", "ERROR") + if(Master) + Master.stat_entry() + else + stat("Master Controller:", "ERROR") + if(Failsafe) + Failsafe.stat_entry() + else + stat("Failsafe Controller:", "ERROR") + if(Master) + stat(null) + for(var/datum/controller/subsystem/SS in Master.subsystems) + SS.stat_entry() + + if(statpanel("Tickets")) + GLOB.ahelp_tickets.stat_entry() + + + if(length(GLOB.sdql2_queries)) + if(statpanel("SDQL2")) + stat("Access Global SDQL2 List", GLOB.sdql2_vv_statobj) + for(var/i in GLOB.sdql2_queries) + var/datum/SDQL2_query/Q = i + Q.generate_stat() + + if(listed_turf && client) + if(!TurfAdjacent(listed_turf)) + listed_turf = null + else + if(statpanel("Turf")) + stat(listed_turf) + for(var/atom/A in listed_turf) + if(!A.mouse_opacity) + continue + if(A.invisibility > see_invisible) + continue + if(is_type_in_list(A, shouldnt_see)) + continue + if(A.plane > plane) + continue + stat(A) + + +// facing verbs +/mob/proc/canface() +// if(!canmove) return 0 //VOREStation Edit. Redundant check that only affects conscious proning, actual inability to turn and shift around handled by actual inabilities. + if(stat) return 0 + if(anchored) return 0 + if(transforming) return 0 + return 1 + +// Not sure what to call this. Used to check if humans are wearing an AI-controlled exosuit and hence don't need to fall over yet. +/mob/proc/can_stand_overridden() + return 0 + +//Updates canmove, lying and icons. Could perhaps do with a rename but I can't think of anything to describe it. +/mob/proc/update_canmove() + return canmove + + +/mob/proc/facedir(var/ndir) + if(!canface() || (client && (client.moving || !checkMoveCooldown()))) + return 0 + set_dir(ndir) + if(buckled && buckled.buckle_movable) + buckled.set_dir(ndir) + setMoveCooldown(movement_delay()) + return 1 + + +/mob/verb/eastface() + set hidden = 1 + return facedir(client.client_dir(EAST)) + + +/mob/verb/westface() + set hidden = 1 + return facedir(client.client_dir(WEST)) + + +/mob/verb/northface() + set hidden = 1 + return facedir(client.client_dir(NORTH)) + + +/mob/verb/southface() + set hidden = 1 + return facedir(client.client_dir(SOUTH)) + + +//This might need a rename but it should replace the can this mob use things check +/mob/proc/IsAdvancedToolUser() + return 0 + +/mob/proc/Stun(amount) + if(status_flags & CANSTUN) + facing_dir = null + stunned = max(max(stunned,amount),0) //can't go below 0, getting a low amount of stun doesn't lower your current stun + update_canmove() //updates lying, canmove and icons + return + +/mob/proc/SetStunned(amount) //if you REALLY need to set stun to a set amount without the whole "can't go below current stunned" + if(status_flags & CANSTUN) + stunned = max(amount,0) + update_canmove() //updates lying, canmove and icons + return + +/mob/proc/AdjustStunned(amount) + if(status_flags & CANSTUN) + stunned = max(stunned + amount,0) + update_canmove() //updates lying, canmove and icons + return + +/mob/proc/Weaken(amount) + if(status_flags & CANWEAKEN) + facing_dir = null + weakened = max(max(weakened,amount),0) + update_canmove() //updates lying, canmove and icons + return + +/mob/proc/SetWeakened(amount) + if(status_flags & CANWEAKEN) + weakened = max(amount,0) + update_canmove() //can you guess what this does yet? + return + +/mob/proc/AdjustWeakened(amount) + if(status_flags & CANWEAKEN) + weakened = max(weakened + amount,0) + update_canmove() //updates lying, canmove and icons + return + +/mob/proc/Paralyse(amount) + if(status_flags & CANPARALYSE) + facing_dir = null + paralysis = max(max(paralysis,amount),0) + return + +/mob/proc/SetParalysis(amount) + if(status_flags & CANPARALYSE) + paralysis = max(amount,0) + return + +/mob/proc/AdjustParalysis(amount) + if(status_flags & CANPARALYSE) + paralysis = max(paralysis + amount,0) + return + +/mob/proc/Sleeping(amount) + facing_dir = null + sleeping = max(max(sleeping,amount),0) + return + +/mob/proc/SetSleeping(amount) + sleeping = max(amount,0) + return + +/mob/proc/AdjustSleeping(amount) + sleeping = max(sleeping + amount,0) + return + +/mob/proc/Confuse(amount) + confused = max(max(confused,amount),0) + return + +/mob/proc/SetConfused(amount) + confused = max(amount,0) + return + +/mob/proc/AdjustConfused(amount) + confused = max(confused + amount,0) + return + +/mob/proc/Blind(amount) + eye_blind = max(max(eye_blind,amount),0) + return + +/mob/proc/SetBlinded(amount) + eye_blind = max(amount,0) + return + +/mob/proc/AdjustBlinded(amount) + eye_blind = max(eye_blind + amount,0) + return + +/mob/proc/Resting(amount) + facing_dir = null + resting = max(max(resting,amount),0) + update_canmove() + return + +/mob/proc/SetResting(amount) + resting = max(amount,0) + update_canmove() + return + +/mob/proc/AdjustResting(amount) + resting = max(resting + amount,0) + update_canmove() + return + +/mob/proc/AdjustLosebreath(amount) + losebreath = CLAMP(losebreath + amount, 0, 25) + +/mob/proc/SetLosebreath(amount) + losebreath = CLAMP(amount, 0, 25) + +/mob/proc/get_species() + return "" + +/mob/proc/flash_weak_pain() + flick("weak_pain",pain) + +/mob/proc/get_visible_implants(var/class = 0) + var/list/visible_implants = list() + for(var/obj/item/O in embedded) + if(O.w_class > class) + visible_implants += O + return visible_implants + +/mob/proc/embedded_needs_process() + return (embedded.len > 0) + +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." + set src in view(1) + + if(!isliving(usr) || !usr.checkClickCooldown()) + return + usr.setClickCooldown(20) + + if(usr.stat == 1) + to_chat(usr, "You are unconcious and cannot do that!") + return + + if(usr.restrained()) + to_chat(usr, "You are restrained and cannot do that!") + return + + var/mob/S = src + var/mob/U = usr + var/list/valid_objects = list() + var/self = null + + if(S == U) + self = 1 // Removing object from yourself. + + valid_objects = get_visible_implants(0) + if(!valid_objects.len) + if(self) + to_chat(src, "You have nothing stuck in your body that is large enough to remove.") + else + to_chat(U, "[src] has nothing stuck in their wounds that is large enough to remove.") + return + + var/obj/item/weapon/selection = input("What do you want to yank out?", "Embedded objects") in valid_objects + + if(self) + to_chat(src, "You attempt to get a good grip on [selection] in your body.") + else + to_chat(U, "You attempt to get a good grip on [selection] in [S]'s body.") + + if(!do_after(U, 30)) + return + if(!selection || !S || !U) + return + + if(self) + visible_message("[src] rips [selection] out of their body.","You rip [selection] out of your body.") + else + visible_message("[usr] rips [selection] out of [src]'s body.","[usr] rips [selection] out of your body.") + valid_objects = get_visible_implants(0) + if(valid_objects.len == 1) //Yanking out last object - removing verb. + src.verbs -= /mob/proc/yank_out_object + clear_alert("embeddedobject") + + if(ishuman(src)) + var/mob/living/carbon/human/H = src + var/obj/item/organ/external/affected + + for(var/obj/item/organ/external/organ in H.organs) //Grab the organ holding the implant. + for(var/obj/item/O in organ.implants) + if(O == selection) + affected = organ + + affected.implants -= selection + H.shock_stage+=20 + affected.take_damage((selection.w_class * 3), 0, 0, 1, "Embedded object extraction") + + if(prob(selection.w_class * 5) && (affected.robotic < ORGAN_ROBOT)) //I'M SO ANEMIC I COULD JUST -DIE-. + var/datum/wound/internal_bleeding/I = new (min(selection.w_class * 5, 15)) + affected.wounds += I + H.custom_pain("Something tears wetly in your [affected] as [selection] is pulled free!", 50) + + if (ishuman(U)) + var/mob/living/carbon/human/human_user = U + human_user.bloody_hands(H) + + else if(issilicon(src)) + var/mob/living/silicon/robot/R = src + R.embedded -= selection + R.adjustBruteLoss(5) + R.adjustFireLoss(10) + + selection.forceMove(get_turf(src)) + U.put_in_hands(selection) + + for(var/obj/item/weapon/O in pinned) + if(O == selection) + pinned -= O + if(!pinned.len) + anchored = 0 + return 1 + +//Check for brain worms in head. +/mob/proc/has_brain_worms() + + for(var/I in contents) + if(istype(I,/mob/living/simple_mob/animal/borer)) + return I + + return 0 + +/mob/proc/updateicon() + return + +// Please always use this proc, never just set the var directly. +/mob/proc/set_stat(var/new_stat) + . = (stat != new_stat) + stat = new_stat + +/mob/verb/face_direction() + + set name = "Face Direction" + set category = "IC" + set src = usr + + set_face_dir() + + if(!facing_dir) + to_chat(usr, "You are now not facing anything.") + else + to_chat(usr, "You are now facing [dir2text(facing_dir)].") + +/mob/proc/set_face_dir(var/newdir) + if(newdir == facing_dir) + facing_dir = null + else if(newdir) + set_dir(newdir) + facing_dir = newdir + else if(facing_dir) + facing_dir = null + else + set_dir(dir) + facing_dir = dir + +/mob/set_dir() + if(facing_dir) + if(!canface() || lying || buckled || restrained()) + facing_dir = null + else if(dir != facing_dir) + return ..(facing_dir) + else + return ..() + +/mob/verb/northfaceperm() + set hidden = 1 + set_face_dir(client.client_dir(NORTH)) + +/mob/verb/southfaceperm() + set hidden = 1 + set_face_dir(client.client_dir(SOUTH)) + +/mob/verb/eastfaceperm() + set hidden = 1 + set_face_dir(client.client_dir(EAST)) + +/mob/verb/westfaceperm() + set hidden = 1 + set_face_dir(client.client_dir(WEST)) + +// Begin VOREstation edit +/mob/verb/shiftnorth() + set hidden = TRUE + if(!canface()) + return FALSE + if(pixel_y <= (default_pixel_y + 16)) + pixel_y++ + is_shifted = TRUE + +/mob/verb/shiftsouth() + set hidden = TRUE + if(!canface()) + return FALSE + if(pixel_y >= (default_pixel_y - 16)) + pixel_y-- + is_shifted = TRUE + +/mob/verb/shiftwest() + set hidden = TRUE + if(!canface()) + return FALSE + if(pixel_x >= (default_pixel_x - 16)) + pixel_x-- + is_shifted = TRUE + +mob/verb/shifteast() + set hidden = TRUE + if(!canface()) + return FALSE + if(pixel_x <= (default_pixel_x + 16)) + pixel_x++ + is_shifted = TRUE +// End VOREstation edit + +/mob/proc/adjustEarDamage() + return + +/mob/proc/setEarDamage() + return + +// Set client view distance (size of client's screen). Returns TRUE if anything changed. +/mob/proc/set_viewsize(var/new_view = world.view) + if (client && new_view != client.view) + client.view = new_view + return TRUE + return FALSE + +//Throwing stuff + +/mob/proc/toggle_throw_mode() + if (src.in_throw_mode) + throw_mode_off() + else + throw_mode_on() + +/mob/proc/throw_mode_off() + src.in_throw_mode = 0 + if(src.throw_icon) //in case we don't have the HUD and we use the hotkey + src.throw_icon.icon_state = "act_throw_off" + +/mob/proc/throw_mode_on() + src.in_throw_mode = 1 + if(src.throw_icon) + src.throw_icon.icon_state = "act_throw_on" + +/mob/proc/isSynthetic() + return 0 + +/mob/proc/is_muzzled() + return 0 + +//Exploitable Info Update + +/mob/proc/amend_exploitable(var/obj/item/I) + if(istype(I)) + exploit_addons |= I + var/exploitmsg = html_decode("\n" + "Has " + I.name + ".") + exploit_record += exploitmsg + +/client/proc/check_has_body_select() + return mob && mob.hud_used && istype(mob.zone_sel, /obj/screen/zone_sel) + +/client/verb/body_toggle_head() + set name = "body-toggle-head" + set hidden = 1 + toggle_zone_sel(list(BP_HEAD, O_EYES, O_MOUTH)) + +/client/verb/body_r_arm() + set name = "body-r-arm" + set hidden = 1 + toggle_zone_sel(list(BP_R_ARM,BP_R_HAND)) + +/client/verb/body_l_arm() + set name = "body-l-arm" + set hidden = 1 + toggle_zone_sel(list(BP_L_ARM,BP_L_HAND)) + +/client/verb/body_chest() + set name = "body-chest" + set hidden = 1 + toggle_zone_sel(list(BP_TORSO)) + +/client/verb/body_groin() + set name = "body-groin" + set hidden = 1 + toggle_zone_sel(list(BP_GROIN)) + +/client/verb/body_r_leg() + set name = "body-r-leg" + set hidden = 1 + toggle_zone_sel(list(BP_R_LEG,BP_R_FOOT)) + +/client/verb/body_l_leg() + set name = "body-l-leg" + set hidden = 1 + toggle_zone_sel(list(BP_L_LEG,BP_L_FOOT)) + +/client/proc/toggle_zone_sel(list/zones) + if(!check_has_body_select()) + return + var/obj/screen/zone_sel/selector = mob.zone_sel + selector.set_selected_zone(next_in_list(mob.zone_sel.selecting,zones)) + +// This handles setting the client's color variable, which makes everything look a specific color. +// This proc is here so it can be called without needing to check if the client exists, or if the client relogs. +// This is for inheritence since /mob/living will serve most cases. If you need ghosts to use this you'll have to implement that yourself. +/mob/proc/update_client_color() + if(client && client.color) + animate(client, color = null, time = 10) + return + +/mob/proc/swap_hand() + return + +//Throwing stuff +/mob/proc/throw_item(atom/target) + return + +/mob/proc/will_show_tooltip() + if(alpha <= EFFECTIVE_INVIS) + return FALSE + return TRUE + +/mob/MouseEntered(location, control, params) + if(usr != src && usr.is_preference_enabled(/datum/client_preference/mob_tooltips) && src.will_show_tooltip()) + openToolTip(user = usr, tip_src = src, params = params, title = get_nametag_name(usr), content = get_nametag_desc(usr)) + + ..() + +/mob/MouseDown() + closeToolTip(usr) //No reason not to, really + + ..() + +/mob/MouseExited() + closeToolTip(usr) //No reason not to, really + + ..() + +// Manages a global list of mobs with clients attached, indexed by z-level. +/mob/proc/update_client_z(new_z) // +1 to register, null to unregister. + if(registered_z != new_z) + if(registered_z) + GLOB.players_by_zlevel[registered_z] -= src + if(client) + if(new_z) + GLOB.players_by_zlevel[new_z] += src + registered_z = new_z + else + registered_z = null + +GLOBAL_LIST_EMPTY_TYPED(living_players_by_zlevel, /list) +/mob/living/update_client_z(new_z) + var/precall_reg_z = registered_z + . = ..() // will update registered_z if necessary + if(precall_reg_z != registered_z) // parent did work, let's do work too + if(precall_reg_z) + GLOB.living_players_by_zlevel[precall_reg_z] -= src + if(registered_z) + GLOB.living_players_by_zlevel[registered_z] += src + +/mob/onTransitZ(old_z, new_z) + ..() + update_client_z(new_z) + +/mob/cloak() + . = ..() + if(client && cloaked_selfimage) + client.images += cloaked_selfimage + +/mob/uncloak() + if(client && cloaked_selfimage) + client.images -= cloaked_selfimage + return ..() + +/mob/get_cloaked_selfimage() + var/icon/selficon = getCompoundIcon(src) + selficon.MapColors(0,0,0, 0,0,0, 0,0,0, 1,1,1) //White + var/image/selfimage = image(selficon) + selfimage.color = "#0000FF" + selfimage.alpha = 100 + selfimage.layer = initial(layer) + selfimage.plane = initial(plane) + selfimage.loc = src + + return selfimage + +/mob/proc/GetAltName() + return "" + +/mob/proc/get_ghost(even_if_they_cant_reenter = 0) + if(mind) + return mind.get_ghost(even_if_they_cant_reenter) + +/mob/proc/grab_ghost(force) + if(mind) + return mind.grab_ghost(force = force) +======= +/mob/Destroy()//This makes sure that mobs withGLOB.clients/keys are not just deleted from the game. + mob_list -= src + dead_mob_list -= src + living_mob_list -= src + unset_machine() + qdel(hud_used) + clear_fullscreen() + if(client) + for(var/obj/screen/movable/spell_master/spell_master in spell_masters) + qdel(spell_master) + remove_screen_obj_references() + client.screen = list() + if(mind && mind.current == src) + spellremove(src) + ghostize() + QDEL_NULL(plane_holder) + ..() + return QDEL_HINT_HARDDEL_NOW + +/mob/proc/remove_screen_obj_references() + hands = null + pullin = null + purged = null + internals = null + i_select = null + m_select = null + healths = null + throw_icon = null + pain = null + item_use_icon = null + gun_move_icon = null + gun_setting_icon = null + spell_masters = null + zone_sel = null + +/mob/Initialize() + mob_list += src + if(stat == DEAD) + dead_mob_list += src + else + living_mob_list += src + lastarea = get_area(src) + hook_vr("mob_new",list(src)) //VOREStation Code + update_transform() // Some mobs may start bigger or smaller than normal. + return ..() + +/mob/proc/show_message(msg, type, alt, alt_type)//Message, type of message (1 or 2), alternative message, alt message type (1 or 2) + + if(!client && !teleop) return + + if (type) + if((type & VISIBLE_MESSAGE) && (is_blind() || paralysis) )//Vision related + if (!( alt )) + return + else + msg = alt + type = alt_type + if ((type & AUDIBLE_MESSAGE) && is_deaf())//Hearing related + if (!( alt )) + return + else + msg = alt + type = alt_type + if ((type & VISIBLE_MESSAGE) && (sdisabilities & BLIND)) + return + // Added voice muffling for Issue 41. + if(stat == UNCONSCIOUS || sleeping > 0) + to_chat(src, "... You can almost hear someone talking ...") + else + to_chat(src,msg) + if(teleop) + to_chat(teleop, create_text_tag("body", "BODY:", teleop) + "[msg]") + return + +// Show a message to all mobs and objects in sight of this one +// This would be for visible actions by the src mob +// message is the message output to anyone who can see e.g. "[src] does something!" +// self_message (optional) is what the src mob sees e.g. "You do something!" +// blind_message (optional) is what blind people will hear e.g. "You hear something!" +/mob/visible_message(var/message, var/self_message, var/blind_message, var/list/exclude_mobs = null, var/range = world.view, var/runemessage) + if(self_message) + if(LAZYLEN(exclude_mobs)) + exclude_mobs |= src + else + exclude_mobs = list(src) + src.show_message(self_message, 1, blind_message, 2) + // Transfer messages about what we are doing to upstairs + if(shadow) + shadow.visible_message(message, self_message, blind_message, exclude_mobs, range) + if(isnull(runemessage)) + runemessage = -1 + . = ..(message, blind_message, exclude_mobs, range, runemessage) // Really not ideal that atom/visible_message has different arg numbering :( + +// Returns an amount of power drawn from the object (-1 if it's not viable). +// If drain_check is set it will not actually drain power, just return a value. +// If surge is set, it will destroy/damage the recipient and not return any power. +// Not sure where to define this, so it can sit here for the rest of time. +/atom/proc/drain_power(var/drain_check,var/surge, var/amount = 0) + return -1 + +// Show a message to all mobs and objects in earshot of this one +// This would be for audible actions by the src mob +// message is the message output to anyone who can hear. +// self_message (optional) is what the src mob hears. +// deaf_message (optional) is what deaf people will see. +// hearing_distance (optional) is the range, how many tiles away the message can be heard. +/mob/audible_message(var/message, var/deaf_message, var/hearing_distance, var/self_message, var/radio_message, var/runemessage) + + var/range = hearing_distance || world.view + var/list/hear = get_mobs_and_objs_in_view_fast(get_turf(src),range,remote_ghosts = FALSE) + + var/list/hearing_mobs = hear["mobs"] + var/list/hearing_objs = hear["objs"] + + if(isnull(runemessage)) + runemessage = -1 // Symmetry with mob/audible_message, despite the fact this one doesn't call parent. Maybe it should! + + if(radio_message) + for(var/obj in hearing_objs) + var/obj/O = obj + O.hear_talk(src, list(new /datum/multilingual_say_piece(GLOB.all_languages["Noise"], radio_message)), null) + else + for(var/obj in hearing_objs) + var/obj/O = obj + O.show_message(message, AUDIBLE_MESSAGE, deaf_message, VISIBLE_MESSAGE) + + for(var/mob in hearing_mobs) + var/mob/M = mob + var/msg = message + if(self_message && M==src) + msg = self_message + M.show_message(msg, AUDIBLE_MESSAGE, deaf_message, VISIBLE_MESSAGE) + if(runemessage != -1) + M.create_chat_message(src, "[runemessage || message]", FALSE, list("emote"), audible = FALSE) + +/mob/proc/findname(msg) + for(var/mob/M in mob_list) + if (M.real_name == text("[]", msg)) + return M + return 0 + +/mob/proc/Life() +// if(organStructure) +// organStructure.ProcessOrgans() + return + +#define UNBUCKLED 0 +#define PARTIALLY_BUCKLED 1 +#define FULLY_BUCKLED 2 +/mob/proc/buckled() + // Preliminary work for a future buckle rewrite, + // where one might be fully restrained (like an elecrical chair), or merely secured (shuttle chair, keeping you safe but not otherwise restrained from acting) + if(!buckled) + return UNBUCKLED + return restrained() ? FULLY_BUCKLED : PARTIALLY_BUCKLED + +/mob/proc/is_blind() + return ((sdisabilities & BLIND) || blinded || incapacitated(INCAPACITATION_KNOCKOUT)) + +/mob/proc/is_deaf() + return ((sdisabilities & DEAF) || ear_deaf || incapacitated(INCAPACITATION_KNOCKOUT)) + +/mob/proc/is_physically_disabled() + return incapacitated(INCAPACITATION_DISABLED) + +/mob/proc/cannot_stand() + return incapacitated(INCAPACITATION_KNOCKDOWN) + +/mob/proc/incapacitated(var/incapacitation_flags = INCAPACITATION_DEFAULT) + if ((incapacitation_flags & INCAPACITATION_STUNNED) && stunned) + return 1 + + if ((incapacitation_flags & INCAPACITATION_FORCELYING) && (weakened || resting)) + return 1 + + if ((incapacitation_flags & INCAPACITATION_KNOCKOUT) && (stat || paralysis || sleeping || (status_flags & FAKEDEATH))) + return 1 + + if((incapacitation_flags & INCAPACITATION_RESTRAINED) && restrained()) + return 1 + + if((incapacitation_flags & (INCAPACITATION_BUCKLED_PARTIALLY|INCAPACITATION_BUCKLED_FULLY))) + var/buckling = buckled() + if(buckling >= PARTIALLY_BUCKLED && (incapacitation_flags & INCAPACITATION_BUCKLED_PARTIALLY)) + return 1 + if(buckling == FULLY_BUCKLED && (incapacitation_flags & INCAPACITATION_BUCKLED_FULLY)) + return 1 + + return 0 + +#undef UNBUCKLED +#undef PARTIALLY_BUCKLED +#undef FULLY_BUCKLED + +/mob/proc/restrained() + return + +/mob/proc/reset_view(atom/A) + if (client) + if (istype(A, /atom/movable)) + client.perspective = EYE_PERSPECTIVE + client.eye = A + else + if (isturf(loc)) + client.eye = client.mob + client.perspective = MOB_PERSPECTIVE + else + client.perspective = EYE_PERSPECTIVE + client.eye = loc + return TRUE + +/mob/verb/pointed(atom/A as mob|obj|turf in view()) + set name = "Point To" + set category = "Object" + + if(!src || !isturf(src.loc) || !(A in view(src.loc))) + return 0 + if(istype(A, /obj/effect/decal/point)) + return 0 + + var/turf/tile = get_turf(A) + if (!tile) + return 0 + + var/turf/our_tile = get_turf(src) + var/obj/visual = new /obj/effect/decal/point(our_tile) + visual.invisibility = invisibility + visual.plane = ABOVE_PLANE + visual.layer = FLY_LAYER + + animate(visual, + pixel_x = (tile.x - our_tile.x) * world.icon_size + A.pixel_x, + pixel_y = (tile.y - our_tile.y) * world.icon_size + A.pixel_y, + time = 1.7, + easing = EASE_OUT) + + QDEL_IN(visual, 2 SECONDS) //Better qdel + + face_atom(A) + return 1 + + +/mob/proc/ret_grab(list/L, flag) + return + +/mob/verb/mode() + set name = "Activate Held Object" + set category = "Object" + set src = usr + + return + +/* +/mob/verb/dump_source() + + var/master = "
"
+	for(var/t in typesof(/area))
+		master += text("[]\n", t)
+		//Foreach goto(26)
+	src << browse(master)
+	return
+*/
+
+/mob/verb/memory()
+	set name = "Notes"
+	set category = "IC"
+	if(mind)
+		mind.show_memory(src)
+	else
+		to_chat(src, "The game appears to have misplaced your mind datum, so we can't show you your notes.")
+
+/mob/verb/add_memory(msg as message)
+	set name = "Add Note"
+	set category = "IC"
+
+	msg = sanitize(msg)
+
+	if(mind)
+		mind.store_memory(msg)
+	else
+		to_chat(src, "The game appears to have misplaced your mind datum, so we can't show you your notes.")
+
+/mob/proc/store_memory(msg as message, popup, sane = 1)
+	msg = copytext(msg, 1, MAX_MESSAGE_LEN)
+
+	if (sane)
+		msg = sanitize(msg)
+
+	if (length(memory) == 0)
+		memory += msg
+	else
+		memory += "
[msg]" + + if (popup) + memory() + +/mob/proc/update_flavor_text() + set src in usr + if(usr != src) + to_chat(usr, "No.") + var/msg = sanitize(input(usr,"Set the flavor text in your 'examine' verb.","Flavor Text",html_decode(flavor_text)) as message|null, extra = 0) //VOREStation Edit: separating out OOC notes + + if(msg != null) + flavor_text = msg + +/mob/proc/warn_flavor_changed() + if(flavor_text && flavor_text != "") // don't spam people that don't use it! + to_chat(src, "

OOC Warning:

") + to_chat(src, "Your flavor text is likely out of date! Change") + +/mob/proc/print_flavor_text() + if (flavor_text && flavor_text != "") + var/msg = replacetext(flavor_text, "\n", " ") + if(length(msg) <= 40) + return "[msg]" + else + return "[copytext_preserve_html(msg, 1, 37)]... More..." + +/* +/mob/verb/help() + set name = "Help" + src << browse('html/help.html', "window=help") + return +*/ + +/mob/proc/set_respawn_timer(var/time) + // Try to figure out what time to use + + // Special cases, can never respawn + if(ticker?.mode?.deny_respawn) + time = -1 + else if(!config.abandon_allowed) + time = -1 + else if(!config.respawn) + time = -1 + + // Special case for observing before game start + else if(ticker?.current_state <= GAME_STATE_SETTING_UP) + time = 1 MINUTE + + // Wasn't given a time, use the config time + else if(!time) + time = config.respawn_time + + var/keytouse = ckey + // Try harder to find a key to use + if(!keytouse && key) + keytouse = ckey(key) + else if(!keytouse && mind?.key) + keytouse = ckey(mind.key) + + GLOB.respawn_timers[keytouse] = world.time + time + +/mob/observer/dead/set_respawn_timer() + if(config.antag_hud_restricted && has_enabled_antagHUD) + ..(-1) + else + return // Don't set it, no need + +/mob/verb/abandon_mob() + set name = "Return to Menu" + set category = "OOC" + + if(stat != DEAD || !ticker) + to_chat(usr, "You must be dead to use this!") + return + + // Final chance to abort "respawning" + if(mind && timeofdeath) // They had spawned before + var/choice = alert(usr, "Returning to the menu will prevent your character from being revived in-round. Are you sure?", "Confirmation", "No, wait", "Yes, leave") + if(choice == "No, wait") + return + + // Beyond this point, you're going to respawn + to_chat(usr, config.respawn_message) + + if(!client) + log_game("[usr.key] AM failed due to disconnect.") + return + client.screen.Cut() + client.screen += client.void + if(!client) + log_game("[usr.key] AM failed due to disconnect.") + return + + announce_ghost_joinleave(client, 0) + + var/mob/new_player/M = new /mob/new_player() + if(!client) + log_game("[usr.key] AM failed due to disconnect.") + qdel(M) + return + + M.key = key + if(M.mind) + M.mind.reset() + return + +/client/verb/changes() + set name = "Changelog" + set category = "OOC" + src << browse('html/changelog.html', "window=changes;size=675x650") + if(prefs.lastchangelog != changelog_hash) + prefs.lastchangelog = changelog_hash + SScharacter_setup.queue_preferences_save(prefs) + winset(src, "rpane.changelog", "background-color=none;font-style=;") + +/mob/verb/observe() + set name = "Observe" + set category = "OOC" + var/is_admin = 0 + + if(client.holder && (client.holder.rights & R_ADMIN|R_EVENT)) + is_admin = 1 + else if(stat != DEAD || istype(src, /mob/new_player)) + to_chat(usr, "You must be observing to use this!") + return + + if(is_admin && stat == DEAD) + is_admin = 0 + + var/list/targets = list() + + + targets += observe_list_format(nuke_disks) + targets += observe_list_format(all_singularities) + targets += getmobs() + targets += observe_list_format(sortAtom(mechas_list)) + targets += observe_list_format(SSshuttles.ships) + + client.perspective = EYE_PERSPECTIVE + + var/eye_name = null + + var/ok = "[is_admin ? "Admin Observe" : "Observe"]" + eye_name = input("Please, select a player!", ok, null, null) as null|anything in targets + + if (!eye_name) + return + + var/mob/mob_eye = targets[eye_name] + + if(client && mob_eye) + client.eye = mob_eye + if (is_admin) + client.adminobs = 1 + if(mob_eye == client.mob || client.eye == client.mob) + client.adminobs = 0 + +/mob/verb/cancel_camera() + set name = "Cancel Camera View" + set category = "OOC" + unset_machine() + reset_view(null) + +/mob/Topic(href, href_list) + if(href_list["mach_close"]) + var/t1 = text("window=[href_list["mach_close"]]") + unset_machine() + src << browse(null, t1) + + if(href_list["flavor_more"]) + usr << browse(text("[][]", name, replacetext(flavor_text, "\n", "
")), text("window=[];size=500x200", name)) + onclose(usr, "[name]") + if(href_list["flavor_change"]) + update_flavor_text() +// ..() + return + + +/mob/proc/pull_damage() + return 0 + +/mob/verb/stop_pulling() + + set name = "Stop Pulling" + set category = "IC" + + if(pulling) + if(ishuman(pulling)) + var/mob/living/carbon/human/H = pulling + visible_message(SPAN_WARNING("\The [src] lets go of \the [H]."), SPAN_NOTICE("You let go of \the [H]."), exclude_mobs = list(H)) + if(!H.stat) + to_chat(H, SPAN_WARNING("\The [src] lets go of you.")) + pulling.pulledby = null + pulling = null + if(pullin) + pullin.icon_state = "pull0" + +/mob/proc/start_pulling(var/atom/movable/AM) + + if ( !AM || !usr || src==AM || !isturf(src.loc) ) //if there's no person pulling OR the person is pulling themself OR the object being pulled is inside something: abort! + return + + if (AM.anchored) + to_chat(src, "It won't budge!") + return + + var/mob/M = AM + if(ismob(AM)) + + if(!can_pull_mobs || !can_pull_size) + to_chat(src, "They won't budge!") + return + + if((mob_size < M.mob_size) && (can_pull_mobs != MOB_PULL_LARGER)) + to_chat(src, "[M] is too large for you to move!") + return + + if((mob_size == M.mob_size) && (can_pull_mobs == MOB_PULL_SMALLER)) + to_chat(src, "[M] is too heavy for you to move!") + return + + // If your size is larger than theirs and you have some + // kind of mob pull value AT ALL, you will be able to pull + // them, so don't bother checking that explicitly. + + if(M.grabbed_by.len) + // Only start pulling when nobody else has a grab on them + . = 1 + for(var/obj/item/weapon/grab/G in M.grabbed_by) + if(G.assailant != usr) + . = 0 + else + qdel(G) + if(!.) + to_chat(src, "Somebody has a grip on them!") + return + + if(!iscarbon(src)) + M.LAssailant = null + else + M.LAssailant = usr + + else if(isobj(AM)) + var/obj/I = AM + if(!can_pull_size || can_pull_size < I.w_class) + to_chat(src, "It won't budge!") + return + + if(pulling) + var/pulling_old = pulling + stop_pulling() + // Are we pulling the same thing twice? Just stop pulling. + if(pulling_old == AM) + return + + src.pulling = AM + AM.pulledby = src + + if(pullin) + pullin.icon_state = "pull1" + + if(ishuman(AM)) + var/mob/living/carbon/human/H = AM + if(H.lying) // If they're on the ground we're probably dragging their arms to move them + visible_message(SPAN_WARNING("\The [src] leans down and grips \the [H]'s arms."), SPAN_NOTICE("You lean down and grip \the [H]'s arms."), exclude_mobs = list(H)) + if(!H.stat) + to_chat(H, SPAN_WARNING("\The [src] leans down and grips your arms.")) + else //Otherwise we're probably just holding their arm to lead them somewhere + visible_message(SPAN_WARNING("\The [src] grips \the [H]'s arm."), SPAN_NOTICE("You grip \the [H]'s arm."), exclude_mobs = list(H)) + if(!H.stat) + to_chat(H, SPAN_WARNING("\The [src] grips your arm.")) + playsound(src.loc, 'sound/weapons/thudswoosh.ogg', 25) //Quieter than hugging/grabbing but we still want some audio feedback + + if(H.pull_damage()) + to_chat(src, "Pulling \the [H] in their current condition would probably be a bad idea.") + + //Attempted fix for people flying away through space when cuffed and dragged. + if(ismob(AM)) + var/mob/pulled = AM + pulled.inertia_dir = 0 + +/mob/proc/can_use_hands() + return + +/mob/proc/is_active() + return (0 >= usr.stat) + +/mob/proc/is_dead() + return stat == DEAD + +/mob/proc/is_mechanical() + if(mind && (mind.assigned_role == "Cyborg" || mind.assigned_role == "AI")) + return 1 + return istype(src, /mob/living/silicon) || get_species() == "Machine" + +/mob/proc/is_ready() + return client && !!mind + +/mob/proc/get_gender() + return gender + +/mob/proc/see(message) + if(!is_active()) + return 0 + to_chat(src,message) + return 1 + +/mob/proc/show_viewers(message) + for(var/mob/M in viewers()) + M.see(message) + +/mob/Stat() + ..() + . = (is_client_active(10 MINUTES)) + + if(.) + if(statpanel("Status")) + stat(null, "Time Dilation: [round(SStime_track.time_dilation_current,1)]% AVG:([round(SStime_track.time_dilation_avg_fast,1)]%, [round(SStime_track.time_dilation_avg,1)]%, [round(SStime_track.time_dilation_avg_slow,1)]%)") + if(ticker && ticker.current_state != GAME_STATE_PREGAME) + stat("Station Time", stationtime2text()) + stat("Station Date", stationdate2text()) + stat("Round Duration", roundduration2text()) + + if(client.holder) + if(statpanel("Status")) + stat("Location:", "([x], [y], [z]) [loc]") + stat("CPU:","[world.cpu]") + stat("Instances:","[world.contents.len]") + stat(null, "Time Dilation: [round(SStime_track.time_dilation_current,1)]% AVG:([round(SStime_track.time_dilation_avg_fast,1)]%, [round(SStime_track.time_dilation_avg,1)]%, [round(SStime_track.time_dilation_avg_slow,1)]%)") + + if(statpanel("MC")) + stat("Location:", "([x], [y], [z]) [loc]") + stat("CPU:","[world.cpu]") + stat("Instances:","[world.contents.len]") + stat("World Time:", world.time) + stat("Real time of day:", REALTIMEOFDAY) + stat(null) + if(GLOB) + GLOB.stat_entry() + else + stat("Globals:", "ERROR") + if(Master) + Master.stat_entry() + else + stat("Master Controller:", "ERROR") + if(Failsafe) + Failsafe.stat_entry() + else + stat("Failsafe Controller:", "ERROR") + if(Master) + stat(null) + for(var/datum/controller/subsystem/SS in Master.subsystems) + SS.stat_entry() + + if(statpanel("Tickets")) + GLOB.ahelp_tickets.stat_entry() + + + if(length(GLOB.sdql2_queries)) + if(statpanel("SDQL2")) + stat("Access Global SDQL2 List", GLOB.sdql2_vv_statobj) + for(var/i in GLOB.sdql2_queries) + var/datum/SDQL2_query/Q = i + Q.generate_stat() + + if(listed_turf && client) + if(!TurfAdjacent(listed_turf)) + listed_turf = null + else + if(statpanel("Turf")) + stat(listed_turf) + for(var/atom/A in listed_turf) + if(!A.mouse_opacity) + continue + if(A.invisibility > see_invisible) + continue + if(is_type_in_list(A, shouldnt_see)) + continue + if(A.plane > plane) + continue + stat(A) + + +// facing verbs +/mob/proc/canface() +// if(!canmove) return 0 //VOREStation Edit. Redundant check that only affects conscious proning, actual inability to turn and shift around handled by actual inabilities. + if(stat) return 0 + if(anchored) return 0 + if(transforming) return 0 + return 1 + +// Not sure what to call this. Used to check if humans are wearing an AI-controlled exosuit and hence don't need to fall over yet. +/mob/proc/can_stand_overridden() + return 0 + +//Updates canmove, lying and icons. Could perhaps do with a rename but I can't think of anything to describe it. +/mob/proc/update_canmove() + return canmove + + +/mob/proc/facedir(var/ndir) + if(!canface() || (client && (client.moving || !checkMoveCooldown()))) + return 0 + set_dir(ndir) + if(buckled && buckled.buckle_movable) + buckled.set_dir(ndir) + setMoveCooldown(movement_delay()) + return 1 + + +/mob/verb/eastface() + set hidden = 1 + return facedir(client.client_dir(EAST)) + + +/mob/verb/westface() + set hidden = 1 + return facedir(client.client_dir(WEST)) + + +/mob/verb/northface() + set hidden = 1 + return facedir(client.client_dir(NORTH)) + + +/mob/verb/southface() + set hidden = 1 + return facedir(client.client_dir(SOUTH)) + + +//This might need a rename but it should replace the can this mob use things check +/mob/proc/IsAdvancedToolUser() + return 0 + +/mob/proc/Stun(amount) + if(status_flags & CANSTUN) + facing_dir = null + stunned = max(max(stunned,amount),0) //can't go below 0, getting a low amount of stun doesn't lower your current stun + update_canmove() //updates lying, canmove and icons + return + +/mob/proc/SetStunned(amount) //if you REALLY need to set stun to a set amount without the whole "can't go below current stunned" + if(status_flags & CANSTUN) + stunned = max(amount,0) + update_canmove() //updates lying, canmove and icons + return + +/mob/proc/AdjustStunned(amount) + if(status_flags & CANSTUN) + stunned = max(stunned + amount,0) + update_canmove() //updates lying, canmove and icons + return + +/mob/proc/Weaken(amount) + if(status_flags & CANWEAKEN) + facing_dir = null + weakened = max(max(weakened,amount),0) + update_canmove() //updates lying, canmove and icons + return + +/mob/proc/SetWeakened(amount) + if(status_flags & CANWEAKEN) + weakened = max(amount,0) + update_canmove() //can you guess what this does yet? + return + +/mob/proc/AdjustWeakened(amount) + if(status_flags & CANWEAKEN) + weakened = max(weakened + amount,0) + update_canmove() //updates lying, canmove and icons + return + +/mob/proc/Paralyse(amount) + if(status_flags & CANPARALYSE) + facing_dir = null + paralysis = max(max(paralysis,amount),0) + return + +/mob/proc/SetParalysis(amount) + if(status_flags & CANPARALYSE) + paralysis = max(amount,0) + return + +/mob/proc/AdjustParalysis(amount) + if(status_flags & CANPARALYSE) + paralysis = max(paralysis + amount,0) + return + +/mob/proc/Sleeping(amount) + facing_dir = null + sleeping = max(max(sleeping,amount),0) + return + +/mob/proc/SetSleeping(amount) + sleeping = max(amount,0) + return + +/mob/proc/AdjustSleeping(amount) + sleeping = max(sleeping + amount,0) + return + +/mob/proc/Confuse(amount) + confused = max(max(confused,amount),0) + return + +/mob/proc/SetConfused(amount) + confused = max(amount,0) + return + +/mob/proc/AdjustConfused(amount) + confused = max(confused + amount,0) + return + +/mob/proc/Blind(amount) + eye_blind = max(max(eye_blind,amount),0) + return + +/mob/proc/SetBlinded(amount) + eye_blind = max(amount,0) + return + +/mob/proc/AdjustBlinded(amount) + eye_blind = max(eye_blind + amount,0) + return + +/mob/proc/Resting(amount) + facing_dir = null + resting = max(max(resting,amount),0) + update_canmove() + return + +/mob/proc/SetResting(amount) + resting = max(amount,0) + update_canmove() + return + +/mob/proc/AdjustResting(amount) + resting = max(resting + amount,0) + update_canmove() + return + +/mob/proc/AdjustLosebreath(amount) + losebreath = CLAMP(losebreath + amount, 0, 25) + +/mob/proc/SetLosebreath(amount) + losebreath = CLAMP(amount, 0, 25) + +/mob/proc/get_species() + return "" + +/mob/proc/flash_weak_pain() + flick("weak_pain",pain) + +/mob/proc/get_visible_implants(var/class = 0) + var/list/visible_implants = list() + for(var/obj/item/O in embedded) + if(O.w_class > class) + visible_implants += O + return visible_implants + +/mob/proc/embedded_needs_process() + return (embedded.len > 0) + +/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." + set src in view(1) + + if(!isliving(usr) || !usr.checkClickCooldown()) + return + usr.setClickCooldown(20) + + if(usr.stat == 1) + to_chat(usr, "You are unconcious and cannot do that!") + return + + if(usr.restrained()) + to_chat(usr, "You are restrained and cannot do that!") + return + + var/mob/S = src + var/mob/U = usr + var/list/valid_objects = list() + var/self = null + + if(S == U) + self = 1 // Removing object from yourself. + + valid_objects = get_visible_implants(0) + if(!valid_objects.len) + if(self) + to_chat(src, "You have nothing stuck in your body that is large enough to remove.") + else + to_chat(U, "[src] has nothing stuck in their wounds that is large enough to remove.") + return + + var/obj/item/weapon/selection = input("What do you want to yank out?", "Embedded objects") in valid_objects + + if(self) + to_chat(src, "You attempt to get a good grip on [selection] in your body.") + else + to_chat(U, "You attempt to get a good grip on [selection] in [S]'s body.") + + if(!do_after(U, 30)) + return + if(!selection || !S || !U) + return + + if(self) + visible_message("[src] rips [selection] out of their body.","You rip [selection] out of your body.") + else + visible_message("[usr] rips [selection] out of [src]'s body.","[usr] rips [selection] out of your body.") + valid_objects = get_visible_implants(0) + if(valid_objects.len == 1) //Yanking out last object - removing verb. + src.verbs -= /mob/proc/yank_out_object + clear_alert("embeddedobject") + + if(ishuman(src)) + var/mob/living/carbon/human/H = src + var/obj/item/organ/external/affected + + for(var/obj/item/organ/external/organ in H.organs) //Grab the organ holding the implant. + for(var/obj/item/O in organ.implants) + if(O == selection) + affected = organ + + affected.implants -= selection + H.shock_stage+=20 + affected.take_damage((selection.w_class * 3), 0, 0, 1, "Embedded object extraction") + + if(prob(selection.w_class * 5) && (affected.robotic < ORGAN_ROBOT)) //I'M SO ANEMIC I COULD JUST -DIE-. + var/datum/wound/internal_bleeding/I = new (min(selection.w_class * 5, 15)) + affected.wounds += I + H.custom_pain("Something tears wetly in your [affected] as [selection] is pulled free!", 50) + + if (ishuman(U)) + var/mob/living/carbon/human/human_user = U + human_user.bloody_hands(H) + + else if(issilicon(src)) + var/mob/living/silicon/robot/R = src + R.embedded -= selection + R.adjustBruteLoss(5) + R.adjustFireLoss(10) + + selection.forceMove(get_turf(src)) + U.put_in_hands(selection) + + for(var/obj/item/weapon/O in pinned) + if(O == selection) + pinned -= O + if(!pinned.len) + anchored = 0 + return 1 + +//Check for brain worms in head. +/mob/proc/has_brain_worms() + + for(var/I in contents) + if(istype(I,/mob/living/simple_mob/animal/borer)) + return I + + return 0 + +/mob/proc/updateicon() + return + +// Please always use this proc, never just set the var directly. +/mob/proc/set_stat(var/new_stat) + . = (stat != new_stat) + stat = new_stat + +/mob/verb/face_direction() + + set name = "Face Direction" + set category = "IC" + set src = usr + + set_face_dir() + + if(!facing_dir) + to_chat(usr, "You are now not facing anything.") + else + to_chat(usr, "You are now facing [dir2text(facing_dir)].") + +/mob/proc/set_face_dir(var/newdir) + if(newdir == facing_dir) + facing_dir = null + else if(newdir) + set_dir(newdir) + facing_dir = newdir + else if(facing_dir) + facing_dir = null + else + set_dir(dir) + facing_dir = dir + +/mob/set_dir() + if(facing_dir) + if(!canface() || lying || buckled || restrained()) + facing_dir = null + else if(dir != facing_dir) + return ..(facing_dir) + else + return ..() + +/mob/verb/northfaceperm() + set hidden = 1 + set_face_dir(client.client_dir(NORTH)) + +/mob/verb/southfaceperm() + set hidden = 1 + set_face_dir(client.client_dir(SOUTH)) + +/mob/verb/eastfaceperm() + set hidden = 1 + set_face_dir(client.client_dir(EAST)) + +/mob/verb/westfaceperm() + set hidden = 1 + set_face_dir(client.client_dir(WEST)) + +// Begin VOREstation edit +/mob/verb/shiftnorth() + set hidden = TRUE + if(!canface()) + return FALSE + if(pixel_y <= (default_pixel_y + 16)) + pixel_y++ + is_shifted = TRUE + +/mob/verb/shiftsouth() + set hidden = TRUE + if(!canface()) + return FALSE + if(pixel_y >= (default_pixel_y - 16)) + pixel_y-- + is_shifted = TRUE + +/mob/verb/shiftwest() + set hidden = TRUE + if(!canface()) + return FALSE + if(pixel_x >= (default_pixel_x - 16)) + pixel_x-- + is_shifted = TRUE + +/mob/verb/shifteast() + set hidden = TRUE + if(!canface()) + return FALSE + if(pixel_x <= (default_pixel_x + 16)) + pixel_x++ + is_shifted = TRUE +// End VOREstation edit + +/mob/proc/adjustEarDamage() + return + +/mob/proc/setEarDamage() + return + +// Set client view distance (size of client's screen). Returns TRUE if anything changed. +/mob/proc/set_viewsize(var/new_view = world.view) + if (client && new_view != client.view) + client.view = new_view + return TRUE + return FALSE + +//Throwing stuff + +/mob/proc/toggle_throw_mode() + if (src.in_throw_mode) + throw_mode_off() + else + throw_mode_on() + +/mob/proc/throw_mode_off() + src.in_throw_mode = 0 + if(src.throw_icon) //in case we don't have the HUD and we use the hotkey + src.throw_icon.icon_state = "act_throw_off" + +/mob/proc/throw_mode_on() + src.in_throw_mode = 1 + if(src.throw_icon) + src.throw_icon.icon_state = "act_throw_on" + +/mob/proc/isSynthetic() + return 0 + +/mob/proc/is_muzzled() + return 0 + +//Exploitable Info Update + +/mob/proc/amend_exploitable(var/obj/item/I) + if(istype(I)) + exploit_addons |= I + var/exploitmsg = html_decode("\n" + "Has " + I.name + ".") + exploit_record += exploitmsg + +/client/proc/check_has_body_select() + return mob && mob.hud_used && istype(mob.zone_sel, /obj/screen/zone_sel) + +/client/verb/body_toggle_head() + set name = "body-toggle-head" + set hidden = 1 + toggle_zone_sel(list(BP_HEAD, O_EYES, O_MOUTH)) + +/client/verb/body_r_arm() + set name = "body-r-arm" + set hidden = 1 + toggle_zone_sel(list(BP_R_ARM,BP_R_HAND)) + +/client/verb/body_l_arm() + set name = "body-l-arm" + set hidden = 1 + toggle_zone_sel(list(BP_L_ARM,BP_L_HAND)) + +/client/verb/body_chest() + set name = "body-chest" + set hidden = 1 + toggle_zone_sel(list(BP_TORSO)) + +/client/verb/body_groin() + set name = "body-groin" + set hidden = 1 + toggle_zone_sel(list(BP_GROIN)) + +/client/verb/body_r_leg() + set name = "body-r-leg" + set hidden = 1 + toggle_zone_sel(list(BP_R_LEG,BP_R_FOOT)) + +/client/verb/body_l_leg() + set name = "body-l-leg" + set hidden = 1 + toggle_zone_sel(list(BP_L_LEG,BP_L_FOOT)) + +/client/proc/toggle_zone_sel(list/zones) + if(!check_has_body_select()) + return + var/obj/screen/zone_sel/selector = mob.zone_sel + selector.set_selected_zone(next_in_list(mob.zone_sel.selecting,zones)) + +// This handles setting the client's color variable, which makes everything look a specific color. +// This proc is here so it can be called without needing to check if the client exists, or if the client relogs. +// This is for inheritence since /mob/living will serve most cases. If you need ghosts to use this you'll have to implement that yourself. +/mob/proc/update_client_color() + if(client && client.color) + animate(client, color = null, time = 10) + return + +/mob/proc/swap_hand() + return + +//Throwing stuff +/mob/proc/throw_item(atom/target) + return + +/mob/proc/will_show_tooltip() + if(alpha <= EFFECTIVE_INVIS) + return FALSE + return TRUE + +/mob/MouseEntered(location, control, params) + if(usr != src && usr.is_preference_enabled(/datum/client_preference/mob_tooltips) && src.will_show_tooltip()) + openToolTip(user = usr, tip_src = src, params = params, title = get_nametag_name(usr), content = get_nametag_desc(usr)) + + ..() + +/mob/MouseDown() + closeToolTip(usr) //No reason not to, really + + ..() + +/mob/MouseExited() + closeToolTip(usr) //No reason not to, really + + ..() + +// Manages a global list of mobs with clients attached, indexed by z-level. +/mob/proc/update_client_z(new_z) // +1 to register, null to unregister. + if(registered_z != new_z) + if(registered_z) + GLOB.players_by_zlevel[registered_z] -= src + if(client) + if(new_z) + GLOB.players_by_zlevel[new_z] += src + registered_z = new_z + else + registered_z = null + +GLOBAL_LIST_EMPTY_TYPED(living_players_by_zlevel, /list) +/mob/living/update_client_z(new_z) + var/precall_reg_z = registered_z + . = ..() // will update registered_z if necessary + if(precall_reg_z != registered_z) // parent did work, let's do work too + if(precall_reg_z) + GLOB.living_players_by_zlevel[precall_reg_z] -= src + if(registered_z) + GLOB.living_players_by_zlevel[registered_z] += src + +/mob/onTransitZ(old_z, new_z) + ..() + update_client_z(new_z) + +/mob/cloak() + . = ..() + if(client && cloaked_selfimage) + client.images += cloaked_selfimage + +/mob/uncloak() + if(client && cloaked_selfimage) + client.images -= cloaked_selfimage + return ..() + +/mob/get_cloaked_selfimage() + var/icon/selficon = getCompoundIcon(src) + selficon.MapColors(0,0,0, 0,0,0, 0,0,0, 1,1,1) //White + var/image/selfimage = image(selficon) + selfimage.color = "#0000FF" + selfimage.alpha = 100 + selfimage.layer = initial(layer) + selfimage.plane = initial(plane) + selfimage.loc = src + + return selfimage + +/mob/proc/GetAltName() + return "" + +/mob/proc/get_ghost(even_if_they_cant_reenter = 0) + if(mind) + return mind.get_ghost(even_if_they_cant_reenter) + +/mob/proc/grab_ghost(force) + if(mind) + return mind.grab_ghost(force = force) +>>>>>>> 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 26849709e2..2500f49759 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 ce783bcddb..cc3a658b59 100644 --- a/code/modules/mob/new_player/sprite_accessories_vr.dm +++ b/code/modules/mob/new_player/sprite_accessories_vr.dm @@ -8,453 +8,453 @@ 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 +<<<<<<< HEAD xeno_head_sentinel_color name = "Sentinal dome" icon = 'icons/mob/human_face_vr.dmi' @@ -486,9 +486,75 @@ icon_state = "cxeno_praetorian" species_allowed = list(SPECIES_XENOHYBRID) gender = NEUTER +||||||| parent of 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 + 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 + + 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_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_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_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_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 +>>>>>>> 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 // Shadekin stuffs +<<<<<<< HEAD shadekin_hair_short name = "Shadekin Short Hair" icon = 'icons/mob/human_face_vr.dmi' @@ -521,87 +587,154 @@ ckeys_allowed = list("verysoft") species_allowed = list(SPECIES_SHADEKIN, SPECIES_SHADEKIN_CREW, SPECIES_SHADEKIN_YW) //YW Edits gender = NEUTER +||||||| parent of 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 + 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) + 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" + species_allowed = list(SPECIES_SHADEKIN, SPECIES_SHADEKIN_CREW) + 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" + species_allowed = list(SPECIES_SHADEKIN, SPECIES_SHADEKIN_CREW) + 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") + species_allowed = list(SPECIES_SHADEKIN, SPECIES_SHADEKIN_CREW) + gender = NEUTER +======= +/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) + gender = NEUTER + +/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) + gender = NEUTER + +/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) + gender = NEUTER + +/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) + gender = NEUTER +>>>>>>> 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 /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 3dab7ddb74..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) 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/projectiles/guns/energy/phase.dm b/code/modules/projectiles/guns/energy/phase.dm index 76ab1689fb..99dbace968 100644 --- a/code/modules/projectiles/guns/energy/phase.dm +++ b/code/modules/projectiles/guns/energy/phase.dm @@ -55,7 +55,13 @@ charge_cost = 400 recharge_time = 7 +<<<<<<< HEAD obj/item/weapon/gun/energy/locked/phasegun/rifle +||||||| parent of 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 +obj/item/weapon/gun/energy/phasegun/rifle +======= +/obj/item/weapon/gun/energy/phasegun/rifle +>>>>>>> 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 name = "phase rifle" desc = "The RayZar EW31 Orion is a specialist energy weapon, intended for use against hostile wildlife. This one has a safety interlock that prevents firing while in proximity to the facility." icon_state = "phaserifle" diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm index efd66bea1a..935f91d4e0 100644 --- a/code/modules/projectiles/guns/energy/special.dm +++ b/code/modules/projectiles/guns/energy/special.dm @@ -162,7 +162,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/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 40cd813552..42f58b6b47 100644 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -312,7 +312,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/reagents/_reagents.dm b/code/modules/reagents/reagents/_reagents.dm index e49753d0b2..5231a3208b 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 8f7bbeed97..e0007c59f0 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" @@ -921,7 +921,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" @@ -932,7 +932,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" @@ -943,7 +943,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" @@ -954,7 +954,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) ..() @@ -970,7 +970,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) ..() @@ -1004,7 +1004,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 @@ -1017,7 +1017,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" @@ -1029,7 +1029,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) ..() @@ -1046,7 +1046,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) ..() @@ -1076,7 +1076,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" @@ -1088,7 +1088,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) ..() @@ -1105,7 +1105,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 @@ -1122,7 +1122,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" @@ -1168,7 +1168,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" @@ -1183,7 +1183,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" @@ -1268,7 +1268,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" @@ -1282,7 +1282,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" @@ -1296,7 +1296,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" @@ -1310,7 +1310,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" @@ -1357,7 +1357,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) @@ -1429,7 +1429,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) ..() @@ -1449,7 +1449,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) ..() @@ -1470,7 +1470,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" @@ -1515,7 +1515,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" @@ -1544,7 +1544,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" @@ -1558,7 +1558,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" @@ -1572,7 +1572,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" @@ -1586,7 +1586,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" @@ -1600,7 +1600,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" @@ -1613,7 +1613,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" @@ -1625,7 +1625,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) ..() @@ -1658,7 +1658,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" @@ -1670,7 +1670,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" @@ -1685,7 +1685,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) @@ -1699,7 +1699,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" @@ -1712,7 +1712,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) ..() @@ -1780,7 +1780,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" @@ -1807,7 +1807,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" @@ -1821,7 +1821,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" @@ -1880,7 +1880,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" @@ -1894,7 +1894,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" @@ -1908,7 +1908,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" @@ -1921,7 +1921,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) ..() @@ -2031,7 +2031,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" @@ -2044,7 +2044,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" @@ -2056,7 +2056,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" @@ -2067,7 +2067,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" @@ -2081,7 +2081,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" @@ -2095,7 +2095,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" @@ -2106,7 +2106,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" @@ -2121,7 +2121,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) ..() @@ -2148,7 +2148,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) ..() @@ -2178,7 +2178,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" @@ -2189,7 +2189,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" @@ -2201,7 +2201,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" @@ -2213,7 +2213,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" @@ -2225,7 +2225,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" @@ -2238,7 +2238,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" @@ -2252,7 +2252,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 */ @@ -2282,7 +2282,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" @@ -2296,7 +2296,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) ..() @@ -2316,7 +2316,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" @@ -2330,7 +2330,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" @@ -2344,7 +2344,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" @@ -2386,12 +2386,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) @@ -2445,7 +2445,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" @@ -2459,7 +2459,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" @@ -2495,7 +2495,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" @@ -2540,7 +2540,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" @@ -2553,7 +2553,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) ..() @@ -2570,7 +2570,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" @@ -2583,7 +2583,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" @@ -2595,7 +2595,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" @@ -2609,7 +2609,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 @@ -2626,7 +2626,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" @@ -2639,7 +2639,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" @@ -2652,7 +2652,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" @@ -2666,7 +2666,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" @@ -2679,7 +2679,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" @@ -2694,7 +2694,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" @@ -2709,7 +2709,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" @@ -2723,7 +2723,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" @@ -2736,7 +2736,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" @@ -2750,7 +2750,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" @@ -2763,7 +2763,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" @@ -2778,7 +2778,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) ..() @@ -2796,7 +2796,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" @@ -2809,7 +2809,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" @@ -2822,7 +2822,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" @@ -2835,7 +2835,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" @@ -2860,7 +2860,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" @@ -2873,7 +2873,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" @@ -2899,7 +2899,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" @@ -2911,7 +2911,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" @@ -2924,7 +2924,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" @@ -2937,7 +2937,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" @@ -2962,7 +2962,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" @@ -2978,7 +2978,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" @@ -2991,7 +2991,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" @@ -3005,7 +3005,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" @@ -3020,7 +3020,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 @@ -3048,7 +3048,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" @@ -3061,7 +3061,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" @@ -3074,7 +3074,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" @@ -3087,7 +3087,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" @@ -3100,7 +3100,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" @@ -3113,7 +3113,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" @@ -3126,7 +3126,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" @@ -3139,7 +3139,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" @@ -3152,7 +3152,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" @@ -3193,7 +3193,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) ..() @@ -3221,7 +3221,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) ..() @@ -3260,7 +3260,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" @@ -3273,7 +3273,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" @@ -3287,7 +3287,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" @@ -3300,7 +3300,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" @@ -3314,7 +3314,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" @@ -3328,7 +3328,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" @@ -3341,7 +3341,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" @@ -3366,7 +3366,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" @@ -3382,7 +3382,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" @@ -3395,7 +3395,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" @@ -3408,7 +3408,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" @@ -3421,7 +3421,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" @@ -3435,7 +3435,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" @@ -3449,7 +3449,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" @@ -3462,7 +3462,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" @@ -3500,7 +3500,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" @@ -3513,7 +3513,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" @@ -3526,7 +3526,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" @@ -3539,7 +3539,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" @@ -3552,7 +3552,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" @@ -3565,7 +3565,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" @@ -3578,7 +3578,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" @@ -3591,7 +3591,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" @@ -3605,7 +3605,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" @@ -3618,7 +3618,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" @@ -3632,7 +3632,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" @@ -3645,7 +3645,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" @@ -3659,7 +3659,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" @@ -3683,7 +3683,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" @@ -3707,7 +3707,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) ..() @@ -3726,7 +3726,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" @@ -3739,7 +3739,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" @@ -3752,7 +3752,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" @@ -3766,7 +3766,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" @@ -3799,7 +3799,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" @@ -3812,7 +3812,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" @@ -3825,7 +3825,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" @@ -3838,7 +3838,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" @@ -3851,7 +3851,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) ..() @@ -3870,7 +3870,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" @@ -3883,7 +3883,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" @@ -3896,7 +3896,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" @@ -3909,7 +3909,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" @@ -3922,7 +3922,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" @@ -3936,7 +3936,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" @@ -3950,7 +3950,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" @@ -3963,7 +3963,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" @@ -3978,7 +3978,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" @@ -4015,7 +4015,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) ..() @@ -4045,7 +4045,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" @@ -4058,7 +4058,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" @@ -4075,7 +4075,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" @@ -4088,7 +4088,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" @@ -4101,7 +4101,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" @@ -4125,7 +4125,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" @@ -4138,7 +4138,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" @@ -4162,7 +4162,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" @@ -4178,7 +4178,7 @@ glass_name = "Deathbell" glass_desc = "The perfect blend of the most alcoholic things a bartender can get their hands on." - allergen_type = GRAINS|DAIRY|FRUIT //Made from antifreeze(vodka(grains),cream(dairy)), gargleblaster(vodka(grains),gin(fruit),whiskey(grains),cognac(fruit),lime juice(fruit)), and syndicate bomb(beer(grain),whiskeycola(whiskey(grain))) + allergen_type = ALLERGEN_GRAINS|ALLERGEN_DAIRY|ALLERGEN_FRUIT //Made from antifreeze(vodka(grains),cream(dairy)), gargleblaster(vodka(grains),gin(fruit),whiskey(grains),cognac(fruit),lime juice(fruit)), and syndicate bomb(beer(grain),whiskeycola(whiskey(grain))) /datum/reagent/ethanol/deathbell/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed) ..() diff --git a/code/modules/reagents/reagents/toxins.dm b/code/modules/reagents/reagents/toxins.dm index 0ea989228a..dde7bf21a9 100644 --- a/code/modules/reagents/reagents/toxins.dm +++ b/code/modules/reagents/reagents/toxins.dm @@ -946,7 +946,7 @@ metabolism = REM * 0.5 overdose = REAGENTS_OVERDOSE -datum/reagent/talum_quem/affect_blood(var/mob/living/carbon/M, var/alien, var/removed) +/datum/reagent/talum_quem/affect_blood(var/mob/living/carbon/M, var/alien, var/removed) if(alien == IS_DIONA) return diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index 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 044f627a6b..b7d4f499c3 100644 --- a/code/modules/research/message_server.dm +++ b/code/modules/research/message_server.dm @@ -365,14 +365,22 @@ var/obj/machinery/blackbox_recorder/blackbox query_insert.Execute() qdel(query_insert) //CHOMPEdit TGSQL +<<<<<<< HEAD // Sanitize inputs to avoid SQL injection attacks //CHOMPEdit NOTE: This is not secure. Basic filters like this are pretty easy to bypass. Use the format for arguments used in the above. proc/sql_sanitize_text(var/text) +||||||| parent of 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 +// Sanitize inputs to avoid SQL injection attacks +proc/sql_sanitize_text(var/text) +======= +// Sanitize inputs to avoid SQL injection attacks +/proc/sql_sanitize_text(var/text) +>>>>>>> 18962f7a77... Merge pull request #10719 from VOREStation/upstream-merge-8150 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) @@ -383,7 +391,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) @@ -394,7 +402,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) @@ -405,7 +413,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) @@ -417,7 +425,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/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/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/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 4d911b1c3b..28a5c86a8b 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/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/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 a33f549324..f3d84fc2a8 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 diff --git a/code/modules/vore/fluffstuff/custom_items_vr.dm b/code/modules/vore/fluffstuff/custom_items_vr.dm index 70bf81f546..19dcd73863 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 703d7fb12b..209c758418 100644 --- a/code/stylesheet.dm +++ b/code/stylesheet.dm @@ -1,4 +1,4 @@ -client/script = {"