From 767e655310792d51e50d1503631d72c72bb04050 Mon Sep 17 00:00:00 2001 From: Neerti Date: Tue, 25 May 2021 23:17:26 -0400 Subject: [PATCH 01/13] Linter Introduction + Cleanup --- SpacemanDMM.toml | 3 + code/ATMOSPHERICS/atmospherics.dm | 2 +- .../components/binary_devices/passive_gate.dm | 4 +- .../components/binary_devices/pump.dm | 4 +- code/ATMOSPHERICS/components/shutoff.dm | 2 +- code/ATMOSPHERICS/components/tvalve.dm | 2 +- code/ATMOSPHERICS/components/valve.dm | 2 +- code/ATMOSPHERICS/mainspipe.dm | 1 - code/__defines/spaceman_dmm.dm | 31 + code/__defines/subsystems.dm | 4 +- code/_global_vars/lists/species.dm | 4 +- code/_helpers/events.dm | 2 +- code/_helpers/game.dm | 1 + code/_helpers/logging.dm | 2 +- code/_helpers/unsorted.dm | 5 - code/_macros.dm | 3 +- code/controllers/subsystems/chat.dm | 2 +- code/controllers/subsystems/events.dm | 2 +- code/controllers/subsystems/persistence.dm | 6 +- code/controllers/subsystems/planets.dm | 2 +- code/controllers/subsystems/ticker.dm | 2 +- code/controllers/subsystems/timer.dm | 5 +- code/controllers/subsystems/xenoarch.dm | 2 +- code/datums/beam.dm | 2 +- code/datums/category.dm | 2 +- code/datums/components/_component.dm | 4 +- code/datums/components/crafting/crafting.dm | 2 +- code/datums/datum.dm | 2 +- code/datums/datumvars.dm | 2 +- code/datums/elements/_element.dm | 4 +- code/datums/looping_sounds/sequence.dm | 1 - code/datums/mind.dm | 4 +- code/datums/repositories/decls.dm | 6 +- code/defines/procs/AStar.dm | 4 +- code/game/antagonist/alien/borer.dm | 2 +- code/game/antagonist/alien/xenomorph.dm | 2 +- code/game/antagonist/antagonist.dm | 2 +- code/game/antagonist/station/highlander.dm | 2 +- code/game/antagonist/station/rogue_ai.dm | 2 +- code/game/dna/genes/gene.dm | 2 +- code/game/dna/genes/powers.dm | 1 - code/game/gamemodes/events.dm | 2 +- code/game/gamemodes/events/dust.dm | 2 +- .../newmalf_ability_trees/tree_networking.dm | 5 + .../technomancer/spell_objs_helpers.dm | 2 +- code/game/jobs/access.dm | 5 + code/game/machinery/air_alarm.dm | 15 +- .../atmoalter/area_atmos_computer.dm | 10 +- code/game/machinery/camera/camera.dm | 4 +- code/game/machinery/camera/presets.dm | 2 +- code/game/machinery/camera/tracking.dm | 2 +- code/game/machinery/computer/arcade.dm | 12 +- code/game/machinery/computer/atmos_alert.dm | 2 +- code/game/machinery/computer/message.dm | 17 +- code/game/machinery/computer/prisoner.dm | 13 +- code/game/machinery/computer/station_alert.dm | 2 +- .../computer/syndicate_specops_shuttle.dm | 253 +--- code/game/machinery/doors/door.dm | 3 +- code/game/machinery/flasher.dm | 4 +- code/game/machinery/magnet.dm | 4 +- code/game/machinery/newscaster.dm | 1 - code/game/machinery/pointdefense.dm | 5 + code/game/machinery/suit_storage_unit.dm | 5 - code/game/machinery/telecomms/logbrowser.dm | 11 +- .../telecomms/machine_interactions.dm | 10 +- .../machinery/telecomms/telecomunications.dm | 2 +- code/game/machinery/telecomms/telemonitor.dm | 12 +- .../machinery/telecomms/traffic_control.dm | 2 +- .../machinery/virtual_reality/vr_console.dm | 2 +- code/game/mecha/equipment/tools/orescanner.dm | 2 +- code/game/mecha/equipment/tools/shield.dm | 1 - .../game/mecha/equipment/tools/shield_omni.dm | 1 - .../game/mecha/equipment/tools/syringe_gun.dm | 1 - code/game/mecha/equipment/weapons/weapons.dm | 2 +- code/game/mecha/mecha.dm | 9 +- code/game/objects/explosion.dm | 1 - code/game/objects/items.dm | 3 +- code/game/objects/items/devices/gps.dm | 12 +- .../objects/items/devices/radio/intercom.dm | 4 +- .../game/objects/items/devices/radio/radio.dm | 2 +- .../objects/items/devices/suit_cooling.dm | 3 +- .../objects/items/devices/transfer_valve.dm | 4 +- code/game/objects/items/stacks/stack.dm | 1 - code/game/objects/items/uav.dm | 2 +- code/game/objects/items/weapons/autopsy.dm | 12 +- .../objects/items/weapons/material/misc.dm | 6 +- code/game/objects/items/weapons/melee/misc.dm | 1 - .../objects/items/weapons/storage/belt.dm | 2 +- .../objects/items/weapons/storage/wallets.dm | 2 +- .../game/objects/items/weapons/tanks/tanks.dm | 4 +- .../objects/items/weapons/teleportation.dm | 2 +- code/game/objects/structures/cliff.dm | 2 +- .../structures/crates_lockers/__closets.dm | 18 +- code/game/objects/structures/flora/flora.dm | 2 - .../stool_bed_chair_nest/wheelchair.dm | 4 +- code/game/objects/structures/transit_tubes.dm | 6 +- code/game/turfs/simulated/wall_attacks.dm | 2 - code/game/world.dm | 8 +- code/modules/admin/ToRban.dm | 4 +- code/modules/admin/admin.dm | 6 +- code/modules/admin/admin_memo.dm | 18 +- .../secrets/admin_secrets/prison_warp.dm | 2 +- code/modules/admin/verbs/SDQL2/SDQL_2.dm | 6 +- code/modules/admin/verbs/adminpm.dm | 2 +- code/modules/admin/verbs/diagnostics.dm | 4 +- code/modules/admin/verbs/mapping.dm | 4 +- code/modules/admin/verbs/pray.dm | 10 + .../admin/view_variables/modify_variables.dm | 2 +- code/modules/ai/ai_holder_targeting.dm | 2 +- code/modules/assembly/holder.dm | 4 +- code/modules/assembly/proximity.dm | 4 +- .../preference_setup/preference_setup.dm | 2 +- code/modules/clothing/clothing.dm | 5 +- code/modules/clothing/clothing_icons.dm | 2 +- .../rig/modules/specific/ai_container.dm | 9 +- .../clothing/under/accessories/accessory.dm | 2 +- .../detectivework/microscope/microscope.dm | 2 +- code/modules/economy/Accounts_DB.dm | 2 +- code/modules/economy/EFTPOS.dm | 4 +- code/modules/events/spider_infestation.dm | 2 +- code/modules/flufftext/Dreaming.dm | 4 +- code/modules/food/food/thecake.dm | 1 - .../food/kitchen/cooking_machines/candy.dm | 2 +- .../events/security/spider_infestation.dm | 2 +- code/modules/holomap/station_holomap.dm | 1 - code/modules/hydroponics/grown.dm | 2 +- code/modules/hydroponics/seed.dm | 2 +- .../hydroponics/spreading/spreading.dm | 7 +- .../spreading/spreading_response.dm | 4 +- .../core/special_pins/dir_pin.dm | 2 +- .../subtypes/reagents.dm | 1 - code/modules/maps/tg/map_template.dm | 2 +- code/modules/maps/tg/reader.dm | 4 +- .../modules/materials/materials/_materials.dm | 2 +- .../mining/machinery/machine_processing.dm | 5 +- code/modules/mob/dead/observer/observer.dm | 915 +++++++++++++ code/modules/mob/living/bot/mulebot.dm | 1 - code/modules/mob/living/carbon/brain/life.dm | 10 +- .../carbon/human/human_modular_limbs.dm | 2 - .../mob/living/carbon/human/human_powers.dm | 2 +- .../mob/living/carbon/human/human_resist.dm | 1 - code/modules/mob/living/carbon/human/life.dm | 3 +- .../human/species/xenomorphs/alien_powers.dm | 4 +- .../mob/living/carbon/human/update_icons.dm | 2 +- code/modules/mob/living/inventory.dm | 27 +- code/modules/mob/living/living_defense.dm | 646 +++++++++ .../silicon/robot/drone/drone_console.dm | 8 +- .../mob/living/silicon/robot/inventory.dm | 1 - code/modules/mob/living/silicon/silicon.dm | 422 ++++++ .../subtypes/animal/passive/fish.dm | 2 +- .../simple_mob/subtypes/animal/sif/leech.dm | 6 +- code/modules/mob/mob.dm | 1181 +++++++++++++++++ code/modules/mob/mob_defines.dm | 2 +- code/modules/mob/mob_planes.dm | 2 +- code/modules/mob/skillset.dm | 2 - code/modules/multiz/hoist.dm | 2 +- code/modules/multiz/turf.dm | 2 +- code/modules/nano/interaction/default.dm | 91 ++ code/modules/nano/nanoexternal.dm | 44 + .../organs/internal/robotic/heatsink.dm | 3 +- code/modules/organs/organ_external.dm | 6 +- code/modules/organs/subtypes/diona.dm | 2 +- code/modules/paperwork/faxmachine.dm | 11 +- code/modules/paperwork/filingcabinet.dm | 10 +- code/modules/paperwork/stamps.dm | 2 +- code/modules/power/cable.dm | 1 - code/modules/power/fusion/core/core_field.dm | 8 +- .../power/singularity/containment_field.dm | 4 +- .../particle_accelerator.dm | 2 - code/modules/projectiles/projectile/hook.dm | 2 +- code/modules/reagents/reagents/medicine.dm | 6 +- code/modules/reagents/reagents/toxins.dm | 3 +- .../recycling/disposal-construction.dm | 2 +- code/modules/recycling/sortingmachinery.dm | 8 + code/modules/scripting/IDE.dm | 12 +- code/modules/shieldgen/shield_capacitor.dm | 4 +- code/modules/shieldgen/shield_gen.dm | 31 +- code/modules/shuttles/escape_pods.dm | 25 + code/modules/shuttles/web_datums.dm | 1 + code/modules/spells/spell_code.dm | 2 +- code/modules/spells/spellbook.dm | 2 +- code/modules/tables/presets.dm | 2 +- code/modules/tables/rack.dm | 2 +- code/modules/tgui/modules/atmos_control.dm | 2 +- code/modules/turbolift/turbolift_console.dm | 5 +- code/modules/vchat/vchat_client.dm | 1 - code/modules/virus2/disease2.dm | 7 +- code/modules/xenoarcheaology/finds/special.dm | 2 +- code/modules/xgm/xgm_gas_mixture.dm | 2 +- maps/southern_cross/overmap/sectors.dm | 7 +- vorestation.dme | 1 + 191 files changed, 3753 insertions(+), 609 deletions(-) create mode 100644 code/__defines/spaceman_dmm.dm create mode 100644 code/modules/nano/interaction/default.dm create mode 100644 code/modules/nano/nanoexternal.dm diff --git a/SpacemanDMM.toml b/SpacemanDMM.toml index 500be06fa6..771e48d2ef 100644 --- a/SpacemanDMM.toml +++ b/SpacemanDMM.toml @@ -3,3 +3,6 @@ macro_redefined = "off" macro_undefined_no_definition = "off" as_local_var = "off" tmp_no_effect = "off" + +[langserver] +dreamchecker = true diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm index 6bd32c762c..39e9e44da2 100644 --- a/code/ATMOSPHERICS/atmospherics.dm +++ b/code/ATMOSPHERICS/atmospherics.dm @@ -146,7 +146,7 @@ Pipelines + Other Objects -> Pipe network /obj/machinery/atmospherics/proc/reassign_network(datum/pipe_network/old_network, datum/pipe_network/new_network) // Used when two pipe_networks are combining -/obj/machinery/atmospherics/proc/return_network_air(datum/network/reference) +/obj/machinery/atmospherics/proc/return_network_air(datum/pipe_network/reference) // Return a list of gas_mixture(s) in the object // associated with reference pipe_network for use in rebuilding the networks gases list // Is permitted to return null diff --git a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm index e960d36fa7..8d30c946ca 100644 --- a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm +++ b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm @@ -145,7 +145,7 @@ radio_controller.remove_object(src, frequency) frequency = new_frequency if(frequency) - radio_connection = radio_controller.add_object(src, frequency, filter = RADIO_ATMOSIA) + radio_connection = radio_controller.add_object(src, frequency, radio_filter = RADIO_ATMOSIA) /obj/machinery/atmospherics/binary/passive_gate/proc/broadcast_status() if(!radio_connection) @@ -165,7 +165,7 @@ "sigtype" = "status" ) - radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA) + radio_connection.post_signal(src, signal, radio_filter = RADIO_ATMOSIA) return 1 diff --git a/code/ATMOSPHERICS/components/binary_devices/pump.dm b/code/ATMOSPHERICS/components/binary_devices/pump.dm index 54e034dc92..05922103ff 100644 --- a/code/ATMOSPHERICS/components/binary_devices/pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/pump.dm @@ -121,7 +121,7 @@ Thus, the two variables affect pump operation are set in New(): radio_controller.remove_object(src, frequency) frequency = new_frequency if(frequency) - radio_connection = radio_controller.add_object(src, frequency, filter = RADIO_ATMOSIA) + radio_connection = radio_controller.add_object(src, frequency, radio_filter = RADIO_ATMOSIA) /obj/machinery/atmospherics/binary/pump/proc/broadcast_status() if(!radio_connection) @@ -139,7 +139,7 @@ Thus, the two variables affect pump operation are set in New(): "sigtype" = "status" ) - radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA) + radio_connection.post_signal(src, signal, radio_filter = RADIO_ATMOSIA) return 1 diff --git a/code/ATMOSPHERICS/components/shutoff.dm b/code/ATMOSPHERICS/components/shutoff.dm index d7d8076214..7517cbd7ef 100644 --- a/code/ATMOSPHERICS/components/shutoff.dm +++ b/code/ATMOSPHERICS/components/shutoff.dm @@ -66,7 +66,7 @@ GLOBAL_LIST_EMPTY(shutoff_valves) // Breadth-first search for any leaking pipes that we can directly see /obj/machinery/atmospherics/valve/shutoff/proc/find_leaks() - var/obj/machinery/atmospherics/list/search = list() + var/list/obj/machinery/atmospherics/search = list() // We're the leak! if(!node1 || !node2) diff --git a/code/ATMOSPHERICS/components/tvalve.dm b/code/ATMOSPHERICS/components/tvalve.dm index c0d796d45b..7deca38847 100644 --- a/code/ATMOSPHERICS/components/tvalve.dm +++ b/code/ATMOSPHERICS/components/tvalve.dm @@ -232,7 +232,7 @@ return 1 -/obj/machinery/atmospherics/tvalve/return_network_air(datum/network/reference) +/obj/machinery/atmospherics/tvalve/return_network_air(datum/pipe_network/reference) return null /obj/machinery/atmospherics/tvalve/disconnect(obj/machinery/atmospherics/reference) diff --git a/code/ATMOSPHERICS/components/valve.dm b/code/ATMOSPHERICS/components/valve.dm index 3ded7b7388..c890938100 100644 --- a/code/ATMOSPHERICS/components/valve.dm +++ b/code/ATMOSPHERICS/components/valve.dm @@ -201,7 +201,7 @@ return 1 -/obj/machinery/atmospherics/valve/return_network_air(datum/network/reference) +/obj/machinery/atmospherics/valve/return_network_air(datum/pipe_network/reference) return null /obj/machinery/atmospherics/valve/disconnect(obj/machinery/atmospherics/reference) diff --git a/code/ATMOSPHERICS/mainspipe.dm b/code/ATMOSPHERICS/mainspipe.dm index ac2b3193c9..e7a0d09477 100644 --- a/code/ATMOSPHERICS/mainspipe.dm +++ b/code/ATMOSPHERICS/mainspipe.dm @@ -74,7 +74,6 @@ obj/machinery/atmospherics/mains_pipe update_icon() proc/burst() - ..() for(var/obj/machinery/atmospherics/pipe/mains_component/pipe in contents) burst() diff --git a/code/__defines/spaceman_dmm.dm b/code/__defines/spaceman_dmm.dm new file mode 100644 index 0000000000..94f1743377 --- /dev/null +++ b/code/__defines/spaceman_dmm.dm @@ -0,0 +1,31 @@ +// Interfaces for the SpacemanDMM linter, define'd to nothing when the linter +// is not in use. + +// The SPACEMAN_DMM define is set by the linter and other tooling when it runs. +#ifdef SPACEMAN_DMM + #define RETURN_TYPE(X) set SpacemanDMM_return_type = X + #define SHOULD_CALL_PARENT(X) set SpacemanDMM_should_call_parent = X + #define UNLINT(X) SpacemanDMM_unlint(X) + #define SHOULD_NOT_OVERRIDE(X) set SpacemanDMM_should_not_override = X + #define SHOULD_NOT_SLEEP(X) set SpacemanDMM_should_not_sleep = X + #define SHOULD_BE_PURE(X) set SpacemanDMM_should_be_pure = X + #define PRIVATE_PROC(X) set SpacemanDMM_private_proc = X + #define PROTECTED_PROC(X) set SpacemanDMM_protected_proc = X + #define CAN_BE_REDEFINED(X) set SpacemanDMM_can_be_redefined = X + #define VAR_FINAL var/SpacemanDMM_final + #define VAR_PRIVATE var/SpacemanDMM_private + #define VAR_PROTECTED var/SpacemanDMM_protected +#else + #define RETURN_TYPE(X) + #define SHOULD_CALL_PARENT(X) + #define UNLINT(X) X + #define SHOULD_NOT_OVERRIDE(X) + #define SHOULD_NOT_SLEEP(X) + #define SHOULD_BE_PURE(X) + #define PRIVATE_PROC(X) + #define PROTECTED_PROC(X) + #define CAN_BE_REDEFINED(X) + #define VAR_FINAL var + #define VAR_PRIVATE var + #define VAR_PROTECTED var +#endif diff --git a/code/__defines/subsystems.dm b/code/__defines/subsystems.dm index d24f0bfdd6..cac66f5a11 100644 --- a/code/__defines/subsystems.dm +++ b/code/__defines/subsystems.dm @@ -111,7 +111,7 @@ var/global/list/runlevel_flags = list(RUNLEVEL_LOBBY, RUNLEVEL_SETUP, RUNLEVEL_G // Macro defining the actual code applying our overlays lists to the BYOND overlays list. (I guess a macro for speed) // TODO - I don't really like the location of this macro define. Consider it. ~Leshana #define COMPILE_OVERLAYS(A)\ - if (TRUE) {\ + do {\ var/list/oo = A.our_overlays;\ var/list/po = A.priority_overlays;\ if(LAZYLEN(po)){\ @@ -129,4 +129,4 @@ var/global/list/runlevel_flags = list(RUNLEVEL_LOBBY, RUNLEVEL_SETUP, RUNLEVEL_G A.overlays.Cut();\ }\ A.flags &= ~OVERLAY_QUEUED;\ - } + } while (FALSE) diff --git a/code/_global_vars/lists/species.dm b/code/_global_vars/lists/species.dm index 5b467f573f..f35568b07a 100644 --- a/code/_global_vars/lists/species.dm +++ b/code/_global_vars/lists/species.dm @@ -1,6 +1,6 @@ //Languages/species/whitelist. -GLOBAL_LIST_INIT(all_species, list()) -GLOBAL_LIST_INIT(all_languages, list()) +GLOBAL_LIST_EMPTY_TYPED(all_species, /datum/species) +GLOBAL_LIST_EMPTY_TYPED(all_languages, /datum/language) GLOBAL_LIST_INIT(language_name_conflicts, list()) GLOBAL_LIST_INIT(language_keys, list()) // Table of say codes for all languages GLOBAL_LIST_INIT(language_key_conflicts, list()) diff --git a/code/_helpers/events.dm b/code/_helpers/events.dm index 2d15bb3aa9..5f2e605512 100644 --- a/code/_helpers/events.dm +++ b/code/_helpers/events.dm @@ -10,7 +10,7 @@ // Otherwise add it and all subtypes that exist on the map to our grand list for(var/areapath in typesof(parentpath)) var/area/A = locate(areapath) // Check if it actually exists - if(istype(A) && A.z in using_map.player_levels) + if(istype(A) && (A.z in using_map.player_levels)) grand_list_of_areas += A return grand_list_of_areas diff --git a/code/_helpers/game.dm b/code/_helpers/game.dm index 40dbaf49cb..def9934876 100644 --- a/code/_helpers/game.dm +++ b/code/_helpers/game.dm @@ -27,6 +27,7 @@ return max_z /proc/get_area(atom/A) + RETURN_TYPE(/area) if(isarea(A)) return A var/turf/T = get_turf(A) diff --git a/code/_helpers/logging.dm b/code/_helpers/logging.dm index 3bef9b4f15..ba13bb5b48 100644 --- a/code/_helpers/logging.dm +++ b/code/_helpers/logging.dm @@ -126,7 +126,7 @@ WRITE_LOG(diary, "DEADCHAT: [speaker.simple_info_line()]: [html_decode(text)]") speaker.dialogue_log += "([time_stamp()]) ([speaker]/[speaker.client]) DEADSAY: - [text]" - GLOB.round_text_log += "([time_stamp()]) ([src]/[speaker.client]) DEADSAY: - [text]" + GLOB.round_text_log += "([time_stamp()]) ([speaker]/[speaker.client]) DEADSAY: - [text]" /proc/log_ghostemote(text, mob/speaker) diff --git a/code/_helpers/unsorted.dm b/code/_helpers/unsorted.dm index c1f32f45db..5701521ec5 100644 --- a/code/_helpers/unsorted.dm +++ b/code/_helpers/unsorted.dm @@ -19,11 +19,9 @@ if (!( istext(HTMLstring) )) CRASH("Given non-text argument!") - return else if (length(HTMLstring) != 7) CRASH("Given non-HTML argument!") - return var/textr = copytext(HTMLstring, 2, 4) var/textg = copytext(HTMLstring, 4, 6) var/textb = copytext(HTMLstring, 6, 8) @@ -40,7 +38,6 @@ if (length(textb) < 2) textr = text("0[]", textb) return text("#[][][]", textr, textg, textb) - return //Returns the middle-most value /proc/dd_range(var/low, var/high, var/num) @@ -1130,8 +1127,6 @@ proc/is_hot(obj/item/W as obj) else return 0 - return 0 - //Whether or not the given item counts as sharp in terms of dealing damage /proc/is_sharp(obj/O as obj) if(!O) diff --git a/code/_macros.dm b/code/_macros.dm index 33bdf30ceb..18a8ddf825 100644 --- a/code/_macros.dm +++ b/code/_macros.dm @@ -11,7 +11,8 @@ #define RANDOM_BLOOD_TYPE pick(4;"O-", 36;"O+", 3;"A-", 28;"A+", 1;"B-", 20;"B+", 1;"AB-", 5;"AB+") // #define to_chat(target, message) target << message Not anymore! -#define to_chat to_chat_filename=__FILE__;to_chat_line=__LINE__;to_chat_src=src;__to_chat +//#define to_chat to_chat_filename=__FILE__;to_chat_line=__LINE__;to_chat_src=src;__to_chat +#define to_chat __to_chat #define to_world(message) to_chat(world, message) #define to_world_log(message) world.log << message // TODO - Baystation has this log to crazy places. For now lets just world.log, but maybe look into it later. diff --git a/code/controllers/subsystems/chat.dm b/code/controllers/subsystems/chat.dm index 3fda63b5aa..553c30d128 100644 --- a/code/controllers/subsystems/chat.dm +++ b/code/controllers/subsystems/chat.dm @@ -5,7 +5,7 @@ SUBSYSTEM_DEF(chat) priority = FIRE_PRIORITY_CHAT init_order = INIT_ORDER_CHAT - var/list/msg_queue = list() + var/list/list/msg_queue = list() //List of lists /datum/controller/subsystem/chat/Initialize(timeofday) init_vchat() diff --git a/code/controllers/subsystems/events.dm b/code/controllers/subsystems/events.dm index 226c09f492..5b613775e4 100644 --- a/code/controllers/subsystems/events.dm +++ b/code/controllers/subsystems/events.dm @@ -38,7 +38,7 @@ SUBSYSTEM_DEF(events) return for(var/i = EVENT_LEVEL_MUNDANE to EVENT_LEVEL_MAJOR) - var/list/datum/event_container/EC = event_containers[i] + var/datum/event_container/EC = event_containers[i] EC.process() /datum/controller/subsystem/events/stat_entry() diff --git a/code/controllers/subsystems/persistence.dm b/code/controllers/subsystems/persistence.dm index 1667aa8320..792bf63893 100644 --- a/code/controllers/subsystems/persistence.dm +++ b/code/controllers/subsystems/persistence.dm @@ -32,6 +32,10 @@ SUBSYSTEM_DEF(persistence) if(!A || (A.flags & AREA_FLAG_IS_NOT_PERSISTENT)) return +// if((!T.z in GLOB.using_map.station_levels) || !initialized) + if(!(T.z in using_map.station_levels)) + return + if(!(T.z in using_map.persist_levels)) return @@ -57,4 +61,4 @@ SUBSYSTEM_DEF(persistence) dat += "" var/datum/browser/popup = new(user, "admin_persistence", "Persistence Data") popup.set_content(jointext(dat, null)) - popup.open() \ No newline at end of file + popup.open() diff --git a/code/controllers/subsystems/planets.dm b/code/controllers/subsystems/planets.dm index 4cf7222186..d1c2de2410 100644 --- a/code/controllers/subsystems/planets.dm +++ b/code/controllers/subsystems/planets.dm @@ -33,7 +33,7 @@ SUBSYSTEM_DEF(planets) z_to_planet[Z] = NP // DO NOT CALL THIS DIRECTLY UNLESS IT'S IN INITIALIZE, -// USE turf/simulated/proc/make_indoors() and\ +// USE turf/simulated/proc/make_indoors() and // tyrf/simulated/proc/make_outdoors() /datum/controller/subsystem/planets/proc/addTurf(var/turf/T) if(z_to_planet.len >= T.z && z_to_planet[T.z]) diff --git a/code/controllers/subsystems/ticker.dm b/code/controllers/subsystems/ticker.dm index 47f35a27a8..31f3755744 100644 --- a/code/controllers/subsystems/ticker.dm +++ b/code/controllers/subsystems/ticker.dm @@ -314,7 +314,7 @@ var/global/datum/controller/subsystem/ticker/ticker switch(M.z) if(0) //inside a crate or something var/turf/T = get_turf(M) - if(T && T.z in using_map.station_levels) //we don't use M.death(0) because it calls a for(/mob) loop and + if(T && (T.z in using_map.station_levels)) //we don't use M.death(0) because it calls a for(/mob) loop and M.health = 0 M.set_stat(DEAD) if(1) //on a z-level 1 turf. diff --git a/code/controllers/subsystems/timer.dm b/code/controllers/subsystems/timer.dm index 64a347336a..9c41a0a4ba 100644 --- a/code/controllers/subsystems/timer.dm +++ b/code/controllers/subsystems/timer.dm @@ -159,8 +159,7 @@ SUBSYSTEM_DEF(timer) if (timer.timeToRun < head_offset) bucket_resolution = null //force bucket recreation - CRASH("[i] Invalid timer state: Timer in long run queue with a time to run less then head_offset. [get_timer_debug_string(timer)] world.time: [world.time], head_offset: [head_offset], practical_offset: [practical_offset]") - + crash_with("[i] Invalid timer state: Timer in long run queue with a time to run less then head_offset. [get_timer_debug_string(timer)] world.time: [world.time], head_offset: [head_offset], practical_offset: [practical_offset]") if (timer.callBack && !timer.spent) timer.callBack.InvokeAsync() spent += timer @@ -171,7 +170,7 @@ SUBSYSTEM_DEF(timer) if (timer.timeToRun < head_offset + TICKS2DS(practical_offset-1)) bucket_resolution = null //force bucket recreation - CRASH("[i] Invalid timer state: Timer in long run queue that would require a backtrack to transfer to short run queue. [get_timer_debug_string(timer)] world.time: [world.time], head_offset: [head_offset], practical_offset: [practical_offset]") + crash_with("[i] Invalid timer state: Timer in long run queue that would require a backtrack to transfer to short run queue. [get_timer_debug_string(timer)] world.time: [world.time], head_offset: [head_offset], practical_offset: [practical_offset]") if (timer.callBack && !timer.spent) timer.callBack.InvokeAsync() spent += timer diff --git a/code/controllers/subsystems/xenoarch.dm b/code/controllers/subsystems/xenoarch.dm index 2e22213ee6..9851c69278 100644 --- a/code/controllers/subsystems/xenoarch.dm +++ b/code/controllers/subsystems/xenoarch.dm @@ -31,7 +31,7 @@ SUBSYSTEM_DEF(xenoarch) /datum/controller/subsystem/xenoarch/proc/SetupXenoarch() for(var/turf/simulated/mineral/M in world) - if(!M.density || M.z in using_map.xenoarch_exempt_levels) + if(!M.density || (M.z in using_map.xenoarch_exempt_levels)) continue if(isnull(M.geologic_data)) diff --git a/code/datums/beam.dm b/code/datums/beam.dm index fc4e696702..7b5b385932 100644 --- a/code/datums/beam.dm +++ b/code/datums/beam.dm @@ -194,7 +194,7 @@ -/atom/proc/Beam(atom/BeamTarget,icon_state="b_beam",icon='icons/effects/beam.dmi',time=50, maxdistance=10,beam_type=/obj/effect/ebeam,beam_sleep_time=3,beam_color = null) +/atom/proc/Beam(atom/BeamTarget, icon_state="b_beam", icon='icons/effects/beam.dmi', time=50, maxdistance=10, beam_type=/obj/effect/ebeam, beam_sleep_time=3, beam_color = null) var/datum/beam/newbeam = new(src,BeamTarget,icon,icon_state,time,maxdistance,beam_type,beam_sleep_time,beam_color) spawn(0) newbeam.Start() diff --git a/code/datums/category.dm b/code/datums/category.dm index 3bc9640b79..45b2df5996 100644 --- a/code/datums/category.dm +++ b/code/datums/category.dm @@ -67,7 +67,7 @@ datum/category_group/dd_SortValue() *****************/ /datum/category_item var/name = "" - var/list/datum/category_group/category // The group this item belongs to + var/datum/category_group/category // The group this item belongs to /datum/category_item/New(var/datum/category_group/cg) ..() diff --git a/code/datums/components/_component.dm b/code/datums/components/_component.dm index 4ada8af23b..1cb9e0b1c4 100644 --- a/code/datums/components/_component.dm +++ b/code/datums/components/_component.dm @@ -333,7 +333,7 @@ * * datum/component/c_type The typepath of the component you want to get a reference to */ /datum/proc/GetComponent(datum/component/c_type) - // RETURN_TYPE(c_type) + RETURN_TYPE(c_type) if(initial(c_type.dupe_mode) == COMPONENT_DUPE_ALLOWED || initial(c_type.dupe_mode) == COMPONENT_DUPE_SELECTIVE) stack_trace("GetComponent was called to get a component of which multiple copies could be on an object. This can easily break and should be changed. Type: \[[c_type]\]") var/list/dc = datum_components @@ -353,7 +353,7 @@ * * datum/component/c_type The typepath of the component you want to get a reference to */ /datum/proc/GetExactComponent(datum/component/c_type) - // RETURN_TYPE(c_type) + RETURN_TYPE(c_type) if(initial(c_type.dupe_mode) == COMPONENT_DUPE_ALLOWED || initial(c_type.dupe_mode) == COMPONENT_DUPE_SELECTIVE) stack_trace("GetComponent was called to get a component of which multiple copies could be on an object. This can easily break and should be changed. Type: \[[c_type]\]") var/list/dc = datum_components diff --git a/code/datums/components/crafting/crafting.dm b/code/datums/components/crafting/crafting.dm index 9f39990afd..e823199af3 100644 --- a/code/datums/components/crafting/crafting.dm +++ b/code/datums/components/crafting/crafting.dm @@ -357,7 +357,7 @@ container.close_all() qdel(DL) -/datum/component/personal_crafting/proc/component_ui_interact(atom/movable/screen/craft/image, location, control, params, user) +/datum/component/personal_crafting/proc/component_ui_interact(/obj/screen/craft/image, location, control, params, user) // SIGNAL_HANDLER if(user == parent) diff --git a/code/datums/datum.dm b/code/datums/datum.dm index 1f9feeeacf..721beeaf4c 100644 --- a/code/datums/datum.dm +++ b/code/datums/datum.dm @@ -8,7 +8,7 @@ var/list/active_timers //for SStimer var/list/datum_components //for /datum/components var/list/comp_lookup - var/list/signal_procs + var/list/list/signal_procs // List of lists var/signal_enabled = FALSE var/weakref/weakref // Holder of weakref instance pointing to this datum var/datum_flags = NONE diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index cfd9107898..7b09c83308 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -72,7 +72,7 @@ if(!usr || !result || result == "---Components---" || result == "---Elements---") return if(QDELETED(src)) - to_chat(usr, "That thing doesn't exist anymore!", confidential = TRUE) + to_chat(usr, "That thing doesn't exist anymore!") return var/list/lst = usr.client.get_callproc_args() if(!lst) diff --git a/code/datums/elements/_element.dm b/code/datums/elements/_element.dm index caf02b65b9..46a295f90b 100644 --- a/code/datums/elements/_element.dm +++ b/code/datums/elements/_element.dm @@ -18,7 +18,7 @@ /// Activates the functionality defined by the element on the given target datum /datum/element/proc/Attach(datum/target) - // SHOULD_CALL_PARENT(1) + SHOULD_CALL_PARENT(1) if(type == /datum/element) return ELEMENT_INCOMPATIBLE SEND_SIGNAL(target, COMSIG_ELEMENT_ATTACH, src) @@ -28,7 +28,7 @@ /// Deactivates the functionality defines by the element on the given datum /datum/element/proc/Detach(datum/source, force) SEND_SIGNAL(source, COMSIG_ELEMENT_DETACH, src) - // SHOULD_CALL_PARENT(1) + SHOULD_CALL_PARENT(1) UnregisterSignal(source, COMSIG_PARENT_QDELETING) /datum/element/Destroy(force) diff --git a/code/datums/looping_sounds/sequence.dm b/code/datums/looping_sounds/sequence.dm index 9399619555..650b3c8d5a 100644 --- a/code/datums/looping_sounds/sequence.dm +++ b/code/datums/looping_sounds/sequence.dm @@ -157,7 +157,6 @@ if(!(letter in morse_alphabet)) CRASH("Encountered invalid character in morse sequence \"[letter]\".") - return // So I heard you like sequences... // Play a sequence of sounds while inside the current iteration of the outer sequence. diff --git a/code/datums/mind.dm b/code/datums/mind.dm index c889751475..de91fd48ab 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -239,8 +239,8 @@ var/mob/def_target = null var/objective_list[] = list(/datum/objective/assassinate, /datum/objective/protect, /datum/objective/debrain) - if (objective&&(objective.type in objective_list) && objective:target) - def_target = objective:target.current + if (objective&&(objective.type in objective_list) && objective.target) + def_target = objective.target.current var/new_target = input("Select target:", "Objective target", def_target) as null|anything in possible_targets if (!new_target) return diff --git a/code/datums/repositories/decls.dm b/code/datums/repositories/decls.dm index 5217481ad9..c46c8b41bf 100644 --- a/code/datums/repositories/decls.dm +++ b/code/datums/repositories/decls.dm @@ -61,11 +61,11 @@ var/repository/decls/decls_repository = new() fetched_decl_subtypes[decl_prototype] = . /decl/proc/Initialize() - //SHOULD_CALL_PARENT(TRUE) - //SHOULD_NOT_SLEEP(TRUE) + SHOULD_CALL_PARENT(TRUE) + SHOULD_NOT_SLEEP(TRUE) return /decl/Destroy() - //SHOULD_CALL_PARENT(FALSE) + SHOULD_CALL_PARENT(FALSE) crash_with("Prevented attempt to delete a decl instance: [log_info_line(src)]") return QDEL_HINT_LETMELIVE // Prevents decl destruction diff --git a/code/defines/procs/AStar.dm b/code/defines/procs/AStar.dm index 1aef60bf05..3ce268d375 100644 --- a/code/defines/procs/AStar.dm +++ b/code/defines/procs/AStar.dm @@ -39,7 +39,7 @@ length to avoid portals or something i guess?? Not that they're counted right no PriorityQueue var/list/queue - var/proc/comparison_function + var/comparison_function New(compare) queue = list() @@ -123,7 +123,7 @@ PathNode proc/PathWeightCompare(PathNode/a, PathNode/b) return a.estimated_cost - b.estimated_cost -proc/AStar(var/start, var/end, var/proc/adjacent, var/proc/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/game/antagonist/alien/borer.dm b/code/game/antagonist/alien/borer.dm index 34b79271f7..2673774d1c 100644 --- a/code/game/antagonist/alien/borer.dm +++ b/code/game/antagonist/alien/borer.dm @@ -68,7 +68,7 @@ var/datum/antagonist/borer/borers /datum/antagonist/borer/proc/get_vents() var/list/vents = list() for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in machines) - if(!temp_vent.welded && temp_vent.network && temp_vent.loc.z in using_map.station_levels) + if(!temp_vent.welded && temp_vent.network && (temp_vent.loc.z in using_map.station_levels)) if(temp_vent.network.normal_members.len > 50) vents += temp_vent return vents \ No newline at end of file diff --git a/code/game/antagonist/alien/xenomorph.dm b/code/game/antagonist/alien/xenomorph.dm index e69db8aee7..493a5ed40c 100644 --- a/code/game/antagonist/alien/xenomorph.dm +++ b/code/game/antagonist/alien/xenomorph.dm @@ -32,7 +32,7 @@ var/datum/antagonist/xenos/xenomorphs /datum/antagonist/xenos/proc/get_vents() var/list/vents = list() for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in machines) - if(!temp_vent.welded && temp_vent.network && temp_vent.loc.z in using_map.station_levels) + if(!temp_vent.welded && temp_vent.network && (temp_vent.loc.z in using_map.station_levels)) if(temp_vent.network.normal_members.len > 50) vents += temp_vent return vents diff --git a/code/game/antagonist/antagonist.dm b/code/game/antagonist/antagonist.dm index e00a4a99df..8778cef2cc 100644 --- a/code/game/antagonist/antagonist.dm +++ b/code/game/antagonist/antagonist.dm @@ -179,7 +179,7 @@ /datum/antagonist/proc/draft_antagonist(var/datum/mind/player) //Check if the player can join in this antag role, or if the player has already been given an antag role. - if(!can_become_antag(player) || player.assigned_role in roundstart_restricted) + if(!can_become_antag(player) || (player.assigned_role in roundstart_restricted)) log_debug("[player.key] was selected for [role_text] by lottery, but is not allowed to be that role.") return 0 if(player.special_role) diff --git a/code/game/antagonist/station/highlander.dm b/code/game/antagonist/station/highlander.dm index f483b1df3b..708f047a57 100644 --- a/code/game/antagonist/station/highlander.dm +++ b/code/game/antagonist/station/highlander.dm @@ -47,7 +47,7 @@ var/datum/antagonist/highlander/highlanders var/obj/item/weapon/card/id/W = new(player) W.name = "[player.real_name]'s ID Card" W.icon_state = "centcom" - W.access = get_all_station_access().Copy + W.access = get_all_station_access().Copy() W.access |= get_all_centcom_access() W.assignment = "Highlander" W.registered_name = player.real_name diff --git a/code/game/antagonist/station/rogue_ai.dm b/code/game/antagonist/station/rogue_ai.dm index 2a46cfd0d9..e1b73b064b 100644 --- a/code/game/antagonist/station/rogue_ai.dm +++ b/code/game/antagonist/station/rogue_ai.dm @@ -54,7 +54,7 @@ var/datum/antagonist/rogue_ai/malf if(!istype(A)) error("Non-AI mob designated malf AI! Report this.") to_world("##ERROR: Non-AI mob designated malf AI! Report this.") - return 0 + return A.setup_for_malf() A.laws = new /datum/ai_laws/nanotrasen/malfunction diff --git a/code/game/dna/genes/gene.dm b/code/game/dna/genes/gene.dm index e52cd4e6c0..a448131b85 100644 --- a/code/game/dna/genes/gene.dm +++ b/code/game/dna/genes/gene.dm @@ -27,7 +27,7 @@ * Is the gene active in this mob's DNA? */ /datum/dna/gene/proc/is_active(var/mob/M) - return M.active_genes && type in M.active_genes + return (M.active_genes && (type in M.active_genes)) // Return 1 if we can activate. // HANDLE MUTCHK_FORCED HERE! diff --git a/code/game/dna/genes/powers.dm b/code/game/dna/genes/powers.dm index 0693ffdd08..efb934e504 100644 --- a/code/game/dna/genes/powers.dm +++ b/code/game/dna/genes/powers.dm @@ -164,7 +164,6 @@ return "hulk_[fat]_s" else return "hulk_[g]_s" - return 0 OnMobLife(var/mob/living/carbon/human/M) if(!istype(M)) return diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm index 89abedd726..6c499c030c 100644 --- a/code/game/gamemodes/events.dm +++ b/code/game/gamemodes/events.dm @@ -111,7 +111,7 @@ var/hadevent = 0 //world << sound('sound/AI/aliens.ogg') var/list/vents = list() for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in machines) - if(!temp_vent.welded && temp_vent.network && temp_vent.loc.z in using_map.station_levels) + if(!temp_vent.welded && temp_vent.network && (temp_vent.loc.z in using_map.station_levels)) if(temp_vent.network.normal_members.len > 50) // Stops Aliens getting stuck in small networks. See: Security, Virology vents += temp_vent diff --git a/code/game/gamemodes/events/dust.dm b/code/game/gamemodes/events/dust.dm index 526164cd58..750de2ebd5 100644 --- a/code/game/gamemodes/events/dust.dm +++ b/code/game/gamemodes/events/dust.dm @@ -106,7 +106,7 @@ The "dust" will damage the hull of the station causin minor hull breaches. if(life <= 0) walk(src,0) qdel(src) - return 0 + return return diff --git a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm index 6d9f5a36ff..13e3b15316 100644 --- a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm +++ b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm @@ -193,8 +193,13 @@ to_chat(user, "## REACHABLE APC SYSTEMS OVERTAKEN. BYPASSING PRIMARY FIREWALL.") sleep(300) // Hack all APCs, including those built during hack sequence. +<<<<<<< HEAD for(var/obj/machinery/power/apc/A in GLOB.apcs) if((!A.hacker || A.hacker != src) && !A.aidisabled && A.z in using_map.station_levels) +======= + for(var/obj/machinery/power/apc/A in machines) + if((!A.hacker || A.hacker != src) && !A.aidisabled && (A.z in using_map.station_levels)) +>>>>>>> fdabe51... Linter Introduction + Cleanup (#8085) A.ai_hack(src) diff --git a/code/game/gamemodes/technomancer/spell_objs_helpers.dm b/code/game/gamemodes/technomancer/spell_objs_helpers.dm index cf83640775..27984c1b04 100644 --- a/code/game/gamemodes/technomancer/spell_objs_helpers.dm +++ b/code/game/gamemodes/technomancer/spell_objs_helpers.dm @@ -53,7 +53,7 @@ continue if(L.invisibility > owner.see_invisible) // Don't target ourselves or people we can't see. continue - if(!L in viewers(owner)) // So we don't shoot at walls if someone is hiding behind one. + if(!(L in viewers(owner))) // So we don't shoot at walls if someone is hiding behind one. continue if(!L.stat) // Don't want to target dead people or SSDs. chosen_target = L diff --git a/code/game/jobs/access.dm b/code/game/jobs/access.dm index b49c41f30f..7d0ae60d33 100644 --- a/code/game/jobs/access.dm +++ b/code/game/jobs/access.dm @@ -103,6 +103,7 @@ /var/list/priv_all_access /proc/get_all_accesses() + RETURN_TYPE(/list) if(!priv_all_access) priv_all_access = get_access_ids() @@ -110,6 +111,7 @@ /var/list/priv_station_access /proc/get_all_station_access() + RETURN_TYPE(/list) if(!priv_station_access) priv_station_access = get_access_ids(ACCESS_TYPE_STATION) @@ -117,6 +119,7 @@ /var/list/priv_centcom_access /proc/get_all_centcom_access() + RETURN_TYPE(/list) if(!priv_centcom_access) priv_centcom_access = get_access_ids(ACCESS_TYPE_CENTCOM) @@ -124,6 +127,7 @@ /var/list/priv_syndicate_access /proc/get_all_syndicate_access() + RETURN_TYPE(/list) if(!priv_syndicate_access) priv_syndicate_access = get_access_ids(ACCESS_TYPE_SYNDICATE) @@ -131,6 +135,7 @@ /var/list/priv_private_access /proc/get_all_private_access() + RETURN_TYPE(/list) if(!priv_private_access) priv_private_access = get_access_ids(ACCESS_TYPE_PRIVATE) diff --git a/code/game/machinery/air_alarm.dm b/code/game/machinery/air_alarm.dm index dde8b545b2..08fe89a308 100644 --- a/code/game/machinery/air_alarm.dm +++ b/code/game/machinery/air_alarm.dm @@ -556,7 +556,7 @@ "intdefault"= (info["internal"] == 0), )) - data["scrubbers"] = list() + var/list/scrubbers = list() for(var/id_tag in alarm_area.air_scrub_names) var/long_name = alarm_area.air_scrub_names[id_tag] var/list/info = alarm_area.air_scrub_info[id_tag] @@ -570,12 +570,13 @@ "panic" = info["panic"], "filters" = list() )) - data["scrubbers"][data["scrubbers"].len]["filters"] += list(list("name" = "Oxygen", "command" = "o2_scrub", "val" = info["filter_o2"])) - data["scrubbers"][data["scrubbers"].len]["filters"] += list(list("name" = "Nitrogen", "command" = "n2_scrub", "val" = info["filter_n2"])) - data["scrubbers"][data["scrubbers"].len]["filters"] += list(list("name" = "Carbon Dioxide", "command" = "co2_scrub","val" = info["filter_co2"])) - data["scrubbers"][data["scrubbers"].len]["filters"] += list(list("name" = "Toxin" , "command" = "tox_scrub","val" = info["filter_phoron"])) - data["scrubbers"][data["scrubbers"].len]["filters"] += list(list("name" = "Nitrous Oxide", "command" = "n2o_scrub","val" = info["filter_n2o"])) - data["scrubbers"][data["scrubbers"].len]["filters"] += list(list("name" = "Fuel", "command" = "fuel_scrub","val" = info["filter_fuel"])) + scrubbers[scrubbers.len]["filters"] += list(list("name" = "Oxygen", "command" = "o2_scrub", "val" = info["filter_o2"])) + scrubbers[scrubbers.len]["filters"] += list(list("name" = "Nitrogen", "command" = "n2_scrub", "val" = info["filter_n2"])) + scrubbers[scrubbers.len]["filters"] += list(list("name" = "Carbon Dioxide", "command" = "co2_scrub","val" = info["filter_co2"])) + scrubbers[scrubbers.len]["filters"] += list(list("name" = "Toxin" , "command" = "tox_scrub","val" = info["filter_phoron"])) + scrubbers[scrubbers.len]["filters"] += list(list("name" = "Nitrous Oxide", "command" = "n2o_scrub","val" = info["filter_n2o"])) + scrubbers[scrubbers.len]["filters"] += list(list("name" = "Fuel", "command" = "fuel_scrub","val" = info["filter_fuel"])) + data["scrubbers"] = scrubbers var/list/modes = list() data["mode"] = mode diff --git a/code/game/machinery/atmoalter/area_atmos_computer.dm b/code/game/machinery/atmoalter/area_atmos_computer.dm index 55523ed079..bfe95bada7 100644 --- a/code/game/machinery/atmoalter/area_atmos_computer.dm +++ b/code/game/machinery/atmoalter/area_atmos_computer.dm @@ -33,15 +33,13 @@ ui.open() /obj/machinery/computer/area_atmos/tgui_data(mob/user) - var/list/data = list() - - data["scrubbers"] = list() + var/list/working = list() for(var/id in connectedscrubbers) var/obj/machinery/portable_atmospherics/powered/scrubber/huge/scrubber = connectedscrubbers[id] if(!validscrubber(scrubber)) connectedscrubbers -= scrubber continue - data["scrubbers"].Add(list(list( + working.Add(list(list( "id" = id, "name" = scrubber.name, "on" = scrubber.on, @@ -50,8 +48,8 @@ "load" = scrubber.last_power_draw, "area" = get_area(scrubber), ))) - - return data + + return list("scrubbers" = working) /obj/machinery/computer/area_atmos/tgui_act(action, params) if(..()) diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 955ccf596a..68a93322c6 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -70,7 +70,7 @@ /obj/machinery/camera/Destroy() if(isMotion()) - unsense_proximity(callback = .HasProximity) + unsense_proximity(callback = /atom/proc/HasProximity) deactivate(null, 0) //kick anyone viewing out if(assembly) qdel(assembly) @@ -361,7 +361,6 @@ for(var/obj/machinery/camera/C in oview(4, M)) if(C.can_use()) // check if camera disabled return C - break return null /proc/near_range_camera(var/mob/M) @@ -369,7 +368,6 @@ for(var/obj/machinery/camera/C in range(4, M)) if(C.can_use()) // check if camera disabled return C - break return null diff --git a/code/game/machinery/camera/presets.dm b/code/game/machinery/camera/presets.dm index bb3cdfb4ed..cef3a344bb 100644 --- a/code/game/machinery/camera/presets.dm +++ b/code/game/machinery/camera/presets.dm @@ -216,7 +216,7 @@ var/global/list/engineering_networks = list( assembly.upgrades.Add(new /obj/item/device/assembly/prox_sensor(assembly)) setPowerUsage() START_MACHINE_PROCESSING(src) - sense_proximity(callback = .HasProximity) + sense_proximity(callback = /atom/proc/HasProximity) update_coverage() /obj/machinery/camera/proc/setPowerUsage() diff --git a/code/game/machinery/camera/tracking.dm b/code/game/machinery/camera/tracking.dm index 60541e0fe3..44f50a4644 100644 --- a/code/game/machinery/camera/tracking.dm +++ b/code/game/machinery/camera/tracking.dm @@ -6,7 +6,7 @@ /mob/living/silicon/ai/var/stored_locations[0] /proc/InvalidPlayerTurf(turf/T as turf) - return !(T && T.z in using_map.player_levels) + return !(T?.z in using_map.player_levels) /mob/living/silicon/ai/proc/get_camera_list() if(src.stat == 2) diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index 179f8e0e16..77e7e037a9 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -23,6 +23,7 @@ /obj/item/clothing/head/cowboy_hat/small = 2, /obj/item/toy/stickhorse = 2 ) + var/list/special_prizes = list() // Holds instanced objects, intended for admins to shove surprises inside or something. /obj/machinery/computer/arcade/Initialize() . = ..() @@ -35,17 +36,18 @@ return INITIALIZE_HINT_QDEL /obj/machinery/computer/arcade/proc/prizevend() - if(!(contents-circuit).len) + if(LAZYLEN(special_prizes)) // Downstream wanted the 'win things inside contents sans circuitboard' feature kept. + var/atom/movable/AM = pick_n_take(special_prizes) + AM.forceMove(get_turf(src)) + special_prizes -= AM + + else if(LAZYLEN(prizes)) var/prizeselect = pickweight(prizes) new prizeselect(src.loc) if(istype(prizeselect, /obj/item/clothing/suit/syndicatefake)) //Helmet is part of the suit new /obj/item/clothing/head/syndicatefake(src.loc) - else - var/atom/movable/prize = pick(contents-circuit) - prize.loc = src.loc - /obj/machinery/computer/arcade/attack_ai(mob/user as mob) return attack_hand(user) diff --git a/code/game/machinery/computer/atmos_alert.dm b/code/game/machinery/computer/atmos_alert.dm index 304c254837..24a7d21a5f 100644 --- a/code/game/machinery/computer/atmos_alert.dm +++ b/code/game/machinery/computer/atmos_alert.dm @@ -14,7 +14,7 @@ var/global/list/minor_air_alarms = list() /obj/machinery/computer/atmos_alert/New() ..() - atmosphere_alarm.register_alarm(src, /obj/machinery/computer/station_alert/update_icon) + atmosphere_alarm.register_alarm(src, /atom/proc/update_icon) /obj/machinery/computer/atmos_alert/Destroy() atmosphere_alarm.unregister_alarm(src) diff --git a/code/game/machinery/computer/message.dm b/code/game/machinery/computer/message.dm index 430b42591c..87b35e8cd0 100644 --- a/code/game/machinery/computer/message.dm +++ b/code/game/machinery/computer/message.dm @@ -98,18 +98,19 @@ data["linkedServer"]["active"] = linkedServer.active data["linkedServer"]["broke"] = linkedServer.stat & (NOPOWER|BROKEN) - data["linkedServer"]["pda_msgs"] = list() + var/list/pda_msgs = list() for(var/datum/data_pda_msg/pda in linkedServer.pda_msgs) - data["linkedServer"]["pda_msgs"].Add(list(list( + pda_msgs.Add(list(list( "ref" = "\ref[pda]", "sender" = pda.sender, "recipient" = pda.recipient, "message" = pda.message, ))) + data["linkedServer"]["pda_msgs"] = pda_msgs - data["linkedServer"]["rc_msgs"] = list() + var/list/rc_msgs = list() for(var/datum/data_rc_msg/rc in linkedServer.rc_msgs) - data["linkedServer"]["rc_msgs"].Add(list(list( + rc_msgs.Add(list(list( "ref" = "\ref[rc]", "sender" = rc.send_dpt, "recipient" = rc.rec_dpt, @@ -118,15 +119,17 @@ "id_auth" = rc.id_auth, "priority" = rc.priority, ))) - + data["linkedServer"]["rc_msgs"] = rc_msgs + var/spamIndex = 0 - data["linkedServer"]["spamFilter"] = list() + var/list/spamfilter = list() for(var/token in linkedServer.spamfilter) spamIndex++ - data["linkedServer"]["spamFilter"].Add(list(list( + spamfilter.Add(list(list( "index" = spamIndex, "token" = token, ))) + data["linkedServer"]["spamFilter"] = spamfilter //Get out list of viable PDAs var/list/obj/item/device/pda/sendPDAs = list() diff --git a/code/game/machinery/computer/prisoner.dm b/code/game/machinery/computer/prisoner.dm index c26d2c5365..fa0a2ebce0 100644 --- a/code/game/machinery/computer/prisoner.dm +++ b/code/game/machinery/computer/prisoner.dm @@ -30,11 +30,8 @@ ui.open() /obj/machinery/computer/prisoner/tgui_data(mob/user) - var/list/data = list() - - data["locked"] = !screen - data["chemImplants"] = list() - data["trackImplants"] = list() + var/list/chemImplants = list() + var/list/trackImplants = list() if(screen) for(var/obj/item/weapon/implant/chem/C in all_chem_implants) var/turf/T = get_turf(C) @@ -42,7 +39,7 @@ continue if(!C.implanted) continue - data["chemImplants"].Add(list(list( + chemImplants.Add(list(list( "host" = C.imp_in, "units" = C.reagents.total_volume, "ref" = "\ref[C]" @@ -59,14 +56,14 @@ loc_display = T.loc if(track.malfunction) loc_display = pick(teleportlocs) - data["trackImplants"].Add(list(list( + trackImplants.Add(list(list( "host" = L, "ref" = "\ref[track]", "id" = "[track.id]", "loc" = "[loc_display]", ))) - return data + return list("locked" = !screen, "chemImplants" = chemImplants, "trackImplants" = trackImplants) /obj/machinery/computer/prisoner/tgui_act(action, list/params) diff --git a/code/game/machinery/computer/station_alert.dm b/code/game/machinery/computer/station_alert.dm index 5cb000484d..051a8e368b 100644 --- a/code/game/machinery/computer/station_alert.dm +++ b/code/game/machinery/computer/station_alert.dm @@ -19,7 +19,7 @@ /obj/machinery/computer/station_alert/Initialize() alarm_monitor = new monitor_type(src) - alarm_monitor.register_alarm(src, /obj/machinery/computer/station_alert/update_icon) + alarm_monitor.register_alarm(src, /atom/proc/update_icon) . = ..() /obj/machinery/computer/station_alert/Destroy() diff --git a/code/game/machinery/computer/syndicate_specops_shuttle.dm b/code/game/machinery/computer/syndicate_specops_shuttle.dm index dcf32f9caa..c6ede9ac37 100644 --- a/code/game/machinery/computer/syndicate_specops_shuttle.dm +++ b/code/game/machinery/computer/syndicate_specops_shuttle.dm @@ -1,257 +1,6 @@ -//Config stuff -#define SYNDICATE_ELITE_MOVETIME 600 //Time to station is milliseconds. 60 seconds, enough time for everyone to be on the shuttle before it leaves. -#define SYNDICATE_ELITE_STATION_AREATYPE "/area/shuttle/syndicate_elite/station" //Type of the spec ops shuttle area for station -#define SYNDICATE_ELITE_DOCK_AREATYPE "/area/shuttle/syndicate_elite/mothership" //Type of the spec ops shuttle area for dock - -var/syndicate_elite_shuttle_moving_to_station = 0 -var/syndicate_elite_shuttle_moving_to_mothership = 0 -var/syndicate_elite_shuttle_at_station = 0 -var/syndicate_elite_shuttle_can_send = 1 -var/syndicate_elite_shuttle_time = 0 -var/syndicate_elite_shuttle_timeleft = 0 - /obj/machinery/computer/syndicate_elite_shuttle name = "elite syndicate squad shuttle control console" icon_keyboard = "syndie_key" icon_screen = "syndishuttle" light_color = "#00ffff" - req_access = list(access_cent_specops) - var/temp = null - var/hacked = 0 - var/allowedtocall = 0 - -/proc/syndicate_elite_process() - var/area/syndicate_mothership/control/syndicate_ship = locate()//To find announcer. This area should exist for this proc to work. - var/area/syndicate_mothership/elite_squad/elite_squad = locate()//Where is the specops area located? - var/mob/living/silicon/decoy/announcer = locate() in syndicate_ship//We need a fake AI to announce some stuff below. Otherwise it will be wonky. - - var/message_tracker[] = list(0,1,2,3,5,10,30,45)//Create a a list with potential time values. - var/message = "THE SYNDICATE ELITE SHUTTLE IS PREPARING FOR LAUNCH"//Initial message shown. - if(announcer) - announcer.say(message) - // message = "ARMORED SQUAD TAKE YOUR POSITION ON GRAVITY LAUNCH PAD" - // announcer.say(message) - - while(syndicate_elite_shuttle_time - world.timeofday > 0) - var/ticksleft = syndicate_elite_shuttle_time - world.timeofday - - if(ticksleft > 1e5) - syndicate_elite_shuttle_time = world.timeofday // midnight rollover - syndicate_elite_shuttle_timeleft = (ticksleft / 10) - - //All this does is announce the time before launch. - if(announcer) - var/rounded_time_left = round(syndicate_elite_shuttle_timeleft)//Round time so that it will report only once, not in fractions. - if(rounded_time_left in message_tracker)//If that time is in the list for message announce. - message = "ALERT: [rounded_time_left] SECOND[(rounded_time_left!=1)?"S":""] REMAIN" - if(rounded_time_left==0) - message = "ALERT: TAKEOFF" - announcer.say(message) - message_tracker -= rounded_time_left//Remove the number from the list so it won't be called again next cycle. - //Should call all the numbers but lag could mean some issues. Oh well. Not much I can do about that. - - sleep(5) - - syndicate_elite_shuttle_moving_to_station = 0 - syndicate_elite_shuttle_moving_to_mothership = 0 - - syndicate_elite_shuttle_at_station = 1 - if (syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return - - if (!syndicate_elite_can_move()) - to_chat(usr, "The Syndicate Elite shuttle is unable to leave.") - return - - sleep(600) -/* - //Begin Marauder launchpad. - spawn(0)//So it parallel processes it. - for(var/obj/machinery/door/poddoor/M in elite_squad) - switch(M.id) - if("ASSAULT0") - spawn(10)//1 second delay between each. - M.open() - if("ASSAULT1") - spawn(20) - M.open() - if("ASSAULT2") - spawn(30) - M.open() - if("ASSAULT3") - spawn(40) - M.open() - - sleep(10) - - var/spawn_marauder[] = new() - for(var/obj/effect/landmark/L in landmarks_list) - if(L.name == "Marauder Entry") - spawn_marauder.Add(L) - for(var/obj/effect/landmark/L in landmarks_list) - if(L.name == "Marauder Exit") - var/obj/effect/portal/P = new(L.loc) - P.invisibility = 101//So it is not seen by anyone. - P.failchance = 0//So it has no fail chance when teleporting. - P.target = pick(spawn_marauder)//Where the marauder will arrive. - spawn_marauder.Remove(P.target) - - sleep(10) - - for(var/obj/machinery/mass_driver/M in elite_squad) - switch(M.id) - if("ASSAULT0") - spawn(10) - M.drive() - if("ASSAULT1") - spawn(20) - M.drive() - if("ASSAULT2") - spawn(30) - M.drive() - if("ASSAULT3") - spawn(40) - M.drive() - - sleep(50)//Doors remain open for 5 seconds. - - for(var/obj/machinery/door/poddoor/M in elite_squad) - switch(M.id)//Doors close at the same time. - if("ASSAULT0") - spawn(0) - M.close() - if("ASSAULT1") - spawn(0) - M.close() - if("ASSAULT2") - spawn(0) - M.close() - if("ASSAULT3") - spawn(0) - M.close() - */ - elite_squad.readyreset()//Reset firealarm after the team launched. - //End Marauder launchpad. -/* - var/obj/explosionmarker = locate("Syndicate Breach Area") - if(explosionmarker) - var/turf/simulated/T = explosionmarker.loc - if(T) - explosion(T,4,6,8,10,0) - - sleep(40) -// proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1) - -*/ - var/area/start_location = locate(/area/shuttle/syndicate_elite/mothership) - var/area/end_location = locate(/area/shuttle/syndicate_elite/station) - - 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) - - 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() - - start_location.move_contents_to(end_location) - - for(var/turf/T in get_area_turfs(end_location) ) - var/mob/M = locate(/mob) in T - to_chat(M, "You have arrived to [station_name()]. Commence operation!") - -/proc/syndicate_elite_can_move() - if(syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return 0 - else return 1 - -/obj/machinery/computer/syndicate_elite_shuttle/attackby(I as obj, user as mob) - return attack_hand(user) - -/obj/machinery/computer/syndicate_elite_shuttle/attack_ai(var/mob/user as mob) - return attack_hand(user) - -/obj/machinery/computer/syndicate_elite_shuttle/emag_act(var/remaining_charges, var/mob/user) - to_chat(user, "The electronic systems in this console are far too advanced for your primitive hacking peripherals.") - -/obj/machinery/computer/syndicate_elite_shuttle/attack_hand(var/mob/user as mob) - if(!allowed(user)) - to_chat(user, "Access Denied.") - return - -// if (sent_syndicate_strike_team == 0) -// to_chat(usr, "The strike team has not yet deployed.") -// return - - if(..()) - return - - user.set_machine(src) - var/dat - if (temp) - dat = temp - else - dat = {"
Special Operations Shuttle
- \nLocation: [syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership ? "Departing for [station_name()] in ([syndicate_elite_shuttle_timeleft] seconds.)":syndicate_elite_shuttle_at_station ? "Station":"Dock"]
- [syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership ? "\n*The Syndicate Elite shuttle is already leaving.*
\n
":syndicate_elite_shuttle_at_station ? "\nShuttle Offline
\n
":"\nDepart to [station_name()]
\n
"] - \nClose"} - - user << browse(dat, "window=computer;size=575x450") - onclose(user, "computer") - return - -/obj/machinery/computer/syndicate_elite_shuttle/Topic(href, href_list) - if(..()) - return 1 - - if ((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon))) - usr.set_machine(src) - - if (href_list["sendtodock"]) - if(!syndicate_elite_shuttle_at_station|| syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return - - to_chat(usr, "The Syndicate will not allow the Elite Squad shuttle to return.") - return - - else if (href_list["sendtostation"]) - if(syndicate_elite_shuttle_at_station || syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return - - if (!specops_can_move()) - to_chat(usr, "The Syndicate Elite shuttle is unable to leave.") - return - - to_chat(usr, "The Syndicate Elite shuttle will arrive on [station_name()] in [(SYNDICATE_ELITE_MOVETIME/10)] seconds.") - - temp = "Shuttle departing.

OK" - updateUsrDialog() - - var/area/syndicate_mothership/elite_squad/elite_squad = locate() - if(elite_squad) - elite_squad.readyalert()//Trigger alarm for the spec ops area. - syndicate_elite_shuttle_moving_to_station = 1 - - syndicate_elite_shuttle_time = world.timeofday + SYNDICATE_ELITE_MOVETIME - spawn(0) - syndicate_elite_process() - - - else if (href_list["mainmenu"]) - temp = null - - add_fingerprint(usr) - updateUsrDialog() - return + req_access = list(access_cent_specops) \ No newline at end of file diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 49a16849ea..fc03dcb8d2 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -272,7 +272,8 @@ return if(repairing && I.is_crowbar()) - var/obj/item/stack/material/repairing_sheet = get_material().place_sheet(loc) + var/datum/material/mat = get_material() + var/obj/item/stack/material/repairing_sheet = mat.place_sheet(loc) repairing_sheet.amount += repairing-1 repairing = 0 to_chat(user, "You remove \the [repairing_sheet].") diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm index cbd688b643..d8b4a23994 100644 --- a/code/game/machinery/flasher.dm +++ b/code/game/machinery/flasher.dm @@ -114,12 +114,12 @@ if(!anchored) user.show_message(text("[src] can now be moved.")) cut_overlays() - unsense_proximity(callback = .HasProximity) + unsense_proximity(callback = /atom/proc/HasProximity) else if(anchored) user.show_message(text("[src] is now secured.")) add_overlay("[base_state]-s") - sense_proximity(callback = .HasProximity) + sense_proximity(callback = /atom/proc/HasProximity) /obj/machinery/button/flasher name = "flasher button" diff --git a/code/game/machinery/magnet.dm b/code/game/machinery/magnet.dm index 26a7936e1c..d702a300b5 100644 --- a/code/game/machinery/magnet.dm +++ b/code/game/machinery/magnet.dm @@ -298,7 +298,7 @@ // Broadcast the signal - radio_connection.post_signal(src, signal, filter = RADIO_MAGNETS) + radio_connection.post_signal(src, signal, radio_filter = RADIO_MAGNETS) spawn(1) updateUsrDialog() // pretty sure this increases responsiveness @@ -365,7 +365,7 @@ // Broadcast the signal spawn() - radio_connection.post_signal(src, signal, filter = RADIO_MAGNETS) + radio_connection.post_signal(src, signal, radio_filter = RADIO_MAGNETS) if(speed == 10) sleep(1) diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm index af506f4fe9..df9547692e 100644 --- a/code/game/machinery/newscaster.dm +++ b/code/game/machinery/newscaster.dm @@ -234,7 +234,6 @@ GLOBAL_LIST_BOILERPLATE(allCasters, /obj/machinery/newscaster) isbroken=1 update_icon() return - return /obj/machinery/newscaster/attack_ai(mob/user) return attack_hand(user) diff --git a/code/game/machinery/pointdefense.dm b/code/game/machinery/pointdefense.dm index 4c3ac8ded3..c4781353c7 100644 --- a/code/game/machinery/pointdefense.dm +++ b/code/game/machinery/pointdefense.dm @@ -77,8 +77,13 @@ GLOBAL_LIST_BOILERPLATE(pointdefense_turrets, /obj/machinery/power/pointdefense) if(id_tag) var/list/connected_z_levels = GetConnectedZlevels(get_z(src)) for(var/i = 1 to LAZYLEN(pointdefense_turrets)) +<<<<<<< HEAD var/obj/machinery/power/pointdefense/PD = pointdefense_turrets[i] if(!(PD.id_tag == id_tag && get_z(PD) in connected_z_levels)) +======= + var/obj/machinery/pointdefense/PD = pointdefense_turrets[i] + if(!(PD.id_tag == id_tag && (get_z(PD) in connected_z_levels))) +>>>>>>> fdabe51... Linter Introduction + Cleanup (#8085) continue var/list/turret = list() turret["id"] = "#[i]" diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm index 27e54fd643..416b8544be 100644 --- a/code/game/machinery/suit_storage_unit.dm +++ b/code/game/machinery/suit_storage_unit.dm @@ -73,15 +73,10 @@ if(prob(50)) dump_everything() //So suits dont survive all the time qdel(src) - return if(2.0) if(prob(50)) dump_everything() qdel(src) - return - else - return - return /obj/machinery/suit_storage_unit/attack_hand(mob/user) if(..()) diff --git a/code/game/machinery/telecomms/logbrowser.dm b/code/game/machinery/telecomms/logbrowser.dm index b5dd077efa..c896b77f37 100644 --- a/code/game/machinery/telecomms/logbrowser.dm +++ b/code/game/machinery/telecomms/logbrowser.dm @@ -26,21 +26,22 @@ data["network"] = network data["temp"] = temp - data["servers"] = list() + var/list/servers = list() for(var/obj/machinery/telecomms/T in servers) - data["servers"].Add(list(list( + servers.Add(list(list( "id" = T.id, "name" = T.name, ))) + data["servers"] = servers data["selectedServer"] = null if(SelectedServer) data["selectedServer"] = list( "id" = SelectedServer.id, "totalTraffic" = SelectedServer.totaltraffic, - "logs" = list() ) + var/list/logs = list() var/i = 0 for(var/c in SelectedServer.log_entries) i++ @@ -52,13 +53,15 @@ for(var/log_param in acceptable_params) parameters["[log_param]"] = C.parameters["[log_param]"] - data["selectedServer"]["logs"].Add(list(list( + logs.Add(list(list( "name" = C.name, "input_type" = C.input_type, "id" = i, "parameters" = parameters, ))) + data["selectedServer"]["logs"] = logs + return data /obj/machinery/computer/telecomms/server/attack_hand(mob/user) diff --git a/code/game/machinery/telecomms/machine_interactions.dm b/code/game/machinery/telecomms/machine_interactions.dm index 7a14fa2023..b355d92260 100644 --- a/code/game/machinery/telecomms/machine_interactions.dm +++ b/code/game/machinery/telecomms/machine_interactions.dm @@ -71,23 +71,25 @@ data["multitool_buffer"] = list("name" = "[P.buffer]", "id" = "[P.buffer.id]") var/i = 0 - data["linked"] = list() + var/list/linked = list() for(var/obj/machinery/telecomms/T in links) i++ - data["linked"].Add(list(list( + linked.Add(list(list( "ref" = "\ref[T]", "name" = "[T]", "id" = T.id, "index" = i, ))) + data["linked"] = linked - data["filter"] = list() + var/list/filter = list() if(LAZYLEN(freq_listening)) for(var/x in freq_listening) - data["filter"].Add(list(list( + filter.Add(list(list( "name" = "[format_frequency(x)]", "freq" = x, ))) + data["filter"] = filter return data diff --git a/code/game/machinery/telecomms/telecomunications.dm b/code/game/machinery/telecomms/telecomunications.dm index 6f2e626a00..fb4c92ab7b 100644 --- a/code/game/machinery/telecomms/telecomunications.dm +++ b/code/game/machinery/telecomms/telecomunications.dm @@ -100,7 +100,7 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list() /obj/machinery/telecomms/proc/receive_information(datum/signal/signal, obj/machinery/telecomms/machine_from) // receive information from linked machinery - ..() + return /obj/machinery/telecomms/proc/is_freq_listening(datum/signal/signal) // return 1 if found, 0 if not found diff --git a/code/game/machinery/telecomms/telemonitor.dm b/code/game/machinery/telecomms/telemonitor.dm index 7107e0ff5d..5a79f08be0 100644 --- a/code/game/machinery/telecomms/telemonitor.dm +++ b/code/game/machinery/telecomms/telemonitor.dm @@ -26,28 +26,28 @@ data["network"] = network data["temp"] = temp - data["machinelist"] = list() + var/list/machinelist = list() for(var/obj/machinery/telecomms/T in machinelist) - data["machinelist"].Add(list(list( + machinelist.Add(list(list( "id" = T.id, "name" = T.name, ))) + data["machinelist"] = machinelist data["selectedMachine"] = null if(SelectedMachine) data["selectedMachine"] = list( "id" = SelectedMachine.id, "name" = SelectedMachine.name, - "links" = list(), ) - + var/list/links = list() for(var/obj/machinery/telecomms/T in SelectedMachine.links) if(!T.hide) - data["selectedMachine"]["links"].Add(list(list( + links.Add(list(list( "id" = T.id, "name" = T.name ))) - + data["selectedMachine"]["links"] = links return data /obj/machinery/computer/telecomms/monitor/attack_hand(mob/user) diff --git a/code/game/machinery/telecomms/traffic_control.dm b/code/game/machinery/telecomms/traffic_control.dm index 51c09d95e3..7bd16315e4 100644 --- a/code/game/machinery/telecomms/traffic_control.dm +++ b/code/game/machinery/telecomms/traffic_control.dm @@ -54,7 +54,7 @@ for(var/mob/M in viewingcode) - if( (M.machine == src && M in view(1, src) ) || issilicon(M)) + if( (M.machine == src && (M in view(1, src)) ) || issilicon(M)) winset(M, "tcscode", "is-disabled=true") winset(M, "tcscode", "text=\"[showcode]\"") else diff --git a/code/game/machinery/virtual_reality/vr_console.dm b/code/game/machinery/virtual_reality/vr_console.dm index 75236c3cd2..42179442f0 100644 --- a/code/game/machinery/virtual_reality/vr_console.dm +++ b/code/game/machinery/virtual_reality/vr_console.dm @@ -108,7 +108,7 @@ var/obj/item/organ/O = occupant.internal_organs_by_name[O_BRAIN] O.take_damage(severity * 2) visible_message("\The [src]'s internal lighting flashes rapidly, before the hatch swings open with a cloud of smoke.") - smoke.set_up(n = severity, 0, src) + smoke.set_up(severity, 0, src) smoke.start("#202020") go_out() diff --git a/code/game/mecha/equipment/tools/orescanner.dm b/code/game/mecha/equipment/tools/orescanner.dm index 91027bd264..1c19da06a8 100644 --- a/code/game/mecha/equipment/tools/orescanner.dm +++ b/code/game/mecha/equipment/tools/orescanner.dm @@ -28,7 +28,7 @@ if(!enable_special) target = get_turf(chassis) - var/datum/beam/ScanBeam = chassis.Beam(target,"g_beam",'icons/effects/beam.dmi',time=2 SECONDS,10,/obj/effect/ebeam,2) + var/datum/beam/ScanBeam = chassis.Beam(target, "g_beam", 'icons/effects/beam.dmi', 2 SECONDS, 10, /obj/effect/ebeam, 2) if(do_after(chassis.occupant, 2 SECONDS)) my_scanner.ScanTurf(target, chassis.occupant, exact_scan) diff --git a/code/game/mecha/equipment/tools/shield.dm b/code/game/mecha/equipment/tools/shield.dm index 0a50869e88..497d670313 100644 --- a/code/game/mecha/equipment/tools/shield.dm +++ b/code/game/mecha/equipment/tools/shield.dm @@ -67,7 +67,6 @@ return /obj/item/mecha_parts/mecha_equipment/combat_shield/proc/toggle_shield() - ..() if(chassis) my_shield.attack_self(chassis.occupant) if(my_shield.active) diff --git a/code/game/mecha/equipment/tools/shield_omni.dm b/code/game/mecha/equipment/tools/shield_omni.dm index ca61a138e4..595c860d57 100644 --- a/code/game/mecha/equipment/tools/shield_omni.dm +++ b/code/game/mecha/equipment/tools/shield_omni.dm @@ -39,7 +39,6 @@ shields.update_shield_positions() /obj/item/mecha_parts/mecha_equipment/omni_shield/proc/toggle_shield() - ..() if(shields) shields.set_on(!shields.active) if(shields.active) diff --git a/code/game/mecha/equipment/tools/syringe_gun.dm b/code/game/mecha/equipment/tools/syringe_gun.dm index fd73d74fc2..e12345844b 100644 --- a/code/game/mecha/equipment/tools/syringe_gun.dm +++ b/code/game/mecha/equipment/tools/syringe_gun.dm @@ -461,7 +461,6 @@ E.status &= ~ORGAN_BROKEN /obj/item/mecha_parts/mecha_equipment/crisis_drone/proc/toggle_drone() - ..() if(chassis) enabled = !enabled if(enabled) diff --git a/code/game/mecha/equipment/weapons/weapons.dm b/code/game/mecha/equipment/weapons/weapons.dm index 0482af9937..ecb971dff1 100644 --- a/code/game/mecha/equipment/weapons/weapons.dm +++ b/code/game/mecha/equipment/weapons/weapons.dm @@ -43,7 +43,7 @@ var/turf/aimloc = targloc if(deviation) aimloc = locate(targloc.x+GaussRandRound(deviation,1),targloc.y+GaussRandRound(deviation,1),targloc.z) - if(!aimloc || aimloc == curloc || (locs && aimloc in locs)) + if(!aimloc || aimloc == curloc || (locs && (aimloc in locs))) break playsound(src, fire_sound, fire_volume, 1) projectiles-- diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 525a65ffc8..080891672e 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -1569,7 +1569,7 @@ return 0 /obj/mecha/proc/mmi_moved_inside(var/obj/item/device/mmi/mmi_as_oc as obj,mob/user as mob) - if(mmi_as_oc && user in range(1)) + if(mmi_as_oc && (user in range(1))) if(!mmi_as_oc.brainmob || !mmi_as_oc.brainmob.client) to_chat(user, "Consciousness matrix not detected.") return 0 @@ -1886,7 +1886,7 @@ return /obj/mecha/proc/moved_inside(var/mob/living/carbon/human/H as mob) - if(H && H.client && H in range(1)) + if(H && H.client && (H in range(1))) H.reset_view(src) /* H.client.perspective = EYE_PERSPECTIVE @@ -2514,7 +2514,7 @@ var/mob/occupant = P.occupant user.visible_message("\The [user] begins opening the hatch on \the [P]...", "You begin opening the hatch on \the [P]...") - if (!do_after(user, 40, needhand=0)) + if (!do_after(user, 40)) return user.visible_message("\The [user] opens the hatch on \the [P] and removes [occupant]!", "You open the hatch on \the [P] and remove [occupant]!") @@ -2564,7 +2564,7 @@ src.log_message("Recalibration of coordination system failed with 1 error.",1) if(href_list["drop_from_cargo"]) var/obj/O = locate(href_list["drop_from_cargo"]) - if(O && O in src.cargo) + if(O && (O in src.cargo)) src.occupant_message("You unload [O].") O.forceMove(get_turf(src)) src.cargo -= O @@ -2632,7 +2632,6 @@ AI.icon_state = "ai-crash" src.occupant = cur_occupant */ - return /////////////////////// ///// Power stuff ///// diff --git a/code/game/objects/explosion.dm b/code/game/objects/explosion.dm index 438bb1188d..ac09fc6570 100644 --- a/code/game/objects/explosion.dm +++ b/code/game/objects/explosion.dm @@ -2,7 +2,6 @@ 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 - src = null //so we don't abort once src is deleted spawn(0) var/start = world.timeofday epicenter = get_turf(epicenter) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 42a4a8ce97..5e109aafc9 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -312,7 +312,6 @@ // apparently called whenever an item is removed from a slot, container, or anything else. /obj/item/proc/dropped(mob/user as mob) - ..() if(zoom) zoom() //binoculars, scope, etc appearance_flags &= ~NO_CLIENT_COLOR @@ -695,7 +694,7 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out. if((usr.stat && !zoom) || !(istype(usr,/mob/living/carbon/human))) to_chat(usr, "You are unable to focus through the [devicename]") cannotzoom = 1 - else if(!zoom && global_hud.darkMask[1] in usr.client.screen) + else if(!zoom && (global_hud.darkMask[1] in usr.client.screen)) to_chat(usr, "Your visor gets in the way of looking through the [devicename]") cannotzoom = 1 else if(!zoom && usr.get_active_hand() != src) diff --git a/code/game/objects/items/devices/gps.dm b/code/game/objects/items/devices/gps.dm index 7621f09830..5397359aed 100644 --- a/code/game/objects/items/devices/gps.dm +++ b/code/game/objects/items/devices/gps.dm @@ -193,9 +193,9 @@ var/list/GPS_list = list() dat["curr_y"] = curr.y dat["curr_z"] = curr.z dat["curr_z_name"] = strip_improper(using_map.get_zlevel_name(curr.z)) - dat["gps_list"] = list() dat["z_level_detection"] = using_map.get_map_levels(curr.z, long_range) + var/list/gps_list = list() for(var/obj/item/device/gps/G in GPS_list - src) if(!can_track(G, dat["z_level_detection"])) @@ -219,7 +219,9 @@ var/list/GPS_list = list() gps_data["x"] = T.x gps_data["y"] = T.y - dat["gps_list"][++dat["gps_list"].len] = gps_data + gps_list[++gps_list.len] = gps_data + + dat["gps_list"] = gps_list return dat @@ -241,7 +243,8 @@ var/list/GPS_list = list() dat += "[hide_signal ? "Tagged" : "Broadcasting"] as '[gps_tag]'." dat += "\[Change Tag\]\[Toggle Scan Range\][can_hide_signal ? "\[Toggle Signal Visibility\]":""]" - if(gps_data["gps_list"].len) + var/list/gps_list = gps_data["gps_list"] + if(gps_list.len) dat += "Detected signals" for(var/gps in gps_data["gps_list"]) dat += "" @@ -482,7 +485,8 @@ var/list/GPS_list = list() dat += "[hide_signal ? "Tagged" : "Broadcasting"] as '[gps_tag]'." dat += "\[Change Tag\]\[Toggle Scan Range\][can_hide_signal ? "\[Toggle Signal Visibility\]":""]" - if(gps_data["gps_list"].len) + var/list/gps_list = gps_data["gps_list"] + if(gps_list.len) dat += "Detected signals" for(var/gps in gps_data["gps_list"]) dat += "" diff --git a/code/game/objects/items/devices/radio/intercom.dm b/code/game/objects/items/devices/radio/intercom.dm index 0833d5744b..e1a912323a 100644 --- a/code/game/objects/items/devices/radio/intercom.dm +++ b/code/game/objects/items/devices/radio/intercom.dm @@ -16,12 +16,12 @@ . = ..() var/area/A = get_area(src) if(A) - GLOB.apc_event.register(A, src, /obj/update_icon) + GLOB.apc_event.register(A, src, /atom/proc/update_icon) /obj/item/device/radio/intercom/Destroy() var/area/A = get_area(src) if(A) - GLOB.apc_event.unregister(A, src, /obj/update_icon) + GLOB.apc_event.unregister(A, src, /atom/proc/update_icon) return ..() /obj/item/device/radio/intercom/custom diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 88e957f76e..1e149fa174 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -532,7 +532,7 @@ GLOBAL_DATUM(autospeaker, /mob/living/silicon/ai/announcer) for(var/obj/machinery/telecomms/receiver/R in telecomms_list) R.receive_signal(signal) - if(signal.data["done"] && pos_z in signal.data["level"]) + if(signal.data["done"] && (pos_z in signal.data["level"])) if(adhoc_fallback) to_chat(loc, "\The [src] pings as it reestablishes subspace communications.") subspace_transmission = TRUE diff --git a/code/game/objects/items/devices/suit_cooling.dm b/code/game/objects/items/devices/suit_cooling.dm index 390084f9fe..aae687a9cb 100644 --- a/code/game/objects/items/devices/suit_cooling.dm +++ b/code/game/objects/items/devices/suit_cooling.dm @@ -80,7 +80,8 @@ var/obj/mecha/M = H.loc return M.return_temperature() else if(istype(H.loc, /obj/machinery/atmospherics/unary/cryo_cell)) - return H.loc:air_contents.temperature + var/obj/machinery/atmospherics/unary/cryo_cell/cc = H.loc + return cc.air_contents.temperature var/turf/T = get_turf(src) if(istype(T, /turf/space)) diff --git a/code/game/objects/items/devices/transfer_valve.dm b/code/game/objects/items/devices/transfer_valve.dm index 73f7d27168..f72c3c4d24 100644 --- a/code/game/objects/items/devices/transfer_valve.dm +++ b/code/game/objects/items/devices/transfer_valve.dm @@ -62,9 +62,9 @@ /obj/item/device/transfer_valve/Moved(old_loc, direction, forced) . = ..() if(isturf(old_loc)) - unsense_proximity(callback = .HasProximity, center = old_loc) + unsense_proximity(callback = /atom/proc/HasProximity, center = old_loc) if(isturf(loc)) - sense_proximity(callback = .HasProximity) + sense_proximity(callback = /atom/proc/HasProximity) /obj/item/device/transfer_valve/attack_self(mob/user) tgui_interact(user) diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index f4b52f07aa..89dac4c308 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -248,7 +248,6 @@ var/datum/matter_synth/S = synths[i] S.use_charge(charge_costs[i] * used) // Doesn't need to be deleted return 1 - return 0 /obj/item/stack/proc/add(var/extra) if(!uses_charge) diff --git a/code/game/objects/items/uav.dm b/code/game/objects/items/uav.dm index ff9be37c5a..37dd6ec146 100644 --- a/code/game/objects/items/uav.dm +++ b/code/game/objects/items/uav.dm @@ -207,7 +207,7 @@ return FALSE /obj/item/device/uav/proc/toggle_packed() - if(UAV_ON) + if(state == UAV_ON) power_down() switch(state) if(UAV_OFF) //Packing diff --git a/code/game/objects/items/weapons/autopsy.dm b/code/game/objects/items/weapons/autopsy.dm index 352a3955a3..5f5a2c25a9 100644 --- a/code/game/objects/items/weapons/autopsy.dm +++ b/code/game/objects/items/weapons/autopsy.dm @@ -46,17 +46,7 @@ var/datum/autopsy_data/W = O.autopsy_data[V] if(!W.pretend_weapon) - /* - // the more hits, the more likely it is that we get the right weapon type - if(prob(50 + W.hits * 10 + W.damage)) - */ - - // Buffing this stuff up for now! - if(1) - W.pretend_weapon = W.weapon - else - W.pretend_weapon = pick("mechanical toolbox", "wirecutters", "revolver", "crowbar", "fire extinguisher", "tomato soup", "oxygen tank", "emergency oxygen tank", "laser", "bullet") - + W.pretend_weapon = W.weapon var/datum/autopsy_data_scanner/D = wdata[V] if(!D) diff --git a/code/game/objects/items/weapons/material/misc.dm b/code/game/objects/items/weapons/material/misc.dm index 7dbb927f85..301fff7600 100644 --- a/code/game/objects/items/weapons/material/misc.dm +++ b/code/game/objects/items/weapons/material/misc.dm @@ -142,11 +142,11 @@ if(user.a_intent) switch(user.a_intent) if(I_HURT) - if(prob(10) && istype(target, /mob/living/carbon/human) && user.zone_sel in list(BP_L_LEG, BP_R_LEG, BP_L_FOOT, BP_R_FOOT, BP_L_ARM, BP_R_ARM, BP_L_HAND, BP_R_HAND)) + if(prob(10) && istype(target, /mob/living/carbon/human) && (user.zone_sel in list(BP_L_LEG, BP_R_LEG, BP_L_FOOT, BP_R_FOOT, BP_L_ARM, BP_R_ARM, BP_L_HAND, BP_R_HAND))) to_chat(target, "\The [src] rips at your hands!") ranged_disarm(target) if(I_DISARM) - if(prob(min(90, force * 3)) && istype(target, /mob/living/carbon/human) && user.zone_sel in list(BP_L_LEG, BP_R_LEG, BP_L_FOOT, BP_R_FOOT, BP_L_ARM, BP_R_ARM, BP_L_HAND, BP_R_HAND)) + if(prob(min(90, force * 3)) && istype(target, /mob/living/carbon/human) && (user.zone_sel in list(BP_L_LEG, BP_R_LEG, BP_L_FOOT, BP_R_FOOT, BP_L_ARM, BP_R_ARM, BP_L_HAND, BP_R_HAND))) ranged_disarm(target) else target.visible_message("\The [src] sends \the [target] stumbling away.") @@ -175,7 +175,7 @@ visible_message("[H]'s [W] goes off due to \the [src]!") return W.afterattack(target,H) - if(!(H.species.flags & NO_SLIP) && prob(10) && user.zone_sel in list(BP_L_LEG, BP_R_LEG, BP_L_FOOT, BP_R_FOOT)) + if(!(H.species.flags & NO_SLIP) && prob(10) && (user.zone_sel in list(BP_L_LEG, BP_R_LEG, BP_L_FOOT, BP_R_FOOT))) var/armor_check = H.run_armor_check(user.zone_sel, "melee") H.apply_effect(3, WEAKEN, armor_check) playsound(src, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) diff --git a/code/game/objects/items/weapons/melee/misc.dm b/code/game/objects/items/weapons/melee/misc.dm index b7684d6a7f..781ea5a463 100644 --- a/code/game/objects/items/weapons/melee/misc.dm +++ b/code/game/objects/items/weapons/melee/misc.dm @@ -45,7 +45,6 @@ var/mob/living/carbon/human/H = src.loc H.update_inv_l_hand(0) H.update_inv_r_hand() - ..() // Randomizes color /obj/item/weapon/melee/umbrella/random/New() diff --git a/code/game/objects/items/weapons/storage/belt.dm b/code/game/objects/items/weapons/storage/belt.dm index 116d57fd2e..5412fab07c 100644 --- a/code/game/objects/items/weapons/storage/belt.dm +++ b/code/game/objects/items/weapons/storage/belt.dm @@ -26,7 +26,7 @@ update_icon() //Some belts have sprites to show icons -/obj/item/weapon/storage/belt/make_worn_icon(var/body_type,var/slot_name,var/inhands,var/default_icon,var/default_layer = 0) +/obj/item/weapon/storage/belt/make_worn_icon(var/body_type,var/slot_name,var/inhands,var/default_icon,var/default_layer = 0,var/icon/clip_mask = null) var/image/standing = ..() if(!inhands && contents.len) for(var/obj/item/i in contents) diff --git a/code/game/objects/items/weapons/storage/wallets.dm b/code/game/objects/items/weapons/storage/wallets.dm index 274ea23ab8..1a1458bbca 100644 --- a/code/game/objects/items/weapons/storage/wallets.dm +++ b/code/game/objects/items/weapons/storage/wallets.dm @@ -66,7 +66,7 @@ overlays.Cut() if(front_id) var/tiny_state = "id-generic" - if("id-"+front_id.icon_state in cached_icon_states(icon)) + if("id-[front_id.icon_state]" in cached_icon_states(icon)) tiny_state = "id-"+front_id.icon_state var/image/tiny_image = new/image(icon, icon_state = tiny_state) tiny_image.appearance_flags = RESET_COLOR diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index 806d26c90b..abe2db0d53 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -668,6 +668,6 @@ var/list/global/tank_gauge_cache = list() /obj/item/device/tankassemblyproxy/Moved(old_loc, direction, forced) if(isturf(old_loc)) - unsense_proximity(callback = .HasProximity, center = old_loc) + unsense_proximity(callback = /atom/proc/HasProximity, center = old_loc) if(isturf(loc)) - sense_proximity(callback = .HasProximity) + sense_proximity(callback = /atom/proc/HasProximity) diff --git a/code/game/objects/items/weapons/teleportation.dm b/code/game/objects/items/weapons/teleportation.dm index c219c89eb7..103c52295c 100644 --- a/code/game/objects/items/weapons/teleportation.dm +++ b/code/game/objects/items/weapons/teleportation.dm @@ -132,7 +132,7 @@ Frequency: /obj/item/weapon/hand_tele/attack_self(mob/user as mob) var/turf/current_location = get_turf(user)//What turf is the user on? - if(!current_location || current_location.z in using_map.admin_levels || current_location.block_tele)//If turf was not found or they're on z level 2 or >7 which does not currently exist. + if(!current_location || (current_location.z in using_map.admin_levels) || current_location.block_tele)//If turf was not found or they're on z level 2 or >7 which does not currently exist. to_chat(user, "\The [src] is malfunctioning.") return var/list/L = list( ) diff --git a/code/game/objects/structures/cliff.dm b/code/game/objects/structures/cliff.dm index 24dbb6d25e..7c7ce94e3e 100644 --- a/code/game/objects/structures/cliff.dm +++ b/code/game/objects/structures/cliff.dm @@ -130,7 +130,7 @@ two tiles on initialization, and which way a cliff is facing may change during m var/subtraction_icon_state = "[icon_state]-subtract" var/cache_string = "[icon_state]_[T.icon]_[T.icon_state]" - if(T && subtraction_icon_state in cached_icon_states(icon)) + if(T && (subtraction_icon_state in cached_icon_states(icon))) cut_overlays() // If we've made the same icon before, just recycle it. if(cache_string in GLOB.cliff_icon_cache) diff --git a/code/game/objects/structures/crates_lockers/__closets.dm b/code/game/objects/structures/crates_lockers/__closets.dm index 64c865604e..85e45314de 100644 --- a/code/game/objects/structures/crates_lockers/__closets.dm +++ b/code/game/objects/structures/crates_lockers/__closets.dm @@ -434,17 +434,17 @@ breakout = 0 return - playsound(src, breakout_sound, 100, 1) - animate_shake() - add_fingerprint(escapee) - - //Well then break it! - breakout = 0 - to_chat(escapee, "You successfully break out!") - visible_message("\The [escapee] successfully broke out of \the [src]!") playsound(src, breakout_sound, 100, 1) - break_open() animate_shake() + add_fingerprint(escapee) + + //Well then break it! + breakout = 0 + to_chat(escapee, "You successfully break out!") + visible_message("\The [escapee] successfully broke out of \the [src]!") + playsound(src, breakout_sound, 100, 1) + break_open() + animate_shake() /obj/structure/closet/proc/break_open() sealed = 0 diff --git a/code/game/objects/structures/flora/flora.dm b/code/game/objects/structures/flora/flora.dm index e97c7b84bb..9195de1767 100644 --- a/code/game/objects/structures/flora/flora.dm +++ b/code/game/objects/structures/flora/flora.dm @@ -254,8 +254,6 @@ to_chat(user, "You refrain from putting things into the plant pot.") return - ..() - /obj/structure/flora/pottedplant/attack_hand(mob/user) if(!stored_item) to_chat(user, "You see nothing of interest in [src]...") diff --git a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm index 7459fcab6c..3641d57fda 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm @@ -68,7 +68,7 @@ user.pulledby = null to_chat(user, "You lost your grip!") return - if(has_buckled_mobs() && pulling && user in buckled_mobs) + if(has_buckled_mobs() && pulling && (user in buckled_mobs)) if(pulling.stat || pulling.stunned || pulling.weakened || pulling.paralysis || pulling.lying || pulling.restrained()) pulling.pulledby = null pulling = null @@ -161,7 +161,7 @@ /obj/structure/bed/chair/wheelchair/CtrlClick(var/mob/user) if(in_range(src, user)) if(!ishuman(user)) return - if(has_buckled_mobs() && user in buckled_mobs) + if(has_buckled_mobs() && (user in buckled_mobs)) to_chat(user, "You realize you are unable to push the wheelchair you sit in.") return if(!pulling) diff --git a/code/game/objects/structures/transit_tubes.dm b/code/game/objects/structures/transit_tubes.dm index 32fa0724a4..ca1f311073 100644 --- a/code/game/objects/structures/transit_tubes.dm +++ b/code/game/objects/structures/transit_tubes.dm @@ -119,7 +119,7 @@ obj/structure/ex_act(severity) if(pod.contents.len) to_chat(AM, "The pod is already occupied.") return - else if(!pod.moving && pod.dir in directions()) + else if(!pod.moving && (pod.dir in directions())) AM.loc = pod return @@ -127,7 +127,7 @@ obj/structure/ex_act(severity) /obj/structure/transit_tube/station/attack_hand(mob/user as mob) if(!pod_moving) for(var/obj/structure/transit_tube_pod/pod in loc) - if(!pod.moving && pod.dir in directions()) + if(!pod.moving && (pod.dir in directions())) if(icon_state == "closed") open_animation() @@ -156,7 +156,7 @@ obj/structure/ex_act(severity) /obj/structure/transit_tube/station/proc/launch_pod() for(var/obj/structure/transit_tube_pod/pod in loc) - if(!pod.moving && pod.dir in directions()) + if(!pod.moving && (pod.dir in directions())) spawn(5) pod_moving = 1 close_animation() diff --git a/code/game/turfs/simulated/wall_attacks.dm b/code/game/turfs/simulated/wall_attacks.dm index 20267696f3..2268315f96 100644 --- a/code/game/turfs/simulated/wall_attacks.dm +++ b/code/game/turfs/simulated/wall_attacks.dm @@ -90,8 +90,6 @@ dismantle_wall() return 1 - if(..()) return 1 - if(!can_open) if(!material.wall_touch_special(src, user)) to_chat(user, "You push the wall, but nothing happens.") diff --git a/code/game/world.dm b/code/game/world.dm index 95d6ff18d7..1dd4db46b2 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -227,7 +227,7 @@ var/world_topic_spam_protect_time = world.timeofday spawn(50) world_topic_spam_protect_time = world.time - return "Bad Key (Throttled)" + return world_topic_spam_protect_time = world.time world_topic_spam_protect_ip = addr @@ -314,7 +314,7 @@ var/world_topic_spam_protect_time = world.timeofday spawn(50) world_topic_spam_protect_time = world.time - return "Bad Key (Throttled)" + return world_topic_spam_protect_time = world.time world_topic_spam_protect_ip = addr @@ -364,7 +364,7 @@ var/world_topic_spam_protect_time = world.timeofday spawn(50) world_topic_spam_protect_time = world.time - return "Bad Key (Throttled)" + return world_topic_spam_protect_time = world.time world_topic_spam_protect_ip = addr @@ -378,7 +378,7 @@ var/world_topic_spam_protect_time = world.timeofday if(world_topic_spam_protect_ip == addr && abs(world_topic_spam_protect_time - world.time) < 50) spawn(50) world_topic_spam_protect_time = world.time - return "Bad Key (Throttled)" + return world_topic_spam_protect_time = world.time world_topic_spam_protect_ip = addr diff --git a/code/modules/admin/ToRban.dm b/code/modules/admin/ToRban.dm index dbf373b3ff..aa5cc8c888 100644 --- a/code/modules/admin/ToRban.dm +++ b/code/modules/admin/ToRban.dm @@ -39,9 +39,9 @@ log_misc("ToR data updated!") if(usr) to_chat(usr, "ToRban updated.") - return 1 + return log_misc("ToR data update aborted: no data.") - return 0 + return /client/proc/ToRban(task in list("update","toggle","show","remove","remove all","find")) set name = "ToRban" diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index b70af8354d..ec2c78662a 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -1392,15 +1392,15 @@ var/datum/announcement/minor/admin_min_announcer = new if(2) //Admins var/ref_mob = "\ref[M]" - return "[key_name(C, link, name, highlight_special)](?) (PP) (VV) (SM) ([admin_jump_link(M, src)]) (CA) (TAKE)" + return "[key_name(C, link, name, highlight_special)](?) (PP) (VV) (SM) ([admin_jump_link(M)]) (CA) (TAKE)" if(3) //Devs var/ref_mob = "\ref[M]" - return "[key_name(C, link, name, highlight_special)](VV)([admin_jump_link(M, src)]) (TAKE)" + return "[key_name(C, link, name, highlight_special)](VV)([admin_jump_link(M)]) (TAKE)" if(4) //Event Managers var/ref_mob = "\ref[M]" - return "[key_name(C, link, name, highlight_special)] (?) (PP) (VV) (SM) ([admin_jump_link(M, src)]) (TAKE)" + return "[key_name(C, link, name, highlight_special)] (?) (PP) (VV) (SM) ([admin_jump_link(M)]) (TAKE)" /proc/ishost(whom) diff --git a/code/modules/admin/admin_memo.dm b/code/modules/admin/admin_memo.dm index fc38dda9d5..56306ef3e7 100644 --- a/code/modules/admin/admin_memo.dm +++ b/code/modules/admin/admin_memo.dm @@ -1,11 +1,13 @@ #define MEMOFILE "data/memo.sav" //where the memos are saved -#define ENABLE_MEMOS 1 //using a define because screw making a config variable for it. This is more efficient and purty. +#define ENABLE_MEMOS // this is so stupid //switch verb so we don't spam up the verb lists with like, 3 verbs for this feature. /client/proc/admin_memo(task in list("write","show","delete")) set name = "Memo" set category = "Server" - if(!ENABLE_MEMOS) return + #ifndef ENABLE_MEMOS + return + #endif if(!check_rights(0)) return switch(task) if("write") admin_memo_write() @@ -31,11 +33,13 @@ //show all memos /client/proc/admin_memo_show() - if(ENABLE_MEMOS) - var/savefile/F = new(MEMOFILE) - if(F) - for(var/ckey in F.dir) - to_chat(src, "
Admin Memo by [F[ckey]]
") + #ifndef ENABLE_MEMOS + return + #endif + var/savefile/F = new(MEMOFILE) + if(F) + for(var/ckey in F.dir) + to_chat(src, "
Admin Memo by [F[ckey]]
") //delete your own or somebody else's memo /client/proc/admin_memo_delete() diff --git a/code/modules/admin/secrets/admin_secrets/prison_warp.dm b/code/modules/admin/secrets/admin_secrets/prison_warp.dm index 6f0732e781..b4ac06fcc8 100644 --- a/code/modules/admin/secrets/admin_secrets/prison_warp.dm +++ b/code/modules/admin/secrets/admin_secrets/prison_warp.dm @@ -12,7 +12,7 @@ for(var/mob/living/carbon/human/H in mob_list) var/turf/T = get_turf(H) var/security = 0 - if((T && T in using_map.admin_levels) || prisonwarped.Find(H)) + if((T in using_map.admin_levels) || prisonwarped.Find(H)) //don't warp them if they aren't ready or are already there continue H.Paralyse(5) diff --git a/code/modules/admin/verbs/SDQL2/SDQL_2.dm b/code/modules/admin/verbs/SDQL2/SDQL_2.dm index 58f568cfa7..0d9bceb996 100644 --- a/code/modules/admin/verbs/SDQL2/SDQL_2.dm +++ b/code/modules/admin/verbs/SDQL2/SDQL_2.dm @@ -634,14 +634,14 @@ GLOBAL_DATUM_INIT(sdql2_vv_statobj, /obj/effect/statclick/SDQL2_VV_all, new(null if(!is_proper_datum(i)) continue world.SDQL_var(i, query_tree["call"][1], null, i, superuser, src) - obj_count_finished++ + obj_count_finished += 1 SDQL2_TICK_CHECK SDQL2_HALT_CHECK if("delete") for(var/datum/d in found) SDQL_qdel_datum(d) - obj_count_finished++ + obj_count_finished += 1 SDQL2_TICK_CHECK SDQL2_HALT_CHECK @@ -663,7 +663,7 @@ GLOBAL_DATUM_INIT(sdql2_vv_statobj, /obj/effect/statclick/SDQL2_VV_all, new(null if(!is_proper_datum(d)) continue SDQL_internal_vv(d, set_list) - obj_count_finished++ + obj_count_finished += 1 SDQL2_TICK_CHECK SDQL2_HALT_CHECK if(islist(obj_count_finished)) diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm index 706e5a4274..0e86bec3cd 100644 --- a/code/modules/admin/verbs/adminpm.dm +++ b/code/modules/admin/verbs/adminpm.dm @@ -264,7 +264,7 @@ admin_ticket_log(C, "PM From [irc_tagged]: [msg]") - window_flash(C, ignorepref = TRUE) + window_flash(C) //always play non-admin recipients the adminhelp sound C << 'sound/effects/adminhelp.ogg' diff --git a/code/modules/admin/verbs/diagnostics.dm b/code/modules/admin/verbs/diagnostics.dm index d96fdae6bd..6e034fea7c 100644 --- a/code/modules/admin/verbs/diagnostics.dm +++ b/code/modules/admin/verbs/diagnostics.dm @@ -17,7 +17,7 @@ var/inactive_on_main_station = 0 for(var/zone/zone in air_master.zones) var/turf/simulated/turf = locate() in zone.contents - if(turf && turf.z in using_map.station_levels) + if(turf?.z in using_map.station_levels) if(zone.needs_update) active_on_main_station++ else @@ -79,7 +79,7 @@ var/output = "Radio Report
" for (var/fq in radio_controller.frequencies) output += "Freq: [fq]
" - var/list/datum/radio_frequency/fqs = radio_controller.frequencies[fq] + var/datum/radio_frequency/fqs = radio_controller.frequencies[fq] if (!fqs) output += "  ERROR
" continue diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index aa2b10365c..e317da1d40 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -43,8 +43,6 @@ GLOBAL_LIST_BOILERPLATE(all_debugging_effects, /obj/effect/debugging) set category = "Mapping" set name = "-None of these are for ingame use!!" - ..() - /client/proc/camera_view() set category = "Mapping" set name = "Camera Range Display" @@ -96,7 +94,7 @@ GLOBAL_LIST_BOILERPLATE(all_debugging_effects, /obj/effect/debugging) if(!(locate(/obj/structure/grille,T))) var/window_check = 0 for(var/obj/structure/window/W in T) - if (W.dir == turn(C1.dir,180) || W.dir in list(5,6,9,10) ) + if (W.dir == turn(C1.dir,180) || (W.dir in list(5,6,9,10)) ) window_check = 1 break if(!window_check) diff --git a/code/modules/admin/verbs/pray.dm b/code/modules/admin/verbs/pray.dm index a7a8993694..e1a4cefd15 100644 --- a/code/modules/admin/verbs/pray.dm +++ b/code/modules/admin/verbs/pray.dm @@ -30,15 +30,25 @@ //log_admin("HELP: [key_name(src)]: [msg]") /proc/CentCom_announce(var/msg, var/mob/Sender, var/iamessage) +<<<<<<< HEAD msg = "[uppertext(using_map.boss_short)]M[iamessage ? " IA" : ""]:[key_name(Sender, 1)] (PP) (VV) (SM) ([admin_jump_link(Sender, src)]) (CA) (BSA) (RPLY): [msg]" for(var/client/C in GLOB.admins) +======= + msg = "[uppertext(using_map.boss_short)]M[iamessage ? " IA" : ""]:[key_name(Sender, 1)] (PP) (VV) (SM) ([admin_jump_link(Sender)]) (CA) (BSA) (RPLY): [msg]" + for(var/client/C in admins) +>>>>>>> fdabe51... Linter Introduction + Cleanup (#8085) if(R_ADMIN|R_EVENT & C.holder.rights) to_chat(C,msg) C << 'sound/machines/signal.ogg' /proc/Syndicate_announce(var/msg, var/mob/Sender) +<<<<<<< HEAD msg = "ILLEGAL:[key_name(Sender, 1)] (PP) (VV) (SM) ([admin_jump_link(Sender, src)]) (CA) (BSA) (RPLY): [msg]" for(var/client/C in GLOB.admins) +======= + msg = "ILLEGAL:[key_name(Sender, 1)] (PP) (VV) (SM) ([admin_jump_link(Sender)]) (CA) (BSA) (RPLY): [msg]" + for(var/client/C in admins) +>>>>>>> fdabe51... Linter Introduction + Cleanup (#8085) if(R_ADMIN|R_EVENT & C.holder.rights) to_chat(C,msg) C << 'sound/machines/signal.ogg' \ No newline at end of file diff --git a/code/modules/admin/view_variables/modify_variables.dm b/code/modules/admin/view_variables/modify_variables.dm index 9a999e1a75..593773999d 100644 --- a/code/modules/admin/view_variables/modify_variables.dm +++ b/code/modules/admin/view_variables/modify_variables.dm @@ -297,7 +297,7 @@ GLOBAL_PROTECT(VVpixelmovement) var/var_value if(param_var_name) - if(!param_var_name in O.vars) + if(!(param_var_name in O.vars)) to_chat(src, "A variable with this name ([param_var_name]) doesn't exist in this datum ([O])") return variable = param_var_name diff --git a/code/modules/ai/ai_holder_targeting.dm b/code/modules/ai/ai_holder_targeting.dm index 3647c53cc5..22572bd134 100644 --- a/code/modules/ai/ai_holder_targeting.dm +++ b/code/modules/ai/ai_holder_targeting.dm @@ -60,7 +60,7 @@ return var/chosen_target - if(preferred_target && preferred_target in targets) + if(preferred_target && (preferred_target in targets)) chosen_target = preferred_target else chosen_target = pick(targets) diff --git a/code/modules/assembly/holder.dm b/code/modules/assembly/holder.dm index 824eb85b0a..0f9a9b2f50 100644 --- a/code/modules/assembly/holder.dm +++ b/code/modules/assembly/holder.dm @@ -66,9 +66,9 @@ /obj/item/device/assembly_holder/Moved(atom/old_loc, direction, forced = FALSE) . = ..() if(isturf(old_loc)) - unsense_proximity(callback = .HasProximity, center = old_loc) + unsense_proximity(callback = /atom/proc/HasProximity, center = old_loc) if(isturf(loc)) - sense_proximity(callback = .HasProximity) + sense_proximity(callback = /atom/proc/HasProximity) /obj/item/device/assembly_holder/HasProximity(turf/T, atom/movable/AM, old_loc) if(a_left) diff --git a/code/modules/assembly/proximity.dm b/code/modules/assembly/proximity.dm index de764c5011..3fc49c5067 100644 --- a/code/modules/assembly/proximity.dm +++ b/code/modules/assembly/proximity.dm @@ -90,9 +90,9 @@ /obj/item/device/assembly/prox_sensor/Moved(atom/old_loc, direction, forced = FALSE) . = ..() if(isturf(old_loc)) - unsense_proximity(range = range, callback = .HasProximity, center = old_loc) + unsense_proximity(range = range, callback = /atom/proc/HasProximity, center = old_loc) if(isturf(loc)) - sense_proximity(range = range, callback = .HasProximity) + sense_proximity(range = range, callback = /atom/proc/HasProximity) sense() /obj/item/device/assembly/prox_sensor/tgui_interact(mob/user, datum/tgui/ui) diff --git a/code/modules/client/preference_setup/preference_setup.dm b/code/modules/client/preference_setup/preference_setup.dm index f607b9945f..f4440117c4 100644 --- a/code/modules/client/preference_setup/preference_setup.dm +++ b/code/modules/client/preference_setup/preference_setup.dm @@ -101,7 +101,7 @@ if(href_list["category"]) var/category = locate(href_list["category"]) - if(category && category in categories) + if(category && (category in categories)) selected_category = category . = 1 diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index de9bb813a7..d0cb86230b 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -936,7 +936,7 @@ 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((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 @@ -961,7 +961,7 @@ 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((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 @@ -1025,7 +1025,6 @@ set category = "Object" set src in usr set_sensors(usr) - ..() /obj/item/clothing/under/verb/rollsuit() set name = "Roll Down Jumpsuit" diff --git a/code/modules/clothing/clothing_icons.dm b/code/modules/clothing/clothing_icons.dm index 2d4f00c665..2adfbfa0b9 100644 --- a/code/modules/clothing/clothing_icons.dm +++ b/code/modules/clothing/clothing_icons.dm @@ -17,7 +17,7 @@ return state2use //HELMET: May have a lighting overlay -/obj/item/clothing/head/make_worn_icon(var/body_type,var/slot_name,var/inhands,var/default_icon,var/default_layer = 0) +/obj/item/clothing/head/make_worn_icon(var/body_type,var/slot_name,var/inhands,var/default_icon,var/default_layer = 0,var/icon/clip_mask = null) var/image/standing = ..() if(on && slot_name == slot_head_str) var/cache_key = "[light_overlay][LAZYACCESS(sprite_sheets,body_type) ? "_[body_type]" : ""]" diff --git a/code/modules/clothing/spacesuits/rig/modules/specific/ai_container.dm b/code/modules/clothing/spacesuits/rig/modules/specific/ai_container.dm index 4f7dfef043..adbf514caf 100644 --- a/code/modules/clothing/spacesuits/rig/modules/specific/ai_container.dm +++ b/code/modules/clothing/spacesuits/rig/modules/specific/ai_container.dm @@ -35,7 +35,7 @@ interface_desc = "A socket that supports a range of artificial intelligence systems." var/mob/integrated_ai // Direct reference to the actual mob held in the suit. - var/obj/item/ai_card // Reference to the MMI, posibrain, intellicard or pAI card previously holding the AI. + var/obj/item/device/aicard/ai_card // Reference to the MMI, posibrain, intellicard or pAI card previously holding the AI. var/obj/item/ai_verbs/verb_holder /obj/item/rig_module/ai_container/process() @@ -132,11 +132,18 @@ var/mob/living/carbon/human/H = holder.wearer if(!target) +<<<<<<< HEAD if(ai_card) if(istype(ai_card,/obj/item/device/aicard)) ai_card.tgui_interact(H, custom_state = GLOB.tgui_deep_inventory_state) else eject_ai(H) +======= + if(istype(ai_card)) + ai_card.tgui_interact(H, custom_state = deep_inventory_state) + else + eject_ai(H) +>>>>>>> fdabe51... Linter Introduction + Cleanup (#8085) update_verb_holder() return 1 diff --git a/code/modules/clothing/under/accessories/accessory.dm b/code/modules/clothing/under/accessories/accessory.dm index e576016aa7..7dd36c06b6 100644 --- a/code/modules/clothing/under/accessories/accessory.dm +++ b/code/modules/clothing/under/accessories/accessory.dm @@ -39,7 +39,7 @@ /obj/item/clothing/accessory/proc/get_mob_overlay() if(!istype(loc,/obj/item/clothing/)) //don't need special handling if it's worn as normal item. - return ..() + return var/tmp_icon_state = "[overlay_state? "[overlay_state]" : "[icon_state]"]" if(ishuman(has_suit.loc)) wearer = has_suit.loc diff --git a/code/modules/detectivework/microscope/microscope.dm b/code/modules/detectivework/microscope/microscope.dm index d04d362087..5b556f4c00 100644 --- a/code/modules/detectivework/microscope/microscope.dm +++ b/code/modules/detectivework/microscope/microscope.dm @@ -87,7 +87,7 @@ /obj/machinery/microscope/proc/remove_sample(var/mob/living/remover) if(!istype(remover) || remover.incapacitated() || !Adjacent(remover)) - return ..() + return if(!sample) to_chat(remover, "\The [src] does not have a sample in it.") return diff --git a/code/modules/economy/Accounts_DB.dm b/code/modules/economy/Accounts_DB.dm index 68f71184e9..2b3133c2c1 100644 --- a/code/modules/economy/Accounts_DB.dm +++ b/code/modules/economy/Accounts_DB.dm @@ -19,7 +19,7 @@ return 0 if(access_cent_captain in held_card.access) return 2 - else if(access_hop in held_card.access || access_captain in held_card.access) + else if((access_hop in held_card.access) || (access_captain in held_card.access)) return 1 /obj/machinery/account_database/proc/create_transation(target, reason, amount) diff --git a/code/modules/economy/EFTPOS.dm b/code/modules/economy/EFTPOS.dm index 986ec2766e..f526dcf7ce 100644 --- a/code/modules/economy/EFTPOS.dm +++ b/code/modules/economy/EFTPOS.dm @@ -207,7 +207,7 @@ var/obj/item/I = usr.get_active_hand() if (istype(I, /obj/item/weapon/card)) var/obj/item/weapon/card/id/C = I - if(access_cent_captain in C.access || access_hop in C.access || access_captain in C.access) + if((access_cent_captain in C.access) || (access_hop in C.access) || (access_captain in C.access)) access_code = 0 to_chat(usr, "[bicon(src)]Access code reset to 0.") else if (istype(I, /obj/item/weapon/card/emag)) @@ -285,7 +285,5 @@ playsound(src, 'sound/machines/chime.ogg', 50, 1) src.visible_message("[bicon(src)] \The [src] chimes.") transaction_paid = 1 - else - ..() //emag? diff --git a/code/modules/events/spider_infestation.dm b/code/modules/events/spider_infestation.dm index 6d0be161c5..7e7c82a18d 100644 --- a/code/modules/events/spider_infestation.dm +++ b/code/modules/events/spider_infestation.dm @@ -17,7 +17,7 @@ /datum/event/spider_infestation/start() var/list/vents = list() for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in machines) - if(!temp_vent.welded && temp_vent.network && temp_vent.loc.z in using_map.station_levels) + if(!temp_vent.welded && temp_vent.network && (temp_vent.loc.z in using_map.station_levels)) if(temp_vent.network.normal_members.len > 50) vents += temp_vent diff --git a/code/modules/flufftext/Dreaming.dm b/code/modules/flufftext/Dreaming.dm index 0ed003be7d..da620aca6f 100644 --- a/code/modules/flufftext/Dreaming.dm +++ b/code/modules/flufftext/Dreaming.dm @@ -31,9 +31,9 @@ mob/living/carbon/proc/dream() sleep(rand(40,70)) if(paralysis <= 0) dreaming = 0 - return 0 + return dreaming = 0 - return 1 + return mob/living/carbon/proc/handle_dreams() if(client && !dreaming && prob(5)) diff --git a/code/modules/food/food/thecake.dm b/code/modules/food/food/thecake.dm index 491e6dca9c..3387699962 100644 --- a/code/modules/food/food/thecake.dm +++ b/code/modules/food/food/thecake.dm @@ -160,7 +160,6 @@ layer_stage = 8 /obj/structure/chaoscake/proc/HasSliceMissing() - ..() if(slices < maxslices) if(interval >= regentime) interval = 0 diff --git a/code/modules/food/kitchen/cooking_machines/candy.dm b/code/modules/food/kitchen/cooking_machines/candy.dm index 93b88bef8e..92806dc9a4 100644 --- a/code/modules/food/kitchen/cooking_machines/candy.dm +++ b/code/modules/food/kitchen/cooking_machines/candy.dm @@ -39,6 +39,6 @@ if(candymaker_loop) candymaker_loop.stop(src) -/obj/machinery/appliance/mixer/candy/change_product_appearance(var/obj/item/weapon/reagent_containers/food/snacks/cooked/product) +/obj/machinery/appliance/mixer/candy/change_product_appearance(var/obj/item/weapon/reagent_containers/food/snacks/product) food_color = get_random_colour(1) . = ..() diff --git a/code/modules/gamemaster/event2/events/security/spider_infestation.dm b/code/modules/gamemaster/event2/events/security/spider_infestation.dm index 23dc61c673..244db93dd3 100644 --- a/code/modules/gamemaster/event2/events/security/spider_infestation.dm +++ b/code/modules/gamemaster/event2/events/security/spider_infestation.dm @@ -37,7 +37,7 @@ /datum/event2/event/spider_infestation/start() var/list/vents = list() for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in machines) - if(!temp_vent.welded && temp_vent.network && temp_vent.loc.z in get_location_z_levels()) + if(!temp_vent.welded && temp_vent.network && (temp_vent.loc.z in get_location_z_levels())) if(temp_vent.network.normal_members.len > 50) vents += temp_vent diff --git a/code/modules/holomap/station_holomap.dm b/code/modules/holomap/station_holomap.dm index f414f4f5f7..dc15dabb46 100644 --- a/code/modules/holomap/station_holomap.dm +++ b/code/modules/holomap/station_holomap.dm @@ -48,7 +48,6 @@ . = ..() /obj/machinery/station_map/proc/setup_holomap() - . = ..() bogus = FALSE var/turf/T = get_turf(src) original_zLevel = T.z diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm index 8a05b792f3..96b4385a08 100644 --- a/code/modules/hydroponics/grown.dm +++ b/code/modules/hydroponics/grown.dm @@ -233,7 +233,7 @@ to_chat(user, "You slice up \the [src].") var/slices = rand(3,5) var/reagents_to_transfer = round(reagents.total_volume/slices) - for(var/i=i;i<=slices;i++) + for(var/i=1; i<=slices; i++) var/obj/item/weapon/reagent_containers/food/snacks/fruit_slice/F = new(get_turf(src),seed) if(reagents_to_transfer) reagents.trans_to_obj(F,reagents_to_transfer) qdel(src) diff --git a/code/modules/hydroponics/seed.dm b/code/modules/hydroponics/seed.dm index f97b0ce43a..67e6dbeecb 100644 --- a/code/modules/hydroponics/seed.dm +++ b/code/modules/hydroponics/seed.dm @@ -1,6 +1,6 @@ /datum/plantgene var/genetype // Label used when applying trait. - var/list/values // Values to copy into the target seed datum. + var/list/list/values // Values to copy into the target seed datum. /datum/seed //Tracking. diff --git a/code/modules/hydroponics/spreading/spreading.dm b/code/modules/hydroponics/spreading/spreading.dm index 8d28c85da6..ca99d733a5 100644 --- a/code/modules/hydroponics/spreading/spreading.dm +++ b/code/modules/hydroponics/spreading/spreading.dm @@ -74,8 +74,13 @@ /obj/effect/plant/Destroy() neighbors.Cut() if(seed.get_trait(TRAIT_SPREAD)==2) +<<<<<<< HEAD unsense_proximity(callback = .HasProximity, center = get_turf(src)) SSplants.remove_plant(src) +======= + unsense_proximity(callback = /atom/proc/HasProximity, center = get_turf(src)) + plant_controller.remove_plant(src) +>>>>>>> fdabe51... Linter Introduction + Cleanup (#8085) for(var/obj/effect/plant/neighbor in range(1,src)) SSplants.add_plant(neighbor) return ..() @@ -108,7 +113,7 @@ name = seed.display_name max_health = round(seed.get_trait(TRAIT_ENDURANCE)/2) if(seed.get_trait(TRAIT_SPREAD)==2) - sense_proximity(callback = .HasProximity) // Grabby + sense_proximity(callback = /atom/proc/HasProximity) // Grabby max_growth = VINE_GROWTH_STAGES growth_threshold = max_health/VINE_GROWTH_STAGES icon = 'icons/obj/hydroponics_vines.dmi' diff --git a/code/modules/hydroponics/spreading/spreading_response.dm b/code/modules/hydroponics/spreading/spreading_response.dm index 58f4b4da08..b448357187 100644 --- a/code/modules/hydroponics/spreading/spreading_response.dm +++ b/code/modules/hydroponics/spreading/spreading_response.dm @@ -17,9 +17,9 @@ . = ..() if(seed.get_trait(TRAIT_SPREAD)==2) if(isturf(old_loc)) - unsense_proximity(callback = .HasProximity, center = old_loc) + unsense_proximity(callback = /atom/proc/HasProximity, center = old_loc) if(isturf(loc)) - sense_proximity(callback = .HasProximity) + sense_proximity(callback = /atom/proc/HasProximity) /obj/effect/plant/attack_hand(var/mob/user) manual_unbuckle(user) diff --git a/code/modules/integrated_electronics/core/special_pins/dir_pin.dm b/code/modules/integrated_electronics/core/special_pins/dir_pin.dm index bbb00faa27..1c803db510 100644 --- a/code/modules/integrated_electronics/core/special_pins/dir_pin.dm +++ b/code/modules/integrated_electronics/core/special_pins/dir_pin.dm @@ -20,7 +20,7 @@ write_data_to_pin(new_data) /datum/integrated_io/dir/write_data_to_pin(var/new_data) - if(isnull(new_data) || new_data in alldirs + list(UP, DOWN)) + if(isnull(new_data) || (new_data in alldirs + list(UP, DOWN))) data = new_data holder.on_data_written() diff --git a/code/modules/integrated_electronics/subtypes/reagents.dm b/code/modules/integrated_electronics/subtypes/reagents.dm index f0e92e9e7a..ff8bb0f16b 100644 --- a/code/modules/integrated_electronics/subtypes/reagents.dm +++ b/code/modules/integrated_electronics/subtypes/reagents.dm @@ -148,7 +148,6 @@ else activate_pin(3) return - return var/datum/reagent/B if(istype(T, /mob/living/carbon/human)) var/mob/living/carbon/human/H = T diff --git a/code/modules/maps/tg/map_template.dm b/code/modules/maps/tg/map_template.dm index 019dff407a..8cc742c508 100644 --- a/code/modules/maps/tg/map_template.dm +++ b/code/modules/maps/tg/map_template.dm @@ -217,7 +217,7 @@ continue // Did we already place down a very similar submap? - if(chosen_template.template_group && chosen_template.template_group in template_groups_used) + if(chosen_template.template_group && (chosen_template.template_group in template_groups_used)) priority_submaps -= chosen_template potential_submaps -= chosen_template continue diff --git a/code/modules/maps/tg/reader.dm b/code/modules/maps/tg/reader.dm index b7bf3561f5..aa0bd51b89 100644 --- a/code/modules/maps/tg/reader.dm +++ b/code/modules/maps/tg/reader.dm @@ -144,7 +144,7 @@ GLOBAL_DATUM_INIT(_preloader, /dmm_suite/preloader, new) var/maxx = xcrdStart // Assemble the grid of keys - var/list/key_list = list() + var/list/list/key_list = list() for(var/line in gridLines) var/list/line_keys = list() xcrd = 1 @@ -170,7 +170,7 @@ GLOBAL_DATUM_INIT(_preloader, /dmm_suite/preloader, new) if(orientation != 0) var/num_cols = key_list[1].len var/num_rows = key_list.len - var/list/new_key_list = list() + var/list/list/new_key_list = list() // If it's rotated 180 degrees, the dimensions are the same if(orientation == 180) new_key_list.len = num_rows diff --git a/code/modules/materials/materials/_materials.dm b/code/modules/materials/materials/_materials.dm index 1b6cabffd9..4ff29932b0 100644 --- a/code/modules/materials/materials/_materials.dm +++ b/code/modules/materials/materials/_materials.dm @@ -188,7 +188,7 @@ var/list/name_to_material if(islist(composite_material)) for(var/material_string in composite_material) temp_matter[material_string] = composite_material[material_string] - else if(SHEET_MATERIAL_AMOUNT) + else temp_matter[name] = SHEET_MATERIAL_AMOUNT return temp_matter diff --git a/code/modules/mining/machinery/machine_processing.dm b/code/modules/mining/machinery/machine_processing.dm index b176e9ef61..c87edbeda9 100644 --- a/code/modules/mining/machinery/machine_processing.dm +++ b/code/modules/mining/machinery/machine_processing.dm @@ -158,8 +158,8 @@ var/obj/machinery/mineral/output = null var/obj/machinery/mineral/console = null var/sheets_per_tick = 10 - var/list/ores_processing[0] - var/list/ores_stored[0] + var/list/ores_processing = list() + var/list/ores_stored = list() var/active = FALSE var/points = 0 @@ -329,3 +329,4 @@ #undef PROCESS_SMELT #undef PROCESS_COMPRESS #undef PROCESS_ALLOY + diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index be16a38b9a..237a7e4395 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -1,3 +1,4 @@ +<<<<<<< HEAD /mob/observer name = "observer" desc = "This shouldn't appear" @@ -964,3 +965,917 @@ mob/observer/dead/MayRespawn(var/feedback = 0) set name = "Respawn" set category = "Ghost" src.abandon_mob() +======= +/mob/observer + name = "observer" + desc = "This shouldn't appear" + density = 0 + +/mob/observer/dead + name = "ghost" + desc = "It's a g-g-g-g-ghooooost!" //jinkies! + icon = 'icons/mob/ghost.dmi' + icon_state = "ghost" + stat = DEAD + canmove = 0 + blinded = 0 + anchored = 1 // don't get pushed around + + var/can_reenter_corpse + var/datum/hud/living/carbon/hud = null // hud + var/bootime = 0 + var/started_as_observer //This variable is set to 1 when you enter the game as an observer. + //If you died in the game and are a ghsot - this will remain as null. + //Note that this is not a reliable way to determine if admins started as observers, since they change mobs a lot. + var/has_enabled_antagHUD = 0 + var/medHUD = 0 + var/secHUD = 0 + var/antagHUD = 0 + universal_speak = 1 + var/atom/movable/following = null + var/admin_ghosted = 0 + var/anonsay = 0 + var/ghostvision = 1 //is the ghost able to see things humans can't? + incorporeal_move = 1 + + var/is_manifest = 0 //If set to 1, the ghost is able to whisper. Usually only set if a cultist drags them through the veil. + var/ghost_sprite = null + var/global/list/possible_ghost_sprites = list( + "Clear" = "blank", + "Green Blob" = "otherthing", + "Bland" = "ghost", + "Robed-B" = "ghost1", + "Robed-BAlt" = "ghost2", + "King" = "ghostking", + "Shade" = "shade", + "Hecate" = "ghost-narsie", + "Glowing Statue" = "armour", + "Artificer" = "artificer", + "Behemoth" = "behemoth", + "Harvester" = "harvester", + "Wraith" = "wraith", + "Viscerator" = "viscerator", + "Corgi" = "corgi", + "Tamaskan" = "tamaskan", + "Black Cat" = "blackcat", + "Lizard" = "lizard", + "Goat" = "goat", + "Space Bear" = "bear", + "Bats" = "bat", + "Chicken" = "chicken_white", + "Parrot"= "parrot_fly", + "Goose" = "goose", + "Penguin" = "penguin", + "Brown Crab" = "crab", + "Gray Crab" = "evilcrab", + "Trout" = "trout-swim", + "Salmon" = "salmon-swim", + "Pike" = "pike-swim", + "Koi" = "koi-swim", + "Carp" = "carp", + "Red Robes" = "robe_red", + "Faithless" = "faithless", + "Shadowform" = "forgotten", + "Dark Ethereal" = "bloodguardian", + "Holy Ethereal" = "lightguardian", + "Red Elemental" = "magicRed", + "Blue Elemental" = "magicBlue", + "Pink Elemental" = "magicPink", + "Orange Elemental" = "magicOrange", + "Green Elemental" = "magicGreen", + "Daemon" = "daemon", + "Guard Spider" = "guard", + "Hunter Spider" = "hunter", + "Nurse Spider" = "nurse", + "Rogue Drone" = "drone", + "ED-209" = "ed209", + "Beepsky" = "secbot" + ) + var/last_revive_notification = null // world.time of last notification, used to avoid spamming players from defibs or cloners. + var/cleanup_timer // Refernece to a timer that will delete this mob if no client returns + +/mob/observer/dead/New(mob/body) + + appearance = body + invisibility = INVISIBILITY_OBSERVER + layer = BELOW_MOB_LAYER + plane = PLANE_GHOSTS + alpha = 127 + + sight |= SEE_TURFS | SEE_MOBS | SEE_OBJS | SEE_SELF + see_invisible = SEE_INVISIBLE_OBSERVER + see_in_dark = world.view //I mean. I don't even know if byond has occlusion culling... but... + verbs += /mob/observer/dead/proc/dead_tele + + var/turf/T + if(ismob(body)) + T = get_turf(body) //Where is the body located? + attack_log = body.attack_log //preserve our attack logs by copying them to our ghost + gender = body.gender + if(body.mind && body.mind.name) + name = body.mind.name + else + if(body.real_name) + name = body.real_name + else + if(gender == MALE) + name = capitalize(pick(first_names_male)) + " " + capitalize(pick(last_names)) + else + name = capitalize(pick(first_names_female)) + " " + capitalize(pick(last_names)) + + mind = body.mind //we don't transfer the mind but we keep a reference to it. + + // Fix for naked ghosts. + // Unclear why this isn't being grabbed by appearance. + if(ishuman(body)) + var/mob/living/carbon/human/H = body + add_overlay(H.overlays_standing) + + if(!T) T = pick(latejoin) //Safety in case we cannot find the body's position + forceMove(T) + + if(!name) //To prevent nameless ghosts + name = capitalize(pick(first_names_male)) + " " + capitalize(pick(last_names)) + real_name = name + animate(src, pixel_y = 2, time = 10, loop = -1) + ..() + +/mob/observer/dead/Topic(href, href_list) + if (href_list["track"]) + var/mob/target = locate(href_list["track"]) in mob_list + if(target) + ManualFollow(target) + if(href_list["reenter"]) + reenter_corpse() + return + +/mob/observer/dead/attackby(obj/item/W, mob/user) + if(istype(W,/obj/item/weapon/book/tome)) + var/mob/observer/dead/M = src + M.manifest(user) + +/mob/observer/dead/CanPass(atom/movable/mover, turf/target) + return TRUE + +/mob/observer/dead/set_stat(var/new_stat) + if(new_stat != DEAD) + CRASH("It is best if observers stay dead, thank you.") + +/mob/observer/dead/examine_icon() + var/icon/I = get_cached_examine_icon(src) + if(!I) + I = getFlatIcon(src, defdir = SOUTH, no_anim = TRUE) + set_cached_examine_icon(src, I, 200 SECONDS) + return I + +/mob/observer/dead/examine(mob/user) + . = ..() + + if(is_admin(user)) + . += "\t>[ADMIN_FULLMONTY(src)]" + +/* +Transfer_mind is there to check if mob is being deleted/not going to have a body. +Works together with spawning an observer, noted above. +*/ + +/mob/observer/dead/Life() + ..() + if(!loc) return + if(!client) return 0 + + handle_regular_hud_updates() + handle_vision() + +/mob/proc/ghostize(var/can_reenter_corpse = 1) + if(key) + if(ishuman(src)) + var/mob/living/carbon/human/H = src + if(H.vr_holder && !can_reenter_corpse) + H.exit_vr() + return 0 + var/mob/observer/dead/ghost = new(src) //Transfer safety to observer spawning proc. + ghost.can_reenter_corpse = can_reenter_corpse + ghost.timeofdeath = src.timeofdeath //BS12 EDIT + ghost.key = key + if(istype(loc, /obj/structure/morgue)) + var/obj/structure/morgue/M = loc + M.update() + else if(istype(loc, /obj/structure/closet/body_bag)) + var/obj/structure/closet/body_bag/B = loc + B.update() + if(ghost.client) + ghost.client.time_died_as_mouse = ghost.timeofdeath + if(ghost.client && !ghost.client.holder && !config.antag_hud_allowed) // For new ghosts we remove the verb from even showing up if it's not allowed. + ghost.verbs -= /mob/observer/dead/verb/toggle_antagHUD // Poor guys, don't know what they are missing! + return ghost + +/* +This is the proc mobs get to turn into a ghost. Forked from ghostize due to compatibility issues. +*/ +/mob/living/verb/ghost() + set category = "OOC" + set name = "Ghost" + set desc = "Relinquish your life and enter the land of the dead." + + if(stat == DEAD && !forbid_seeing_deadchat) + announce_ghost_joinleave(ghostize(1)) + else + var/response + if(src.client && src.client.holder) + response = alert(src, "You have the ability to Admin-Ghost. The regular Ghost verb will announce your presence to dead chat. Both variants will allow you to return to your body using 'aghost'.\n\nWhat do you wish to do?", "Are you sure you want to ghost?", "Ghost", "Admin Ghost", "Stay in body") + if(response == "Admin Ghost") + if(!src.client) + return + src.client.admin_ghost() + else + response = alert(src, "Are you -sure- you want to ghost?\n(You are alive, or otherwise have the potential to become alive. If you ghost, you won't be able to play this round until you respawn as a new character! You can't change your mind so choose wisely!)", "Are you sure you want to ghost?", "Ghost", "Stay in body") + if(response != "Ghost") + return + resting = 1 + var/turf/location = get_turf(src) + var/special_role = check_special_role() + if(!istype(loc,/obj/machinery/cryopod)) + log_and_message_admins("has ghosted outside cryo[special_role ? " as [special_role]" : ""]. (JMP)",usr) + else if(special_role) + log_and_message_admins("has ghosted in cryo as [special_role]. (JMP)",usr) + var/mob/observer/dead/ghost = ghostize(0) // 0 parameter is so we can never re-enter our body, "Charlie, you can never come baaaack~" :3 + if(ghost) + ghost.timeofdeath = world.time // Because the living mob won't have a time of death and we want the respawn timer to work properly. + ghost.set_respawn_timer() + announce_ghost_joinleave(ghost) + +/mob/observer/dead/can_use_hands() return 0 +/mob/observer/dead/is_active() return 0 + +/mob/observer/dead/Stat() + ..() + if(statpanel("Status")) + if(emergency_shuttle) + var/eta_status = emergency_shuttle.get_status_panel_eta() + if(eta_status) + stat(null, eta_status) + +/mob/observer/dead/verb/reenter_corpse() + set category = "Ghost" + set name = "Re-enter Corpse" + if(!client) return + if(!(mind && mind.current && can_reenter_corpse)) + to_chat(src, "You have no body.") + return + if(mind.current.key && copytext(mind.current.key,1,2)!="@") //makes sure we don't accidentally kick any clients + to_chat(usr, "Another consciousness is in your body... it is resisting you.") + return + if(mind.current.ajourn && mind.current.stat != DEAD) //check if the corpse is astral-journeying (it's client ghosted using a cultist rune). + var/found_rune + for(var/obj/effect/rune/R in mind.current.loc) //whilst corpse is alive, we can only reenter the body if it's on the rune + if(R && R.word1 == cultwords["hell"] && R.word2 == cultwords["travel"] && R.word3 == cultwords["self"]) // Found an astral journey rune. + found_rune = 1 + break + if(!found_rune) + to_chat(usr, "The astral cord that ties your body and your spirit has been severed. You are likely to wander the realm beyond until your body is finally dead and thus reunited with you.") + return + mind.current.ajourn=0 + mind.current.key = key + mind.current.teleop = null + if(istype(mind.current.loc, /obj/structure/morgue)) + var/obj/structure/morgue/M = mind.current.loc + M.update(1) + else if(istype(mind.current.loc, /obj/structure/closet/body_bag)) + var/obj/structure/closet/body_bag/B = mind.current.loc + B.update(1) + if(!admin_ghosted) + announce_ghost_joinleave(mind, 0, "They now occupy their body again.") + return 1 + +/mob/observer/dead/verb/toggle_medHUD() + set category = "Ghost" + set name = "Toggle MedicHUD" + set desc = "Toggles Medical HUD allowing you to see how everyone is doing" + + medHUD = !medHUD + plane_holder.set_vis(VIS_CH_HEALTH, medHUD) + plane_holder.set_vis(VIS_CH_STATUS_OOC, medHUD) + to_chat(src, "Medical HUD [medHUD ? "Enabled" : "Disabled"]") + +/mob/observer/dead/verb/toggle_secHUD() + set category = "Ghost" + set name = "Toggle Security HUD" + set desc = "Toggles Security HUD allowing you to see people's displayed ID's job, wanted status, etc" + + secHUD = !secHUD + plane_holder.set_vis(VIS_CH_ID, secHUD) + plane_holder.set_vis(VIS_CH_WANTED, secHUD) + plane_holder.set_vis(VIS_CH_IMPTRACK, secHUD) + plane_holder.set_vis(VIS_CH_IMPLOYAL, secHUD) + plane_holder.set_vis(VIS_CH_IMPCHEM, secHUD) + to_chat(src, "Security HUD [secHUD ? "Enabled" : "Disabled"]") + +/mob/observer/dead/verb/toggle_antagHUD() + set category = "Ghost" + set name = "Toggle AntagHUD" + set desc = "Toggles AntagHUD allowing you to see who is the antagonist" + + if(!config.antag_hud_allowed && !client.holder) + to_chat(src, "Admins have disabled this for this round.") + return + if(jobban_isbanned(src, "AntagHUD")) + to_chat(src, "You have been banned from using this feature") + return + if(config.antag_hud_restricted && !has_enabled_antagHUD && !client.holder) + var/response = alert(src, "If you turn this on, you will not be able to take any part in the round.","Are you sure you want to turn this feature on?","Yes","No") + if(response == "No") return + can_reenter_corpse = FALSE + set_respawn_timer(-1) // Foreeeever + if(!has_enabled_antagHUD && !client.holder) + has_enabled_antagHUD = TRUE + + antagHUD = !antagHUD + plane_holder.set_vis(VIS_CH_SPECIAL, antagHUD) + to_chat(src, "AntagHUD [antagHUD ? "Enabled" : "Disabled"]") + +/mob/observer/dead/proc/dead_tele(var/area/A in return_sorted_areas()) + set category = "Ghost" + set name = "Teleport" + set desc = "Teleport to a location" + + if(!istype(usr, /mob/observer/dead)) + to_chat(usr, "Not when you're not dead!") + return + + if(!A) + A = input(usr, "Select an area:", "Ghost Teleport") as null|anything in return_sorted_areas() + if(!A) + return + + usr.forceMove(pick(get_area_turfs(A))) + usr.on_mob_jump() + +/mob/observer/dead/verb/follow(input in getmobs()) + set category = "Ghost" + set name = "Follow" // "Haunt" + set desc = "Follow and haunt a mob." + + if(!input) + input = input(usr, "Select a mob:", "Ghost Follow") as null|anything in getmobs() + if(!input) + return + + var/target = getmobs()[input] + if(!target) return + ManualFollow(target) + +// This is the ghost's follow verb with an argument +/mob/observer/dead/proc/ManualFollow(var/atom/movable/target) + if(!target) + return + + var/turf/targetloc = get_turf(target) + if(check_holy(targetloc)) + to_chat(usr, "You cannot follow a mob standing on holy grounds!") + return + if(target != src) + if(following && following == target) + return + following = target + to_chat(src, "Now following [target]") + if(ismob(target)) + forceMove(get_turf(target)) + var/mob/M = target + M.following_mobs += src + else + spawn(0) + while(target && following == target && client) + var/turf/T = get_turf(target) + if(!T) + break + // To stop the ghost flickering. + if(loc != T) + forceMove(T) + sleep(15) + + var/icon/I = icon(target.icon,target.icon_state,target.dir) + + var/orbitsize = (I.Width()+I.Height())*0.5 + orbitsize -= (orbitsize/world.icon_size)*(world.icon_size*0.25) + + var/rot_seg + + /* We don't have this pref yet + switch(ghost_orbit) + if(GHOST_ORBIT_TRIANGLE) + rot_seg = 3 + if(GHOST_ORBIT_SQUARE) + rot_seg = 4 + if(GHOST_ORBIT_PENTAGON) + rot_seg = 5 + if(GHOST_ORBIT_HEXAGON) + rot_seg = 6 + else //Circular + rot_seg = 36 //360/10 bby, smooth enough aproximation of a circle + */ + + orbit(target, orbitsize, FALSE, 20, rot_seg) + +/mob/observer/dead/orbit() + set_dir(2) //reset dir so the right directional sprites show up + return ..() + +/mob/observer/dead/stop_orbit() + . = ..() + //restart our floating animation after orbit is done. + pixel_y = 0 + pixel_x = 0 + transform = null + animate(src, pixel_y = 2, time = 10, loop = -1) + +/mob/observer/dead/proc/stop_following() + following = null + stop_orbit() + +/mob/proc/update_following() + . = get_turf(src) + for(var/mob/observer/dead/M in following_mobs) + if(M.following != src) + following_mobs -= M + else + if(M.loc != .) + M.forceMove(.) + +/mob + var/list/following_mobs = list() + +/mob/Destroy() + for(var/mob/observer/dead/M in following_mobs) + M.stop_following() + following_mobs = null + return ..() + +/mob/observer/dead/Destroy() + if(ismob(following)) + var/mob/M = following + M.following_mobs -= src + stop_following() + return ..() + +/mob/Moved(atom/old_loc, direction, forced = FALSE) + . = ..() + update_following() + +/mob/Life() + // to catch teleports etc which directly set loc + update_following() + return ..() + +/mob/proc/check_holy(var/turf/T) + return 0 + +/mob/observer/dead/check_holy(var/turf/T) + if(check_rights(R_ADMIN|R_FUN|R_EVENT, 0, src)) + return 0 + + return (T && T.holy) && (is_manifest || (mind in cult.current_antagonists)) + +/mob/observer/dead/verb/jumptomob(input in getmobs()) //Moves the ghost instead of just changing the ghosts's eye -Nodrak + set category = "Ghost" + set name = "Jump to Mob" + set desc = "Teleport to a mob" + set popup_menu = FALSE + + if(!istype(usr, /mob/observer/dead)) //Make sure they're an observer! + return + + if(!input) + input = input(usr, "Select a mob:", "Ghost Jump") as null|anything in getmobs() + if(!input) + return + + var/target = getmobs()[input] + if (!target)//Make sure we actually have a target + return + else + var/mob/M = target //Destination mob + var/turf/T = get_turf(M) //Turf of the destination mob + + if(T && isturf(T)) //Make sure the turf exists, then move the source to that destination. + forceMove(T) + stop_following() + else + to_chat(src, "This mob is not located in the game world.") + +/mob/observer/dead/memory() + set hidden = 1 + to_chat(src, "You are dead! You have no mind to store memory!") + +/mob/observer/dead/add_memory() + set hidden = 1 + to_chat(src, "You are dead! You have no mind to store memory!") + +/mob/observer/dead/Post_Incorpmove() + stop_following() + +/mob/observer/dead/verb/analyze_air() + set name = "Analyze Air" + set category = "Ghost" + + if(!istype(usr, /mob/observer/dead)) return + + // Shamelessly copied from the Gas Analyzers + if (!( istype(usr.loc, /turf) )) + return + + var/datum/gas_mixture/environment = usr.loc.return_air() + + var/pressure = environment.return_pressure() + var/total_moles = environment.total_moles + + to_chat(src, "Results:") + if(abs(pressure - ONE_ATMOSPHERE) < 10) + to_chat(src, "Pressure: [round(pressure,0.1)] kPa") + else + to_chat(src, "Pressure: [round(pressure,0.1)] kPa") + if(total_moles) + for(var/g in environment.gas) + to_chat(src, "[gas_data.name[g]]: [round((environment.gas[g] / total_moles) * 100)]% ([round(environment.gas[g], 0.01)] moles)") + to_chat(src, "Temperature: [round(environment.temperature-T0C,0.1)]°C ([round(environment.temperature,0.1)]K)") + to_chat(src, "Heat Capacity: [round(environment.heat_capacity(),0.1)]") + +/mob/observer/dead/verb/check_radiation() + set name = "Check Radiation" + set category = "Ghost" + + var/turf/t = get_turf(src) + if(t) + var/rads = SSradiation.get_rads_at_turf(t) + to_chat(src, "Radiation level: [rads ? rads : "0"] Bq.") + + +/mob/observer/dead/verb/become_mouse() + set name = "Become mouse" + set category = "Ghost" + + if(config.disable_player_mice) + to_chat(src, "Spawning as a mouse is currently disabled.") + return + + if(!MayRespawn(1)) + return + + var/turf/T = get_turf(src) + if(!T || (T.z in using_map.admin_levels)) + to_chat(src, "You may not spawn as a mouse on this Z-level.") + return + + var/timedifference = world.time - client.time_died_as_mouse + if(client.time_died_as_mouse && timedifference <= mouse_respawn_time * 600) + var/timedifference_text + timedifference_text = time2text(mouse_respawn_time * 600 - timedifference,"mm:ss") + to_chat(src, "You may only spawn again as a mouse more than [mouse_respawn_time] minutes after your death. You have [timedifference_text] left.") + return + + var/response = alert(src, "Are you -sure- you want to become a mouse?","Are you sure you want to squeek?","Squeek!","Nope!") + if(response != "Squeek!") return //Hit the wrong key...again. + + + //find a viable mouse candidate + var/mob/living/simple_mob/animal/passive/mouse/host + var/obj/machinery/atmospherics/unary/vent_pump/vent_found + var/list/found_vents = list() + for(var/obj/machinery/atmospherics/unary/vent_pump/v in machines) + if(!v.welded && v.z == T.z && v.network && v.network.normal_members.len > 20) + found_vents.Add(v) + if(found_vents.len) + vent_found = pick(found_vents) + host = new /mob/living/simple_mob/animal/passive/mouse(vent_found) + else + to_chat(src, "Unable to find any unwelded vents to spawn mice at.") + + if(host) + if(config.uneducated_mice) + host.universal_understand = 0 + announce_ghost_joinleave(src, 0, "They are now a mouse.") + host.ckey = src.ckey + host.add_ventcrawl(vent_found) + to_chat(host, "You are now a mouse. Try to avoid interaction with players, and do not give hints away that you are more than a simple rodent.") + +/mob/observer/dead/verb/view_manfiest() + set name = "Show Crew Manifest" + set category = "Ghost" + + var/dat + dat += "

Crew Manifest

" + dat += data_core.get_manifest() + + src << browse(dat, "window=manifest;size=370x420;can_close=1") + +//This is called when a ghost is drag clicked to something. +/mob/observer/dead/MouseDrop(atom/over) + if(!usr || !over) return + if (isobserver(usr) && usr.client && usr.client.holder && isliving(over)) + if (usr.client.holder.cmd_ghost_drag(src,over)) + return + + return ..() + +//Used for drawing on walls with blood puddles as a spooky ghost. +/mob/observer/dead/verb/bloody_doodle() + + set category = "Ghost" + set name = "Write in blood" + set desc = "If the round is sufficiently spooky, write a short message in blood on the floor or a wall. Remember, no IC in OOC or OOC in IC." + + if(!(config.cult_ghostwriter)) + to_chat(src, "That verb is not currently permitted.") + return + + if (!src.stat) + return + + if (usr != src) + return 0 //something is terribly wrong + + var/ghosts_can_write + if(ticker.mode.name == "cult") + if(cult.current_antagonists.len > config.cult_ghostwriter_req_cultists) + ghosts_can_write = 1 + + if(!ghosts_can_write && !check_rights(R_ADMIN|R_EVENT|R_FUN, 0)) //Let's allow for admins to write in blood for events and the such. + to_chat(src, "The veil is not thin enough for you to do that.") + return + + var/list/choices = list() + for(var/obj/effect/decal/cleanable/blood/B in view(1,src)) + if(B.amount > 0) + choices += B + + if(!choices.len) + to_chat(src, "There is no blood to use nearby.") + return + + var/obj/effect/decal/cleanable/blood/choice = input(src,"What blood would you like to use?") in null|choices + + var/direction = input(src,"Which way?","Tile selection") as anything in list("Here","North","South","East","West") + var/turf/simulated/T = src.loc + if (direction != "Here") + T = get_step(T,text2dir(direction)) + + if (!istype(T)) + to_chat(src, "You cannot doodle there.") + return + + if(!choice || choice.amount == 0 || !(src.Adjacent(choice))) + return + + var/doodle_color = (choice.basecolor) ? choice.basecolor : "#A10808" + + var/num_doodles = 0 + for (var/obj/effect/decal/cleanable/blood/writing/W in T) + num_doodles++ + if (num_doodles > 4) + to_chat(src, "There is no space to write on!") + return + + var/max_length = 50 + + var/message = sanitize(input("Write a message. It cannot be longer than [max_length] characters.","Blood writing", "")) + + if (message) + + if (length(message) > max_length) + message += "-" + to_chat(src, "You ran out of blood to write with!") + + var/obj/effect/decal/cleanable/blood/writing/W = new(T) + W.basecolor = doodle_color + W.update_icon() + W.message = message + W.add_hiddenprint(src) + W.visible_message("Invisible fingers crudely paint something in blood on [T]...") + +/mob/observer/dead/pointed(atom/A as mob|obj|turf in view()) + if(!..()) + return 0 + usr.visible_message("[src] points to [A]") + return 1 + +/mob/observer/dead/proc/manifest(mob/user) + is_manifest = TRUE + verbs |= /mob/observer/dead/proc/toggle_visibility + verbs |= /mob/observer/dead/proc/ghost_whisper + to_chat(src, "As you are now in the realm of the living, you can whisper to the living with the Spectral Whisper verb, inside the IC tab.") + if(plane != PLANE_WORLD) + user.visible_message( \ + "\The [user] drags ghost, [src], to our plane of reality!", \ + "You drag [src] to our plane of reality!" \ + ) + toggle_visibility(TRUE) + else + var/datum/gender/T = gender_datums[user.get_visible_gender()] + user.visible_message ( \ + "\The [user] just tried to smash [T.his] book into that ghost! It's not very effective.", \ + "You get the feeling that the ghost can't become any more visible." \ + ) + +/mob/observer/dead/proc/toggle_icon(var/icon) + if(!client) + return + + var/iconRemoved = 0 + for(var/image/I in client.images) + if(I.icon_state == icon) + iconRemoved = 1 + qdel(I) + + if(!iconRemoved) + var/image/J = image('icons/mob/mob.dmi', loc = src, icon_state = icon) + client.images += J + +/mob/observer/dead/proc/toggle_visibility(var/forced = 0) + set category = "Ghost" + set name = "Toggle Visibility" + set desc = "Allows you to turn (in)visible (almost) at will." + + var/toggled_invisible + if(!forced && plane == PLANE_GHOSTS && world.time < toggled_invisible + 600) + to_chat(src, "You must gather strength before you can turn visible again...") + return + + if(plane == PLANE_WORLD) + toggled_invisible = world.time + visible_message("It fades from sight...", "You are now invisible.") + else + to_chat(src, "You are now visible!") + + plane = (plane == PLANE_GHOSTS) ? PLANE_WORLD : PLANE_GHOSTS + invisibility = (plane == PLANE_WORLD) ? 0 : INVISIBILITY_OBSERVER + + // Give the ghost a cult icon which should be visible only to itself + toggle_icon("cult") + +/mob/observer/dead/verb/toggle_anonsay() + set category = "Ghost" + set name = "Toggle Anonymous Chat" + set desc = "Toggles showing your key in dead chat." + + src.anonsay = !src.anonsay + if(anonsay) + to_chat(src, "Your key won't be shown when you speak in dead chat.") + else + to_chat(src, "Your key will be publicly visible again.") + +/mob/observer/dead/canface() + return 1 + +/mob/observer/dead/proc/can_admin_interact() + return check_rights(R_ADMIN|R_EVENT, 0, src) + +/mob/observer/dead/verb/toggle_ghostsee() + set name = "Toggle Ghost Vision" + set desc = "Toggles your ability to see things only ghosts can see, like other ghosts" + set category = "Ghost" + ghostvision = !ghostvision + updateghostsight() + to_chat(src, "You [ghostvision ? "now" : "no longer"] have ghost vision.") + +/mob/observer/dead/verb/toggle_darkness() + set name = "Toggle Darkness" + set desc = "Toggles your ability to see lighting overlays, and the darkness they create." + set category = "Ghost" + seedarkness = !seedarkness + updateghostsight() + to_chat(src, "You [seedarkness ? "now" : "no longer"] see darkness.") + +/mob/observer/dead/proc/updateghostsight() + plane_holder.set_vis(VIS_FULLBRIGHT, !seedarkness) //Inversion, because "not seeing" the darkness is "seeing" the lighting plane master. + plane_holder.set_vis(VIS_GHOSTS, ghostvision) + +mob/observer/dead/MayRespawn(var/feedback = 0) + if(!client) + return 0 + if(mind && mind.current && mind.current.stat != DEAD && can_reenter_corpse) + if(feedback) + to_chat(src, "Your non-dead body prevent you from respawning.") + return 0 + if(config.antag_hud_restricted && has_enabled_antagHUD == 1) + if(feedback) + to_chat(src, "antagHUD restrictions prevent you from respawning.") + return 0 + return 1 + +/atom/proc/extra_ghost_link() + return + +/mob/extra_ghost_link(var/atom/ghost) + if(client && eyeobj) + return "|eye" + +/mob/observer/dead/extra_ghost_link(var/atom/ghost) + if(mind && mind.current) + return "|body" + +/proc/ghost_follow_link(var/atom/target, var/atom/ghost) + if((!target) || (!ghost)) return + . = "follow" + . += target.extra_ghost_link(ghost) + +//Culted Ghosts + +/mob/observer/dead/proc/ghost_whisper() + set name = "Spectral Whisper" + set category = "IC" + + if(is_manifest) //Only able to whisper if it's hit with a tome. + var/list/options = list() + for(var/mob/living/Ms in view(src)) + options += Ms + var/mob/living/M = input(src, "Select who to whisper to:", "Whisper to?", null) as null|mob in options + if(!M) + return 0 + var/msg = sanitize(input(src, "Message:", "Spectral Whisper") as text|null) + if(msg) + log_say("(SPECWHISP to [key_name(M)]): [msg]", src) + to_chat(M, " You hear a strange, unidentifiable voice in your head... [msg]") + to_chat(src, " You said: '[msg]' to [M].") + else + return + return 1 + else + to_chat(src, "You have not been pulled past the veil!") + +/mob/observer/dead/verb/choose_ghost_sprite() + set category = "Ghost" + set name = "Choose Sprite" + + var/choice + var/previous_state + var/finalized = "No" + + while(finalized == "No" && src.client) + choice = input(usr,"What would you like to use for your ghost sprite?") as null|anything in possible_ghost_sprites + if(!choice) + return + + if(choice) + icon = 'icons/mob/ghost.dmi' + overlays.Cut() + + if(icon_state && icon) + previous_state = icon_state + + icon_state = possible_ghost_sprites[choice] + finalized = alert("Look at your sprite. Is this what you wish to use?",,"No","Yes") + + ghost_sprite = possible_ghost_sprites[choice] + + if(finalized == "No") + icon_state = previous_state + +/mob/observer/dead/is_blind() + return FALSE + +/mob/observer/dead/is_deaf() + return FALSE + +/mob/observer/dead/verb/paialert() + set category = "Ghost" + set name = "Blank pAI alert" + set desc = "Flash an indicator light on available blank pAI devices for a smidgen of hope." + + if(usr.client.prefs?.be_special & BE_PAI) + var/count = 0 + for(var/obj/item/device/paicard/p in all_pai_cards) + var/obj/item/device/paicard/PP = p + if(PP.pai == null) + count++ + PP.overlays += "pai-ghostalert" + spawn(54) + PP.overlays.Cut() + to_chat(usr,"Flashing the displays of [count] unoccupied PAIs.") + else + to_chat(usr,"You have 'Be pAI' disabled in your character prefs, so we can't help you.") + +/mob/observer/dead/speech_bubble_appearance() + return "ghost" + +// Lets a ghost know someone's trying to bring them back, and for them to get into their body. +// Mostly the same as TG's sans the hud element, since we don't have TG huds. +/mob/observer/dead/proc/notify_revive(var/message, var/sound, flashwindow = TRUE, var/atom/source) + if((last_revive_notification + 2 MINUTES) > world.time) + return + last_revive_notification = world.time + + if(flashwindow) + window_flash(client) + if(message) + to_chat(src, "[message]") + if(source) + throw_alert("\ref[source]_notify_revive", /obj/screen/alert/notify_cloning, new_master = source) + to_chat(src, "(Click to re-enter)") + if(sound) + SEND_SOUND(src, sound(sound)) + +/mob/observer/dead/verb/respawn() + set name = "Respawn" + set category = "Ghost" + src.abandon_mob() +>>>>>>> fdabe51... Linter Introduction + Cleanup (#8085) diff --git a/code/modules/mob/living/bot/mulebot.dm b/code/modules/mob/living/bot/mulebot.dm index 92cc55f7f0..04878bf727 100644 --- a/code/modules/mob/living/bot/mulebot.dm +++ b/code/modules/mob/living/bot/mulebot.dm @@ -242,7 +242,6 @@ M.apply_damage(0.5 * damage, BRUTE, BP_R_ARM) blood_splatter(src, M, 1) - ..() /mob/living/bot/mulebot/relaymove(var/mob/user, var/direction) if(load == user) diff --git a/code/modules/mob/living/carbon/brain/life.dm b/code/modules/mob/living/carbon/brain/life.dm index c52584ba96..075384bc18 100644 --- a/code/modules/mob/living/carbon/brain/life.dm +++ b/code/modules/mob/living/carbon/brain/life.dm @@ -219,12 +219,4 @@ if(client && !client.adminobs) reset_view(null) - return 1 - - if (stat != 2) - if (machine) - if (machine.check_eye(src) < 0) - reset_view(null) - else - if(client && !client.adminobs) - reset_view(null) \ No newline at end of file + return 1 \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/human_modular_limbs.dm b/code/modules/mob/living/carbon/human/human_modular_limbs.dm index 0f79bd7add..6be9f62a8f 100644 --- a/code/modules/mob/living/carbon/human/human_modular_limbs.dm +++ b/code/modules/mob/living/carbon/human/human_modular_limbs.dm @@ -151,7 +151,6 @@ set name = "Attach Limb" set category = "Object" set desc = "Attach a replacement limb." - set usr = src var/obj/item/organ/external/E = get_active_hand() if(!check_can_attach_modular_limb(E)) @@ -181,7 +180,6 @@ set name = "Remove Limb" set category = "Object" set desc = "Detach one of your limbs." - set usr = src var/list/detachable_limbs = get_modular_limbs(return_first_found = FALSE, validate_proc = /obj/item/organ/external/proc/can_remove_modular_limb) if(!length(detachable_limbs)) diff --git a/code/modules/mob/living/carbon/human/human_powers.dm b/code/modules/mob/living/carbon/human/human_powers.dm index 33fb57356b..4b363cb604 100644 --- a/code/modules/mob/living/carbon/human/human_powers.dm +++ b/code/modules/mob/living/carbon/human/human_powers.dm @@ -19,7 +19,7 @@ else var/list/datum/sprite_accessory/hair/valid_hairstyles = list() for(var/hair_string in hair_styles_list) - var/list/datum/sprite_accessory/hair/test = hair_styles_list[hair_string] + var/datum/sprite_accessory/hair/test = hair_styles_list[hair_string] if(test.flags & HAIR_TIEABLE) valid_hairstyles.Add(hair_string) selected_string = input("Select a new hairstyle", "Your hairstyle", hair_style) as null|anything in valid_hairstyles diff --git a/code/modules/mob/living/carbon/human/human_resist.dm b/code/modules/mob/living/carbon/human/human_resist.dm index f9ef85c94b..0b09d169f0 100644 --- a/code/modules/mob/living/carbon/human/human_resist.dm +++ b/code/modules/mob/living/carbon/human/human_resist.dm @@ -67,7 +67,6 @@ /mob/living/carbon/human/proc/can_break_straight_jacket() if((HULK in mutations) || species.can_shred(src,1)) return 1 - return ..() /mob/living/carbon/human/proc/break_straight_jacket() visible_message( diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index dab0f0d18f..4d2f350cc6 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -653,7 +653,8 @@ var/obj/mecha/M = loc loc_temp = M.return_temperature() else if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell)) - loc_temp = loc:air_contents.temperature + var/obj/machinery/atmospherics/unary/cryo_cell/cc = loc + loc_temp = cc.air_contents.temperature else loc_temp = environment.temperature diff --git a/code/modules/mob/living/carbon/human/species/xenomorphs/alien_powers.dm b/code/modules/mob/living/carbon/human/species/xenomorphs/alien_powers.dm index 6022c10ba2..01ef3fa7f4 100644 --- a/code/modules/mob/living/carbon/human/species/xenomorphs/alien_powers.dm +++ b/code/modules/mob/living/carbon/human/species/xenomorphs/alien_powers.dm @@ -145,15 +145,13 @@ P.old_style_target(A) P.fire() playsound(src, 'sound/weapons/pierce.ogg', 25, 0) - else - ..() /mob/living/carbon/human/proc/corrosive_acid(O as obj|turf in oview(1)) //If they right click to corrode, an error will flash if its an invalid target./N set name = "Corrosive Acid (200)" set desc = "Drench an object in acid, destroying it over time." set category = "Abilities" - if(!O in oview(1)) + if(!(O in oview(1))) to_chat(src, "[O] is too far away.") return diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index d5f51aece2..cc238fe792 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -565,7 +565,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() standing.underlays += underlay for(var/mut in mutations) - if(LASER) + if(mut == LASER) standing.overlays += "lasereyes_s" //TODO overlays_standing[MUTATIONS_LAYER] = standing diff --git a/code/modules/mob/living/inventory.dm b/code/modules/mob/living/inventory.dm index a1d81a0549..8d4a66def3 100644 --- a/code/modules/mob/living/inventory.dm +++ b/code/modules/mob/living/inventory.dm @@ -229,32 +229,33 @@ /datum/inventory_panel/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state) var/list/data = ..() - data["slots"] = list() - data["slots"].Add(list(list( + var/list/slots = list() + slots.Add(list(list( "name" = "Head (Mask)", "item" = host.wear_mask, "act" = "mask", ))) - data["slots"].Add(list(list( + slots.Add(list(list( "name" = "Left Hand", "item" = host.l_hand, "act" = "l_hand", ))) - data["slots"].Add(list(list( + slots.Add(list(list( "name" = "Right Hand", "item" = host.r_hand, "act" = "r_hand", ))) - data["slots"].Add(list(list( + slots.Add(list(list( "name" = "Back", "item" = host.back, "act" = "back", ))) - data["slots"].Add(list(list( + slots.Add(list(list( "name" = "Pockets", "item" = "Empty Pockets", "act" = "pockets", ))) + data["slots"] = slots data["internals"] = host.internals data["internalsValid"] = istype(host.wear_mask, /obj/item/clothing/mask) && istype(host.back, /obj/item/weapon/tank) @@ -300,33 +301,37 @@ if(istype(H.w_uniform, /obj/item/clothing/under)) suit = H.w_uniform - data["slots"] = list() + + var/list/slots = list() for(var/entry in H.species.hud.gear) var/list/slot_ref = H.species.hud.gear[entry] if((slot_ref["slot"] in list(slot_l_store, slot_r_store))) continue var/obj/item/thing_in_slot = H.get_equipped_item(slot_ref["slot"]) - data["slots"].Add(list(list( + slots.Add(list(list( "name" = slot_ref["name"], "item" = thing_in_slot, "act" = "targetSlot", "params" = list("slot" = slot_ref["slot"]), ))) + data["slots"] = slots - data["specialSlots"] = list() + + var/list/specialSlots = list() if(H.species.hud.has_hands) - data["specialSlots"].Add(list(list( + specialSlots.Add(list(list( "name" = "Left Hand", "item" = H.l_hand, "act" = "targetSlot", "params" = list("slot" = slot_l_hand), ))) - data["specialSlots"].Add(list(list( + specialSlots.Add(list(list( "name" = "Right Hand", "item" = H.r_hand, "act" = "targetSlot", "params" = list("slot" = slot_r_hand), ))) + data["specialSlots"] = specialSlots data["internals"] = H.internals data["internalsValid"] = (istype(H.wear_mask, /obj/item/clothing/mask) || istype(H.head, /obj/item/clothing/head/helmet/space)) && (istype(H.back, /obj/item/weapon/tank) || istype(H.belt, /obj/item/weapon/tank) || istype(H.s_store, /obj/item/weapon/tank)) diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index eca22436bf..3c88a09a0f 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -1,3 +1,4 @@ +<<<<<<< HEAD /* run_armor_check(a,b) @@ -642,3 +643,648 @@ /mob/living/proc/restore_all_organs() return +======= + +/* + run_armor_check(a,b) + args + a:def_zone - What part is getting hit, if null will check entire body + b:attack_flag - What type of attack, bullet, laser, energy, melee + c:armour_pen - How much armor to ignore. + d:absorb_text - Custom text to send to the player when the armor fully absorbs an attack. + e:soften_text - Similar to absorb_text, custom text to send to the player when some damage is reduced. + + Returns + A number between 0 and 100, with higher numbers resulting in less damage taken. +*/ +/mob/living/proc/run_armor_check(var/def_zone = null, var/attack_flag = "melee", var/armour_pen = 0, var/absorb_text = null, var/soften_text = null) + if(Debug2) + to_world_log("## DEBUG: getarmor() was called.") + + if(armour_pen >= 100) + return 0 //might as well just skip the processing + + var/armor = getarmor(def_zone, attack_flag) + if(armor) + var/armor_variance_range = round(armor * 0.25) //Armor's effectiveness has a +25%/-25% variance. + var/armor_variance = rand(-armor_variance_range, armor_variance_range) //Get a random number between -25% and +25% of the armor's base value + if(Debug2) + to_world_log("## DEBUG: The range of armor variance is [armor_variance_range]. The variance picked by RNG is [armor_variance].") + + armor = min(armor + armor_variance, 100) //Now we calcuate damage using the new armor percentage. + armor = max(armor - armour_pen, 0) //Armor pen makes armor less effective. + if(armor >= 100) + if(absorb_text) + to_chat(src, "[absorb_text]") + else + to_chat(src, "Your armor absorbs the blow!") + + else if(armor > 0) + if(soften_text) + to_chat(src, "[soften_text]") + else + to_chat(src, "Your armor softens the blow!") + if(Debug2) + to_world_log("## DEBUG: Armor when [src] was attacked was [armor].") + return armor + +/* + //Old armor code here. + if(armour_pen >= 100) + return 0 //might as well just skip the processing + + var/armor = getarmor(def_zone, attack_flag) + var/absorb = 0 + + //Roll armour + if(prob(armor)) + absorb += 1 + if(prob(armor)) + absorb += 1 + + //Roll penetration + if(prob(armour_pen)) + absorb -= 1 + if(prob(armour_pen)) + absorb -= 1 + + if(absorb >= 2) + if(absorb_text) + show_message("[absorb_text]") + else + show_message("Your armor absorbs the blow!") + return 2 + if(absorb == 1) + if(absorb_text) + show_message("[soften_text]",4) + else + show_message("Your armor softens the blow!") + return 1 + return 0 +*/ + +//Certain pieces of armor actually absorb flat amounts of damage from income attacks +/mob/living/proc/get_armor_soak(var/def_zone = null, var/attack_flag = "melee", var/armour_pen = 0) + var/soaked = getsoak(def_zone, attack_flag) + //5 points of armor pen negate one point of soak + if(armour_pen) + soaked = max(soaked - (armour_pen/5), 0) + return soaked + +//if null is passed for def_zone, then this should return something appropriate for all zones (e.g. area effect damage) +/mob/living/proc/getarmor(var/def_zone, var/type) + return 0 + +/mob/living/proc/getsoak(var/def_zone, var/type) + return 0 + +// Clicking with an empty hand +/mob/living/attack_hand(mob/living/L) + ..() + if(istype(L) && L.a_intent != I_HELP) + if(ai_holder) // Using disarm, grab, or harm intent is considered a hostile action to the mob's AI. + ai_holder.react_to_attack(L) + +/mob/living/bullet_act(var/obj/item/projectile/P, var/def_zone) + + //Being hit while using a deadman switch + if(istype(get_active_hand(),/obj/item/device/assembly/signaler)) + var/obj/item/device/assembly/signaler/signaler = get_active_hand() + if(signaler.deadman && prob(80)) + log_and_message_admins("has triggered a signaler deadman's switch") + src.visible_message("[src] triggers their deadman's switch!") + signaler.signal() + + if(ai_holder && P.firer) + ai_holder.react_to_attack(P.firer) + + //Armor + var/soaked = get_armor_soak(def_zone, P.check_armour, P.armor_penetration) + var/absorb = run_armor_check(def_zone, P.check_armour, P.armor_penetration) + var/proj_sharp = is_sharp(P) + var/proj_edge = has_edge(P) + + if ((proj_sharp || proj_edge) && (soaked >= round(P.damage*0.8))) + proj_sharp = 0 + proj_edge = 0 + + if ((proj_sharp || proj_edge) && prob(getarmor(def_zone, P.check_armour))) + proj_sharp = 0 + proj_edge = 0 + + //Stun Beams + if(P.taser_effect) + stun_effect_act(0, P.agony, def_zone, P) + if(!P.nodamage) + apply_damage(P.damage, P.damage_type, def_zone, absorb, soaked, 0, P, sharp=proj_sharp, edge=proj_edge) + qdel(P) + return + + if(!P.nodamage) + apply_damage(P.damage, P.damage_type, def_zone, absorb, soaked, 0, P, sharp=proj_sharp, edge=proj_edge) + P.on_hit(src, absorb, soaked, def_zone) + + if(absorb == 100) + return 2 + else if (absorb >= 0) + return 1 + else + return 0 + +// return absorb + +//Handles the effects of "stun" weapons +/mob/living/proc/stun_effect_act(var/stun_amount, var/agony_amount, var/def_zone, var/used_weapon=null) + flash_pain() + + if (stun_amount) + Stun(stun_amount) + Weaken(stun_amount) + apply_effect(STUTTER, stun_amount) + apply_effect(EYE_BLUR, stun_amount) + + if (agony_amount) + apply_damage(agony_amount, HALLOSS, def_zone, 0, used_weapon) + apply_effect(STUTTER, agony_amount/10) + apply_effect(EYE_BLUR, agony_amount/10) + +/mob/living/proc/electrocute_act(var/shock_damage, var/obj/source, var/siemens_coeff = 1.0, var/def_zone = null, var/stun = 1) + return 0 //only carbon liveforms have this proc + +/mob/living/emp_act(severity) + var/list/L = src.get_contents() + + if(LAZYLEN(modifiers)) + for(var/datum/modifier/M in modifiers) + if(!isnull(M.emp_modifier)) + severity = CLAMP(severity + M.emp_modifier, 1, 5) + + if(severity == 5) // Effectively nullified. + return + + for(var/obj/O in L) + O.emp_act(severity) + ..() + +/mob/living/blob_act(var/obj/structure/blob/B) + if(stat == DEAD || faction == B.faction) + return + + var/damage = rand(30, 40) + var/armor_pen = 0 + var/armor_check = "melee" + var/damage_type = BRUTE + var/attack_message = "The blob attacks you!" + var/attack_verb = "attacks" + var/def_zone = pick(BP_HEAD, BP_TORSO, BP_GROIN, BP_L_ARM, BP_R_ARM, BP_L_LEG, BP_R_LEG) + + if(B && B.overmind) + var/datum/blob_type/blob = B.overmind.blob_type + + damage = rand(blob.damage_lower, blob.damage_upper) + armor_check = blob.armor_check + armor_pen = blob.armor_pen + damage_type = blob.damage_type + + attack_message = "[blob.attack_message][isSynthetic() ? "[blob.attack_message_synth]":"[blob.attack_message_living]"]" + attack_verb = blob.attack_verb + B.overmind.blob_type.on_attack(B, src, def_zone) + + if( (damage_type == TOX || damage_type == OXY) && isSynthetic()) // Borgs and FBPs don't really handle tox/oxy damage the same way other mobs do. + damage_type = BRUTE + damage *= 0.66 // Take 2/3s as much damage. + + visible_message("\The [B] [attack_verb] \the [src]!", "[attack_message]!") + playsound(src, 'sound/effects/attackblob.ogg', 50, 1) + + //Armor + var/soaked = get_armor_soak(def_zone, armor_check, armor_pen) + var/absorb = run_armor_check(def_zone, armor_check, armor_pen) + + if(ai_holder) + ai_holder.react_to_attack(B) + + apply_damage(damage, damage_type, def_zone, absorb, soaked) + +/mob/living/proc/resolve_item_attack(obj/item/I, mob/living/user, var/target_zone) + return target_zone + +//Called when the mob is hit with an item in combat. Returns the blocked result +/mob/living/proc/hit_with_weapon(obj/item/I, mob/living/user, var/effective_force, var/hit_zone) + visible_message("[src] has been [I.attack_verb.len? pick(I.attack_verb) : "attacked"] with [I.name] by [user]!") + + if(ai_holder) + ai_holder.react_to_attack(user) + + var/soaked = get_armor_soak(hit_zone, "melee") + var/blocked = run_armor_check(hit_zone, "melee") + + standard_weapon_hit_effects(I, user, effective_force, blocked, soaked, hit_zone) + + if(I.damtype == BRUTE && prob(33)) // Added blood for whacking non-humans too + var/turf/simulated/location = get_turf(src) + if(istype(location)) location.add_blood_floor(src) + + return blocked + +//returns 0 if the effects failed to apply for some reason, 1 otherwise. +/mob/living/proc/standard_weapon_hit_effects(obj/item/I, mob/living/user, var/effective_force, var/blocked, var/soaked, var/hit_zone) + if(!effective_force || blocked >= 100) + return 0 + //Apply weapon damage + var/weapon_sharp = is_sharp(I) + var/weapon_edge = has_edge(I) + + if(getsoak(hit_zone, "melee",) - (I.armor_penetration/5) > round(effective_force*0.8)) //soaking a hit turns sharp attacks into blunt ones + weapon_sharp = 0 + weapon_edge = 0 + + if(prob(max(getarmor(hit_zone, "melee") - I.armor_penetration, 0))) //melee armour provides a chance to turn sharp/edge weapon attacks into blunt ones + weapon_sharp = 0 + weapon_edge = 0 + + apply_damage(effective_force, I.damtype, hit_zone, blocked, soaked, sharp=weapon_sharp, edge=weapon_edge, used_weapon=I) + + return 1 + +//this proc handles being hit by a thrown atom +/mob/living/hitby(atom/movable/AM as mob|obj,var/speed = THROWFORCE_SPEED_DIVISOR)//Standardization and logging -Sieve + if(istype(AM,/obj/)) + var/obj/O = AM + var/dtype = O.damtype + var/throw_damage = O.throwforce*(speed/THROWFORCE_SPEED_DIVISOR) + + var/miss_chance = 15 + if (O.throw_source) + var/distance = get_dist(O.throw_source, loc) + miss_chance = max(15*(distance-2), 0) + + if (prob(miss_chance)) + visible_message("\The [O] misses [src] narrowly!") + return + + src.visible_message("[src] has been hit by [O].") + var/armor = run_armor_check(null, "melee") + var/soaked = get_armor_soak(null, "melee") + + + apply_damage(throw_damage, dtype, null, armor, soaked, is_sharp(O), has_edge(O), O) + + O.throwing = 0 //it hit, so stop moving + + if(ismob(O.thrower)) + var/mob/M = O.thrower + var/client/assailant = M.client + if(assailant) + add_attack_logs(M,src,"Hit by thrown [O.name]") + if(ai_holder) + ai_holder.react_to_attack(O.thrower) + + // Begin BS12 momentum-transfer code. + var/mass = 1.5 + if(istype(O, /obj/item)) + var/obj/item/I = O + mass = I.w_class/THROWNOBJ_KNOCKBACK_DIVISOR + var/momentum = speed*mass + + if(O.throw_source && momentum >= THROWNOBJ_KNOCKBACK_SPEED) + var/dir = get_dir(O.throw_source, src) + + visible_message("[src] staggers under the impact!","You stagger under the impact!") + src.throw_at(get_edge_target_turf(src,dir),1,momentum) + + if(!O || !src) return + + if(O.sharp) //Projectile is suitable for pinning. + if(soaked >= round(throw_damage*0.8)) + return + + //Handles embedding for non-humans and simple_animals. + embed(O) + + var/turf/T = near_wall(dir,2) + + if(T) + src.loc = T + visible_message("[src] is pinned to the wall by [O]!","You are pinned to the wall by [O]!") + src.anchored = 1 + src.pinned += O + +/mob/living/proc/embed(var/obj/O, var/def_zone=null) + O.loc = src + src.embedded += O + src.verbs += /mob/proc/yank_out_object + throw_alert("embeddedobject", /obj/screen/alert/embeddedobject) + +//This is called when the mob is thrown into a dense turf +/mob/living/proc/turf_collision(var/turf/T, var/speed) + src.take_organ_damage(speed*5) + +/mob/living/proc/near_wall(var/direction,var/distance=1) + var/turf/T = get_step(get_turf(src),direction) + var/turf/last_turf = src.loc + var/i = 1 + + while(i>0 && i<=distance) + if(T.density) //Turf is a wall! + return last_turf + i++ + last_turf = T + T = get_step(T,direction) + + return 0 + +// End BS12 momentum-transfer code. + +/mob/living/attack_generic(var/mob/user, var/damage, var/attack_message) + if(!damage) + return + + adjustBruteLoss(damage) + add_attack_logs(user,src,"Generic attack (probably animal)", admin_notify = FALSE) //Usually due to simple_mob attacks + if(ai_holder) + ai_holder.react_to_attack(user) + src.visible_message("[user] has [attack_message] [src]!") + user.do_attack_animation(src) + spawn(1) updatehealth() + return 1 + +/mob/living/proc/IgniteMob() + if(fire_stacks > 0 && !on_fire) + on_fire = 1 + handle_light() + throw_alert("fire", /obj/screen/alert/fire) + update_fire() + +/mob/living/proc/ExtinguishMob() + if(on_fire) + on_fire = 0 + fire_stacks = 0 + handle_light() + clear_alert("fire") + update_fire() + + if(has_modifier_of_type(/datum/modifier/fire)) + remove_modifiers_of_type(/datum/modifier/fire) + +/mob/living/proc/update_fire() + return + +/mob/living/proc/adjust_fire_stacks(add_fire_stacks) //Adjusting the amount of fire_stacks we have on person + fire_stacks = CLAMP(fire_stacks + add_fire_stacks, FIRE_MIN_STACKS, FIRE_MAX_STACKS) + +/mob/living/proc/handle_fire() + if(fire_stacks < 0) + fire_stacks = min(0, ++fire_stacks) //If we've doused ourselves in water to avoid fire, dry off slowly + + if(fire_stacks > 0) + fire_stacks = max(0, (fire_stacks-0.1)) //Should slowly burn out + + if(!on_fire) + return 1 + else if(fire_stacks <= 0) + ExtinguishMob() //Fire's been put out. + return 1 + + var/datum/gas_mixture/G = loc.return_air() // Check if we're standing in an oxygenless environment + if(G.gas["oxygen"] < 1) + ExtinguishMob() //If there's no oxygen in the tile we're on, put out the fire + return 1 + + var/turf/location = get_turf(src) + location.hotspot_expose(fire_burn_temperature(), 50, 1) + +//altered this to cap at the temperature of the fire causing it, using the same 1:1500 value as /mob/living/carbon/human/handle_fire() in human/life.dm +/mob/living/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume) + if(exposed_temperature) + if(fire_stacks < exposed_temperature/1500) // Subject to balance + adjust_fire_stacks(2) + else + adjust_fire_stacks(2) + IgniteMob() + +//Share fire evenly between the two mobs +//Called in MobCollide() and Crossed() +/mob/living/proc/spread_fire(mob/living/L) + return +// This is commented out pending discussion on Polaris. If you're a downsteam and you want people to spread fire by touching each other, feel free to uncomment this. +/* + if(!istype(L)) + return + var/L_old_on_fire = L.on_fire + + if(on_fire) //Only spread fire stacks if we're on fire + fire_stacks /= 2 + L.fire_stacks += fire_stacks + if(L.IgniteMob()) + message_admins("[key_name(src)] bumped into [key_name(L)] and set them on fire.") + + if(L_old_on_fire) //Only ignite us and gain their stacks if they were onfire before we bumped them + L.fire_stacks /= 2 + fire_stacks += L.fire_stacks + IgniteMob() +*/ + +/mob/living/proc/get_cold_protection() + return 0 + +/mob/living/proc/get_heat_protection() + return 0 + +/mob/living/proc/get_shock_protection() + return 0 + +/mob/living/proc/get_water_protection() + return 1 // Water won't hurt most things. + +/mob/living/proc/get_poison_protection() + return 0 + +//Finds the effective temperature that the mob is burning at. +/mob/living/proc/fire_burn_temperature() + if (fire_stacks <= 0) + return 0 + + //Scale quadratically so that single digit numbers of fire stacks don't burn ridiculously hot. + //lower limit of 700 K, same as matches and roughly the temperature of a cool flame. + return max(2.25*round(FIRESUIT_MAX_HEAT_PROTECTION_TEMPERATURE*(fire_stacks/FIRE_MAX_FIRESUIT_STACKS)**2), 700) + +// Called when struck by lightning. +/mob/living/proc/lightning_act() + // The actual damage/electrocution is handled by the tesla_zap() that accompanies this. + Paralyse(5) + stuttering += 20 + make_jittery(150) + emp_act(1) + to_chat(src, span("critical", "You've been struck by lightning!")) + +// Called when touching a lava tile. +// Does roughly 100 damage to unprotected mobs, and 20 to fully protected mobs. +/mob/living/lava_act() + add_modifier(/datum/modifier/fire/intense, 8 SECONDS) // Around 40 total if left to burn and without fire protection per stack. + inflict_heat_damage(40) // Another 40, however this is instantly applied to unprotected mobs. + adjustFireLoss(20) // Lava cannot be 100% resisted with fire protection. + +/mob/living/proc/reagent_permeability() + return 1 + +/mob/living/proc/handle_actions() + //Pretty bad, i'd use picked/dropped instead but the parent calls in these are nonexistent + for(var/datum/action/A in actions) + if(A.CheckRemoval(src)) + A.Remove(src) + for(var/obj/item/I in src) + if(I.action_button_name) + if(!I.action) + if(I.action_button_is_hands_free) + I.action = new/datum/action/item_action/hands_free + else + I.action = new/datum/action/item_action + I.action.name = I.action_button_name + I.action.target = I + I.action.Grant(src) + return + +/mob/living/update_action_buttons() + if(!hud_used) return + if(!client) return + + if(hud_used.hud_shown != 1) //Hud toggled to minimal + return + + client.screen -= hud_used.hide_actions_toggle + for(var/datum/action/A in actions) + if(A.button) + client.screen -= A.button + + if(hud_used.action_buttons_hidden) + if(!hud_used.hide_actions_toggle) + hud_used.hide_actions_toggle = new(hud_used) + hud_used.hide_actions_toggle.UpdateIcon() + + if(!hud_used.hide_actions_toggle.moved) + hud_used.hide_actions_toggle.screen_loc = hud_used.ButtonNumberToScreenCoords(1) + //hud_used.SetButtonCoords(hud_used.hide_actions_toggle,1) + + client.screen += hud_used.hide_actions_toggle + return + + var/button_number = 0 + for(var/datum/action/A in actions) + button_number++ + if(A.button == null) + var/obj/screen/movable/action_button/N = new(hud_used) + N.owner = A + A.button = N + + var/obj/screen/movable/action_button/B = A.button + + B.UpdateIcon() + + B.name = A.UpdateName() + + client.screen += B + + if(!B.moved) + B.screen_loc = hud_used.ButtonNumberToScreenCoords(button_number) + //hud_used.SetButtonCoords(B,button_number) + + if(button_number > 0) + if(!hud_used.hide_actions_toggle) + hud_used.hide_actions_toggle = new(hud_used) + hud_used.hide_actions_toggle.InitialiseIcon(src) + if(!hud_used.hide_actions_toggle.moved) + hud_used.hide_actions_toggle.screen_loc = hud_used.ButtonNumberToScreenCoords(button_number+1) + //hud_used.SetButtonCoords(hud_used.hide_actions_toggle,button_number+1) + client.screen += hud_used.hide_actions_toggle + +// Returns a number to determine if something is harder or easier to hit than normal. +/mob/living/proc/get_evasion() + var/result = evasion // First we get the 'base' evasion. Generally this is zero. + for(var/datum/modifier/M in modifiers) + if(!isnull(M.evasion)) + result += M.evasion + return result + +/mob/living/proc/get_accuracy_penalty() + // Certain statuses make it harder to score a hit. + var/accuracy_penalty = 0 + if(eye_blind) + accuracy_penalty += 75 + if(eye_blurry) + accuracy_penalty += 30 + if(confused) + accuracy_penalty += 45 + + return accuracy_penalty + +// Applies direct "cold" damage while checking protection against the cold. +/mob/living/proc/inflict_cold_damage(amount) + amount *= 1 - get_cold_protection(50) // Within spacesuit protection. + if(amount > 0) + adjustFireLoss(amount) + +// Ditto, but for "heat". +/mob/living/proc/inflict_heat_damage(amount) + amount *= 1 - get_heat_protection(10000) // Within firesuit protection. + if(amount > 0) + adjustFireLoss(amount) + +// and one for electricity because why not +/mob/living/proc/inflict_shock_damage(amount) + electrocute_act(amount, null, 1 - get_shock_protection(), pick(BP_HEAD, BP_TORSO, BP_GROIN)) + +// also one for water (most things resist it entirely, except for slimes) +/mob/living/proc/inflict_water_damage(amount) + amount *= 1 - get_water_protection() + if(amount > 0) + adjustToxLoss(amount) + +// one for abstracted away ""poison"" (mostly because simplemobs shouldn't handle reagents) +/mob/living/proc/inflict_poison_damage(amount) + if(isSynthetic()) + return + amount *= 1 - get_poison_protection() + if(amount > 0) + adjustToxLoss(amount) + +/mob/living/proc/can_inject(var/mob/user, var/error_msg, var/target_zone, var/ignore_thickness = FALSE) + return 1 + +/mob/living/proc/get_organ_target() + var/mob/shooter = src + var/t = shooter.zone_sel.selecting + if ((t in list( O_EYES, O_MOUTH ))) + t = BP_HEAD + var/obj/item/organ/external/def_zone = ran_zone(t) + return def_zone + +// heal ONE external organ, organ gets randomly selected from damaged ones. +/mob/living/proc/heal_organ_damage(var/brute, var/burn) + adjustBruteLoss(-brute) + adjustFireLoss(-burn) + src.updatehealth() + +// damage ONE external organ, organ gets randomly selected from damaged ones. +/mob/living/proc/take_organ_damage(var/brute, var/burn, var/emp=0) + if(status_flags & GODMODE) return 0 //godmode + adjustBruteLoss(brute) + adjustFireLoss(burn) + src.updatehealth() + +// heal MANY external organs, in random order +/mob/living/proc/heal_overall_damage(var/brute, var/burn) + adjustBruteLoss(-brute) + adjustFireLoss(-burn) + src.updatehealth() + +// damage MANY external organs, in random order +/mob/living/proc/take_overall_damage(var/brute, var/burn, var/used_weapon = null) + if(status_flags & GODMODE) return 0 //godmode + adjustBruteLoss(brute) + adjustFireLoss(burn) + src.updatehealth() + +/mob/living/proc/restore_all_organs() + return +>>>>>>> fdabe51... Linter Introduction + Cleanup (#8085) diff --git a/code/modules/mob/living/silicon/robot/drone/drone_console.dm b/code/modules/mob/living/silicon/robot/drone/drone_console.dm index 138b1610f5..d5ec28e3cd 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone_console.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone_console.dm @@ -34,7 +34,7 @@ /obj/machinery/computer/drone_control/tgui_data(mob/user) var/list/data = list() - data["drones"] = list() + var/list/drones = list() for(var/mob/living/silicon/robot/drone/D in mob_list) //VOREStation Edit - multiz lol if(!(D.z in using_map.get_map_levels(z, TRUE, 0))) @@ -42,8 +42,13 @@ //VOREStation Edit - multiz lol if(D.foreign_droid) continue +<<<<<<< HEAD data["drones"].Add(list(list( +======= + + drones.Add(list(list( +>>>>>>> fdabe51... Linter Introduction + Cleanup (#8085) "name" = D.real_name, "active" = D.stat != 2, "charge" = D.cell.charge, @@ -51,6 +56,7 @@ "loc" = "[get_area(D)]", "ref" = "\ref[D]", ))) + data["drones"] = drones data["fabricator"] = dronefab data["fabPower"] = dronefab?.produce_drones diff --git a/code/modules/mob/living/silicon/robot/inventory.dm b/code/modules/mob/living/silicon/robot/inventory.dm index 96daaf9af7..6ddff91192 100644 --- a/code/modules/mob/living/silicon/robot/inventory.dm +++ b/code/modules/mob/living/silicon/robot/inventory.dm @@ -95,7 +95,6 @@ return 1 else return 0 - updateicon() // This one takes an object's type instead of an instance, as above. /mob/living/silicon/robot/proc/has_active_type(var/type_to_compare) diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index b9c2c60c47..1d1ac96f54 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -1,3 +1,4 @@ +<<<<<<< HEAD /mob/living/silicon gender = NEUTER voice_name = "synthesized voice" @@ -405,3 +406,424 @@ /mob/living/silicon/has_vision() return 0 //NOT REAL EYES +======= +/mob/living/silicon + gender = NEUTER + voice_name = "synthesized voice" + var/syndicate = 0 + var/const/MAIN_CHANNEL = "Main Frequency" + var/lawchannel = MAIN_CHANNEL // Default channel on which to state laws + var/list/stating_laws = list()// Channels laws are currently being stated on + var/obj/item/device/radio/common_radio + + has_huds = TRUE + var/list/speech_synthesizer_langs = list() //which languages can be vocalized by the speech synthesizer + + //Used in say.dm. + var/speak_statement = "states" + var/speak_exclamation = "declares" + var/speak_query = "queries" + var/pose //Yes, now AIs can pose too. + var/obj/item/device/camera/siliconcam/aiCamera = null //photography + var/local_transmit //If set, can only speak to others of the same type within a short range. + + var/next_alarm_notice + var/list/datum/alarm/queued_alarms = new() + + var/list/access_rights + var/obj/item/weapon/card/id/idcard + var/idcard_type = /obj/item/weapon/card/id/synthetic + + var/hudmode = null + +/mob/living/silicon/New() + silicon_mob_list |= src + ..() + add_language(LANGUAGE_GALCOM) + set_default_language(GLOB.all_languages[LANGUAGE_GALCOM]) + init_id() + init_subsystems() + +/mob/living/silicon/Destroy() + silicon_mob_list -= src + for(var/datum/alarm_handler/AH in SSalarm.all_handlers) + AH.unregister_alarm(src) + return ..() + +/mob/living/silicon/proc/init_id() + if(idcard) + return + idcard = new idcard_type(src) + set_id_info(idcard) + +/mob/living/silicon/proc/SetName(pickedName as text) + real_name = pickedName + name = real_name + +/mob/living/silicon/proc/show_laws() + return + +/mob/living/silicon/drop_item() + return + +/mob/living/silicon/emp_act(severity) + switch(severity) + if(1) + src.take_organ_damage(0,20,emp=1) + Confuse(5) + if(2) + src.take_organ_damage(0,15,emp=1) + Confuse(4) + if(3) + src.take_organ_damage(0,10,emp=1) + Confuse(3) + if(4) + src.take_organ_damage(0,5,emp=1) + Confuse(2) + flash_eyes(affect_silicon = 1) + to_chat(src, "*BZZZT*") + to_chat(src, "Warning: Electromagnetic pulse detected.") + ..() + +/mob/living/silicon/stun_effect_act(var/stun_amount, var/agony_amount) + return //immune + +/mob/living/silicon/electrocute_act(var/shock_damage, var/obj/source, var/siemens_coeff = 0.0, var/def_zone = null, var/stun = 1) + if(shock_damage > 0) + var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread + s.set_up(5, 1, loc) + s.start() + + shock_damage *= siemens_coeff //take reduced damage + take_overall_damage(0, shock_damage) + visible_message("[src] was shocked by \the [source]!", \ + "Energy pulse detected, system damaged!", \ + "You hear an electrical crack.") + if(prob(20)) + Stun(2) + return + +/mob/living/silicon/proc/damage_mob(var/brute = 0, var/fire = 0, var/tox = 0) + return + +/mob/living/silicon/IsAdvancedToolUser() + return 1 + +/mob/living/silicon/bullet_act(var/obj/item/projectile/Proj) + + if(!Proj.nodamage) + switch(Proj.damage_type) + if(BRUTE) + adjustBruteLoss(Proj.damage) + if(BURN) + adjustFireLoss(Proj.damage) + + Proj.on_hit(src,2) + updatehealth() + return 2 + +/mob/living/silicon/apply_effect(var/effect = 0,var/effecttype = STUN, var/blocked = 0, var/check_protection = 1) + return 0//The only effect that can hit them atm is flashes and they still directly edit so this works for now + + +/proc/islinked(var/mob/living/silicon/robot/bot, var/mob/living/silicon/ai/ai) + if(!istype(bot) || !istype(ai)) + return 0 + if (bot.connected_ai == ai) + return 1 + return 0 + + +// this function shows the health of the AI in the Status panel +/mob/living/silicon/proc/show_system_integrity() + if(!src.stat) + stat(null, text("System integrity: [round((health/getMaxHealth())*100)]%")) + else + stat(null, text("Systems nonfunctional")) + + +// This is a pure virtual function, it should be overwritten by all subclasses +/mob/living/silicon/proc/show_malf_ai() + return 0 + +// this function displays the shuttles ETA in the status panel if the shuttle has been called +/mob/living/silicon/proc/show_emergency_shuttle_eta() + if(emergency_shuttle) + var/eta_status = emergency_shuttle.get_status_panel_eta() + if(eta_status) + stat(null, eta_status) + + +// This adds the basic clock, shuttle recall timer, and malf_ai info to all silicon lifeforms +/mob/living/silicon/Stat() + if(statpanel("Status")) + show_emergency_shuttle_eta() + show_system_integrity() + show_malf_ai() + ..() + +// this function displays the stations manifest in a separate window +/mob/living/silicon/proc/show_station_manifest() + var/dat = "
" + if(!data_core) + to_chat(src, "There is no data to form a manifest with. Contact your Nanotrasen administrator.") + return + dat += data_core.get_manifest(1) //The 1 makes it monochrome. + + var/datum/browser/popup = new(src, "Crew Manifest", "Crew Manifest", 370, 420, src) + popup.set_content(dat) + popup.open() + +//can't inject synths +/mob/living/silicon/can_inject(var/mob/user, var/error_msg, var/target_zone, var/ignore_thickness = FALSE) + if(error_msg) + to_chat(user, "The armoured plating is too tough.") + return 0 + + +//Silicon mob language procs + +/mob/living/silicon/can_speak(datum/language/speaking) + if(universal_speak) + return TRUE + //need speech synthesizer support to vocalize a language + if(speaking in speech_synthesizer_langs) + return TRUE + if(speaking && speaking.flags & INNATE) + return TRUE + return FALSE + +/mob/living/silicon/add_language(var/language, var/can_speak=1) + var/datum/language/added_language = GLOB.all_languages[language] + if(!added_language) + return + + . = ..(language) + if (can_speak && (added_language in languages) && !(added_language in speech_synthesizer_langs)) + speech_synthesizer_langs += added_language + return 1 + +/mob/living/silicon/remove_language(var/rem_language) + var/datum/language/removed_language = GLOB.all_languages[rem_language] + if(!removed_language) + return + + ..(rem_language) + speech_synthesizer_langs -= removed_language + +/mob/living/silicon/check_lang_data() + . = "" + + if(default_language) + . += "Current default language: [default_language] - reset

" + + for(var/datum/language/L in languages) + if(!(L.flags & NONGLOBAL)) + var/default_str + if(L == default_language) + default_str = " - default - reset" + else + default_str = " - set default" + + var/synth = (L in speech_synthesizer_langs) + . += "[L.name] ([get_language_prefix()][L.key])[synth ? default_str : null]
Speech Synthesizer: [synth ? "YES" : "NOT SUPPORTED"]
[L.desc]

" + +/mob/living/silicon/proc/toggle_sensor_mode() + var/sensor_type = input("Please select sensor type.", "Sensor Integration", null) in list("Security","Medical","Disable") + switch(sensor_type) + if ("Security") + if(plane_holder) + //Enable Security planes + plane_holder.set_vis(VIS_CH_ID,TRUE) + plane_holder.set_vis(VIS_CH_WANTED,TRUE) + plane_holder.set_vis(VIS_CH_IMPLOYAL,TRUE) + plane_holder.set_vis(VIS_CH_IMPTRACK,TRUE) + plane_holder.set_vis(VIS_CH_IMPCHEM,TRUE) + + //Disable Medical planes + plane_holder.set_vis(VIS_CH_STATUS,FALSE) + plane_holder.set_vis(VIS_CH_HEALTH,FALSE) + + to_chat(src, "Security records overlay enabled.") + if ("Medical") + if(plane_holder) + //Disable Security planes + plane_holder.set_vis(VIS_CH_ID,FALSE) + plane_holder.set_vis(VIS_CH_WANTED,FALSE) + plane_holder.set_vis(VIS_CH_IMPLOYAL,FALSE) + plane_holder.set_vis(VIS_CH_IMPTRACK,FALSE) + plane_holder.set_vis(VIS_CH_IMPCHEM,FALSE) + + //Enable Medical planes + plane_holder.set_vis(VIS_CH_STATUS,TRUE) + plane_holder.set_vis(VIS_CH_HEALTH,TRUE) + + to_chat(src, "Life signs monitor overlay enabled.") + if ("Disable") + if(plane_holder) + //Disable Security planes + plane_holder.set_vis(VIS_CH_ID,FALSE) + plane_holder.set_vis(VIS_CH_WANTED,FALSE) + plane_holder.set_vis(VIS_CH_IMPLOYAL,FALSE) + plane_holder.set_vis(VIS_CH_IMPTRACK,FALSE) + plane_holder.set_vis(VIS_CH_IMPCHEM,FALSE) + + //Disable Medical planes + plane_holder.set_vis(VIS_CH_STATUS,FALSE) + plane_holder.set_vis(VIS_CH_HEALTH,FALSE) + to_chat(src, "Sensor augmentations disabled.") + + hudmode = sensor_type //This is checked in examine.dm on humans, so they can see medical/security records depending on mode + +/mob/living/silicon/verb/pose() + set name = "Set Pose" + set desc = "Sets a description which will be shown when someone examines you." + set category = "IC" + + pose = sanitize(input(usr, "This is [src]. It is...", "Pose", null) as text) + +/mob/living/silicon/verb/set_flavor() + set name = "Set Flavour Text" + set desc = "Sets an extended description of your character's features." + set category = "IC" + + flavor_text = sanitize(input(usr, "Please enter your new flavour text.", "Flavour text", null) as text) + +/mob/living/silicon/binarycheck() + return 1 + +/mob/living/silicon/ex_act(severity) + if(!blinded) + flash_eyes() + + for(var/datum/modifier/M in modifiers) + if(!isnull(M.explosion_modifier)) + severity = CLAMP(severity + M.explosion_modifier, 1, 4) + + severity = round(severity) + + if(severity > 3) + return + + switch(severity) + if(1.0) + if (stat != 2) + adjustBruteLoss(100) + adjustFireLoss(100) + if(!anchored) + gib() + if(2.0) + if (stat != 2) + adjustBruteLoss(60) + adjustFireLoss(60) + if(3.0) + if (stat != 2) + adjustBruteLoss(30) + + updatehealth() + +/mob/living/silicon/proc/receive_alarm(var/datum/alarm_handler/alarm_handler, var/datum/alarm/alarm, was_raised) + if(!next_alarm_notice) + next_alarm_notice = world.time + SecondsToTicks(10) + if(alarm.hidden) + return + if(alarm.origin && !(get_z(alarm.origin) in using_map.get_map_levels(get_z(src), TRUE, om_range = DEFAULT_OVERMAP_RANGE))) + return + + var/list/alarms = queued_alarms[alarm_handler] + if(was_raised) + // Raised alarms are always set + alarms[alarm] = 1 + else + // Alarms that were raised but then cleared before the next notice are instead removed + if(alarm in alarms) + alarms -= alarm + // And alarms that have only been cleared thus far are set as such + else + alarms[alarm] = -1 + +/mob/living/silicon/proc/process_queued_alarms() + if(next_alarm_notice && (world.time > next_alarm_notice)) + next_alarm_notice = 0 + + var/alarm_raised = 0 + for(var/datum/alarm_handler/AH in queued_alarms) + var/list/alarms = queued_alarms[AH] + var/reported = 0 + for(var/datum/alarm/A in alarms) + if(alarms[A] == 1) + alarm_raised = 1 + if(!reported) + reported = 1 + to_chat(src, "--- [AH.category] Detected ---") + raised_alarm(A) + + for(var/datum/alarm_handler/AH in queued_alarms) + var/list/alarms = queued_alarms[AH] + var/reported = 0 + for(var/datum/alarm/A in alarms) + if(alarms[A] == -1) + if(!reported) + reported = 1 + to_chat(src, "--- [AH.category] Cleared ---") + to_chat(src, "\The [A.alarm_name()].") + + if(alarm_raised) + to_chat(src, "\[Show Alerts\]") + + for(var/datum/alarm_handler/AH in queued_alarms) + var/list/alarms = queued_alarms[AH] + alarms.Cut() + +/mob/living/silicon/proc/raised_alarm(var/datum/alarm/A) + to_chat(src, "[A.alarm_name()]!") + +/mob/living/silicon/ai/raised_alarm(var/datum/alarm/A) + var/cameratext = "" + for(var/obj/machinery/camera/C in A.cameras()) + cameratext += "[(cameratext == "")? "" : "|"][C.c_tag]" + to_chat(src, "[A.alarm_name()]! ([(cameratext)? cameratext : "No Camera"])") + + +/mob/living/silicon/proc/is_traitor() + return mind && (mind in traitors.current_antagonists) + +/mob/living/silicon/proc/is_malf() + return mind && (mind in malf.current_antagonists) + +/mob/living/silicon/proc/is_malf_or_traitor() + return is_traitor() || is_malf() + +/mob/living/silicon/adjustEarDamage() + return + +/mob/living/silicon/setEarDamage() + return + +/mob/living/silicon/reset_view() + . = ..() + if(cameraFollow) + cameraFollow = null + +/mob/living/silicon/flash_eyes(intensity = FLASH_PROTECTION_MODERATE, override_blindness_check = FALSE, affect_silicon = FALSE, visual = FALSE, type = /obj/screen/fullscreen/flash) + if(affect_silicon) + return ..() + +/mob/living/silicon/proc/clear_client() + //Handle job slot/tater cleanup. + var/job = mind.assigned_role + + job_master.FreeRole(job) + + if(mind.objectives.len) + qdel(mind.objectives) + mind.special_role = null + + clear_antag_roles(mind) + + ghostize(0) + qdel(src) + +/mob/living/silicon/has_vision() + return 0 //NOT REAL EYES +>>>>>>> fdabe51... Linter Introduction + Cleanup (#8085) diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/passive/fish.dm b/code/modules/mob/living/simple_mob/subtypes/animal/passive/fish.dm index 7ba595b47b..fe23b86bf7 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/passive/fish.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/passive/fish.dm @@ -43,7 +43,7 @@ default_pixel_y = rand(-6, 10) // Makes the AI unable to willingly go on land. -/mob/living/simple_mob/animal/passive/fish/IMove(newloc) +/mob/living/simple_mob/animal/passive/fish/IMove(turf/newloc, safety = TRUE) if(is_type_in_list(newloc, suitable_turf_types)) return ..() // Procede as normal. return MOVEMENT_FAILED // Don't leave the water! diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/sif/leech.dm b/code/modules/mob/living/simple_mob/subtypes/animal/sif/leech.dm index a6c6aabbf2..41cd6aec93 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/sif/leech.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/sif/leech.dm @@ -192,7 +192,7 @@ chemicals -= 30 if(host.getToxLoss() >= 30 && chemicals > 50) - var/randomchem = pickweight("tramadol" = 7, "anti_toxin" = 15, "frostoil" = 3) + var/randomchem = pickweight(list("tramadol" = 7, "anti_toxin" = 15, "frostoil" = 3)) host.reagents.add_reagent(randomchem, 5) chemicals -= 50 @@ -330,10 +330,6 @@ if(!host) return - if(ai_holder) - ai_holder.hostile = initial(ai_holder.hostile) - ai_holder.lose_target() - host_bodypart.implants -= src host_bodypart = null diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 7c6163855e..4a0ebb576d 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 @@ -1223,3 +1224,1183 @@ GLOBAL_LIST_EMPTY(living_players_by_zlevel) /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) + update_transform() // Some mobs may start bigger or smaller than normal. + update_emotes() + 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) + 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) + . = ..(message, blind_message, exclude_mobs, range) // 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/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(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) + +/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. Can also be used for OOC notes about your character.","Flavor Text",html_decode(flavor_text)) as message|null, extra = 0) + + 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 + stat(A) + + +// facing verbs +/mob/proc/canface() + if(!canmove) return 0 + 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)) + +/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 + +/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) +>>>>>>> fdabe51... Linter Introduction + Cleanup (#8085) diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index daf9ab6d89..ecd6604a83 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -170,7 +170,7 @@ var/mob/living/carbon/LAssailant = null //Wizard mode, but can be used in other modes thanks to the brand new "Give Spell" badmin button - var/spell/list/spell_list = list() + var/list/spell/spell_list = list() //Changlings, but can be used in other modes // var/obj/effect/proc_holder/changpower/list/power_list = list() diff --git a/code/modules/mob/mob_planes.dm b/code/modules/mob/mob_planes.dm index 241840321a..1d557e4e51 100644 --- a/code/modules/mob/mob_planes.dm +++ b/code/modules/mob/mob_planes.dm @@ -82,7 +82,7 @@ if(PM.sub_planes) var/list/subplanes = PM.sub_planes for(var/SP in subplanes) - set_vis(which = SP, new_alpha = new_alpha) + set_vis(which = SP, state = !!new_alpha) /datum/plane_holder/proc/set_ao(var/which = null, var/enabled = FALSE) ASSERT(which) diff --git a/code/modules/mob/skillset.dm b/code/modules/mob/skillset.dm index 2877372491..3afb7a97aa 100644 --- a/code/modules/mob/skillset.dm +++ b/code/modules/mob/skillset.dm @@ -10,5 +10,3 @@ return 0 else return fail_chance * 2 ** (factor*(SKILL_BASIC - points)) - - return FALSE // We don't actually have a skills system, so never fail. diff --git a/code/modules/multiz/hoist.dm b/code/modules/multiz/hoist.dm index 32e2ed9bb7..4a3f14836c 100644 --- a/code/modules/multiz/hoist.dm +++ b/code/modules/multiz/hoist.dm @@ -211,7 +211,7 @@ size = O.w_class user.visible_message(span("notice", "[user] begins to [movtext] \the [hoistee]!"), span("notice", "You begin to [movtext] \the [hoistee]!"), span("notice", "You hear the sound of a crank.")) - if (do_after(user, (1 SECONDS) * size / 4, act_target = src)) + if (do_after(user, (1 SECONDS) * size / 4, target = src)) move_dir(movedir, 1) /obj/structure/hoist/proc/collapse_kit() diff --git a/code/modules/multiz/turf.dm b/code/modules/multiz/turf.dm index f34cae0065..77885e7ce5 100644 --- a/code/modules/multiz/turf.dm +++ b/code/modules/multiz/turf.dm @@ -72,7 +72,7 @@ /turf/simulated/open/proc/update() plane = OPENSPACE_PLANE + src.z below = GetBelow(src) - turf_changed_event.register(below, src, /turf/simulated/open/update_icon) + turf_changed_event.register(below, src, /atom/proc/update_icon) levelupdate() below.update_icon() // So the 'ceiling-less' overlay gets added. for(var/atom/movable/A in src) diff --git a/code/modules/nano/interaction/default.dm b/code/modules/nano/interaction/default.dm new file mode 100644 index 0000000000..89bf16f858 --- /dev/null +++ b/code/modules/nano/interaction/default.dm @@ -0,0 +1,91 @@ +/var/global/datum/topic_state/default/default_state = new() + +/datum/topic_state/default/href_list(var/mob/user) + return list() + +/datum/topic_state/default/can_use_topic(var/src_object, var/mob/user) + return user.default_can_use_topic(src_object) + +/mob/proc/default_can_use_topic(var/src_object) + return STATUS_CLOSE // By default no mob can do anything with NanoUI + +/mob/observer/dead/default_can_use_topic(var/src_object) + if(can_admin_interact()) + return STATUS_INTERACTIVE // Admins are more equal + if(!client || get_dist(src_object, src) > client.view) // Preventing ghosts from having a million windows open by limiting to objects in range + return STATUS_CLOSE + return STATUS_UPDATE // Ghosts can view updates + +/mob/living/silicon/pai/default_can_use_topic(var/src_object) + if((src_object == src || src_object == radio || src_object == communicator) && !stat) + return STATUS_INTERACTIVE + else + return ..() + +/mob/living/silicon/robot/default_can_use_topic(var/src_object) + . = shared_nano_interaction() + if(. <= STATUS_DISABLED) + return + + // robots can interact with things they can see within their view range + if((src_object in view(src)) && get_dist(src_object, src) <= src.client.view) + return STATUS_INTERACTIVE // interactive (green visibility) + return STATUS_DISABLED // no updates, completely disabled (red visibility) + +/mob/living/silicon/ai/default_can_use_topic(var/src_object) + . = shared_nano_interaction() + if(. != STATUS_INTERACTIVE) + return + + // Prevents the AI from using Topic on admin levels (by for example viewing through the court/thunderdome cameras) + // unless it's on the same level as the object it's interacting with. + var/turf/T = get_turf(src_object) + if(!T || !(z == T.z || (T.z in using_map.player_levels))) + return STATUS_CLOSE + + // If an object is in view then we can interact with it + if(src_object in view(client.view, src)) + return STATUS_INTERACTIVE + + // If we're installed in a chassi, rather than transfered to an inteliCard or other container, then check if we have camera view + if(is_in_chassis()) + //stop AIs from leaving windows open and using then after they lose vision + if(cameranet && !cameranet.checkTurfVis(get_turf(src_object))) + return STATUS_CLOSE + return STATUS_INTERACTIVE + else if(get_dist(src_object, src) <= client.view) // View does not return what one would expect while installed in an inteliCard + return STATUS_INTERACTIVE + + return STATUS_CLOSE + +//Some atoms such as vehicles might have special rules for how mobs inside them interact with NanoUI. +/atom/proc/contents_nano_distance(var/src_object, var/mob/living/user) + return user.shared_living_nano_distance(src_object) + +/mob/living/proc/shared_living_nano_distance(var/atom/movable/src_object) + if (!(src_object in view(4, src))) // If the src object is not in visable, disable updates + return STATUS_CLOSE + + var/dist = get_dist(src_object, src) + if (dist <= 1) + return STATUS_INTERACTIVE // interactive (green visibility) + else if (dist <= 2) + return STATUS_UPDATE // update only (orange visibility) + else if (dist <= 4) + return STATUS_DISABLED // no updates, completely disabled (red visibility) + return STATUS_CLOSE + +/mob/living/default_can_use_topic(var/src_object) + . = shared_nano_interaction(src_object) + if(. != STATUS_CLOSE) + if(loc) + . = min(., loc.contents_nano_distance(src_object, src)) + if(. == STATUS_INTERACTIVE) + return STATUS_UPDATE + +/mob/living/carbon/human/default_can_use_topic(var/src_object) + . = shared_nano_interaction(src_object) + if(. != STATUS_CLOSE) + . = min(., shared_living_nano_distance(src_object)) + if(. == STATUS_UPDATE && (TK in mutations)) // If we have telekinesis and remain close enough, allow interaction. + return STATUS_INTERACTIVE diff --git a/code/modules/nano/nanoexternal.dm b/code/modules/nano/nanoexternal.dm new file mode 100644 index 0000000000..fa22cb1580 --- /dev/null +++ b/code/modules/nano/nanoexternal.dm @@ -0,0 +1,44 @@ + // This file contains all Nano procs/definitions for external classes/objects + + /** + * Called when a Nano UI window is closed + * This is how Nano handles closed windows + * It must be a verb so that it can be called using winset + * + * @return nothing + */ +/client/verb/nanoclose(var/uiref as text) + set hidden = 1 // hide this verb from the user's panel + set name = "nanoclose" + + var/datum/nanoui/ui = locate(uiref) + + if (istype(ui)) + ui.close() + + if(ui.ref) + var/href = "close=1" + src.Topic(href, params2list(href), ui.ref) // this will direct to the atom's Topic() proc via client.Topic() + else if (ui.on_close_logic) + // no atomref specified (or not found) + // so just reset the user mob's machine var + if(src && src.mob) + src.mob.unset_machine() + + /** + * The ui_interact proc is used to open and update Nano UIs + * If ui_interact is not used then the UI will not update correctly + * ui_interact is currently defined for /atom/movable + * + * @param user /mob The mob who is interacting with this ui + * @param ui_key string A string key to use for this ui. Allows for multiple unique uis on one obj/mob (defaut value "main") + * @param ui /datum/nanoui This parameter is passed by the nanoui process() proc when updating an open ui + * @param force_open boolean Force the UI to (re)open, even if it's already open + * + * @return nothing + */ +/datum/proc/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, master_ui = null, var/datum/topic_state/state = default_state) + return + +// Used by the Nano UI Manager (/datum/nanomanager) to track UIs opened by this mob +/mob/var/list/open_uis = list() diff --git a/code/modules/organs/internal/robotic/heatsink.dm b/code/modules/organs/internal/robotic/heatsink.dm index 4db6e41922..2309a9b7c2 100644 --- a/code/modules/organs/internal/robotic/heatsink.dm +++ b/code/modules/organs/internal/robotic/heatsink.dm @@ -38,7 +38,8 @@ var/obj/mecha/M = owner.loc return M.return_temperature() else if(istype(owner.loc, /obj/machinery/atmospherics/unary/cryo_cell)) - return owner.loc:air_contents.temperature + var/obj/machinery/atmospherics/unary/cryo_cell/cc = owner.loc + return cc.air_contents.temperature var/turf/T = get_turf(src) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 6a3323e4d9..abaf66559d 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -581,7 +581,7 @@ This function completely restores a damaged organ to perfect condition. //external organs handle brokenness a bit differently when it comes to damage. Instead brute_dam is checked inside process() //this also ensures that an external organ cannot be "broken" without broken_description being set. /obj/item/organ/external/is_broken() - return ((status & ORGAN_CUT_AWAY) || (status & ORGAN_BROKEN) && (!splinted || (splinted && splinted in src.contents && prob(30)))) + return ((status & ORGAN_CUT_AWAY) || (status & ORGAN_BROKEN) && (!splinted || (splinted && (splinted in src.contents) && prob(30)))) //Determines if we even need to process this organ. /obj/item/organ/external/proc/need_process() @@ -988,12 +988,12 @@ Note that amputating the affected organ does in fact remove the infection from t holder = owner if(!holder) return - if (holder.handcuffed && body_part in list(ARM_LEFT, ARM_RIGHT, HAND_LEFT, HAND_RIGHT)) + if (holder.handcuffed && (body_part in list(ARM_LEFT, ARM_RIGHT, HAND_LEFT, HAND_RIGHT))) holder.visible_message(\ "\The [holder.handcuffed.name] falls off of [holder.name].",\ "\The [holder.handcuffed.name] falls off you.") holder.drop_from_inventory(holder.handcuffed) - if (holder.legcuffed && body_part in list(FOOT_LEFT, FOOT_RIGHT, LEG_LEFT, LEG_RIGHT)) + if (holder.legcuffed && (body_part in list(FOOT_LEFT, FOOT_RIGHT, LEG_LEFT, LEG_RIGHT))) holder.visible_message(\ "\The [holder.legcuffed.name] falls off of [holder.name].",\ "\The [holder.legcuffed.name] falls off you.") diff --git a/code/modules/organs/subtypes/diona.dm b/code/modules/organs/subtypes/diona.dm index 6b6367e8a0..3d320e3742 100644 --- a/code/modules/organs/subtypes/diona.dm +++ b/code/modules/organs/subtypes/diona.dm @@ -15,7 +15,7 @@ if(D) if(!D.ckey || !D.client) D.death() - return 1 + return /obj/item/organ/external/diona name = "tendril" diff --git a/code/modules/paperwork/faxmachine.dm b/code/modules/paperwork/faxmachine.dm index 9f4a183b31..e594b6514f 100644 --- a/code/modules/paperwork/faxmachine.dm +++ b/code/modules/paperwork/faxmachine.dm @@ -208,16 +208,23 @@ var/list/adminfaxes = list() //cache for faxes that have been sent to admins adminfaxes += rcvdcopy //message badmins that a fax has arrived - if (destination == using_map.boss_name) + + // Sadly, we can't use a switch statement here due to not using a constant value for the current map's centcom name. + if(destination == using_map.boss_name) message_admins(sender, "[uppertext(using_map.boss_short)] FAX", rcvdcopy, "CentComFaxReply", "#006100") +<<<<<<< HEAD else if (destination == "Virgo-Prime Governmental Authority") // Vorestation Edit message_admins(sender, "VIRGO GOVERNMENT FAX", rcvdcopy, "CentComFaxReply", "#1F66A0") else if (destination == "Supply") +======= + else if(destination == "Sif Governmental Authority") + message_admins(sender, "SIF GOVERNMENT FAX", rcvdcopy, "CentComFaxReply", "#1F66A0") + else if(destination == "Supply") +>>>>>>> fdabe51... Linter Introduction + Cleanup (#8085) message_admins(sender, "[uppertext(using_map.boss_short)] SUPPLY FAX", rcvdcopy, "CentComFaxReply", "#5F4519") else message_admins(sender, "[uppertext(destination)] FAX", rcvdcopy, "UNKNOWN") - sendcooldown = 1800 sleep(50) visible_message("[src] beeps, \"Message transmitted successfully.\"") diff --git a/code/modules/paperwork/filingcabinet.dm b/code/modules/paperwork/filingcabinet.dm index 3d12e68534..c4fa72a9b5 100644 --- a/code/modules/paperwork/filingcabinet.dm +++ b/code/modules/paperwork/filingcabinet.dm @@ -90,16 +90,14 @@ ui.open() /obj/structure/filingcabinet/tgui_data(mob/user) - var/list/data = list() - - data["contents"] = list() + var/list/files = list() for(var/obj/item/P in src) - data["contents"].Add(list(list( + files.Add(list(list( "name" = P.name, "ref" = "\ref[P]", ))) - return data + return list("contents" = files) /obj/structure/filingcabinet/tgui_act(action, params) if(..()) @@ -146,7 +144,6 @@ P.name = "Security Record ([G.fields["name"]])" virgin = 0 //tabbing here is correct- it's possible for people to try and use it //before the records have been generated, so we do this inside the loop. - ..() /obj/structure/filingcabinet/security/attack_hand() populate() @@ -184,7 +181,6 @@ P.name = "Medical Record ([G.fields["name"]])" virgin = 0 //tabbing here is correct- it's possible for people to try and use it //before the records have been generated, so we do this inside the loop. - ..() /obj/structure/filingcabinet/medical/attack_hand() populate() diff --git a/code/modules/paperwork/stamps.dm b/code/modules/paperwork/stamps.dm index 5d15083229..8667ffc772 100644 --- a/code/modules/paperwork/stamps.dm +++ b/code/modules/paperwork/stamps.dm @@ -88,7 +88,7 @@ var/input_stamp = input(user, "Choose a stamp to disguise as.", "Choose a stamp.") in show_stamps - if(user && src in user.contents) + if(user && (src in user.contents)) // Er, how necessary is this in attack_self? var/obj/item/weapon/stamp/chosen_stamp = stamps[capitalize(input_stamp)] diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index cfc8a9de5a..10b9889f89 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -635,7 +635,6 @@ obj/structure/cable/proc/cableColor(var/colorC) src.use(15) else to_chat(usr, "You cannot do that.") - ..() /obj/item/stack/cable_coil/cyborg/verb/set_colour() set name = "Change Colour" diff --git a/code/modules/power/fusion/core/core_field.dm b/code/modules/power/fusion/core/core_field.dm index 0fb3c63b40..9be55a9ce0 100644 --- a/code/modules/power/fusion/core/core_field.dm +++ b/code/modules/power/fusion/core/core_field.dm @@ -531,12 +531,10 @@ if(percent_unstable >= warnpoint) //we're unstable, start warning engineering global_announcer.autosay(warnmessage, "Field Stability Monitor", "Engineering") - stable = 0 //we know we're not stable, so let's not state the safe message. - sleep(20) - return - if(percent_unstable < warnpoint && stable == 0) //The field is stable again. Let's set our safe variable and state the safe message. + stable = FALSE //we know we're not stable, so let's not state the safe message. + else if(percent_unstable < warnpoint && stable == 0) //The field is stable again. Let's set our safe variable and state the safe message. global_announcer.autosay(stablemessage, "Field Stability Monitor", "Engineering") - stable = 1 + stable = TRUE return //Reaction radiation is fairly buggy and there's at least three procs dealing with radiation here, this is to ensure constant radiation output. diff --git a/code/modules/power/singularity/containment_field.dm b/code/modules/power/singularity/containment_field.dm index c3927ec2bd..50655315ad 100644 --- a/code/modules/power/singularity/containment_field.dm +++ b/code/modules/power/singularity/containment_field.dm @@ -18,7 +18,7 @@ /obj/machinery/containment_field/Initialize() . = ..() shockdirs = list(turn(dir,90),turn(dir,-90)) - sense_proximity(callback = .HasProximity) + sense_proximity(callback = /atom/proc/HasProximity) /obj/machinery/containment_field/set_dir(new_dir) . = ..() @@ -26,7 +26,7 @@ shockdirs = list(turn(dir,90),turn(dir,-90)) /obj/machinery/containment_field/Destroy() - unsense_proximity(callback = .HasProximity) + unsense_proximity(callback = /atom/proc/HasProximity) if(FG1 && !FG1.clean_up) FG1.cleanup() if(FG2 && !FG2.clean_up) diff --git a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm index 08af0c23a5..6d7108fbd6 100644 --- a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm +++ b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm @@ -244,7 +244,6 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin update_state() update_icon() return 1 - return 0 @@ -384,4 +383,3 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin update_use_power(USE_POWER_IDLE) update_icon() return 1 - return 0 diff --git a/code/modules/projectiles/projectile/hook.dm b/code/modules/projectiles/projectile/hook.dm index 3e98319ebd..35b39910a0 100644 --- a/code/modules/projectiles/projectile/hook.dm +++ b/code/modules/projectiles/projectile/hook.dm @@ -127,7 +127,7 @@ if(!target_mob) return - if(Bump(target_mob, forced=1)) //If we hit a turf, try to force an interaction with a mob on the turf. + if(Bump(target_mob)) //If we hit a turf, try to force an interaction with a mob on the turf. done_mob_unique = TRUE success = TRUE else if(firer) diff --git a/code/modules/reagents/reagents/medicine.dm b/code/modules/reagents/reagents/medicine.dm index 98b8f9c841..e2b175fe1f 100644 --- a/code/modules/reagents/reagents/medicine.dm +++ b/code/modules/reagents/reagents/medicine.dm @@ -240,7 +240,8 @@ /datum/reagent/carthatoline/overdose(var/mob/living/carbon/M, var/alien, var/removed) M.adjustHalLoss(2) var/mob/living/carbon/human/H = M - H.internal_organs_by_name[O_STOMACH].take_damage(removed * 2) // Causes stomach contractions, makes sense for an overdose to make it much worse. + var/obj/item/organ/internal/stomach/st = H.internal_organs_by_name[O_STOMACH] + st?.take_damage(removed * 2) // Causes stomach contractions, makes sense for an overdose to make it much worse. /datum/reagent/dexalin name = "Dexalin" @@ -612,7 +613,8 @@ ..() if(prob(5)) // 1 in 20 var/mob/living/carbon/human/H = M - H.internal_organs_by_name[O_HEART].take_damage(1) + var/obj/item/organ/internal/heart/ht = H.internal_organs_by_name[O_HEART] + ht?.take_damage(1) to_chat(M, "Huh... Is this what a heart attack feels like?") /datum/reagent/alkysine diff --git a/code/modules/reagents/reagents/toxins.dm b/code/modules/reagents/reagents/toxins.dm index 6055ff244b..0ea989228a 100644 --- a/code/modules/reagents/reagents/toxins.dm +++ b/code/modules/reagents/reagents/toxins.dm @@ -246,7 +246,8 @@ ..() if(prob(10)) // 1 in 10. This thing's made with welder fuel and fertilizer, what do you expect? var/mob/living/carbon/human/H = M - H.internal_organs_by_name[O_HEART].take_damage(1) + var/obj/item/organ/internal/heart/ht = H.internal_organs_by_name[O_HEART] + ht?.take_damage(1) to_chat(M, "Huh... Is this what a heart attack feels like?") /datum/reagent/toxin/potassium_chloride diff --git a/code/modules/recycling/disposal-construction.dm b/code/modules/recycling/disposal-construction.dm index 62c9faec5d..a336d4c0e8 100644 --- a/code/modules/recycling/disposal-construction.dm +++ b/code/modules/recycling/disposal-construction.dm @@ -23,7 +23,7 @@ ptype = newtype dir = newdir // Disposals handle "bent"/"corner" strangely, handle this specially. - if(ptype == DISPOSAL_PIPE_STRAIGHT && dir in cornerdirs) + if(ptype == DISPOSAL_PIPE_STRAIGHT && (dir in cornerdirs)) ptype = DISPOSAL_PIPE_CORNER switch(dir) if(NORTHWEST) diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index 08d68d8956..1fdf44119d 100755 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -359,6 +359,7 @@ /obj/item/device/destTagger/attack_self(mob/user as mob) tgui_interact(user) +<<<<<<< HEAD /obj/item/device/destTagger/tgui_act(action, params) if(..()) return TRUE @@ -370,6 +371,13 @@ return FALSE currTag = new_tag . = TRUE +======= + Topic(href, href_list) + src.add_fingerprint(usr) + if(href_list["nextTag"] && (href_list["nextTag"] in GLOB.tagger_locations)) + src.currTag = href_list["nextTag"] + openwindow(usr) +>>>>>>> fdabe51... Linter Introduction + Cleanup (#8085) /obj/machinery/disposal/deliveryChute name = "Delivery chute" diff --git a/code/modules/scripting/IDE.dm b/code/modules/scripting/IDE.dm index 3974e2dee4..8adc021c4d 100644 --- a/code/modules/scripting/IDE.dm +++ b/code/modules/scripting/IDE.dm @@ -1,7 +1,7 @@ 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)) + if((istype(mob.machine, /obj/machinery/computer/telecomms/traffic) && (mob.machine in view(1, mob))) || issilicon(mob)) var/obj/machinery/computer/telecomms/traffic/Machine = mob.machine if(Machine.editingcode != mob) return @@ -28,7 +28,7 @@ client/verb/tcssave() 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) )) + 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) )) var/obj/machinery/computer/telecomms/traffic/Machine = mob.machine if(Machine.editingcode != mob) return @@ -79,7 +79,7 @@ client/verb/tcscompile() 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) )) + 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) )) var/obj/machinery/computer/telecomms/traffic/Machine = mob.machine if(Machine.editingcode != mob) return @@ -145,7 +145,7 @@ client/verb/tcsrun() 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) )) + 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) )) var/obj/machinery/computer/telecomms/traffic/Machine = mob.machine if(Machine.editingcode == mob) Machine.storedcode = "[winget(mob, "tcscode", "text")]" @@ -157,7 +157,7 @@ client/verb/exittcs() 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) )) + 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) )) var/obj/machinery/computer/telecomms/traffic/Machine = mob.machine if(Machine.editingcode != mob) return @@ -186,7 +186,7 @@ client/verb/tcsrevert() 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) )) + 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) )) var/obj/machinery/computer/telecomms/traffic/Machine = mob.machine if(Machine.editingcode != mob) return diff --git a/code/modules/shieldgen/shield_capacitor.dm b/code/modules/shieldgen/shield_capacitor.dm index d76a18045a..35cd71e134 100644 --- a/code/modules/shieldgen/shield_capacitor.dm +++ b/code/modules/shieldgen/shield_capacitor.dm @@ -40,7 +40,7 @@ if(istype(W, /obj/item/weapon/card/id)) var/obj/item/weapon/card/id/C = W - if(access_captain in C.access || access_security in C.access || access_engine in C.access) + if((access_captain in C.access) || (access_security in C.access) || (access_engine in C.access)) src.locked = !src.locked to_chat(user, "Controls are now [src.locked ? "locked." : "unlocked."]") updateDialog() @@ -59,7 +59,7 @@ owned_gen.capacitors |= src owned_gen.updateDialog() else - if(owned_gen && src in owned_gen.capacitors) + if(owned_gen && (src in owned_gen.capacitors)) owned_gen.capacitors -= src owned_gen = null else diff --git a/code/modules/shieldgen/shield_gen.dm b/code/modules/shieldgen/shield_gen.dm index 08d0b8ce86..ee35dd2657 100644 --- a/code/modules/shieldgen/shield_gen.dm +++ b/code/modules/shieldgen/shield_gen.dm @@ -60,7 +60,7 @@ /obj/machinery/shield_gen/attackby(obj/item/W, mob/user) if(istype(W, /obj/item/weapon/card/id)) var/obj/item/weapon/card/id/C = W - if(access_captain in C.access || access_security in C.access || access_engine in C.access) + if((access_captain in C.access) || (access_security in C.access) || (access_engine in C.access)) src.locked = !src.locked to_chat(user, "Controls are now [src.locked ? "locked." : "unlocked."]") updateDialog() @@ -110,19 +110,18 @@ return ..() /obj/machinery/shield_gen/tgui_data(mob/user) - var/list/data = list() + var/list/lockedData = list() - data["locked"] = locked - data["lockedData"] = list() if(!locked) - data["lockedData"]["capacitors"] = list() + var/list/caps = list() for(var/obj/machinery/shield_capacitor/C in capacitors) - data["lockedData"]["capacitors"].Add(list(list( + caps.Add(list(list( "active" = C.active, "stored_charge" = C.stored_charge, "max_charge" = C.max_charge, "failing" = (C.time_since_fail <= 2), ))) +<<<<<<< HEAD data["lockedData"]["active"] = active data["lockedData"]["failing"] = (time_since_fail <= 2) @@ -140,6 +139,26 @@ data["lockedData"]["gen_power"] = round(field.len * min(strengthen_rate, target_field_strength - average_field_strength) / energy_conversion_rate) return data +======= + lockedData["capacitors"] = caps + + lockedData["active"] = active + lockedData["failing"] = (time_since_fail <= 2) + lockedData["radius"] = field_radius + lockedData["max_radius"] = max_field_radius + lockedData["z_range"] = z_range + lockedData["max_z_range"] = 10 + lockedData["average_field_strength"] = average_field_strength + lockedData["target_field_strength"] = target_field_strength + lockedData["max_field_strength"] = max_field_strength + lockedData["shields"] = LAZYLEN(field) + lockedData["upkeep"] = round(field.len * max(average_field_strength * dissipation_rate, min_dissipation) / energy_conversion_rate) + lockedData["strengthen_rate"] = strengthen_rate + lockedData["max_strengthen_rate"] = max_strengthen_rate + lockedData["gen_power"] = round(field.len * min(strengthen_rate, target_field_strength - average_field_strength) / energy_conversion_rate) + + return list("locked" = locked, "lockedData" = lockedData) +>>>>>>> fdabe51... Linter Introduction + Cleanup (#8085) /obj/machinery/shield_gen/process() if (!anchored && active) diff --git a/code/modules/shuttles/escape_pods.dm b/code/modules/shuttles/escape_pods.dm index b1d3efdc0c..6e8a41fd3c 100644 --- a/code/modules/shuttles/escape_pods.dm +++ b/code/modules/shuttles/escape_pods.dm @@ -60,9 +60,34 @@ "internalTemplateName" = "EscapePodConsole", ) +<<<<<<< HEAD /obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod/tgui_act(action, params) if(..()) return TRUE +======= + ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open) + + if (!ui) + ui = new(user, src, ui_key, "escape_pod_console.tmpl", name, 470, 290) + ui.set_initial_data(data) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod/Topic(href, href_list) + if((. = ..())) + return + + if(href_list["manual_arm"]) + pod.arming_controller.arm() + return TOPIC_REFRESH + if(href_list["force_launch"]) + if (pod.can_force()) + pod.force_launch(src) + else if (emergency_shuttle.departed && pod.can_launch()) //allow players to manually launch ahead of time if the shuttle leaves + pod.launch(src) + return TOPIC_REFRESH + return 0 +>>>>>>> fdabe51... Linter Introduction + Cleanup (#8085) switch(action) if("manual_arm") diff --git a/code/modules/shuttles/web_datums.dm b/code/modules/shuttles/web_datums.dm index bbba42dd58..6e34d3750b 100644 --- a/code/modules/shuttles/web_datums.dm +++ b/code/modules/shuttles/web_datums.dm @@ -220,6 +220,7 @@ return current_destination.routes.Copy() /datum/shuttle_web_master/proc/get_current_destination() + RETURN_TYPE(/datum/shuttle_destination) return current_destination /datum/shuttle_web_master/proc/get_destination_by_type(var/type_to_get) diff --git a/code/modules/spells/spell_code.dm b/code/modules/spells/spell_code.dm index f2a85f7bbe..5ab0643450 100644 --- a/code/modules/spells/spell_code.dm +++ b/code/modules/spells/spell_code.dm @@ -277,7 +277,7 @@ var/list/spells = typesof(/spell) //needed for the badmin verb for now if(level_max[Sp_TOTAL] <= ( spell_levels[Sp_SPEED] + spell_levels[Sp_POWER] )) //too many levels, can't do it return 0 - if(upgrade_type && upgrade_type in spell_levels && upgrade_type in level_max) + if(upgrade_type && (upgrade_type in spell_levels) && (upgrade_type in level_max)) if(spell_levels[upgrade_type] >= level_max[upgrade_type]) return 0 diff --git a/code/modules/spells/spellbook.dm b/code/modules/spells/spellbook.dm index 831d44ba2f..b4e5e94b70 100644 --- a/code/modules/spells/spellbook.dm +++ b/code/modules/spells/spellbook.dm @@ -291,7 +291,7 @@ /obj/item/weapon/spellbook/oneuse/fireball/recoil(mob/user as mob) ..() - explosion(user.loc, -1, 0, 2, 3, 0, flame_range = 2) + explosion(user.loc, -1, 0, 2, 3, 0) qdel(src) /obj/item/weapon/spellbook/oneuse/smoke diff --git a/code/modules/tables/presets.dm b/code/modules/tables/presets.dm index 085489b26a..93b9de593b 100644 --- a/code/modules/tables/presets.dm +++ b/code/modules/tables/presets.dm @@ -129,7 +129,7 @@ verbs -= /obj/structure/table/proc/do_put ..() -/obj/structure/table/alien/dismantle(obj/item/weapon/wrench/W, mob/user) +/obj/structure/table/alien/dismantle(obj/item/weapon/tool/wrench/W, mob/user) to_chat(user, "You cannot dismantle \the [src].") return diff --git a/code/modules/tables/rack.dm b/code/modules/tables/rack.dm index b07aa188b7..c39fb2c59f 100644 --- a/code/modules/tables/rack.dm +++ b/code/modules/tables/rack.dm @@ -23,6 +23,6 @@ color = material.icon_colour return -/obj/structure/table/rack/holorack/dismantle(obj/item/weapon/wrench/W, mob/user) +/obj/structure/table/rack/holorack/dismantle(obj/item/weapon/tool/wrench/W, mob/user) to_chat(user, "You cannot dismantle \the [src].") return diff --git a/code/modules/tgui/modules/atmos_control.dm b/code/modules/tgui/modules/atmos_control.dm index 4fd477a531..6f573ad96c 100644 --- a/code/modules/tgui/modules/atmos_control.dm +++ b/code/modules/tgui/modules/atmos_control.dm @@ -13,7 +13,7 @@ if(monitored_alarm_ids) for(var/obj/machinery/alarm/alarm in machines) - if(alarm.alarm_id && alarm.alarm_id in monitored_alarm_ids) + if(alarm.alarm_id && (alarm.alarm_id in monitored_alarm_ids)) monitored_alarms += alarm // machines may not yet be ordered at this point monitored_alarms = dd_sortedObjectList(monitored_alarms) diff --git a/code/modules/turbolift/turbolift_console.dm b/code/modules/turbolift/turbolift_console.dm index 4d300bcfc2..9868188d18 100644 --- a/code/modules/turbolift/turbolift_console.dm +++ b/code/modules/turbolift/turbolift_console.dm @@ -158,10 +158,10 @@ data["doors_open"] = lift.doors_are_open() data["fire_mode"] = lift.fire_mode - data["floors"] = list() + var/list/floors = list() for(var/i in lift.floors.len to 1 step -1) var/datum/turbolift_floor/floor = lift.floors[i] - data["floors"].Add(list(list( + floors.Add(list(list( "id" = i, "ref" = "\ref[floor]", "queued" = (floor in lift.queued_floors), @@ -170,6 +170,7 @@ "label" = floor.label, "name" = floor.name, ))) + data["floors"] = floors return data diff --git a/code/modules/vchat/vchat_client.dm b/code/modules/vchat/vchat_client.dm index f5b6613cdf..f005a8f2f1 100644 --- a/code/modules/vchat/vchat_client.dm +++ b/code/modules/vchat/vchat_client.dm @@ -176,7 +176,6 @@ GLOBAL_DATUM_INIT(iconCache, /savefile, new("data/iconCache.sav")) //Cache of ic /proc/jsEncode(var/list/message) { if(!islist(message)) CRASH("Passed a non-list to encode.") - return; //Necessary? return url_encode(url_encode(json_encode(message))) } diff --git a/code/modules/virus2/disease2.dm b/code/modules/virus2/disease2.dm index 9d37b1db29..67d76a8177 100644 --- a/code/modules/virus2/disease2.dm +++ b/code/modules/virus2/disease2.dm @@ -253,17 +253,18 @@ var/global/list/virusDB = list() "rate" = stageprob * 10, "resistance" = resistance, "species" = jointext(affected_species, ", "), - "symptoms" = list(), "ref" = "\ref[src]", ) - + + var/list/symptoms = list() for(var/datum/disease2/effectholder/E in effects) - .["symptoms"].Add(list(list( + symptoms.Add(list(list( "stage" = E.stage, "name" = E.effect.name, "strength" = "[E.multiplier >= 3 ? "Severe" : E.multiplier > 1 ? "Above Average" : "Average"]", "aggressiveness" = E.chance * 15, ))) + .["symptoms"] = symptoms /datum/disease2/disease/proc/addToDB() if ("[uniqueID]" in virusDB) diff --git a/code/modules/xenoarcheaology/finds/special.dm b/code/modules/xenoarcheaology/finds/special.dm index 2a7f149dfa..69aa73a02f 100644 --- a/code/modules/xenoarcheaology/finds/special.dm +++ b/code/modules/xenoarcheaology/finds/special.dm @@ -118,7 +118,7 @@ /obj/item/weapon/vampiric/hear_talk(mob/M, list/message_pieces, verb) ..() - if(world.time - last_bloodcall >= bloodcall_interval && M in view(7, src)) + if(world.time - last_bloodcall >= bloodcall_interval && (M in view(7, src))) bloodcall(M) /obj/item/weapon/vampiric/proc/bloodcall(var/mob/living/carbon/human/M) diff --git a/code/modules/xgm/xgm_gas_mixture.dm b/code/modules/xgm/xgm_gas_mixture.dm index 6036b7381a..1e363f35c9 100644 --- a/code/modules/xgm/xgm_gas_mixture.dm +++ b/code/modules/xgm/xgm_gas_mixture.dm @@ -446,7 +446,7 @@ //Equalizes a list of gas mixtures. Used for pipe networks. -/proc/equalize_gases(datum/gas_mixture/list/gases) +/proc/equalize_gases(list/datum/gas_mixture/gases) //Calculate totals from individual components var/total_volume = 0 var/total_thermal_energy = 0 diff --git a/maps/southern_cross/overmap/sectors.dm b/maps/southern_cross/overmap/sectors.dm index 6bfc3edfa1..36b074235c 100644 --- a/maps/southern_cross/overmap/sectors.dm +++ b/maps/southern_cross/overmap/sectors.dm @@ -24,9 +24,10 @@ docking_codes = null /obj/effect/overmap/visitable/planet/Sif/get_skybox_representation() - . = ..() - (.).pixel_x = skybox_offset_x - (.).pixel_y = skybox_offset_y + var/image/tmp = ..() + tmp.pixel_x = skybox_offset_x + tmp.pixel_y = skybox_offset_y + return tmp /obj/effect/overmap/visitable/Southern_Cross name = "Southern Cross" diff --git a/vorestation.dme b/vorestation.dme index 3d45c71f86..b82e8ef04d 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -80,6 +80,7 @@ #include "code\__defines\shields.dm" #include "code\__defines\shuttle.dm" #include "code\__defines\sound.dm" +#include "code\__defines\spaceman_dmm.dm" #include "code\__defines\species_languages.dm" #include "code\__defines\species_languages_vr.dm" #include "code\__defines\sqlite_defines.dm" From be32764665a30c5e88cf270c17318a9899f388a3 Mon Sep 17 00:00:00 2001 From: Novacat <35587478+Novacat@users.noreply.github.com> Date: Tue, 25 May 2021 23:21:36 -0400 Subject: [PATCH 02/13] Update pointdefense.dm --- code/game/machinery/pointdefense.dm | 5 ----- 1 file changed, 5 deletions(-) diff --git a/code/game/machinery/pointdefense.dm b/code/game/machinery/pointdefense.dm index c4781353c7..e9d513319a 100644 --- a/code/game/machinery/pointdefense.dm +++ b/code/game/machinery/pointdefense.dm @@ -77,13 +77,8 @@ GLOBAL_LIST_BOILERPLATE(pointdefense_turrets, /obj/machinery/power/pointdefense) if(id_tag) var/list/connected_z_levels = GetConnectedZlevels(get_z(src)) for(var/i = 1 to LAZYLEN(pointdefense_turrets)) -<<<<<<< HEAD - var/obj/machinery/power/pointdefense/PD = pointdefense_turrets[i] - if(!(PD.id_tag == id_tag && get_z(PD) in connected_z_levels)) -======= var/obj/machinery/pointdefense/PD = pointdefense_turrets[i] if(!(PD.id_tag == id_tag && (get_z(PD) in connected_z_levels))) ->>>>>>> fdabe51... Linter Introduction + Cleanup (#8085) continue var/list/turret = list() turret["id"] = "#[i]" From 726c90fac94d0f51bc0ef25804aacf0ea9cdce5b Mon Sep 17 00:00:00 2001 From: Novacat <35587478+Novacat@users.noreply.github.com> Date: Tue, 25 May 2021 23:22:40 -0400 Subject: [PATCH 03/13] Update escape_pods.dm --- code/modules/shuttles/escape_pods.dm | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/code/modules/shuttles/escape_pods.dm b/code/modules/shuttles/escape_pods.dm index 6e8a41fd3c..b1d3efdc0c 100644 --- a/code/modules/shuttles/escape_pods.dm +++ b/code/modules/shuttles/escape_pods.dm @@ -60,34 +60,9 @@ "internalTemplateName" = "EscapePodConsole", ) -<<<<<<< HEAD /obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod/tgui_act(action, params) if(..()) return TRUE -======= - ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open) - - if (!ui) - ui = new(user, src, ui_key, "escape_pod_console.tmpl", name, 470, 290) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) - -/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod/Topic(href, href_list) - if((. = ..())) - return - - if(href_list["manual_arm"]) - pod.arming_controller.arm() - return TOPIC_REFRESH - if(href_list["force_launch"]) - if (pod.can_force()) - pod.force_launch(src) - else if (emergency_shuttle.departed && pod.can_launch()) //allow players to manually launch ahead of time if the shuttle leaves - pod.launch(src) - return TOPIC_REFRESH - return 0 ->>>>>>> fdabe51... Linter Introduction + Cleanup (#8085) switch(action) if("manual_arm") From 408b0f366da29bbfad48cca023fe1bf1ff40e1d6 Mon Sep 17 00:00:00 2001 From: Novacat <35587478+Novacat@users.noreply.github.com> Date: Tue, 25 May 2021 23:25:28 -0400 Subject: [PATCH 04/13] Update spreading.dm --- code/modules/hydroponics/spreading/spreading.dm | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/code/modules/hydroponics/spreading/spreading.dm b/code/modules/hydroponics/spreading/spreading.dm index ca99d733a5..73d93abe55 100644 --- a/code/modules/hydroponics/spreading/spreading.dm +++ b/code/modules/hydroponics/spreading/spreading.dm @@ -74,13 +74,8 @@ /obj/effect/plant/Destroy() neighbors.Cut() if(seed.get_trait(TRAIT_SPREAD)==2) -<<<<<<< HEAD - unsense_proximity(callback = .HasProximity, center = get_turf(src)) - SSplants.remove_plant(src) -======= unsense_proximity(callback = /atom/proc/HasProximity, center = get_turf(src)) - plant_controller.remove_plant(src) ->>>>>>> fdabe51... Linter Introduction + Cleanup (#8085) + SSplants.remove_plant(src) for(var/obj/effect/plant/neighbor in range(1,src)) SSplants.add_plant(neighbor) return ..() From d52621ab52c77b9392ef7f4642e14b3fd7c1f858 Mon Sep 17 00:00:00 2001 From: Novacat <35587478+Novacat@users.noreply.github.com> Date: Tue, 25 May 2021 23:26:04 -0400 Subject: [PATCH 05/13] Update ai_container.dm --- .../spacesuits/rig/modules/specific/ai_container.dm | 7 ------- 1 file changed, 7 deletions(-) diff --git a/code/modules/clothing/spacesuits/rig/modules/specific/ai_container.dm b/code/modules/clothing/spacesuits/rig/modules/specific/ai_container.dm index adbf514caf..cdc86a0acf 100644 --- a/code/modules/clothing/spacesuits/rig/modules/specific/ai_container.dm +++ b/code/modules/clothing/spacesuits/rig/modules/specific/ai_container.dm @@ -132,18 +132,11 @@ var/mob/living/carbon/human/H = holder.wearer if(!target) -<<<<<<< HEAD if(ai_card) if(istype(ai_card,/obj/item/device/aicard)) ai_card.tgui_interact(H, custom_state = GLOB.tgui_deep_inventory_state) else eject_ai(H) -======= - if(istype(ai_card)) - ai_card.tgui_interact(H, custom_state = deep_inventory_state) - else - eject_ai(H) ->>>>>>> fdabe51... Linter Introduction + Cleanup (#8085) update_verb_holder() return 1 From 01c3feae6f163212045ef98edba5350c142dad0b Mon Sep 17 00:00:00 2001 From: Novacat <35587478+Novacat@users.noreply.github.com> Date: Tue, 25 May 2021 23:27:04 -0400 Subject: [PATCH 06/13] Update tree_networking.dm --- .../malfunction/newmalf_ability_trees/tree_networking.dm | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm index 13e3b15316..03f7474380 100644 --- a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm +++ b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm @@ -193,13 +193,8 @@ to_chat(user, "## REACHABLE APC SYSTEMS OVERTAKEN. BYPASSING PRIMARY FIREWALL.") sleep(300) // Hack all APCs, including those built during hack sequence. -<<<<<<< HEAD for(var/obj/machinery/power/apc/A in GLOB.apcs) - if((!A.hacker || A.hacker != src) && !A.aidisabled && A.z in using_map.station_levels) -======= - for(var/obj/machinery/power/apc/A in machines) if((!A.hacker || A.hacker != src) && !A.aidisabled && (A.z in using_map.station_levels)) ->>>>>>> fdabe51... Linter Introduction + Cleanup (#8085) A.ai_hack(src) @@ -211,4 +206,4 @@ user.verbs += new/datum/game_mode/malfunction/verb/ai_destroy_station() -// END ABILITY VERBS \ No newline at end of file +// END ABILITY VERBS From 00a42a96eac4bcabfbdf6ac00d8a5265f69423ac Mon Sep 17 00:00:00 2001 From: Aronai Sieyes Date: Thu, 27 May 2021 11:12:51 -0400 Subject: [PATCH 07/13] Finish polaris linter portions --- code/game/machinery/pointdefense.dm | 2 +- code/modules/admin/verbs/pray.dm | 14 +- code/modules/mob/dead/observer/observer.dm | 917 +----------- code/modules/mob/living/living_defense.dm | 647 --------- .../silicon/robot/drone/drone_console.dm | 5 - code/modules/mob/living/silicon/silicon.dm | 446 +----- code/modules/mob/mob.dm | 1281 +---------------- code/modules/paperwork/faxmachine.dm | 10 +- code/modules/recycling/sortingmachinery.dm | 8 - code/modules/shieldgen/shield_gen.dm | 20 - 10 files changed, 75 insertions(+), 3275 deletions(-) diff --git a/code/game/machinery/pointdefense.dm b/code/game/machinery/pointdefense.dm index e9d513319a..412775bc05 100644 --- a/code/game/machinery/pointdefense.dm +++ b/code/game/machinery/pointdefense.dm @@ -77,7 +77,7 @@ GLOBAL_LIST_BOILERPLATE(pointdefense_turrets, /obj/machinery/power/pointdefense) if(id_tag) var/list/connected_z_levels = GetConnectedZlevels(get_z(src)) for(var/i = 1 to LAZYLEN(pointdefense_turrets)) - var/obj/machinery/pointdefense/PD = pointdefense_turrets[i] + var/obj/machinery/power/pointdefense/PD = pointdefense_turrets[i] if(!(PD.id_tag == id_tag && (get_z(PD) in connected_z_levels))) continue var/list/turret = list() diff --git a/code/modules/admin/verbs/pray.dm b/code/modules/admin/verbs/pray.dm index e1a4cefd15..f2f484ed7c 100644 --- a/code/modules/admin/verbs/pray.dm +++ b/code/modules/admin/verbs/pray.dm @@ -30,25 +30,15 @@ //log_admin("HELP: [key_name(src)]: [msg]") /proc/CentCom_announce(var/msg, var/mob/Sender, var/iamessage) -<<<<<<< HEAD - msg = "[uppertext(using_map.boss_short)]M[iamessage ? " IA" : ""]:[key_name(Sender, 1)] (PP) (VV) (SM) ([admin_jump_link(Sender, src)]) (CA) (BSA) (RPLY): [msg]" - for(var/client/C in GLOB.admins) -======= msg = "[uppertext(using_map.boss_short)]M[iamessage ? " IA" : ""]:[key_name(Sender, 1)] (PP) (VV) (SM) ([admin_jump_link(Sender)]) (CA) (BSA) (RPLY): [msg]" - for(var/client/C in admins) ->>>>>>> fdabe51... Linter Introduction + Cleanup (#8085) + for(var/client/C in GLOB.admins) //VOREStation Edit - GLOB admins if(R_ADMIN|R_EVENT & C.holder.rights) to_chat(C,msg) C << 'sound/machines/signal.ogg' /proc/Syndicate_announce(var/msg, var/mob/Sender) -<<<<<<< HEAD - msg = "ILLEGAL:[key_name(Sender, 1)] (PP) (VV) (SM) ([admin_jump_link(Sender, src)]) (CA) (BSA) (RPLY): [msg]" - for(var/client/C in GLOB.admins) -======= msg = "ILLEGAL:[key_name(Sender, 1)] (PP) (VV) (SM) ([admin_jump_link(Sender)]) (CA) (BSA) (RPLY): [msg]" - for(var/client/C in admins) ->>>>>>> fdabe51... Linter Introduction + Cleanup (#8085) + for(var/client/C in GLOB.admins) //VOREStation Edit - GLOB admins if(R_ADMIN|R_EVENT & C.holder.rights) to_chat(C,msg) C << 'sound/machines/signal.ogg' \ No newline at end of file diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 237a7e4395..865952471b 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -1,4 +1,3 @@ -<<<<<<< HEAD /mob/observer name = "observer" desc = "This shouldn't appear" @@ -467,7 +466,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp set_dir(2) //reset dir so the right directional sprites show up return ..() -/mob/observer/dead/stop_orbit(datum/component/orbiter/orbits) +/mob/observer/dead/stop_orbit() . = ..() //restart our floating animation after orbit is done. pixel_y = 0 @@ -965,917 +964,3 @@ mob/observer/dead/MayRespawn(var/feedback = 0) set name = "Respawn" set category = "Ghost" src.abandon_mob() -======= -/mob/observer - name = "observer" - desc = "This shouldn't appear" - density = 0 - -/mob/observer/dead - name = "ghost" - desc = "It's a g-g-g-g-ghooooost!" //jinkies! - icon = 'icons/mob/ghost.dmi' - icon_state = "ghost" - stat = DEAD - canmove = 0 - blinded = 0 - anchored = 1 // don't get pushed around - - var/can_reenter_corpse - var/datum/hud/living/carbon/hud = null // hud - var/bootime = 0 - var/started_as_observer //This variable is set to 1 when you enter the game as an observer. - //If you died in the game and are a ghsot - this will remain as null. - //Note that this is not a reliable way to determine if admins started as observers, since they change mobs a lot. - var/has_enabled_antagHUD = 0 - var/medHUD = 0 - var/secHUD = 0 - var/antagHUD = 0 - universal_speak = 1 - var/atom/movable/following = null - var/admin_ghosted = 0 - var/anonsay = 0 - var/ghostvision = 1 //is the ghost able to see things humans can't? - incorporeal_move = 1 - - var/is_manifest = 0 //If set to 1, the ghost is able to whisper. Usually only set if a cultist drags them through the veil. - var/ghost_sprite = null - var/global/list/possible_ghost_sprites = list( - "Clear" = "blank", - "Green Blob" = "otherthing", - "Bland" = "ghost", - "Robed-B" = "ghost1", - "Robed-BAlt" = "ghost2", - "King" = "ghostking", - "Shade" = "shade", - "Hecate" = "ghost-narsie", - "Glowing Statue" = "armour", - "Artificer" = "artificer", - "Behemoth" = "behemoth", - "Harvester" = "harvester", - "Wraith" = "wraith", - "Viscerator" = "viscerator", - "Corgi" = "corgi", - "Tamaskan" = "tamaskan", - "Black Cat" = "blackcat", - "Lizard" = "lizard", - "Goat" = "goat", - "Space Bear" = "bear", - "Bats" = "bat", - "Chicken" = "chicken_white", - "Parrot"= "parrot_fly", - "Goose" = "goose", - "Penguin" = "penguin", - "Brown Crab" = "crab", - "Gray Crab" = "evilcrab", - "Trout" = "trout-swim", - "Salmon" = "salmon-swim", - "Pike" = "pike-swim", - "Koi" = "koi-swim", - "Carp" = "carp", - "Red Robes" = "robe_red", - "Faithless" = "faithless", - "Shadowform" = "forgotten", - "Dark Ethereal" = "bloodguardian", - "Holy Ethereal" = "lightguardian", - "Red Elemental" = "magicRed", - "Blue Elemental" = "magicBlue", - "Pink Elemental" = "magicPink", - "Orange Elemental" = "magicOrange", - "Green Elemental" = "magicGreen", - "Daemon" = "daemon", - "Guard Spider" = "guard", - "Hunter Spider" = "hunter", - "Nurse Spider" = "nurse", - "Rogue Drone" = "drone", - "ED-209" = "ed209", - "Beepsky" = "secbot" - ) - var/last_revive_notification = null // world.time of last notification, used to avoid spamming players from defibs or cloners. - var/cleanup_timer // Refernece to a timer that will delete this mob if no client returns - -/mob/observer/dead/New(mob/body) - - appearance = body - invisibility = INVISIBILITY_OBSERVER - layer = BELOW_MOB_LAYER - plane = PLANE_GHOSTS - alpha = 127 - - sight |= SEE_TURFS | SEE_MOBS | SEE_OBJS | SEE_SELF - see_invisible = SEE_INVISIBLE_OBSERVER - see_in_dark = world.view //I mean. I don't even know if byond has occlusion culling... but... - verbs += /mob/observer/dead/proc/dead_tele - - var/turf/T - if(ismob(body)) - T = get_turf(body) //Where is the body located? - attack_log = body.attack_log //preserve our attack logs by copying them to our ghost - gender = body.gender - if(body.mind && body.mind.name) - name = body.mind.name - else - if(body.real_name) - name = body.real_name - else - if(gender == MALE) - name = capitalize(pick(first_names_male)) + " " + capitalize(pick(last_names)) - else - name = capitalize(pick(first_names_female)) + " " + capitalize(pick(last_names)) - - mind = body.mind //we don't transfer the mind but we keep a reference to it. - - // Fix for naked ghosts. - // Unclear why this isn't being grabbed by appearance. - if(ishuman(body)) - var/mob/living/carbon/human/H = body - add_overlay(H.overlays_standing) - - if(!T) T = pick(latejoin) //Safety in case we cannot find the body's position - forceMove(T) - - if(!name) //To prevent nameless ghosts - name = capitalize(pick(first_names_male)) + " " + capitalize(pick(last_names)) - real_name = name - animate(src, pixel_y = 2, time = 10, loop = -1) - ..() - -/mob/observer/dead/Topic(href, href_list) - if (href_list["track"]) - var/mob/target = locate(href_list["track"]) in mob_list - if(target) - ManualFollow(target) - if(href_list["reenter"]) - reenter_corpse() - return - -/mob/observer/dead/attackby(obj/item/W, mob/user) - if(istype(W,/obj/item/weapon/book/tome)) - var/mob/observer/dead/M = src - M.manifest(user) - -/mob/observer/dead/CanPass(atom/movable/mover, turf/target) - return TRUE - -/mob/observer/dead/set_stat(var/new_stat) - if(new_stat != DEAD) - CRASH("It is best if observers stay dead, thank you.") - -/mob/observer/dead/examine_icon() - var/icon/I = get_cached_examine_icon(src) - if(!I) - I = getFlatIcon(src, defdir = SOUTH, no_anim = TRUE) - set_cached_examine_icon(src, I, 200 SECONDS) - return I - -/mob/observer/dead/examine(mob/user) - . = ..() - - if(is_admin(user)) - . += "\t>[ADMIN_FULLMONTY(src)]" - -/* -Transfer_mind is there to check if mob is being deleted/not going to have a body. -Works together with spawning an observer, noted above. -*/ - -/mob/observer/dead/Life() - ..() - if(!loc) return - if(!client) return 0 - - handle_regular_hud_updates() - handle_vision() - -/mob/proc/ghostize(var/can_reenter_corpse = 1) - if(key) - if(ishuman(src)) - var/mob/living/carbon/human/H = src - if(H.vr_holder && !can_reenter_corpse) - H.exit_vr() - return 0 - var/mob/observer/dead/ghost = new(src) //Transfer safety to observer spawning proc. - ghost.can_reenter_corpse = can_reenter_corpse - ghost.timeofdeath = src.timeofdeath //BS12 EDIT - ghost.key = key - if(istype(loc, /obj/structure/morgue)) - var/obj/structure/morgue/M = loc - M.update() - else if(istype(loc, /obj/structure/closet/body_bag)) - var/obj/structure/closet/body_bag/B = loc - B.update() - if(ghost.client) - ghost.client.time_died_as_mouse = ghost.timeofdeath - if(ghost.client && !ghost.client.holder && !config.antag_hud_allowed) // For new ghosts we remove the verb from even showing up if it's not allowed. - ghost.verbs -= /mob/observer/dead/verb/toggle_antagHUD // Poor guys, don't know what they are missing! - return ghost - -/* -This is the proc mobs get to turn into a ghost. Forked from ghostize due to compatibility issues. -*/ -/mob/living/verb/ghost() - set category = "OOC" - set name = "Ghost" - set desc = "Relinquish your life and enter the land of the dead." - - if(stat == DEAD && !forbid_seeing_deadchat) - announce_ghost_joinleave(ghostize(1)) - else - var/response - if(src.client && src.client.holder) - response = alert(src, "You have the ability to Admin-Ghost. The regular Ghost verb will announce your presence to dead chat. Both variants will allow you to return to your body using 'aghost'.\n\nWhat do you wish to do?", "Are you sure you want to ghost?", "Ghost", "Admin Ghost", "Stay in body") - if(response == "Admin Ghost") - if(!src.client) - return - src.client.admin_ghost() - else - response = alert(src, "Are you -sure- you want to ghost?\n(You are alive, or otherwise have the potential to become alive. If you ghost, you won't be able to play this round until you respawn as a new character! You can't change your mind so choose wisely!)", "Are you sure you want to ghost?", "Ghost", "Stay in body") - if(response != "Ghost") - return - resting = 1 - var/turf/location = get_turf(src) - var/special_role = check_special_role() - if(!istype(loc,/obj/machinery/cryopod)) - log_and_message_admins("has ghosted outside cryo[special_role ? " as [special_role]" : ""]. (JMP)",usr) - else if(special_role) - log_and_message_admins("has ghosted in cryo as [special_role]. (JMP)",usr) - var/mob/observer/dead/ghost = ghostize(0) // 0 parameter is so we can never re-enter our body, "Charlie, you can never come baaaack~" :3 - if(ghost) - ghost.timeofdeath = world.time // Because the living mob won't have a time of death and we want the respawn timer to work properly. - ghost.set_respawn_timer() - announce_ghost_joinleave(ghost) - -/mob/observer/dead/can_use_hands() return 0 -/mob/observer/dead/is_active() return 0 - -/mob/observer/dead/Stat() - ..() - if(statpanel("Status")) - if(emergency_shuttle) - var/eta_status = emergency_shuttle.get_status_panel_eta() - if(eta_status) - stat(null, eta_status) - -/mob/observer/dead/verb/reenter_corpse() - set category = "Ghost" - set name = "Re-enter Corpse" - if(!client) return - if(!(mind && mind.current && can_reenter_corpse)) - to_chat(src, "You have no body.") - return - if(mind.current.key && copytext(mind.current.key,1,2)!="@") //makes sure we don't accidentally kick any clients - to_chat(usr, "Another consciousness is in your body... it is resisting you.") - return - if(mind.current.ajourn && mind.current.stat != DEAD) //check if the corpse is astral-journeying (it's client ghosted using a cultist rune). - var/found_rune - for(var/obj/effect/rune/R in mind.current.loc) //whilst corpse is alive, we can only reenter the body if it's on the rune - if(R && R.word1 == cultwords["hell"] && R.word2 == cultwords["travel"] && R.word3 == cultwords["self"]) // Found an astral journey rune. - found_rune = 1 - break - if(!found_rune) - to_chat(usr, "The astral cord that ties your body and your spirit has been severed. You are likely to wander the realm beyond until your body is finally dead and thus reunited with you.") - return - mind.current.ajourn=0 - mind.current.key = key - mind.current.teleop = null - if(istype(mind.current.loc, /obj/structure/morgue)) - var/obj/structure/morgue/M = mind.current.loc - M.update(1) - else if(istype(mind.current.loc, /obj/structure/closet/body_bag)) - var/obj/structure/closet/body_bag/B = mind.current.loc - B.update(1) - if(!admin_ghosted) - announce_ghost_joinleave(mind, 0, "They now occupy their body again.") - return 1 - -/mob/observer/dead/verb/toggle_medHUD() - set category = "Ghost" - set name = "Toggle MedicHUD" - set desc = "Toggles Medical HUD allowing you to see how everyone is doing" - - medHUD = !medHUD - plane_holder.set_vis(VIS_CH_HEALTH, medHUD) - plane_holder.set_vis(VIS_CH_STATUS_OOC, medHUD) - to_chat(src, "Medical HUD [medHUD ? "Enabled" : "Disabled"]") - -/mob/observer/dead/verb/toggle_secHUD() - set category = "Ghost" - set name = "Toggle Security HUD" - set desc = "Toggles Security HUD allowing you to see people's displayed ID's job, wanted status, etc" - - secHUD = !secHUD - plane_holder.set_vis(VIS_CH_ID, secHUD) - plane_holder.set_vis(VIS_CH_WANTED, secHUD) - plane_holder.set_vis(VIS_CH_IMPTRACK, secHUD) - plane_holder.set_vis(VIS_CH_IMPLOYAL, secHUD) - plane_holder.set_vis(VIS_CH_IMPCHEM, secHUD) - to_chat(src, "Security HUD [secHUD ? "Enabled" : "Disabled"]") - -/mob/observer/dead/verb/toggle_antagHUD() - set category = "Ghost" - set name = "Toggle AntagHUD" - set desc = "Toggles AntagHUD allowing you to see who is the antagonist" - - if(!config.antag_hud_allowed && !client.holder) - to_chat(src, "Admins have disabled this for this round.") - return - if(jobban_isbanned(src, "AntagHUD")) - to_chat(src, "You have been banned from using this feature") - return - if(config.antag_hud_restricted && !has_enabled_antagHUD && !client.holder) - var/response = alert(src, "If you turn this on, you will not be able to take any part in the round.","Are you sure you want to turn this feature on?","Yes","No") - if(response == "No") return - can_reenter_corpse = FALSE - set_respawn_timer(-1) // Foreeeever - if(!has_enabled_antagHUD && !client.holder) - has_enabled_antagHUD = TRUE - - antagHUD = !antagHUD - plane_holder.set_vis(VIS_CH_SPECIAL, antagHUD) - to_chat(src, "AntagHUD [antagHUD ? "Enabled" : "Disabled"]") - -/mob/observer/dead/proc/dead_tele(var/area/A in return_sorted_areas()) - set category = "Ghost" - set name = "Teleport" - set desc = "Teleport to a location" - - if(!istype(usr, /mob/observer/dead)) - to_chat(usr, "Not when you're not dead!") - return - - if(!A) - A = input(usr, "Select an area:", "Ghost Teleport") as null|anything in return_sorted_areas() - if(!A) - return - - usr.forceMove(pick(get_area_turfs(A))) - usr.on_mob_jump() - -/mob/observer/dead/verb/follow(input in getmobs()) - set category = "Ghost" - set name = "Follow" // "Haunt" - set desc = "Follow and haunt a mob." - - if(!input) - input = input(usr, "Select a mob:", "Ghost Follow") as null|anything in getmobs() - if(!input) - return - - var/target = getmobs()[input] - if(!target) return - ManualFollow(target) - -// This is the ghost's follow verb with an argument -/mob/observer/dead/proc/ManualFollow(var/atom/movable/target) - if(!target) - return - - var/turf/targetloc = get_turf(target) - if(check_holy(targetloc)) - to_chat(usr, "You cannot follow a mob standing on holy grounds!") - return - if(target != src) - if(following && following == target) - return - following = target - to_chat(src, "Now following [target]") - if(ismob(target)) - forceMove(get_turf(target)) - var/mob/M = target - M.following_mobs += src - else - spawn(0) - while(target && following == target && client) - var/turf/T = get_turf(target) - if(!T) - break - // To stop the ghost flickering. - if(loc != T) - forceMove(T) - sleep(15) - - var/icon/I = icon(target.icon,target.icon_state,target.dir) - - var/orbitsize = (I.Width()+I.Height())*0.5 - orbitsize -= (orbitsize/world.icon_size)*(world.icon_size*0.25) - - var/rot_seg - - /* We don't have this pref yet - switch(ghost_orbit) - if(GHOST_ORBIT_TRIANGLE) - rot_seg = 3 - if(GHOST_ORBIT_SQUARE) - rot_seg = 4 - if(GHOST_ORBIT_PENTAGON) - rot_seg = 5 - if(GHOST_ORBIT_HEXAGON) - rot_seg = 6 - else //Circular - rot_seg = 36 //360/10 bby, smooth enough aproximation of a circle - */ - - orbit(target, orbitsize, FALSE, 20, rot_seg) - -/mob/observer/dead/orbit() - set_dir(2) //reset dir so the right directional sprites show up - return ..() - -/mob/observer/dead/stop_orbit() - . = ..() - //restart our floating animation after orbit is done. - pixel_y = 0 - pixel_x = 0 - transform = null - animate(src, pixel_y = 2, time = 10, loop = -1) - -/mob/observer/dead/proc/stop_following() - following = null - stop_orbit() - -/mob/proc/update_following() - . = get_turf(src) - for(var/mob/observer/dead/M in following_mobs) - if(M.following != src) - following_mobs -= M - else - if(M.loc != .) - M.forceMove(.) - -/mob - var/list/following_mobs = list() - -/mob/Destroy() - for(var/mob/observer/dead/M in following_mobs) - M.stop_following() - following_mobs = null - return ..() - -/mob/observer/dead/Destroy() - if(ismob(following)) - var/mob/M = following - M.following_mobs -= src - stop_following() - return ..() - -/mob/Moved(atom/old_loc, direction, forced = FALSE) - . = ..() - update_following() - -/mob/Life() - // to catch teleports etc which directly set loc - update_following() - return ..() - -/mob/proc/check_holy(var/turf/T) - return 0 - -/mob/observer/dead/check_holy(var/turf/T) - if(check_rights(R_ADMIN|R_FUN|R_EVENT, 0, src)) - return 0 - - return (T && T.holy) && (is_manifest || (mind in cult.current_antagonists)) - -/mob/observer/dead/verb/jumptomob(input in getmobs()) //Moves the ghost instead of just changing the ghosts's eye -Nodrak - set category = "Ghost" - set name = "Jump to Mob" - set desc = "Teleport to a mob" - set popup_menu = FALSE - - if(!istype(usr, /mob/observer/dead)) //Make sure they're an observer! - return - - if(!input) - input = input(usr, "Select a mob:", "Ghost Jump") as null|anything in getmobs() - if(!input) - return - - var/target = getmobs()[input] - if (!target)//Make sure we actually have a target - return - else - var/mob/M = target //Destination mob - var/turf/T = get_turf(M) //Turf of the destination mob - - if(T && isturf(T)) //Make sure the turf exists, then move the source to that destination. - forceMove(T) - stop_following() - else - to_chat(src, "This mob is not located in the game world.") - -/mob/observer/dead/memory() - set hidden = 1 - to_chat(src, "You are dead! You have no mind to store memory!") - -/mob/observer/dead/add_memory() - set hidden = 1 - to_chat(src, "You are dead! You have no mind to store memory!") - -/mob/observer/dead/Post_Incorpmove() - stop_following() - -/mob/observer/dead/verb/analyze_air() - set name = "Analyze Air" - set category = "Ghost" - - if(!istype(usr, /mob/observer/dead)) return - - // Shamelessly copied from the Gas Analyzers - if (!( istype(usr.loc, /turf) )) - return - - var/datum/gas_mixture/environment = usr.loc.return_air() - - var/pressure = environment.return_pressure() - var/total_moles = environment.total_moles - - to_chat(src, "Results:") - if(abs(pressure - ONE_ATMOSPHERE) < 10) - to_chat(src, "Pressure: [round(pressure,0.1)] kPa") - else - to_chat(src, "Pressure: [round(pressure,0.1)] kPa") - if(total_moles) - for(var/g in environment.gas) - to_chat(src, "[gas_data.name[g]]: [round((environment.gas[g] / total_moles) * 100)]% ([round(environment.gas[g], 0.01)] moles)") - to_chat(src, "Temperature: [round(environment.temperature-T0C,0.1)]°C ([round(environment.temperature,0.1)]K)") - to_chat(src, "Heat Capacity: [round(environment.heat_capacity(),0.1)]") - -/mob/observer/dead/verb/check_radiation() - set name = "Check Radiation" - set category = "Ghost" - - var/turf/t = get_turf(src) - if(t) - var/rads = SSradiation.get_rads_at_turf(t) - to_chat(src, "Radiation level: [rads ? rads : "0"] Bq.") - - -/mob/observer/dead/verb/become_mouse() - set name = "Become mouse" - set category = "Ghost" - - if(config.disable_player_mice) - to_chat(src, "Spawning as a mouse is currently disabled.") - return - - if(!MayRespawn(1)) - return - - var/turf/T = get_turf(src) - if(!T || (T.z in using_map.admin_levels)) - to_chat(src, "You may not spawn as a mouse on this Z-level.") - return - - var/timedifference = world.time - client.time_died_as_mouse - if(client.time_died_as_mouse && timedifference <= mouse_respawn_time * 600) - var/timedifference_text - timedifference_text = time2text(mouse_respawn_time * 600 - timedifference,"mm:ss") - to_chat(src, "You may only spawn again as a mouse more than [mouse_respawn_time] minutes after your death. You have [timedifference_text] left.") - return - - var/response = alert(src, "Are you -sure- you want to become a mouse?","Are you sure you want to squeek?","Squeek!","Nope!") - if(response != "Squeek!") return //Hit the wrong key...again. - - - //find a viable mouse candidate - var/mob/living/simple_mob/animal/passive/mouse/host - var/obj/machinery/atmospherics/unary/vent_pump/vent_found - var/list/found_vents = list() - for(var/obj/machinery/atmospherics/unary/vent_pump/v in machines) - if(!v.welded && v.z == T.z && v.network && v.network.normal_members.len > 20) - found_vents.Add(v) - if(found_vents.len) - vent_found = pick(found_vents) - host = new /mob/living/simple_mob/animal/passive/mouse(vent_found) - else - to_chat(src, "Unable to find any unwelded vents to spawn mice at.") - - if(host) - if(config.uneducated_mice) - host.universal_understand = 0 - announce_ghost_joinleave(src, 0, "They are now a mouse.") - host.ckey = src.ckey - host.add_ventcrawl(vent_found) - to_chat(host, "You are now a mouse. Try to avoid interaction with players, and do not give hints away that you are more than a simple rodent.") - -/mob/observer/dead/verb/view_manfiest() - set name = "Show Crew Manifest" - set category = "Ghost" - - var/dat - dat += "

Crew Manifest

" - dat += data_core.get_manifest() - - src << browse(dat, "window=manifest;size=370x420;can_close=1") - -//This is called when a ghost is drag clicked to something. -/mob/observer/dead/MouseDrop(atom/over) - if(!usr || !over) return - if (isobserver(usr) && usr.client && usr.client.holder && isliving(over)) - if (usr.client.holder.cmd_ghost_drag(src,over)) - return - - return ..() - -//Used for drawing on walls with blood puddles as a spooky ghost. -/mob/observer/dead/verb/bloody_doodle() - - set category = "Ghost" - set name = "Write in blood" - set desc = "If the round is sufficiently spooky, write a short message in blood on the floor or a wall. Remember, no IC in OOC or OOC in IC." - - if(!(config.cult_ghostwriter)) - to_chat(src, "That verb is not currently permitted.") - return - - if (!src.stat) - return - - if (usr != src) - return 0 //something is terribly wrong - - var/ghosts_can_write - if(ticker.mode.name == "cult") - if(cult.current_antagonists.len > config.cult_ghostwriter_req_cultists) - ghosts_can_write = 1 - - if(!ghosts_can_write && !check_rights(R_ADMIN|R_EVENT|R_FUN, 0)) //Let's allow for admins to write in blood for events and the such. - to_chat(src, "The veil is not thin enough for you to do that.") - return - - var/list/choices = list() - for(var/obj/effect/decal/cleanable/blood/B in view(1,src)) - if(B.amount > 0) - choices += B - - if(!choices.len) - to_chat(src, "There is no blood to use nearby.") - return - - var/obj/effect/decal/cleanable/blood/choice = input(src,"What blood would you like to use?") in null|choices - - var/direction = input(src,"Which way?","Tile selection") as anything in list("Here","North","South","East","West") - var/turf/simulated/T = src.loc - if (direction != "Here") - T = get_step(T,text2dir(direction)) - - if (!istype(T)) - to_chat(src, "You cannot doodle there.") - return - - if(!choice || choice.amount == 0 || !(src.Adjacent(choice))) - return - - var/doodle_color = (choice.basecolor) ? choice.basecolor : "#A10808" - - var/num_doodles = 0 - for (var/obj/effect/decal/cleanable/blood/writing/W in T) - num_doodles++ - if (num_doodles > 4) - to_chat(src, "There is no space to write on!") - return - - var/max_length = 50 - - var/message = sanitize(input("Write a message. It cannot be longer than [max_length] characters.","Blood writing", "")) - - if (message) - - if (length(message) > max_length) - message += "-" - to_chat(src, "You ran out of blood to write with!") - - var/obj/effect/decal/cleanable/blood/writing/W = new(T) - W.basecolor = doodle_color - W.update_icon() - W.message = message - W.add_hiddenprint(src) - W.visible_message("Invisible fingers crudely paint something in blood on [T]...") - -/mob/observer/dead/pointed(atom/A as mob|obj|turf in view()) - if(!..()) - return 0 - usr.visible_message("[src] points to [A]") - return 1 - -/mob/observer/dead/proc/manifest(mob/user) - is_manifest = TRUE - verbs |= /mob/observer/dead/proc/toggle_visibility - verbs |= /mob/observer/dead/proc/ghost_whisper - to_chat(src, "As you are now in the realm of the living, you can whisper to the living with the Spectral Whisper verb, inside the IC tab.") - if(plane != PLANE_WORLD) - user.visible_message( \ - "\The [user] drags ghost, [src], to our plane of reality!", \ - "You drag [src] to our plane of reality!" \ - ) - toggle_visibility(TRUE) - else - var/datum/gender/T = gender_datums[user.get_visible_gender()] - user.visible_message ( \ - "\The [user] just tried to smash [T.his] book into that ghost! It's not very effective.", \ - "You get the feeling that the ghost can't become any more visible." \ - ) - -/mob/observer/dead/proc/toggle_icon(var/icon) - if(!client) - return - - var/iconRemoved = 0 - for(var/image/I in client.images) - if(I.icon_state == icon) - iconRemoved = 1 - qdel(I) - - if(!iconRemoved) - var/image/J = image('icons/mob/mob.dmi', loc = src, icon_state = icon) - client.images += J - -/mob/observer/dead/proc/toggle_visibility(var/forced = 0) - set category = "Ghost" - set name = "Toggle Visibility" - set desc = "Allows you to turn (in)visible (almost) at will." - - var/toggled_invisible - if(!forced && plane == PLANE_GHOSTS && world.time < toggled_invisible + 600) - to_chat(src, "You must gather strength before you can turn visible again...") - return - - if(plane == PLANE_WORLD) - toggled_invisible = world.time - visible_message("It fades from sight...", "You are now invisible.") - else - to_chat(src, "You are now visible!") - - plane = (plane == PLANE_GHOSTS) ? PLANE_WORLD : PLANE_GHOSTS - invisibility = (plane == PLANE_WORLD) ? 0 : INVISIBILITY_OBSERVER - - // Give the ghost a cult icon which should be visible only to itself - toggle_icon("cult") - -/mob/observer/dead/verb/toggle_anonsay() - set category = "Ghost" - set name = "Toggle Anonymous Chat" - set desc = "Toggles showing your key in dead chat." - - src.anonsay = !src.anonsay - if(anonsay) - to_chat(src, "Your key won't be shown when you speak in dead chat.") - else - to_chat(src, "Your key will be publicly visible again.") - -/mob/observer/dead/canface() - return 1 - -/mob/observer/dead/proc/can_admin_interact() - return check_rights(R_ADMIN|R_EVENT, 0, src) - -/mob/observer/dead/verb/toggle_ghostsee() - set name = "Toggle Ghost Vision" - set desc = "Toggles your ability to see things only ghosts can see, like other ghosts" - set category = "Ghost" - ghostvision = !ghostvision - updateghostsight() - to_chat(src, "You [ghostvision ? "now" : "no longer"] have ghost vision.") - -/mob/observer/dead/verb/toggle_darkness() - set name = "Toggle Darkness" - set desc = "Toggles your ability to see lighting overlays, and the darkness they create." - set category = "Ghost" - seedarkness = !seedarkness - updateghostsight() - to_chat(src, "You [seedarkness ? "now" : "no longer"] see darkness.") - -/mob/observer/dead/proc/updateghostsight() - plane_holder.set_vis(VIS_FULLBRIGHT, !seedarkness) //Inversion, because "not seeing" the darkness is "seeing" the lighting plane master. - plane_holder.set_vis(VIS_GHOSTS, ghostvision) - -mob/observer/dead/MayRespawn(var/feedback = 0) - if(!client) - return 0 - if(mind && mind.current && mind.current.stat != DEAD && can_reenter_corpse) - if(feedback) - to_chat(src, "Your non-dead body prevent you from respawning.") - return 0 - if(config.antag_hud_restricted && has_enabled_antagHUD == 1) - if(feedback) - to_chat(src, "antagHUD restrictions prevent you from respawning.") - return 0 - return 1 - -/atom/proc/extra_ghost_link() - return - -/mob/extra_ghost_link(var/atom/ghost) - if(client && eyeobj) - return "|eye" - -/mob/observer/dead/extra_ghost_link(var/atom/ghost) - if(mind && mind.current) - return "|body" - -/proc/ghost_follow_link(var/atom/target, var/atom/ghost) - if((!target) || (!ghost)) return - . = "follow" - . += target.extra_ghost_link(ghost) - -//Culted Ghosts - -/mob/observer/dead/proc/ghost_whisper() - set name = "Spectral Whisper" - set category = "IC" - - if(is_manifest) //Only able to whisper if it's hit with a tome. - var/list/options = list() - for(var/mob/living/Ms in view(src)) - options += Ms - var/mob/living/M = input(src, "Select who to whisper to:", "Whisper to?", null) as null|mob in options - if(!M) - return 0 - var/msg = sanitize(input(src, "Message:", "Spectral Whisper") as text|null) - if(msg) - log_say("(SPECWHISP to [key_name(M)]): [msg]", src) - to_chat(M, " You hear a strange, unidentifiable voice in your head... [msg]") - to_chat(src, " You said: '[msg]' to [M].") - else - return - return 1 - else - to_chat(src, "You have not been pulled past the veil!") - -/mob/observer/dead/verb/choose_ghost_sprite() - set category = "Ghost" - set name = "Choose Sprite" - - var/choice - var/previous_state - var/finalized = "No" - - while(finalized == "No" && src.client) - choice = input(usr,"What would you like to use for your ghost sprite?") as null|anything in possible_ghost_sprites - if(!choice) - return - - if(choice) - icon = 'icons/mob/ghost.dmi' - overlays.Cut() - - if(icon_state && icon) - previous_state = icon_state - - icon_state = possible_ghost_sprites[choice] - finalized = alert("Look at your sprite. Is this what you wish to use?",,"No","Yes") - - ghost_sprite = possible_ghost_sprites[choice] - - if(finalized == "No") - icon_state = previous_state - -/mob/observer/dead/is_blind() - return FALSE - -/mob/observer/dead/is_deaf() - return FALSE - -/mob/observer/dead/verb/paialert() - set category = "Ghost" - set name = "Blank pAI alert" - set desc = "Flash an indicator light on available blank pAI devices for a smidgen of hope." - - if(usr.client.prefs?.be_special & BE_PAI) - var/count = 0 - for(var/obj/item/device/paicard/p in all_pai_cards) - var/obj/item/device/paicard/PP = p - if(PP.pai == null) - count++ - PP.overlays += "pai-ghostalert" - spawn(54) - PP.overlays.Cut() - to_chat(usr,"Flashing the displays of [count] unoccupied PAIs.") - else - to_chat(usr,"You have 'Be pAI' disabled in your character prefs, so we can't help you.") - -/mob/observer/dead/speech_bubble_appearance() - return "ghost" - -// Lets a ghost know someone's trying to bring them back, and for them to get into their body. -// Mostly the same as TG's sans the hud element, since we don't have TG huds. -/mob/observer/dead/proc/notify_revive(var/message, var/sound, flashwindow = TRUE, var/atom/source) - if((last_revive_notification + 2 MINUTES) > world.time) - return - last_revive_notification = world.time - - if(flashwindow) - window_flash(client) - if(message) - to_chat(src, "[message]") - if(source) - throw_alert("\ref[source]_notify_revive", /obj/screen/alert/notify_cloning, new_master = source) - to_chat(src, "(Click to re-enter)") - if(sound) - SEND_SOUND(src, sound(sound)) - -/mob/observer/dead/verb/respawn() - set name = "Respawn" - set category = "Ghost" - src.abandon_mob() ->>>>>>> fdabe51... Linter Introduction + Cleanup (#8085) diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 3c88a09a0f..b6e6ffc03f 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -1,649 +1,3 @@ -<<<<<<< HEAD - -/* - run_armor_check(a,b) - args - a:def_zone - What part is getting hit, if null will check entire body - b:attack_flag - What type of attack, bullet, laser, energy, melee - c:armour_pen - How much armor to ignore. - d:absorb_text - Custom text to send to the player when the armor fully absorbs an attack. - e:soften_text - Similar to absorb_text, custom text to send to the player when some damage is reduced. - - Returns - A number between 0 and 100, with higher numbers resulting in less damage taken. -*/ -/mob/living/proc/run_armor_check(var/def_zone = null, var/attack_flag = "melee", var/armour_pen = 0, var/absorb_text = null, var/soften_text = null) - if(Debug2) - to_world_log("## DEBUG: getarmor() was called.") - - if(armour_pen >= 100) - return 0 //might as well just skip the processing - - var/armor = getarmor(def_zone, attack_flag) - if(armor) - var/armor_variance_range = round(armor * 0.25) //Armor's effectiveness has a +25%/-25% variance. - var/armor_variance = rand(-armor_variance_range, armor_variance_range) //Get a random number between -25% and +25% of the armor's base value - if(Debug2) - to_world_log("## DEBUG: The range of armor variance is [armor_variance_range]. The variance picked by RNG is [armor_variance].") - - armor = min(armor + armor_variance, 100) //Now we calcuate damage using the new armor percentage. - armor = max(armor - armour_pen, 0) //Armor pen makes armor less effective. - if(armor >= 100) - if(absorb_text) - to_chat(src, "[absorb_text]") - else - to_chat(src, "Your armor absorbs the blow!") - - else if(armor > 0) - if(soften_text) - to_chat(src, "[soften_text]") - else - to_chat(src, "Your armor softens the blow!") - if(Debug2) - to_world_log("## DEBUG: Armor when [src] was attacked was [armor].") - return armor - -/* - //Old armor code here. - if(armour_pen >= 100) - return 0 //might as well just skip the processing - - var/armor = getarmor(def_zone, attack_flag) - var/absorb = 0 - - //Roll armour - if(prob(armor)) - absorb += 1 - if(prob(armor)) - absorb += 1 - - //Roll penetration - if(prob(armour_pen)) - absorb -= 1 - if(prob(armour_pen)) - absorb -= 1 - - if(absorb >= 2) - if(absorb_text) - show_message("[absorb_text]") - else - show_message("Your armor absorbs the blow!") - return 2 - if(absorb == 1) - if(absorb_text) - show_message("[soften_text]",4) - else - show_message("Your armor softens the blow!") - return 1 - return 0 -*/ - -//Certain pieces of armor actually absorb flat amounts of damage from income attacks -/mob/living/proc/get_armor_soak(var/def_zone = null, var/attack_flag = "melee", var/armour_pen = 0) - var/soaked = getsoak(def_zone, attack_flag) - //5 points of armor pen negate one point of soak - if(armour_pen) - soaked = max(soaked - (armour_pen/5), 0) - return soaked - -//if null is passed for def_zone, then this should return something appropriate for all zones (e.g. area effect damage) -/mob/living/proc/getarmor(var/def_zone, var/type) - return 0 - -/mob/living/proc/getsoak(var/def_zone, var/type) - return 0 - -// Clicking with an empty hand -/mob/living/attack_hand(mob/living/L) - ..() - if(istype(L) && L.a_intent != I_HELP) - if(ai_holder) // Using disarm, grab, or harm intent is considered a hostile action to the mob's AI. - ai_holder.react_to_attack(L) - -/mob/living/bullet_act(var/obj/item/projectile/P, var/def_zone) - - //Being hit while using a deadman switch - if(istype(get_active_hand(),/obj/item/device/assembly/signaler)) - var/obj/item/device/assembly/signaler/signaler = get_active_hand() - if(signaler.deadman && prob(80)) - log_and_message_admins("has triggered a signaler deadman's switch") - src.visible_message("[src] triggers their deadman's switch!") - signaler.signal() - - if(ai_holder && P.firer) - ai_holder.react_to_attack(P.firer) - - //Armor - var/soaked = get_armor_soak(def_zone, P.check_armour, P.armor_penetration) - var/absorb = run_armor_check(def_zone, P.check_armour, P.armor_penetration) - var/proj_sharp = is_sharp(P) - var/proj_edge = has_edge(P) - - if ((proj_sharp || proj_edge) && (soaked >= round(P.damage*0.8))) - proj_sharp = 0 - proj_edge = 0 - - if ((proj_sharp || proj_edge) && prob(getarmor(def_zone, P.check_armour))) - proj_sharp = 0 - proj_edge = 0 - - //Stun Beams - if(P.taser_effect) - stun_effect_act(0, P.agony, def_zone, P) - if(!P.nodamage) - apply_damage(P.damage, P.damage_type, def_zone, absorb, soaked, 0, P, sharp=proj_sharp, edge=proj_edge) - qdel(P) - return - - if(!P.nodamage) - apply_damage(P.damage, P.damage_type, def_zone, absorb, soaked, 0, P, sharp=proj_sharp, edge=proj_edge) - P.on_hit(src, absorb, soaked, def_zone) - - if(absorb == 100) - return 2 - else if (absorb >= 0) - return 1 - else - return 0 - -// return absorb - -//Handles the effects of "stun" weapons -/mob/living/proc/stun_effect_act(var/stun_amount, var/agony_amount, var/def_zone, var/used_weapon=null) - flash_pain() - - if (stun_amount) - Stun(stun_amount) - Weaken(stun_amount) - apply_effect(STUTTER, stun_amount) - apply_effect(EYE_BLUR, stun_amount) - - if (agony_amount) - apply_damage(agony_amount, HALLOSS, def_zone, 0, used_weapon) - apply_effect(STUTTER, agony_amount/10) - apply_effect(EYE_BLUR, agony_amount/10) - -/mob/living/proc/electrocute_act(var/shock_damage, var/obj/source, var/siemens_coeff = 1.0) - return 0 //only carbon liveforms have this proc - -/mob/living/emp_act(severity) - var/list/L = src.get_contents() - - if(LAZYLEN(modifiers)) - for(var/datum/modifier/M in modifiers) - if(!isnull(M.emp_modifier)) - severity = CLAMP(severity + M.emp_modifier, 1, 5) - - if(severity == 5) // Effectively nullified. - return - - for(var/obj/O in L) - O.emp_act(severity) - ..() - -/mob/living/blob_act(var/obj/structure/blob/B) - if(stat == DEAD || faction == B.faction) - return - - var/damage = rand(30, 40) - var/armor_pen = 0 - var/armor_check = "melee" - var/damage_type = BRUTE - var/attack_message = "The blob attacks you!" - var/attack_verb = "attacks" - var/def_zone = pick(BP_HEAD, BP_TORSO, BP_GROIN, BP_L_ARM, BP_R_ARM, BP_L_LEG, BP_R_LEG) - - if(B && B.overmind) - var/datum/blob_type/blob = B.overmind.blob_type - - damage = rand(blob.damage_lower, blob.damage_upper) - armor_check = blob.armor_check - armor_pen = blob.armor_pen - damage_type = blob.damage_type - - attack_message = "[blob.attack_message][isSynthetic() ? "[blob.attack_message_synth]":"[blob.attack_message_living]"]" - attack_verb = blob.attack_verb - B.overmind.blob_type.on_attack(B, src, def_zone) - - if( (damage_type == TOX || damage_type == OXY) && isSynthetic()) // Borgs and FBPs don't really handle tox/oxy damage the same way other mobs do. - damage_type = BRUTE - damage *= 0.66 // Take 2/3s as much damage. - - visible_message("\The [B] [attack_verb] \the [src]!", "[attack_message]!") - playsound(src, 'sound/effects/attackblob.ogg', 50, 1) - - //Armor - var/soaked = get_armor_soak(def_zone, armor_check, armor_pen) - var/absorb = run_armor_check(def_zone, armor_check, armor_pen) - - if(ai_holder) - ai_holder.react_to_attack(B) - - apply_damage(damage, damage_type, def_zone, absorb, soaked) - -/mob/living/proc/resolve_item_attack(obj/item/I, mob/living/user, var/target_zone) - return target_zone - -//Called when the mob is hit with an item in combat. Returns the blocked result -/mob/living/proc/hit_with_weapon(obj/item/I, mob/living/user, var/effective_force, var/hit_zone) - visible_message("[src] has been [I.attack_verb.len? pick(I.attack_verb) : "attacked"] with [I.name] by [user]!") - - if(ai_holder) - ai_holder.react_to_attack(user) - - var/soaked = get_armor_soak(hit_zone, "melee") - var/blocked = run_armor_check(hit_zone, "melee") - - standard_weapon_hit_effects(I, user, effective_force, blocked, soaked, hit_zone) - - if(I.damtype == BRUTE && prob(33)) // Added blood for whacking non-humans too - var/turf/simulated/location = get_turf(src) - if(istype(location)) location.add_blood_floor(src) - - return blocked - -//returns 0 if the effects failed to apply for some reason, 1 otherwise. -/mob/living/proc/standard_weapon_hit_effects(obj/item/I, mob/living/user, var/effective_force, var/blocked, var/soaked, var/hit_zone) - if(!effective_force || blocked >= 100) - return 0 - //Apply weapon damage - var/weapon_sharp = is_sharp(I) - var/weapon_edge = has_edge(I) - - if(getsoak(hit_zone, "melee",) - (I.armor_penetration/5) > round(effective_force*0.8)) //soaking a hit turns sharp attacks into blunt ones - weapon_sharp = 0 - weapon_edge = 0 - - if(prob(max(getarmor(hit_zone, "melee") - I.armor_penetration, 0))) //melee armour provides a chance to turn sharp/edge weapon attacks into blunt ones - weapon_sharp = 0 - weapon_edge = 0 - - apply_damage(effective_force, I.damtype, hit_zone, blocked, soaked, sharp=weapon_sharp, edge=weapon_edge, used_weapon=I) - - return 1 - -//this proc handles being hit by a thrown atom -/mob/living/hitby(atom/movable/AM as mob|obj,var/speed = THROWFORCE_SPEED_DIVISOR)//Standardization and logging -Sieve - if(istype(AM,/obj/)) - var/obj/O = AM - var/dtype = O.damtype - var/throw_damage = O.throwforce*(speed/THROWFORCE_SPEED_DIVISOR) - - var/miss_chance = 15 - if (O.throw_source) - var/distance = get_dist(O.throw_source, loc) - miss_chance = max(15*(distance-2), 0) - - if (prob(miss_chance)) - visible_message("\The [O] misses [src] narrowly!") - return - - src.visible_message("[src] has been hit by [O].") - var/armor = run_armor_check(null, "melee") - var/soaked = get_armor_soak(null, "melee") - - - apply_damage(throw_damage, dtype, null, armor, soaked, is_sharp(O), has_edge(O), O) - - O.throwing = 0 //it hit, so stop moving - - if(ismob(O.thrower)) - var/mob/M = O.thrower - var/client/assailant = M.client - if(assailant) - add_attack_logs(M,src,"Hit by thrown [O.name]") - if(ai_holder) - ai_holder.react_to_attack(O.thrower) - - // Begin BS12 momentum-transfer code. - var/mass = 1.5 - if(istype(O, /obj/item)) - var/obj/item/I = O - mass = I.w_class/THROWNOBJ_KNOCKBACK_DIVISOR - var/momentum = speed*mass - - if(O.throw_source && momentum >= THROWNOBJ_KNOCKBACK_SPEED) - var/dir = get_dir(O.throw_source, src) - - visible_message("[src] staggers under the impact!","You stagger under the impact!") - src.throw_at(get_edge_target_turf(src,dir),1,momentum) - - if(!O || !src) return - - if(O.sharp) //Projectile is suitable for pinning. - if(soaked >= round(throw_damage*0.8)) - return - - //Handles embedding for non-humans and simple_mobs. - embed(O) - - var/turf/T = near_wall(dir,2) - - if(T) - src.loc = T - visible_message("[src] is pinned to the wall by [O]!","You are pinned to the wall by [O]!") - src.anchored = 1 - src.pinned += O - -/mob/living/proc/embed(var/obj/O, var/def_zone=null) - O.loc = src - src.embedded += O - src.verbs += /mob/proc/yank_out_object - throw_alert("embeddedobject", /obj/screen/alert/embeddedobject) - -//This is called when the mob is thrown into a dense turf -/mob/living/proc/turf_collision(var/turf/T, var/speed) - src.take_organ_damage(speed*5) - -/mob/living/proc/near_wall(var/direction,var/distance=1) - var/turf/T = get_step(get_turf(src),direction) - var/turf/last_turf = src.loc - var/i = 1 - - while(i>0 && i<=distance) - if(T.density) //Turf is a wall! - return last_turf - i++ - last_turf = T - T = get_step(T,direction) - - return 0 - -// End BS12 momentum-transfer code. - -/mob/living/attack_generic(var/mob/user, var/damage, var/attack_message) - if(!damage) - return - - adjustBruteLoss(damage) - add_attack_logs(user,src,"Generic attack (probably animal)", admin_notify = FALSE) //Usually due to simple_mob attacks - if(ai_holder) - ai_holder.react_to_attack(user) - src.visible_message("[user] has [attack_message] [src]!") - user.do_attack_animation(src) - spawn(1) updatehealth() - return 1 - -/mob/living/proc/IgniteMob() - if(fire_stacks > 0 && !on_fire) - on_fire = 1 - handle_light() - throw_alert("fire", /obj/screen/alert/fire) - update_fire() - -/mob/living/proc/ExtinguishMob() - if(on_fire) - on_fire = 0 - fire_stacks = 0 - handle_light() - clear_alert("fire") - update_fire() - - if(has_modifier_of_type(/datum/modifier/fire)) - remove_modifiers_of_type(/datum/modifier/fire) - -/mob/living/proc/update_fire() - return - -/mob/living/proc/adjust_fire_stacks(add_fire_stacks) //Adjusting the amount of fire_stacks we have on person - fire_stacks = CLAMP(fire_stacks + add_fire_stacks, FIRE_MIN_STACKS, FIRE_MAX_STACKS) - -/mob/living/proc/handle_fire() - if(fire_stacks < 0) - fire_stacks = min(0, ++fire_stacks) //If we've doused ourselves in water to avoid fire, dry off slowly - - if(fire_stacks > 0) - fire_stacks = max(0, (fire_stacks-0.1)) //Should slowly burn out - - if(!on_fire) - return 1 - else if(fire_stacks <= 0) - ExtinguishMob() //Fire's been put out. - return 1 - - var/datum/gas_mixture/G = loc.return_air() // Check if we're standing in an oxygenless environment - if(G.gas["oxygen"] < 1) - ExtinguishMob() //If there's no oxygen in the tile we're on, put out the fire - return 1 - - var/turf/location = get_turf(src) - location.hotspot_expose(fire_burn_temperature(), 50, 1) - -//altered this to cap at the temperature of the fire causing it, using the same 1:1500 value as /mob/living/carbon/human/handle_fire() in human/life.dm -/mob/living/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume) - if(exposed_temperature) - if(fire_stacks < exposed_temperature/1500) // Subject to balance - adjust_fire_stacks(2) - else - adjust_fire_stacks(2) - IgniteMob() - -//Share fire evenly between the two mobs -//Called in MobCollide() and Crossed() -/mob/living/proc/spread_fire(mob/living/L) - return -// This is commented out pending discussion on Polaris. If you're a downsteam and you want people to spread fire by touching each other, feel free to uncomment this. -/* - if(!istype(L)) - return - var/L_old_on_fire = L.on_fire - - if(on_fire) //Only spread fire stacks if we're on fire - fire_stacks /= 2 - L.fire_stacks += fire_stacks - if(L.IgniteMob()) - message_admins("[key_name(src)] bumped into [key_name(L)] and set them on fire.") - - if(L_old_on_fire) //Only ignite us and gain their stacks if they were onfire before we bumped them - L.fire_stacks /= 2 - fire_stacks += L.fire_stacks - IgniteMob() -*/ - -/mob/living/proc/get_cold_protection() - return 0 - -/mob/living/proc/get_heat_protection() - return 0 - -/mob/living/proc/get_shock_protection() - return 0 - -/mob/living/proc/get_water_protection() - return 1 // Water won't hurt most things. - -/mob/living/proc/get_poison_protection() - return 0 - -//Finds the effective temperature that the mob is burning at. -/mob/living/proc/fire_burn_temperature() - if (fire_stacks <= 0) - return 0 - - //Scale quadratically so that single digit numbers of fire stacks don't burn ridiculously hot. - //lower limit of 700 K, same as matches and roughly the temperature of a cool flame. - return max(2.25*round(FIRESUIT_MAX_HEAT_PROTECTION_TEMPERATURE*(fire_stacks/FIRE_MAX_FIRESUIT_STACKS)**2), 700) - -// Called when struck by lightning. -/mob/living/proc/lightning_act() - // The actual damage/electrocution is handled by the tesla_zap() that accompanies this. - Paralyse(5) - stuttering += 20 - make_jittery(150) - emp_act(1) - to_chat(src, span("critical", "You've been struck by lightning!")) - -// Called when touching a lava tile. -// Does roughly 100 damage to unprotected mobs, and 20 to fully protected mobs. -/mob/living/lava_act() - add_modifier(/datum/modifier/fire/intense, 8 SECONDS) // Around 40 total if left to burn and without fire protection per stack. - inflict_heat_damage(40) // Another 40, however this is instantly applied to unprotected mobs. - adjustFireLoss(20) // Lava cannot be 100% resisted with fire protection. - -/mob/living/proc/reagent_permeability() - return 1 - return round(FIRESUIT_MAX_HEAT_PROTECTION_TEMPERATURE*(fire_stacks/FIRE_MAX_FIRESUIT_STACKS)**2) - -/mob/living/proc/handle_actions() - //Pretty bad, i'd use picked/dropped instead but the parent calls in these are nonexistent - for(var/datum/action/A in actions) - if(A.CheckRemoval(src)) - A.Remove(src) - for(var/obj/item/I in src) - if(I.action_button_name) - if(!I.action) - if(I.action_button_is_hands_free) - I.action = new/datum/action/item_action/hands_free - else - I.action = new/datum/action/item_action - I.action.name = I.action_button_name - I.action.target = I - I.action.Grant(src) - return - -/mob/living/update_action_buttons() - if(!hud_used) return - if(!client) return - - if(hud_used.hud_shown != 1) //Hud toggled to minimal - return - - client.screen -= hud_used.hide_actions_toggle - for(var/datum/action/A in actions) - if(A.button) - client.screen -= A.button - - if(hud_used.action_buttons_hidden) - if(!hud_used.hide_actions_toggle) - hud_used.hide_actions_toggle = new(hud_used) - hud_used.hide_actions_toggle.UpdateIcon() - - if(!hud_used.hide_actions_toggle.moved) - hud_used.hide_actions_toggle.screen_loc = hud_used.ButtonNumberToScreenCoords(1) - //hud_used.SetButtonCoords(hud_used.hide_actions_toggle,1) - - client.screen += hud_used.hide_actions_toggle - return - - var/button_number = 0 - for(var/datum/action/A in actions) - button_number++ - if(A.button == null) - var/obj/screen/movable/action_button/N = new(hud_used) - N.owner = A - A.button = N - - var/obj/screen/movable/action_button/B = A.button - - B.UpdateIcon() - - B.name = A.UpdateName() - - client.screen += B - - if(!B.moved) - B.screen_loc = hud_used.ButtonNumberToScreenCoords(button_number) - //hud_used.SetButtonCoords(B,button_number) - - if(button_number > 0) - if(!hud_used.hide_actions_toggle) - hud_used.hide_actions_toggle = new(hud_used) - hud_used.hide_actions_toggle.InitialiseIcon(src) - if(!hud_used.hide_actions_toggle.moved) - hud_used.hide_actions_toggle.screen_loc = hud_used.ButtonNumberToScreenCoords(button_number+1) - //hud_used.SetButtonCoords(hud_used.hide_actions_toggle,button_number+1) - client.screen += hud_used.hide_actions_toggle - -// Returns a number to determine if something is harder or easier to hit than normal. -/mob/living/proc/get_evasion() - var/result = evasion // First we get the 'base' evasion. Generally this is zero. - for(var/datum/modifier/M in modifiers) - if(!isnull(M.evasion)) - result += M.evasion - return result - -/mob/living/proc/get_accuracy_penalty() - // Certain statuses make it harder to score a hit. - var/accuracy_penalty = 0 - if(eye_blind) - accuracy_penalty += 75 - if(eye_blurry) - accuracy_penalty += 30 - if(confused) - accuracy_penalty += 45 - - return accuracy_penalty - -// Applies direct "cold" damage while checking protection against the cold. -/mob/living/proc/inflict_cold_damage(amount) - amount *= 1 - get_cold_protection(50) // Within spacesuit protection. - if(amount > 0) - adjustFireLoss(amount) - -// Ditto, but for "heat". -/mob/living/proc/inflict_heat_damage(amount) - amount *= 1 - get_heat_protection(10000) // Within firesuit protection. - if(amount > 0) - adjustFireLoss(amount) - -// and one for electricity because why not -/mob/living/proc/inflict_shock_damage(amount) - electrocute_act(amount, null, 1 - get_shock_protection(), pick(BP_HEAD, BP_TORSO, BP_GROIN)) - -// also one for water (most things resist it entirely, except for slimes) -/mob/living/proc/inflict_water_damage(amount) - amount *= 1 - get_water_protection() - if(amount > 0) - adjustToxLoss(amount) - -// one for abstracted away ""poison"" (mostly because simplemobs shouldn't handle reagents) -/mob/living/proc/inflict_poison_damage(amount) - if(isSynthetic()) - return - amount *= 1 - get_poison_protection() - if(amount > 0) - adjustToxLoss(amount) - -/mob/living/proc/can_inject() - return 1 - -/mob/living/proc/get_organ_target() - var/mob/shooter = src - var/t = shooter:zone_sel.selecting - if ((t in list( O_EYES, O_MOUTH ))) - t = BP_HEAD - var/obj/item/organ/external/def_zone = ran_zone(t) - return def_zone - -// heal ONE external organ, organ gets randomly selected from damaged ones. -/mob/living/proc/heal_organ_damage(var/brute, var/burn) - adjustBruteLoss(-brute) - adjustFireLoss(-burn) - src.updatehealth() - -// damage ONE external organ, organ gets randomly selected from damaged ones. -/mob/living/proc/take_organ_damage(var/brute, var/burn, var/emp=0) - if(status_flags & GODMODE) return 0 //godmode - adjustBruteLoss(brute) - adjustFireLoss(burn) - src.updatehealth() - -// heal MANY external organs, in random order -/mob/living/proc/heal_overall_damage(var/brute, var/burn) - adjustBruteLoss(-brute) - adjustFireLoss(-burn) - src.updatehealth() - -// damage MANY external organs, in random order -/mob/living/proc/take_overall_damage(var/brute, var/burn, var/used_weapon = null) - if(status_flags & GODMODE) return 0 //godmode - adjustBruteLoss(brute) - adjustFireLoss(burn) - src.updatehealth() - -/mob/living/proc/restore_all_organs() - return -======= /* run_armor_check(a,b) @@ -1287,4 +641,3 @@ /mob/living/proc/restore_all_organs() return ->>>>>>> fdabe51... Linter Introduction + Cleanup (#8085) diff --git a/code/modules/mob/living/silicon/robot/drone/drone_console.dm b/code/modules/mob/living/silicon/robot/drone/drone_console.dm index d5ec28e3cd..2b8d37c7ae 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone_console.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone_console.dm @@ -42,13 +42,8 @@ //VOREStation Edit - multiz lol if(D.foreign_droid) continue -<<<<<<< HEAD - - data["drones"].Add(list(list( -======= drones.Add(list(list( ->>>>>>> fdabe51... Linter Introduction + Cleanup (#8085) "name" = D.real_name, "active" = D.stat != 2, "charge" = D.cell.charge, diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index 1d1ac96f54..694d3a80a1 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -1,4 +1,3 @@ -<<<<<<< HEAD /mob/living/silicon gender = NEUTER voice_name = "synthesized voice" @@ -80,7 +79,7 @@ /mob/living/silicon/stun_effect_act(var/stun_amount, var/agony_amount) return //immune -/mob/living/silicon/electrocute_act(var/shock_damage, var/obj/source, var/siemens_coeff = 0.0) +/mob/living/silicon/electrocute_act(var/shock_damage, var/obj/source, var/siemens_coeff = 0.0, var/def_zone = null, var/stun = 1) if(shock_damage > 0) var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread s.set_up(5, 1, loc) @@ -114,7 +113,7 @@ updatehealth() return 2 -/mob/living/silicon/apply_effect(var/effect = 0,var/effecttype = STUN, var/blocked = 0) +/mob/living/silicon/apply_effect(var/effect = 0,var/effecttype = STUN, var/blocked = 0, var/check_protection = 1) return 0//The only effect that can hit them atm is flashes and they still directly edit so this works for now @@ -154,8 +153,22 @@ show_malf_ai() ..() +/* VOREStation Removal +// this function displays the stations manifest in a separate window +/mob/living/silicon/proc/show_station_manifest() + var/dat = "
" + if(!data_core) + to_chat(src, "There is no data to form a manifest with. Contact your Nanotrasen administrator.") + return + dat += data_core.get_manifest(1) //The 1 makes it monochrome. + + var/datum/browser/popup = new(src, "Crew Manifest", "Crew Manifest", 370, 420, src) + popup.set_content(dat) + popup.open() +*/ + //can't inject synths -/mob/living/silicon/can_inject(var/mob/user, var/error_msg) +/mob/living/silicon/can_inject(var/mob/user, var/error_msg, var/target_zone, var/ignore_thickness = FALSE) if(error_msg) to_chat(user, "The armoured plating is too tough.") return 0 @@ -174,7 +187,7 @@ return FALSE /mob/living/silicon/add_language(var/language, var/can_speak=1) - var/var/datum/language/added_language = GLOB.all_languages[language] + var/datum/language/added_language = GLOB.all_languages[language] if(!added_language) return @@ -184,7 +197,7 @@ return 1 /mob/living/silicon/remove_language(var/rem_language) - var/var/datum/language/removed_language = GLOB.all_languages[rem_language] + var/datum/language/removed_language = GLOB.all_languages[rem_language] if(!removed_language) return @@ -406,424 +419,3 @@ /mob/living/silicon/has_vision() return 0 //NOT REAL EYES -======= -/mob/living/silicon - gender = NEUTER - voice_name = "synthesized voice" - var/syndicate = 0 - var/const/MAIN_CHANNEL = "Main Frequency" - var/lawchannel = MAIN_CHANNEL // Default channel on which to state laws - var/list/stating_laws = list()// Channels laws are currently being stated on - var/obj/item/device/radio/common_radio - - has_huds = TRUE - var/list/speech_synthesizer_langs = list() //which languages can be vocalized by the speech synthesizer - - //Used in say.dm. - var/speak_statement = "states" - var/speak_exclamation = "declares" - var/speak_query = "queries" - var/pose //Yes, now AIs can pose too. - var/obj/item/device/camera/siliconcam/aiCamera = null //photography - var/local_transmit //If set, can only speak to others of the same type within a short range. - - var/next_alarm_notice - var/list/datum/alarm/queued_alarms = new() - - var/list/access_rights - var/obj/item/weapon/card/id/idcard - var/idcard_type = /obj/item/weapon/card/id/synthetic - - var/hudmode = null - -/mob/living/silicon/New() - silicon_mob_list |= src - ..() - add_language(LANGUAGE_GALCOM) - set_default_language(GLOB.all_languages[LANGUAGE_GALCOM]) - init_id() - init_subsystems() - -/mob/living/silicon/Destroy() - silicon_mob_list -= src - for(var/datum/alarm_handler/AH in SSalarm.all_handlers) - AH.unregister_alarm(src) - return ..() - -/mob/living/silicon/proc/init_id() - if(idcard) - return - idcard = new idcard_type(src) - set_id_info(idcard) - -/mob/living/silicon/proc/SetName(pickedName as text) - real_name = pickedName - name = real_name - -/mob/living/silicon/proc/show_laws() - return - -/mob/living/silicon/drop_item() - return - -/mob/living/silicon/emp_act(severity) - switch(severity) - if(1) - src.take_organ_damage(0,20,emp=1) - Confuse(5) - if(2) - src.take_organ_damage(0,15,emp=1) - Confuse(4) - if(3) - src.take_organ_damage(0,10,emp=1) - Confuse(3) - if(4) - src.take_organ_damage(0,5,emp=1) - Confuse(2) - flash_eyes(affect_silicon = 1) - to_chat(src, "*BZZZT*") - to_chat(src, "Warning: Electromagnetic pulse detected.") - ..() - -/mob/living/silicon/stun_effect_act(var/stun_amount, var/agony_amount) - return //immune - -/mob/living/silicon/electrocute_act(var/shock_damage, var/obj/source, var/siemens_coeff = 0.0, var/def_zone = null, var/stun = 1) - if(shock_damage > 0) - var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread - s.set_up(5, 1, loc) - s.start() - - shock_damage *= siemens_coeff //take reduced damage - take_overall_damage(0, shock_damage) - visible_message("[src] was shocked by \the [source]!", \ - "Energy pulse detected, system damaged!", \ - "You hear an electrical crack.") - if(prob(20)) - Stun(2) - return - -/mob/living/silicon/proc/damage_mob(var/brute = 0, var/fire = 0, var/tox = 0) - return - -/mob/living/silicon/IsAdvancedToolUser() - return 1 - -/mob/living/silicon/bullet_act(var/obj/item/projectile/Proj) - - if(!Proj.nodamage) - switch(Proj.damage_type) - if(BRUTE) - adjustBruteLoss(Proj.damage) - if(BURN) - adjustFireLoss(Proj.damage) - - Proj.on_hit(src,2) - updatehealth() - return 2 - -/mob/living/silicon/apply_effect(var/effect = 0,var/effecttype = STUN, var/blocked = 0, var/check_protection = 1) - return 0//The only effect that can hit them atm is flashes and they still directly edit so this works for now - - -/proc/islinked(var/mob/living/silicon/robot/bot, var/mob/living/silicon/ai/ai) - if(!istype(bot) || !istype(ai)) - return 0 - if (bot.connected_ai == ai) - return 1 - return 0 - - -// this function shows the health of the AI in the Status panel -/mob/living/silicon/proc/show_system_integrity() - if(!src.stat) - stat(null, text("System integrity: [round((health/getMaxHealth())*100)]%")) - else - stat(null, text("Systems nonfunctional")) - - -// This is a pure virtual function, it should be overwritten by all subclasses -/mob/living/silicon/proc/show_malf_ai() - return 0 - -// this function displays the shuttles ETA in the status panel if the shuttle has been called -/mob/living/silicon/proc/show_emergency_shuttle_eta() - if(emergency_shuttle) - var/eta_status = emergency_shuttle.get_status_panel_eta() - if(eta_status) - stat(null, eta_status) - - -// This adds the basic clock, shuttle recall timer, and malf_ai info to all silicon lifeforms -/mob/living/silicon/Stat() - if(statpanel("Status")) - show_emergency_shuttle_eta() - show_system_integrity() - show_malf_ai() - ..() - -// this function displays the stations manifest in a separate window -/mob/living/silicon/proc/show_station_manifest() - var/dat = "
" - if(!data_core) - to_chat(src, "There is no data to form a manifest with. Contact your Nanotrasen administrator.") - return - dat += data_core.get_manifest(1) //The 1 makes it monochrome. - - var/datum/browser/popup = new(src, "Crew Manifest", "Crew Manifest", 370, 420, src) - popup.set_content(dat) - popup.open() - -//can't inject synths -/mob/living/silicon/can_inject(var/mob/user, var/error_msg, var/target_zone, var/ignore_thickness = FALSE) - if(error_msg) - to_chat(user, "The armoured plating is too tough.") - return 0 - - -//Silicon mob language procs - -/mob/living/silicon/can_speak(datum/language/speaking) - if(universal_speak) - return TRUE - //need speech synthesizer support to vocalize a language - if(speaking in speech_synthesizer_langs) - return TRUE - if(speaking && speaking.flags & INNATE) - return TRUE - return FALSE - -/mob/living/silicon/add_language(var/language, var/can_speak=1) - var/datum/language/added_language = GLOB.all_languages[language] - if(!added_language) - return - - . = ..(language) - if (can_speak && (added_language in languages) && !(added_language in speech_synthesizer_langs)) - speech_synthesizer_langs += added_language - return 1 - -/mob/living/silicon/remove_language(var/rem_language) - var/datum/language/removed_language = GLOB.all_languages[rem_language] - if(!removed_language) - return - - ..(rem_language) - speech_synthesizer_langs -= removed_language - -/mob/living/silicon/check_lang_data() - . = "" - - if(default_language) - . += "Current default language: [default_language] - reset

" - - for(var/datum/language/L in languages) - if(!(L.flags & NONGLOBAL)) - var/default_str - if(L == default_language) - default_str = " - default - reset" - else - default_str = " - set default" - - var/synth = (L in speech_synthesizer_langs) - . += "[L.name] ([get_language_prefix()][L.key])[synth ? default_str : null]
Speech Synthesizer: [synth ? "YES" : "NOT SUPPORTED"]
[L.desc]

" - -/mob/living/silicon/proc/toggle_sensor_mode() - var/sensor_type = input("Please select sensor type.", "Sensor Integration", null) in list("Security","Medical","Disable") - switch(sensor_type) - if ("Security") - if(plane_holder) - //Enable Security planes - plane_holder.set_vis(VIS_CH_ID,TRUE) - plane_holder.set_vis(VIS_CH_WANTED,TRUE) - plane_holder.set_vis(VIS_CH_IMPLOYAL,TRUE) - plane_holder.set_vis(VIS_CH_IMPTRACK,TRUE) - plane_holder.set_vis(VIS_CH_IMPCHEM,TRUE) - - //Disable Medical planes - plane_holder.set_vis(VIS_CH_STATUS,FALSE) - plane_holder.set_vis(VIS_CH_HEALTH,FALSE) - - to_chat(src, "Security records overlay enabled.") - if ("Medical") - if(plane_holder) - //Disable Security planes - plane_holder.set_vis(VIS_CH_ID,FALSE) - plane_holder.set_vis(VIS_CH_WANTED,FALSE) - plane_holder.set_vis(VIS_CH_IMPLOYAL,FALSE) - plane_holder.set_vis(VIS_CH_IMPTRACK,FALSE) - plane_holder.set_vis(VIS_CH_IMPCHEM,FALSE) - - //Enable Medical planes - plane_holder.set_vis(VIS_CH_STATUS,TRUE) - plane_holder.set_vis(VIS_CH_HEALTH,TRUE) - - to_chat(src, "Life signs monitor overlay enabled.") - if ("Disable") - if(plane_holder) - //Disable Security planes - plane_holder.set_vis(VIS_CH_ID,FALSE) - plane_holder.set_vis(VIS_CH_WANTED,FALSE) - plane_holder.set_vis(VIS_CH_IMPLOYAL,FALSE) - plane_holder.set_vis(VIS_CH_IMPTRACK,FALSE) - plane_holder.set_vis(VIS_CH_IMPCHEM,FALSE) - - //Disable Medical planes - plane_holder.set_vis(VIS_CH_STATUS,FALSE) - plane_holder.set_vis(VIS_CH_HEALTH,FALSE) - to_chat(src, "Sensor augmentations disabled.") - - hudmode = sensor_type //This is checked in examine.dm on humans, so they can see medical/security records depending on mode - -/mob/living/silicon/verb/pose() - set name = "Set Pose" - set desc = "Sets a description which will be shown when someone examines you." - set category = "IC" - - pose = sanitize(input(usr, "This is [src]. It is...", "Pose", null) as text) - -/mob/living/silicon/verb/set_flavor() - set name = "Set Flavour Text" - set desc = "Sets an extended description of your character's features." - set category = "IC" - - flavor_text = sanitize(input(usr, "Please enter your new flavour text.", "Flavour text", null) as text) - -/mob/living/silicon/binarycheck() - return 1 - -/mob/living/silicon/ex_act(severity) - if(!blinded) - flash_eyes() - - for(var/datum/modifier/M in modifiers) - if(!isnull(M.explosion_modifier)) - severity = CLAMP(severity + M.explosion_modifier, 1, 4) - - severity = round(severity) - - if(severity > 3) - return - - switch(severity) - if(1.0) - if (stat != 2) - adjustBruteLoss(100) - adjustFireLoss(100) - if(!anchored) - gib() - if(2.0) - if (stat != 2) - adjustBruteLoss(60) - adjustFireLoss(60) - if(3.0) - if (stat != 2) - adjustBruteLoss(30) - - updatehealth() - -/mob/living/silicon/proc/receive_alarm(var/datum/alarm_handler/alarm_handler, var/datum/alarm/alarm, was_raised) - if(!next_alarm_notice) - next_alarm_notice = world.time + SecondsToTicks(10) - if(alarm.hidden) - return - if(alarm.origin && !(get_z(alarm.origin) in using_map.get_map_levels(get_z(src), TRUE, om_range = DEFAULT_OVERMAP_RANGE))) - return - - var/list/alarms = queued_alarms[alarm_handler] - if(was_raised) - // Raised alarms are always set - alarms[alarm] = 1 - else - // Alarms that were raised but then cleared before the next notice are instead removed - if(alarm in alarms) - alarms -= alarm - // And alarms that have only been cleared thus far are set as such - else - alarms[alarm] = -1 - -/mob/living/silicon/proc/process_queued_alarms() - if(next_alarm_notice && (world.time > next_alarm_notice)) - next_alarm_notice = 0 - - var/alarm_raised = 0 - for(var/datum/alarm_handler/AH in queued_alarms) - var/list/alarms = queued_alarms[AH] - var/reported = 0 - for(var/datum/alarm/A in alarms) - if(alarms[A] == 1) - alarm_raised = 1 - if(!reported) - reported = 1 - to_chat(src, "--- [AH.category] Detected ---") - raised_alarm(A) - - for(var/datum/alarm_handler/AH in queued_alarms) - var/list/alarms = queued_alarms[AH] - var/reported = 0 - for(var/datum/alarm/A in alarms) - if(alarms[A] == -1) - if(!reported) - reported = 1 - to_chat(src, "--- [AH.category] Cleared ---") - to_chat(src, "\The [A.alarm_name()].") - - if(alarm_raised) - to_chat(src, "\[Show Alerts\]") - - for(var/datum/alarm_handler/AH in queued_alarms) - var/list/alarms = queued_alarms[AH] - alarms.Cut() - -/mob/living/silicon/proc/raised_alarm(var/datum/alarm/A) - to_chat(src, "[A.alarm_name()]!") - -/mob/living/silicon/ai/raised_alarm(var/datum/alarm/A) - var/cameratext = "" - for(var/obj/machinery/camera/C in A.cameras()) - cameratext += "[(cameratext == "")? "" : "|"][C.c_tag]" - to_chat(src, "[A.alarm_name()]! ([(cameratext)? cameratext : "No Camera"])") - - -/mob/living/silicon/proc/is_traitor() - return mind && (mind in traitors.current_antagonists) - -/mob/living/silicon/proc/is_malf() - return mind && (mind in malf.current_antagonists) - -/mob/living/silicon/proc/is_malf_or_traitor() - return is_traitor() || is_malf() - -/mob/living/silicon/adjustEarDamage() - return - -/mob/living/silicon/setEarDamage() - return - -/mob/living/silicon/reset_view() - . = ..() - if(cameraFollow) - cameraFollow = null - -/mob/living/silicon/flash_eyes(intensity = FLASH_PROTECTION_MODERATE, override_blindness_check = FALSE, affect_silicon = FALSE, visual = FALSE, type = /obj/screen/fullscreen/flash) - if(affect_silicon) - return ..() - -/mob/living/silicon/proc/clear_client() - //Handle job slot/tater cleanup. - var/job = mind.assigned_role - - job_master.FreeRole(job) - - if(mind.objectives.len) - qdel(mind.objectives) - mind.special_role = null - - clear_antag_roles(mind) - - ghostize(0) - qdel(src) - -/mob/living/silicon/has_vision() - return 0 //NOT REAL EYES ->>>>>>> fdabe51... Linter Introduction + Cleanup (#8085) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 4a0ebb576d..71a5779fa7 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1,1230 +1,3 @@ -<<<<<<< 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 - 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) - 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) - . = ..(message, blind_message, exclude_mobs, range) // 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/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(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) - -/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(obj/effect/list_container/mobl/L as obj, 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(living_players_by_zlevel) -/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 @@ -1267,8 +40,8 @@ GLOBAL_LIST_EMPTY(living_players_by_zlevel) 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. - update_emotes() 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) @@ -1518,7 +291,7 @@ GLOBAL_LIST_EMPTY(living_players_by_zlevel) set src in usr if(usr != src) to_chat(usr, "No.") - var/msg = sanitize(input(usr,"Set the flavor text in your 'examine' verb. Can also be used for OOC notes about your character.","Flavor Text",html_decode(flavor_text)) as message|null, extra = 0) + 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 @@ -1867,6 +640,7 @@ GLOBAL_LIST_EMPTY(living_players_by_zlevel) 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) @@ -1887,12 +661,14 @@ GLOBAL_LIST_EMPTY(living_players_by_zlevel) 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 +// 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 @@ -2230,6 +1006,40 @@ mob/proc/yank_out_object() 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 @@ -2367,6 +1177,16 @@ mob/proc/yank_out_object() else registered_z = null +GLOBAL_LIST_EMPTY(living_players_by_zlevel) +/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) @@ -2403,4 +1223,3 @@ mob/proc/yank_out_object() /mob/proc/grab_ghost(force) if(mind) return mind.grab_ghost(force = force) ->>>>>>> fdabe51... Linter Introduction + Cleanup (#8085) diff --git a/code/modules/paperwork/faxmachine.dm b/code/modules/paperwork/faxmachine.dm index e594b6514f..55b88bd8db 100644 --- a/code/modules/paperwork/faxmachine.dm +++ b/code/modules/paperwork/faxmachine.dm @@ -212,15 +212,9 @@ var/list/adminfaxes = list() //cache for faxes that have been sent to admins // Sadly, we can't use a switch statement here due to not using a constant value for the current map's centcom name. if(destination == using_map.boss_name) message_admins(sender, "[uppertext(using_map.boss_short)] FAX", rcvdcopy, "CentComFaxReply", "#006100") -<<<<<<< HEAD - else if (destination == "Virgo-Prime Governmental Authority") // Vorestation Edit - message_admins(sender, "VIRGO GOVERNMENT FAX", rcvdcopy, "CentComFaxReply", "#1F66A0") - else if (destination == "Supply") -======= - else if(destination == "Sif Governmental Authority") - message_admins(sender, "SIF GOVERNMENT FAX", rcvdcopy, "CentComFaxReply", "#1F66A0") + else if(destination == "Virgo-Prime Governmental Authority") // Vorestation Edit + message_admins(sender, "VIRGO GOVERNMENT FAX", rcvdcopy, "CentComFaxReply", "#1F66A0") // Vorestation Edit else if(destination == "Supply") ->>>>>>> fdabe51... Linter Introduction + Cleanup (#8085) message_admins(sender, "[uppertext(using_map.boss_short)] SUPPLY FAX", rcvdcopy, "CentComFaxReply", "#5F4519") else message_admins(sender, "[uppertext(destination)] FAX", rcvdcopy, "UNKNOWN") diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index 1fdf44119d..08d68d8956 100755 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -359,7 +359,6 @@ /obj/item/device/destTagger/attack_self(mob/user as mob) tgui_interact(user) -<<<<<<< HEAD /obj/item/device/destTagger/tgui_act(action, params) if(..()) return TRUE @@ -371,13 +370,6 @@ return FALSE currTag = new_tag . = TRUE -======= - Topic(href, href_list) - src.add_fingerprint(usr) - if(href_list["nextTag"] && (href_list["nextTag"] in GLOB.tagger_locations)) - src.currTag = href_list["nextTag"] - openwindow(usr) ->>>>>>> fdabe51... Linter Introduction + Cleanup (#8085) /obj/machinery/disposal/deliveryChute name = "Delivery chute" diff --git a/code/modules/shieldgen/shield_gen.dm b/code/modules/shieldgen/shield_gen.dm index ee35dd2657..af9d10d444 100644 --- a/code/modules/shieldgen/shield_gen.dm +++ b/code/modules/shieldgen/shield_gen.dm @@ -121,25 +121,6 @@ "max_charge" = C.max_charge, "failing" = (C.time_since_fail <= 2), ))) -<<<<<<< HEAD - - data["lockedData"]["active"] = active - data["lockedData"]["failing"] = (time_since_fail <= 2) - data["lockedData"]["radius"] = field_radius - data["lockedData"]["max_radius"] = max_field_radius - data["lockedData"]["z_range"] = z_range - data["lockedData"]["max_z_range"] = 10 - data["lockedData"]["average_field_strength"] = average_field_strength - data["lockedData"]["target_field_strength"] = target_field_strength - data["lockedData"]["max_field_strength"] = max_field_strength - data["lockedData"]["shields"] = LAZYLEN(field) - data["lockedData"]["upkeep"] = round(field.len * max(average_field_strength * dissipation_rate, min_dissipation) / energy_conversion_rate) - data["lockedData"]["strengthen_rate"] = strengthen_rate - data["lockedData"]["max_strengthen_rate"] = max_strengthen_rate - data["lockedData"]["gen_power"] = round(field.len * min(strengthen_rate, target_field_strength - average_field_strength) / energy_conversion_rate) - - return data -======= lockedData["capacitors"] = caps lockedData["active"] = active @@ -158,7 +139,6 @@ lockedData["gen_power"] = round(field.len * min(strengthen_rate, target_field_strength - average_field_strength) / energy_conversion_rate) return list("locked" = locked, "lockedData" = lockedData) ->>>>>>> fdabe51... Linter Introduction + Cleanup (#8085) /obj/machinery/shield_gen/process() if (!anchored && active) From 0c954142d21dfde3f437f61a9ed97d50d4948485 Mon Sep 17 00:00:00 2001 From: Aronai Sieyes Date: Thu, 27 May 2021 12:05:00 -0400 Subject: [PATCH 08/13] VS: Times /list was used wrong --- code/controllers/subsystems/transcore_vr.dm | 8 ++++---- code/modules/resleeving/computers.dm | 2 +- code/modules/resleeving/implant.dm | 2 +- code/modules/rogueminer_vr/zonemaster.dm | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/code/controllers/subsystems/transcore_vr.dm b/code/controllers/subsystems/transcore_vr.dm index ddfb679932..c8ec7280bd 100644 --- a/code/controllers/subsystems/transcore_vr.dm +++ b/code/controllers/subsystems/transcore_vr.dm @@ -22,10 +22,10 @@ SUBSYSTEM_DEF(transcore) var/cost_backups = 0 var/cost_implants = 0 - var/datum/transhuman/mind_record/list/backed_up = list() // All known mind records, indexed by MR.mindname/mind.name - var/datum/transhuman/mind_record/list/has_left = list() // Why do we even have this? - var/datum/transhuman/body_record/list/body_scans = list() // All known body records, indexed by BR.mydna.name - var/obj/item/weapon/implant/backup/list/implants = list() // All OPERATING implants that are being ticked + var/list/datum/transhuman/mind_record/backed_up = list() // All known mind records, indexed by MR.mindname/mind.name + var/list/datum/transhuman/mind_record/has_left = list() // Why do we even have this? + var/list/datum/transhuman/body_record/body_scans = list() // All known body records, indexed by BR.mydna.name + var/list/obj/item/weapon/implant/backup/implants = list() // All OPERATING implants that are being ticked var/list/current_run = list() diff --git a/code/modules/resleeving/computers.dm b/code/modules/resleeving/computers.dm index e30276eebe..c8f6f21083 100644 --- a/code/modules/resleeving/computers.dm +++ b/code/modules/resleeving/computers.dm @@ -469,7 +469,7 @@ icon_state = "harddisk" item_state = "card-id" w_class = ITEMSIZE_SMALL - var/datum/transhuman/mind_record/list/stored = list() + var/list/datum/transhuman/mind_record/stored = list() /** * Sets a temporary message to display to the user diff --git a/code/modules/resleeving/implant.dm b/code/modules/resleeving/implant.dm index b7fb329238..5904887002 100644 --- a/code/modules/resleeving/implant.dm +++ b/code/modules/resleeving/implant.dm @@ -50,7 +50,7 @@ throw_range = 5 w_class = ITEMSIZE_SMALL matter = list(DEFAULT_WALL_MATERIAL = 2000, "glass" = 2000) - var/obj/item/weapon/implant/backup/list/imps = list() + var/list/obj/item/weapon/implant/backup/imps = list() var/max_implants = 4 //Iconstates need to exist due to the update proc! /obj/item/weapon/backup_implanter/New() diff --git a/code/modules/rogueminer_vr/zonemaster.dm b/code/modules/rogueminer_vr/zonemaster.dm index ffca74bb34..8f2eba8426 100644 --- a/code/modules/rogueminer_vr/zonemaster.dm +++ b/code/modules/rogueminer_vr/zonemaster.dm @@ -27,8 +27,8 @@ var/original_mobs = 0 //in-use spawns from the area - var/obj/asteroid_spawner/list/rockspawns = list() - var/obj/rogue_mobspawner/list/mobspawns = list() + var/list/obj/asteroid_spawner/rockspawns = list() + var/list/obj/rogue_mobspawner/mobspawns = list() /datum/rogue/zonemaster/New(var/area/A) ASSERT(A) From 4cfdd72c021bfbe884f5292c48610147e656a91f Mon Sep 17 00:00:00 2001 From: Aronai Sieyes Date: Thu, 27 May 2021 12:07:41 -0400 Subject: [PATCH 09/13] VS: Strange incorrect code times --- code/controllers/subsystems/transcore_vr.dm | 8 +-- code/game/machinery/adv_med.dm | 2 +- code/game/machinery/machinery.dm | 2 +- code/game/objects/effects/spiders.dm | 62 +++++++------------ code/game/objects/items/weapons/chewables.dm | 2 +- code/modules/blob/blob.dm | 2 +- code/modules/client/ui_style.dm | 2 +- .../clothing/under/miscellaneous_vr.dm | 2 - .../emotes/definitions/audible_scream_vr.dm | 1 - code/modules/ext_scripts/irc.dm | 2 + code/modules/ext_scripts/python.dm | 5 +- .../station/protean_vr/protean_species.dm | 2 +- .../mob/living/carbon/human/update_icons.dm | 2 +- code/modules/mob/transform_procs.dm | 3 +- .../overmap/disperser/disperser_fire.dm | 2 +- .../guns/energy/cell_loaded_vr/cell_loaded.dm | 1 - code/modules/telesci/telesci_computer.dm | 2 +- .../tgui/modules/admin_shuttle_controller.dm | 4 +- code/modules/tgui/modules/overmap.dm | 1 - code/modules/vore/persist/persist_vr.dm | 10 +-- code/modules/vore/resizing/sizegun_vr.dm | 5 +- 21 files changed, 51 insertions(+), 71 deletions(-) diff --git a/code/controllers/subsystems/transcore_vr.dm b/code/controllers/subsystems/transcore_vr.dm index c8ec7280bd..bd8786ed0c 100644 --- a/code/controllers/subsystems/transcore_vr.dm +++ b/code/controllers/subsystems/transcore_vr.dm @@ -115,14 +115,14 @@ SUBSYSTEM_DEF(transcore) /datum/controller/subsystem/transcore/Recover() if (istype(SStranscore.body_scans)) - for(var/N in SStranscore.body_scans[N]) - if(N) body_scans[N] = SStranscore.body_scans[N] + for(var/N in SStranscore.body_scans) + if(N && SStranscore.body_scans[N]) body_scans[N] = SStranscore.body_scans[N] if(SStranscore.core_dumped) core_dumped = TRUE can_fire = FALSE else if (istype(SStranscore.backed_up)) - for(var/N in SStranscore.backed_up[N]) - if(N) backed_up[N] = SStranscore.backed_up[N] + for(var/N in SStranscore.backed_up) + if(N && SStranscore.backed_up[N]) backed_up[N] = SStranscore.backed_up[N] /datum/controller/subsystem/transcore/proc/m_backup(var/datum/mind/mind, var/obj/item/device/nif/nif, var/one_time = FALSE) ASSERT(mind) diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index 1aa1967d6d..de0d8dbcd9 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -486,7 +486,7 @@ if(unknown_body) imp += "Unknown body present:" - if(!AN && !open && !infected & !imp) + if(!AN && !open && !infected && !imp) AN = "None:" if(!(e.status & ORGAN_DESTROYED)) dat += "[e.name][e.burn_dam][e.brute_dam][robot][bled][AN][splint][open][infected][imp][internal_bleeding][lung_ruptured][o_dead]" diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index e410914bee..47d26c7ab1 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -319,8 +319,8 @@ Class Procs: qdel(C) C = new /obj/item/weapon/cell/high(src) component_parts += C - return C RefreshParts() + return C /obj/machinery/proc/default_part_replacement(var/mob/user, var/obj/item/weapon/storage/part_replacer/R) if(!istype(R)) diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm index f6422259d3..dcbf63688a 100644 --- a/code/game/objects/effects/spiders.dm +++ b/code/game/objects/effects/spiders.dm @@ -188,50 +188,34 @@ entry_vent = null else if(entry_vent) if(get_dist(src, entry_vent) <= 1) - //VOREStation Edit Start + //VOREStation Edit Start var/obj/machinery/atmospherics/unary/vent_pump/exit_vent = get_safe_ventcrawl_target(entry_vent) if(!exit_vent) return - if(1) //To maintain indentation level - //VOREStation Edit End - /* //VOREStation Removal Start - prevent spiders in dorms - if(entry_vent.network && entry_vent.network.normal_members.len) - var/list/vents = list() - for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in entry_vent.network.normal_members) - vents.Add(temp_vent) - if(!vents.len) - entry_vent = null - return - var/obj/machinery/atmospherics/unary/vent_pump/exit_vent = pick(vents) - */ //VOREStation Removal End - /*if(prob(50)) - src.visible_message("[src] scrambles into the ventillation ducts!")*/ + spawn(rand(20,60)) + loc = exit_vent + var/travel_time = round(get_dist(loc, exit_vent.loc) / 2) + spawn(travel_time) - spawn(rand(20,60)) - loc = exit_vent - var/travel_time = round(get_dist(loc, exit_vent.loc) / 2) - spawn(travel_time) - - if(!exit_vent || exit_vent.welded) - loc = entry_vent - entry_vent = null - return - - if(prob(50)) - src.visible_message("You hear something squeezing through the ventilation ducts.",2) - sleep(travel_time) - - if(!exit_vent || exit_vent.welded) - loc = entry_vent - entry_vent = null - return - loc = exit_vent.loc + if(!exit_vent || exit_vent.welded) + loc = entry_vent entry_vent = null - var/area/new_area = get_area(loc) - if(new_area) - new_area.Entered(src) - else - entry_vent = null + return + + if(prob(50)) + src.visible_message("You hear something squeezing through the ventilation ducts.",2) + sleep(travel_time) + + if(!exit_vent || exit_vent.welded) + loc = entry_vent + entry_vent = null + return + loc = exit_vent.loc + entry_vent = null + var/area/new_area = get_area(loc) + if(new_area) + new_area.Entered(src) + //VOREStation Edit End //================= if(isturf(loc)) diff --git a/code/game/objects/items/weapons/chewables.dm b/code/game/objects/items/weapons/chewables.dm index 7e38782092..3f7e3fc1b8 100644 --- a/code/game/objects/items/weapons/chewables.dm +++ b/code/game/objects/items/weapons/chewables.dm @@ -259,4 +259,4 @@ obj/item/clothing/mask/chewable/Destroy() /obj/item/clothing/mask/chewable/candy/pocky/Initialize() . = ..() - reagents.add_reagent("chocolate" = 10) \ No newline at end of file + reagents.add_reagent("chocolate", 10) \ No newline at end of file diff --git a/code/modules/blob/blob.dm b/code/modules/blob/blob.dm index 91524d6899..587214a0cb 100644 --- a/code/modules/blob/blob.dm +++ b/code/modules/blob/blob.dm @@ -22,7 +22,7 @@ update_icon() return ..(loc) -/obj/effect/blob/CanPass(var/atom/movable/mover, vra/turf/target) +/obj/effect/blob/CanPass(var/atom/movable/mover, var/turf/target) return FALSE /obj/effect/blob/ex_act(var/severity) diff --git a/code/modules/client/ui_style.dm b/code/modules/client/ui_style.dm index 84c8055d9f..bcf580bd47 100644 --- a/code/modules/client/ui_style.dm +++ b/code/modules/client/ui_style.dm @@ -49,7 +49,7 @@ var/global/list/all_tooltip_styles = list( if(!UI_style_new) return var/UI_style_alpha_new = input(usr, "Select a new alpha (transparency) parameter for your UI, between 50 and 255") as null|num - if(!UI_style_alpha_new | !(UI_style_alpha_new <= 255 && UI_style_alpha_new >= 50)) return + if(!UI_style_alpha_new || !(UI_style_alpha_new <= 255 && UI_style_alpha_new >= 50)) return var/UI_style_color_new = input(usr, "Choose your UI color. Dark colors are not recommended!") as color|null if(!UI_style_color_new) return diff --git a/code/modules/clothing/under/miscellaneous_vr.dm b/code/modules/clothing/under/miscellaneous_vr.dm index 98bf1ceaf4..aba31abd19 100644 --- a/code/modules/clothing/under/miscellaneous_vr.dm +++ b/code/modules/clothing/under/miscellaneous_vr.dm @@ -38,7 +38,6 @@ set src in usr adjust_fibers(usr) - ..() /obj/item/clothing/under/hyperfiber/proc/adjust_fibers(mob/user) if(hides_bulges == FALSE) @@ -63,7 +62,6 @@ set category = "Object" set src in usr bluespace_size(usr) - ..() /obj/item/clothing/under/hyperfiber/bluespace/proc/bluespace_size(mob/usr as mob) if (!ishuman(usr)) diff --git a/code/modules/emotes/definitions/audible_scream_vr.dm b/code/modules/emotes/definitions/audible_scream_vr.dm index 7114d0eb66..f2c69ba3c3 100644 --- a/code/modules/emotes/definitions/audible_scream_vr.dm +++ b/code/modules/emotes/definitions/audible_scream_vr.dm @@ -10,4 +10,3 @@ "sound" = H.species.male_scream_sound, "vol" = emote_volume ) - return ..() diff --git a/code/modules/ext_scripts/irc.dm b/code/modules/ext_scripts/irc.dm index e76c2055b7..a554cdd20a 100644 --- a/code/modules/ext_scripts/irc.dm +++ b/code/modules/ext_scripts/irc.dm @@ -1,5 +1,6 @@ /proc/send2irc(var/channel, var/msg) return // VOREStation Edit - Can't exploit shell if we never call shell! + /* Unreachable with above VOREStation Edit if (config.use_irc_bot) if (config.use_node_bot) shell("node bridge.js -h \"[config.irc_bot_host]\" -p \"[config.irc_bot_port]\" -c \"[channel]\" -m \"[escape_shell_arg(msg)]\"") @@ -22,6 +23,7 @@ spawn(0) ext_python("ircbot_message.py", "[config.comms_password] [config.irc_bot_host] [channel] [escape_shell_arg(msg)]") return + */ /proc/send2mainirc(var/msg) if(config.main_irc) diff --git a/code/modules/ext_scripts/python.dm b/code/modules/ext_scripts/python.dm index eb6e61aea2..c8fbdd9303 100644 --- a/code/modules/ext_scripts/python.dm +++ b/code/modules/ext_scripts/python.dm @@ -18,6 +18,7 @@ /proc/ext_python(var/script, var/args, var/scriptsprefix = 1) return // VOREStation Edit - Can't exploit shell if we never call shell! + /* Unreachable with above vorestation edit if(scriptsprefix) script = "scripts/" + script @@ -25,4 +26,6 @@ script = replacetext(script, "/", "\\") var/command = config.python_path + " " + script + " " + args - return shell(command) \ No newline at end of file + return shell(command) + */ + \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_species.dm b/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_species.dm index 8bd2192be8..2713e1beec 100755 --- a/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_species.dm +++ b/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_species.dm @@ -176,7 +176,7 @@ for(var/obj/item/organ/I in H.internal_organs) I.removed() - for(var/obj/item/I in src) + for(var/obj/item/I in H.contents) H.drop_from_inventory(I) qdel(H) diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index cc238fe792..b4836d168f 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -481,7 +481,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() overlays_standing[HAIR_LAYER] = image(face_standing, layer = BODY_LAYER+HAIR_LAYER, "pixel_y" = head_organ.head_offset) apply_layer(HAIR_LAYER) - return + //return //VOREStation Edit // VOREStation Edit - START var/icon/hair_acc_s = get_hair_accessory_overlay() diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index fc0c3bebdd..47ccbfac25 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -55,8 +55,7 @@ var/mob/living/silicon/ai/O = ..(move) if(O) O.flavor_text = O.client?.prefs?.flavor_texts["general"] - - return O + return O //VOREStation Edit End return ..(move) diff --git a/code/modules/overmap/disperser/disperser_fire.dm b/code/modules/overmap/disperser/disperser_fire.dm index 421c9b4a20..86116b0677 100644 --- a/code/modules/overmap/disperser/disperser_fire.dm +++ b/code/modules/overmap/disperser/disperser_fire.dm @@ -67,7 +67,7 @@ return TRUE var/obj/effect/overmap/event/finaltarget = pick(candidates) - log_and_message_admins("A type [chargetype] disperser beam was launched at [finaltarget].", location=finaltarget) + log_and_message_admins("A type [chargetype] disperser beam was launched at [finaltarget].") fire_at_event(finaltarget, chargetype) return TRUE diff --git a/code/modules/projectiles/guns/energy/cell_loaded_vr/cell_loaded.dm b/code/modules/projectiles/guns/energy/cell_loaded_vr/cell_loaded.dm index 1ec51e1e90..4f95b54d5a 100644 --- a/code/modules/projectiles/guns/energy/cell_loaded_vr/cell_loaded.dm +++ b/code/modules/projectiles/guns/energy/cell_loaded_vr/cell_loaded.dm @@ -38,7 +38,6 @@ if(istype(other_batt,chambered.type) && other_batt.shots_left) switch_to(other_batt) return new chambered.projectile_type() - break return null diff --git a/code/modules/telesci/telesci_computer.dm b/code/modules/telesci/telesci_computer.dm index d2a6a0a35a..bac505f612 100644 --- a/code/modules/telesci/telesci_computer.dm +++ b/code/modules/telesci/telesci_computer.dm @@ -197,7 +197,7 @@ // Irradiate everyone in telescience! for(var/obj/machinery/telepad/E in machines) var/L = get_turf(E) - sparks(target = L) + sparks() for(var/mob/living/carbon/human/M in viewers(L, null)) M.apply_effect((rand(10, 20)), IRRADIATE, 0) to_chat(M, "You feel strange.") diff --git a/code/modules/tgui/modules/admin_shuttle_controller.dm b/code/modules/tgui/modules/admin_shuttle_controller.dm index 20e5c47367..d2ce9bc69e 100644 --- a/code/modules/tgui/modules/admin_shuttle_controller.dm +++ b/code/modules/tgui/modules/admin_shuttle_controller.dm @@ -58,11 +58,11 @@ target = V.restricted_waypoints[1] else to_chat(C, "Unable to jump to [V].") - return FALSE + return var/turf/T = get_turf(target) if(!istype(T)) to_chat(C, "Unable to jump to [V].") - return FALSE + return C.jumptoturf(T) return TRUE if("classicmove") diff --git a/code/modules/tgui/modules/overmap.dm b/code/modules/tgui/modules/overmap.dm index 2e566e1267..097bf84a05 100644 --- a/code/modules/tgui/modules/overmap.dm +++ b/code/modules/tgui/modules/overmap.dm @@ -158,7 +158,6 @@ . = ..() if(!istype(new_linked)) CRASH("Warning, [new_linked] is not an overmap ship! Something went horribly wrong for [usr]!") - return linked = new_linked name = initial(name) + " ([linked.name])" // HELM diff --git a/code/modules/vore/persist/persist_vr.dm b/code/modules/vore/persist/persist_vr.dm index 3372910973..3bae4a8524 100644 --- a/code/modules/vore/persist/persist_vr.dm +++ b/code/modules/vore/persist/persist_vr.dm @@ -48,12 +48,12 @@ // Okay this mob has a real loaded-from-savefile mind in it! var/datum/preferences/prefs = preferences_datums[persister.mind.loaded_from_ckey] if(!prefs) - WARNING("Persist (P4P): [persister.mind] was loaded from ckey [persister.mind.loaded_from_ckey] but no prefs datum found.") + warning("Persist (P4P): [persister.mind] was loaded from ckey [persister.mind.loaded_from_ckey] but no prefs datum found.") return // Okay, lets do a few checks to see if we should really save tho! if(!prefs.load_character(persister.mind.loaded_from_slot)) - WARNING("Persist (P4P): [persister.mind] was loaded from slot [persister.mind.loaded_from_slot] but loading prefs failed.") + warning("Persist (P4P): [persister.mind] was loaded from slot [persister.mind.loaded_from_slot] but loading prefs failed.") return // Failed to load character // For now as a safety measure we will only save if the name matches. @@ -79,7 +79,7 @@ var/datum/preferences/prefs = prep_for_persist(occupant) if(!prefs) - WARNING("Persist (PID): Skipping [occupant] for persisting, as they have no prefs.") + warning("Persist (PID): Skipping [occupant] for persisting, as they have no prefs.") return //This one doesn't rely on persistence prefs @@ -232,7 +232,7 @@ prefs = prep_for_persist(H) if(!prefs) - WARNING("Persist (NIF): [H] has no prefs datum, skipping") + warning("Persist (NIF): [H] has no prefs datum, skipping") return var/obj/item/device/nif/nif = H.nif @@ -254,6 +254,6 @@ var/datum/category_item/player_setup_item/vore/nif/nif_prefs = vore_cat.items_by_name["NIF Data"] var/savefile/S = new /savefile(prefs.path) - if(!S) WARNING ("Persist (NIF): Couldn't load NIF save savefile? [prefs.real_name]") + if(!S) warning("Persist (NIF): Couldn't load NIF save savefile? [prefs.real_name]") S.cd = "/character[prefs.default_slot]" nif_prefs.save_character(S) diff --git a/code/modules/vore/resizing/sizegun_vr.dm b/code/modules/vore/resizing/sizegun_vr.dm index 41775af2a5..b25cea2291 100644 --- a/code/modules/vore/resizing/sizegun_vr.dm +++ b/code/modules/vore/resizing/sizegun_vr.dm @@ -24,10 +24,7 @@ /obj/item/weapon/gun/energy/sizegun/New() ..() - if(istype(src, /obj/item/weapon/gun/energy/sizegun/admin)) - verbs += /obj/item/weapon/gun/energy/sizegun/admin/select_size - else - verbs += /obj/item/weapon/gun/energy/sizegun/proc/select_size + verbs += .proc/select_size /obj/item/weapon/gun/energy/sizegun/attack_self(mob/user) . = ..() From 7d725e740bd22e44d2cd92d8add654c22ace9cb3 Mon Sep 17 00:00:00 2001 From: Aronai Sieyes Date: Thu, 27 May 2021 12:08:51 -0400 Subject: [PATCH 10/13] VS: Implicit list abuse --- code/game/machinery/cryopod.dm | 11 ++-- code/game/mecha/mecha_control_console.dm | 6 +- .../core/integrated_circuit.dm | 23 ++++--- .../integrated_electronics/core/printer.dm | 8 ++- .../mining/machinery/machine_processing.dm | 7 ++- .../mining/machinery/machine_stacking.dm | 6 +- .../silicon/robot/dogborg/dog_sleeper_vr.dm | 2 +- code/modules/mob/mob.dm | 2 +- code/modules/persistence/noticeboard.dm | 7 ++- code/modules/research/server.dm | 10 +-- code/modules/vore/eating/belly_obj_vr.dm | 2 +- code/modules/vore/eating/vorepanel_vr.dm | 62 +++++++++++-------- 12 files changed, 86 insertions(+), 60 deletions(-) diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index f17c97a627..7ed6abed40 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -96,16 +96,17 @@ data["allow_items"] = allow_items data["crew"] = frozen_crew - data["items"] = list() + var/list/items = list() if(allow_items) for(var/F in frozen_items) - data["items"].Add(F) // VOREStation Edit + items.Add(F) // VOREStation Edit /* VOREStation Removal - data["items"].Add(list(list( + items.Add(list(list( "name" = "[F]", "ref" = REF(F), ))) VOREStation Removal End */ + data["items"] = items return data @@ -116,7 +117,7 @@ add_fingerprint(usr) return FALSE // VOREStation Edit - prevent topic exploits - + /* VOREStation Edit - Unreachable due to above switch(action) if("item") if(!allow_items) @@ -148,7 +149,7 @@ for(var/obj/item/I in frozen_items) I.forceMove(get_turf(src)) frozen_items -= I - + */ /obj/item/weapon/circuitboard/cryopodcontrol name = "Circuit board (Cryogenic Oversight Console)" diff --git a/code/game/mecha/mecha_control_console.dm b/code/game/mecha/mecha_control_console.dm index 54e00dc39a..0b438e5632 100644 --- a/code/game/mecha/mecha_control_console.dm +++ b/code/game/mecha/mecha_control_console.dm @@ -27,11 +27,13 @@ /obj/machinery/computer/mecha/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state) var/list/data = ..() - data["beacons"] = list() + + var/list/beacons = list() for(var/obj/item/mecha_parts/mecha_tracking/TR in world) var/list/tr_data = TR.tgui_data(user) if(tr_data) - data["beacons"].Add(list(tr_data)) + beacons.Add(list(tr_data)) + data["beacons"] = beacons LAZYINITLIST(stored_data) data["stored_data"] = stored_data diff --git a/code/modules/integrated_electronics/core/integrated_circuit.dm b/code/modules/integrated_electronics/core/integrated_circuit.dm index 2253d67702..da63046fd5 100644 --- a/code/modules/integrated_electronics/core/integrated_circuit.dm +++ b/code/modules/integrated_electronics/core/integrated_circuit.dm @@ -100,17 +100,17 @@ a creative player the means to solve many problems. Circuits are held inside an data["power_draw_per_use"] = power_draw_per_use data["extended_desc"] = extended_desc - data["inputs"] = list() + var/list/inputs = list() + var/list/outputs = list() + var/list/activators = list() for(var/datum/integrated_io/io in inputs) - data["inputs"].Add(list(tgui_pin_data(io))) + inputs.Add(list(tgui_pin_data(io))) - data["outputs"] = list() for(var/datum/integrated_io/io in outputs) - data["outputs"].Add(list(tgui_pin_data(io))) + outputs.Add(list(tgui_pin_data(io))) - data["activators"] = list() for(var/datum/integrated_io/io in activators) - var/list/activator = list( + var/list/list/activator = list( "ref" = REF(io), "name" = io.name, "pulse_out" = io.data, @@ -124,7 +124,11 @@ a creative player the means to solve many problems. Circuits are held inside an "holder_name" = linked.holder.displayed_name, ))) - data["activators"].Add(list(activator)) + activators.Add(list(activator)) + + data["inputs"] = inputs + data["outputs"] = outputs + data["activators"] = activators return data @@ -136,14 +140,15 @@ a creative player the means to solve many problems. Circuits are held inside an pindata["name"] = io.name pindata["data"] = io.display_data(io.data) pindata["ref"] = REF(io) - pindata["linked"] = list() + var/list/linked_list = list() for(var/datum/integrated_io/linked in io.linked) - pindata["linked"].Add(list(list( + linked_list.Add(list(list( "ref" = REF(linked), "name" = linked.name, "holder_ref" = REF(linked.holder), "holder_name" = linked.holder.displayed_name, ))) + pindata["linked"] = linked_list return pindata /obj/item/integrated_circuit/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state) diff --git a/code/modules/integrated_electronics/core/printer.dm b/code/modules/integrated_electronics/core/printer.dm index 2480e39fb2..173e81adea 100644 --- a/code/modules/integrated_electronics/core/printer.dm +++ b/code/modules/integrated_electronics/core/printer.dm @@ -108,12 +108,14 @@ for(var/category in SScircuit.circuit_fabricator_recipe_list) var/list/cat_obj = list( "name" = category, - "items" = list() + "items" = null ) var/list/circuit_list = SScircuit.circuit_fabricator_recipe_list[category] + var/list/items = list() for(var/path in circuit_list) var/obj/O = path var/can_build = TRUE + if(ispath(path, /obj/item/integrated_circuit)) var/obj/item/integrated_circuit/IC = path if((initial(IC.spawn_flags) & IC_SPAWN_RESEARCH) && (!(initial(IC.spawn_flags) & IC_SPAWN_DEFAULT)) && !upgraded) @@ -127,13 +129,15 @@ var/obj/item/I = path cost = initial(I.w_class) - cat_obj["items"].Add(list(list( + items.Add(list(list( "name" = initial(O.name), "desc" = initial(O.desc), "can_build" = can_build, "cost" = cost, "path" = path, ))) + + cat_obj["items"] = items categories.Add(list(cat_obj)) data["categories"] = categories diff --git a/code/modules/mining/machinery/machine_processing.dm b/code/modules/mining/machinery/machine_processing.dm index c87edbeda9..f9b8929003 100644 --- a/code/modules/mining/machinery/machine_processing.dm +++ b/code/modules/mining/machinery/machine_processing.dm @@ -69,20 +69,21 @@ else data["has_id"] = FALSE - data["ores"] = list() + + var/list/ores = list() for(var/ore in machine.ores_processing) if(!machine.ores_stored[ore] && !show_all_ores) continue var/ore/O = GLOB.ore_data[ore] if(!O) continue - data["ores"].Add(list(list( + ores.Add(list(list( "ore" = ore, "name" = O.display_name, "amount" = machine.ores_stored[ore], "processing" = machine.ores_processing[ore] ? machine.ores_processing[ore] : 0, ))) - + data["ores"] = ores data["showAllOres"] = show_all_ores data["power"] = machine.active data["speed"] = machine.speed_process diff --git a/code/modules/mining/machinery/machine_stacking.dm b/code/modules/mining/machinery/machine_stacking.dm index b88511bbe7..9469b2d64d 100644 --- a/code/modules/mining/machinery/machine_stacking.dm +++ b/code/modules/mining/machinery/machine_stacking.dm @@ -37,13 +37,15 @@ /obj/machinery/mineral/stacking_unit_console/tgui_data(mob/user) var/list/data = ..() - data["stacktypes"] = list() + + var/list/stacktypes = list() for(var/stacktype in machine.stack_storage) if(machine.stack_storage[stacktype] > 0) - data["stacktypes"].Add(list(list( + stacktypes.Add(list(list( "type" = stacktype, "amt" = machine.stack_storage[stacktype], ))) + data["stacktypes"] = stacktypes data["stackingAmt"] = machine.stack_amt return data diff --git a/code/modules/mob/living/silicon/robot/dogborg/dog_sleeper_vr.dm b/code/modules/mob/living/silicon/robot/dogborg/dog_sleeper_vr.dm index 7f6a4475b8..81cc9f3dce 100644 --- a/code/modules/mob/living/silicon/robot/dogborg/dog_sleeper_vr.dm +++ b/code/modules/mob/living/silicon/robot/dogborg/dog_sleeper_vr.dm @@ -22,7 +22,7 @@ var/decompiler = FALSE var/delivery = FALSE var/delivery_tag = "Fuel" - var/list/deliverylists = list() + var/list/list/deliverylists = list() var/list/deliveryslot_1 = list() var/list/deliveryslot_2 = list() var/list/deliveryslot_3 = list() diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 71a5779fa7..00d705f8e1 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1177,7 +1177,7 @@ mob/verb/shifteast() else registered_z = null -GLOBAL_LIST_EMPTY(living_players_by_zlevel) +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 diff --git a/code/modules/persistence/noticeboard.dm b/code/modules/persistence/noticeboard.dm index 2677977253..30fd4acb6f 100644 --- a/code/modules/persistence/noticeboard.dm +++ b/code/modules/persistence/noticeboard.dm @@ -115,15 +115,16 @@ /obj/structure/noticeboard/tgui_data(mob/user) var/list/data = ..() - data["notices"] = list() + + var/list/notices = list() for(var/obj/item/I in notices) - data["notices"].Add(list(list( + notices.Add(list(list( "ispaper" = istype(I, /obj/item/weapon/paper), "isphoto" = istype(I, /obj/item/weapon/photo), "name" = I.name, "ref" = "\ref[I]", ))) - + data["notices"] = notices return data /obj/structure/noticeboard/tgui_act(action, params) diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm index 3ea0aede1b..700e1d9040 100644 --- a/code/modules/research/server.dm +++ b/code/modules/research/server.dm @@ -178,22 +178,24 @@ for(var/obj/machinery/r_n_d/server/S in machines) if(istype(S, /obj/machinery/r_n_d/server/centcom) && !badmin) continue + var/list/tech = list() + var/list/designs = list() var/list/server_data = list( "name" = S.name, "ref" = REF(S), "id" = S.server_id, "id_with_upload" = S.id_with_upload, "id_with_download" = S.id_with_download, - "tech" = list(), - "designs" = list(), + "tech" = tech, + "designs" = designs, ) for(var/datum/tech/T in S.files.known_tech) - server_data["tech"].Add(list(list( + tech.Add(list(list( "name" = T.name, "id" = T.id, ))) for(var/datum/design/D in S.files.known_designs) - server_data["designs"].Add(list(list( + designs.Add(list(list( "name" = D.name, "id" = D.id, ))) diff --git a/code/modules/vore/eating/belly_obj_vr.dm b/code/modules/vore/eating/belly_obj_vr.dm index ab82f4c6d1..a141ebac44 100644 --- a/code/modules/vore/eating/belly_obj_vr.dm +++ b/code/modules/vore/eating/belly_obj_vr.dm @@ -41,7 +41,7 @@ var/obj/item/weapon/storage/vore_egg/ownegg // Is this belly creating an egg? var/egg_type = "Egg" // Default egg type and path. var/egg_path = /obj/item/weapon/storage/vore_egg - var/list/emote_lists = list() // Idle emotes that happen on their own, depending on the bellymode. Contains lists of strings indexed by bellymode + var/list/list/emote_lists = list() // Idle emotes that happen on their own, depending on the bellymode. Contains lists of strings indexed by bellymode var/emote_time = 60 // How long between stomach emotes at prey (in seconds) var/emote_active = TRUE // Are we even giving emotes out at all or not? var/next_emote = 0 // When we're supposed to print our next emote, as a world.time diff --git a/code/modules/vore/eating/vorepanel_vr.dm b/code/modules/vore/eating/vorepanel_vr.dm index 5a47029b13..36f38b11da 100644 --- a/code/modules/vore/eating/vorepanel_vr.dm +++ b/code/modules/vore/eating/vorepanel_vr.dm @@ -87,13 +87,13 @@ data["unsaved_changes"] = unsaved_changes data["show_pictures"] = show_pictures - data["inside"] = list() var/atom/hostloc = host.loc + var/list/inside = list() if(isbelly(hostloc)) var/obj/belly/inside_belly = hostloc var/mob/living/pred = inside_belly.owner - data["inside"] = list( + inside = list( "absorbed" = host.absorbed, "belly_name" = inside_belly.name, "belly_mode" = inside_belly.digest_mode, @@ -102,7 +102,7 @@ "ref" = "\ref[inside_belly]", ) - data["inside"]["contents"] = list() + var/list/inside_contents = list() for(var/atom/movable/O in inside_belly) if(O == host) continue @@ -121,23 +121,26 @@ info["stat"] = M.stat if(M.absorbed) info["absorbed"] = TRUE - data["inside"]["contents"].Add(list(info)) + inside_contents.Add(list(info)) + inside["contents"] = inside_contents + data["inside"] = list() - data["our_bellies"] = list() + var/list/our_bellies = list() for(var/belly in host.vore_organs) var/obj/belly/B = belly - data["our_bellies"].Add(list(list( + our_bellies.Add(list(list( "selected" = (B == host.vore_selected), "name" = B.name, "ref" = "\ref[B]", "digest_mode" = B.digest_mode, "contents" = LAZYLEN(B.contents), ))) + data["our_bellies"] = our_bellies - data["selected"] = null + var/list/selected_list = null if(host.vore_selected) var/obj/belly/selected = host.vore_selected - data["selected"] = list( + selected_list = list( "belly_name" = selected.name, "is_wet" = selected.is_wet, "wet_loop" = selected.wet_loop, @@ -162,33 +165,37 @@ "belly_fullscreen" = selected.belly_fullscreen, "possible_fullscreens" = icon_states('icons/mob/screen_full_vore.dmi'), ) + data["selected"] = selected_list - data["selected"]["addons"] = list() + + var/list/addons = list() for(var/flag_name in selected.mode_flag_list) if(selected.mode_flags & selected.mode_flag_list[flag_name]) - data["selected"]["addons"].Add(flag_name) + addons.Add(flag_name) + selected["addons"] = addons - data["selected"]["egg_type"] = selected.egg_type - data["selected"]["contaminates"] = selected.contaminates - data["selected"]["contaminate_flavor"] = null - data["selected"]["contaminate_color"] = null + selected["egg_type"] = selected.egg_type + selected["contaminates"] = selected.contaminates + selected["contaminate_flavor"] = null + selected["contaminate_color"] = null if(selected.contaminates) - data["selected"]["contaminate_flavor"] = selected.contamination_flavor - data["selected"]["contaminate_color"] = selected.contamination_color + selected["contaminate_flavor"] = selected.contamination_flavor + selected["contaminate_color"] = selected.contamination_color - data["selected"]["escapable"] = selected.escapable - data["selected"]["interacts"] = list() + selected["escapable"] = selected.escapable + selected["interacts"] = list() if(selected.escapable) - data["selected"]["interacts"]["escapechance"] = selected.escapechance - data["selected"]["interacts"]["escapetime"] = selected.escapetime - data["selected"]["interacts"]["transferchance"] = selected.transferchance - data["selected"]["interacts"]["transferlocation"] = selected.transferlocation - data["selected"]["interacts"]["absorbchance"] = selected.absorbchance - data["selected"]["interacts"]["digestchance"] = selected.digestchance + selected["interacts"]["escapechance"] = selected.escapechance + selected["interacts"]["escapetime"] = selected.escapetime + selected["interacts"]["transferchance"] = selected.transferchance + selected["interacts"]["transferlocation"] = selected.transferlocation + selected["interacts"]["absorbchance"] = selected.absorbchance + selected["interacts"]["digestchance"] = selected.digestchance - data["selected"]["disable_hud"] = selected.disable_hud + selected["disable_hud"] = selected.disable_hud - data["selected"]["contents"] = list() + + var/list/selected_contents = list() for(var/O in selected) var/list/info = list( "name" = "[O]", @@ -204,7 +211,8 @@ info["stat"] = M.stat if(M.absorbed) info["absorbed"] = TRUE - data["selected"]["contents"].Add(list(info)) + selected_contents.Add(list(info)) + selected["contents"] = selected_contents data["prefs"] = list( "digestable" = host.digestable, From 3ee63e782a20cc7230b520ec7a945259415c4133 Mon Sep 17 00:00:00 2001 From: Aronai Sieyes Date: Thu, 27 May 2021 12:09:38 -0400 Subject: [PATCH 11/13] VS: Ambig OoO --- code/game/jobs/job_controller.dm | 2 +- code/game/objects/items/devices/scanners_vr.dm | 4 ++-- code/game/objects/items/devices/translocator_vr.dm | 2 +- code/modules/client/verbs/who.dm | 8 ++++---- code/modules/clothing/clothing_vr.dm | 2 +- code/modules/events/grubinfestation_vr.dm | 2 +- code/modules/mob/dead/observer/observer_vr.dm | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm index a439200b63..5f2fa97e54 100644 --- a/code/game/jobs/job_controller.dm +++ b/code/game/jobs/job_controller.dm @@ -108,7 +108,7 @@ var/global/datum/controller/occupations/job_master Debug("FOC is_job_whitelisted failed, Player: [player]") continue //VOREStation Code End - if(flag && (!player.client.prefs.be_special & flag)) + 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) diff --git a/code/game/objects/items/devices/scanners_vr.dm b/code/game/objects/items/devices/scanners_vr.dm index b8892ea501..5740a7df86 100644 --- a/code/game/objects/items/devices/scanners_vr.dm +++ b/code/game/objects/items/devices/scanners_vr.dm @@ -171,7 +171,7 @@ var/global/mob/living/carbon/human/dummy/mannequin/sleevemate_mob //The actual options if(href_list["mindscan"]) - if(!target.mind || target.mind.name in prevent_respawns) + if(!target.mind || (target.mind.name in prevent_respawns)) to_chat(usr,"Target seems totally braindead.") return @@ -208,7 +208,7 @@ var/global/mob/living/carbon/human/dummy/mannequin/sleevemate_mob return if(href_list["mindsteal"]) - if(!target.mind || target.mind.name in prevent_respawns) + if(!target.mind || (target.mind.name in prevent_respawns)) to_chat(usr,"Target seems totally braindead.") return diff --git a/code/game/objects/items/devices/translocator_vr.dm b/code/game/objects/items/devices/translocator_vr.dm index a424bac70a..0b3715fa5c 100644 --- a/code/game/objects/items/devices/translocator_vr.dm +++ b/code/game/objects/items/devices/translocator_vr.dm @@ -506,7 +506,7 @@ GLOBAL_LIST_BOILERPLATE(premade_tele_beacons, /obj/item/device/perfect_tele_beac var/phase_power = 75 var/recharging = 0 -/obj/item/device/perfect_tele/frontier/unload_ammo(var/mob/user) +/obj/item/device/perfect_tele/frontier/unload_ammo(mob/user, var/ignore_inactive_hand_check = 0) if(recharging) return recharging = 1 diff --git a/code/modules/client/verbs/who.dm b/code/modules/client/verbs/who.dm index ebcc5859ed..6c309a6566 100644 --- a/code/modules/client/verbs/who.dm +++ b/code/modules/client/verbs/who.dm @@ -84,7 +84,7 @@ for(var/client/C in GLOB.admins) if(R_ADMIN & C.holder.rights && R_BAN & C.holder.rights) - if(C.holder.fakekey && (!R_ADMIN & holder.rights && !R_MOD & holder.rights)) //Event Managerss can't see stealthmins + if(C.holder.fakekey && !((R_ADMIN & holder.rights) || (R_MOD & holder.rights))) //Event Managerss can't see stealthmins continue msg += "\t[C] is a [C.holder.rank]" @@ -110,7 +110,7 @@ else if(R_ADMIN & C.holder.rights && !(R_SERVER & C.holder.rights)) modmsg += "\t[C] is a [C.holder.rank]" - if(C.holder.fakekey && (!R_ADMIN & holder.rights && !R_MOD & holder.rights)) + if(C.holder.fakekey && !((R_ADMIN & holder.rights) || (R_MOD & holder.rights))) continue if(C.holder.fakekey) msg += " (as [C.holder.fakekey])" @@ -131,7 +131,7 @@ num_mods_online++ else if(R_SERVER & C.holder.rights) - if(C.holder.fakekey && (!R_ADMIN & holder.rights && !R_MOD & holder.rights)) + if(C.holder.fakekey && !((R_ADMIN & holder.rights) || (R_MOD & holder.rights))) continue devmsg += "\t[C] is a [C.holder.rank]" if(C.holder.fakekey) @@ -152,7 +152,7 @@ num_devs_online++ else - if(C.holder.fakekey && (!R_ADMIN & holder.rights && !R_MOD & holder.rights)) + if(C.holder.fakekey && !((R_ADMIN & holder.rights) || (R_MOD & holder.rights))) continue eventMmsg += "\t[C] is a [C.holder.rank]" if(C.holder.fakekey) diff --git a/code/modules/clothing/clothing_vr.dm b/code/modules/clothing/clothing_vr.dm index 2dc6ed7f92..b8610fdfcb 100644 --- a/code/modules/clothing/clothing_vr.dm +++ b/code/modules/clothing/clothing_vr.dm @@ -40,7 +40,7 @@ to_chat(user, "You can't fit anyone else into \the [src]!") else var/obj/item/weapon/holder/micro/holder = I - if(holder.held_mob && holder.held_mob in holder) + if(holder.held_mob && (holder.held_mob in holder)) to_chat(holder.held_mob, "[user] stuffs you into \the [src]!") holder.held_mob.forceMove(src) to_chat(user, "You stuff \the [holder.held_mob] into \the [src]!") diff --git a/code/modules/events/grubinfestation_vr.dm b/code/modules/events/grubinfestation_vr.dm index c67a5a72f5..45ca8bd6a7 100644 --- a/code/modules/events/grubinfestation_vr.dm +++ b/code/modules/events/grubinfestation_vr.dm @@ -13,7 +13,7 @@ for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in machines) if(istype(get_area(temp_vent), /area/crew_quarters/sleep)) continue - if(!temp_vent.welded && temp_vent.network && temp_vent.loc.z in using_map.station_levels) + if(!temp_vent.welded && temp_vent.network && (temp_vent.loc.z in using_map.station_levels)) if(temp_vent.network.normal_members.len > 50) vents += temp_vent diff --git a/code/modules/mob/dead/observer/observer_vr.dm b/code/modules/mob/dead/observer/observer_vr.dm index 7abad3ef09..2e54e6414e 100644 --- a/code/modules/mob/dead/observer/observer_vr.dm +++ b/code/modules/mob/dead/observer/observer_vr.dm @@ -62,7 +62,7 @@ set name = "Notify Transcore" set desc = "If your past-due backup notification was missed or ignored, you can use this to send a new one." - if(src.mind && src.mind.name in SStranscore.backed_up) + if(src.mind && (src.mind.name in SStranscore.backed_up)) var/datum/transhuman/mind_record/record = SStranscore.backed_up[src.mind.name] if(!(record.dead_state == MR_DEAD)) to_chat(src, "Your backup is not past-due yet.") From 27b94511817bc52b2cb49b76c1c5a9a25055304a Mon Sep 17 00:00:00 2001 From: Aronai Sieyes Date: Thu, 27 May 2021 12:10:22 -0400 Subject: [PATCH 12/13] VS: Kwargs fixes --- code/modules/mining/shelter_atoms_vr.dm | 2 +- .../human/species/station/protean_vr/protean_blob.dm | 4 ++-- code/modules/mob/living/silicon/robot/robot_damage.dm | 4 ++-- code/modules/mob/living/simple_mob/simple_mob_vr.dm | 2 +- .../living/simple_mob/subtypes/animal/passive/possum.dm | 8 ++++---- code/modules/multiz/movement_vr.dm | 2 +- code/modules/nifsoft/nif_tgui.dm | 8 +++++--- code/modules/nifsoft/software/05_health.dm | 8 ++++---- code/modules/nifsoft/software/06_screens.dm | 4 ++-- code/modules/nifsoft/software/13_soulcatcher.dm | 6 +++--- code/modules/nifsoft/software/15_misc.dm | 6 +++--- code/modules/resleeving/infomorph.dm | 4 ++-- code/modules/tables/presets_vr.dm | 4 ++-- code/modules/tgui/external.dm | 2 +- 14 files changed, 33 insertions(+), 31 deletions(-) diff --git a/code/modules/mining/shelter_atoms_vr.dm b/code/modules/mining/shelter_atoms_vr.dm index 1c0fc5010e..09bd7911c8 100644 --- a/code/modules/mining/shelter_atoms_vr.dm +++ b/code/modules/mining/shelter_atoms_vr.dm @@ -207,7 +207,7 @@ GLOBAL_LIST_EMPTY(unique_deployable) verbs -= /obj/structure/table/proc/do_put ..() -/obj/structure/table/survival_pod/dismantle(obj/item/weapon/wrench/W, mob/user) +/obj/structure/table/survival_pod/dismantle(obj/item/weapon/tool/wrench/W, mob/user) to_chat(user, "You cannot dismantle \the [src].") return diff --git a/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_blob.dm b/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_blob.dm index 83321e4049..4ad7416f1a 100644 --- a/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_blob.dm +++ b/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_blob.dm @@ -162,14 +162,14 @@ else return ..() -/mob/living/simple_mob/protean_blob/adjustBruteLoss(var/amount) +/mob/living/simple_mob/protean_blob/adjustBruteLoss(var/amount,var/include_robo) amount *= 1.5 if(humanform) return humanform.adjustBruteLoss(amount) else return ..() -/mob/living/simple_mob/protean_blob/adjustFireLoss(var/amount) +/mob/living/simple_mob/protean_blob/adjustFireLoss(var/amount,var/include_robo) amount *= 1.5 if(humanform) return humanform.adjustFireLoss(amount) diff --git a/code/modules/mob/living/silicon/robot/robot_damage.dm b/code/modules/mob/living/silicon/robot/robot_damage.dm index 67ab5dd3c4..3c7999be3c 100644 --- a/code/modules/mob/living/silicon/robot/robot_damage.dm +++ b/code/modules/mob/living/silicon/robot/robot_damage.dm @@ -20,13 +20,13 @@ if(C.installed != 0) amount += C.electronics_damage return amount -/mob/living/silicon/robot/adjustBruteLoss(var/amount) +/mob/living/silicon/robot/adjustBruteLoss(var/amount,var/include_robo) if(amount > 0) take_overall_damage(amount, 0) else heal_overall_damage(-amount, 0) -/mob/living/silicon/robot/adjustFireLoss(var/amount) +/mob/living/silicon/robot/adjustFireLoss(var/amount,var/include_robo) if(amount > 0) take_overall_damage(0, amount) else diff --git a/code/modules/mob/living/simple_mob/simple_mob_vr.dm b/code/modules/mob/living/simple_mob/simple_mob_vr.dm index f18a745486..7808dea7bf 100644 --- a/code/modules/mob/living/simple_mob/simple_mob_vr.dm +++ b/code/modules/mob/living/simple_mob/simple_mob_vr.dm @@ -266,7 +266,7 @@ return FALSE // Checks to see if mob doesn't like this kind of turf -/mob/living/simple_mob/IMove(newloc) +/mob/living/simple_mob/IMove(turf/newloc, safety = TRUE) if(istype(newloc,/turf/unsimulated/floor/sky)) return MOVEMENT_FAILED //Mobs aren't that stupid, probably return ..() // Procede as normal. diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/passive/possum.dm b/code/modules/mob/living/simple_mob/subtypes/animal/passive/possum.dm index 80ccfff874..69f0c90d45 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/passive/possum.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/passive/possum.dm @@ -139,14 +139,14 @@ say_list_type = /datum/say_list/possum catalogue_data = list(/datum/category_item/catalogue/fauna/opossum) -/mob/living/simple_mob/animal/passive/opossum/adjustBruteLoss(damage) +/mob/living/simple_mob/animal/passive/opossum/adjustBruteLoss(var/amount,var/include_robo) . = ..() - if(damage >= 3) + if(amount >= 3) respond_to_damage() -/mob/living/simple_mob/animal/passive/opossum/adjustFireLoss(damage) +/mob/living/simple_mob/animal/passive/opossum/adjustFireLoss(var/amount,var/include_robo) . = ..() - if(damage >= 3) + if(amount >= 3) respond_to_damage() /mob/living/simple_mob/animal/passive/opossum/lay_down() diff --git a/code/modules/multiz/movement_vr.dm b/code/modules/multiz/movement_vr.dm index cba6ebb6c5..963215d389 100644 --- a/code/modules/multiz/movement_vr.dm +++ b/code/modules/multiz/movement_vr.dm @@ -39,7 +39,7 @@ else if(prey.can_be_drop_pred && pred.can_be_drop_prey) //Is person being fallen onto pred & person falling prey pred.feed_grabbed_to_self_falling_nom(prey,pred) //oh, how the tables have turned. */ -/mob/zshadow/fall_impact(var/atom/hit_atom) //You actually "fall" onto their shadow, first. +/mob/zshadow/fall_impact(var/atom/hit_atom, var/damage_min = 0, var/damage_max = 10, var/silent = FALSE, var/planetary = FALSE) //You actually "fall" onto their shadow, first. /* var/floor_below = src.loc.below //holy fuck for(var/mob/M in floor_below.contents) diff --git a/code/modules/nifsoft/nif_tgui.dm b/code/modules/nifsoft/nif_tgui.dm index 2d53ad979c..b5978242c4 100644 --- a/code/modules/nifsoft/nif_tgui.dm +++ b/code/modules/nifsoft/nif_tgui.dm @@ -60,7 +60,7 @@ user.verbs |= /mob/living/carbon/human/proc/nif_menu -/datum/component/nif_menu/proc/nif_menu_click(atom/movable/screen/nif/image, location, control, params, user) +/datum/component/nif_menu/proc/nif_menu_click(obj/screen/nif/image, location, control, params, user) var/mob/living/carbon/human/H = user if(istype(H) && H.nif) INVOKE_ASYNC(H.nif, .proc/tgui_interact, user) @@ -118,13 +118,14 @@ data["nif_percent"] = round((durability/initial(durability))*100) data["nif_stat"] = stat - data["modules"] = list() + + var/list/modules = list() if(stat == NIF_WORKING) for(var/nifsoft in nifsofts) if(!nifsoft) continue var/datum/nifsoft/NS = nifsoft - data["modules"].Add(list(list( + modules.Add(list(list( "name" = NS.name, "desc" = NS.desc, "p_drain" = NS.p_drain, @@ -137,6 +138,7 @@ "stat_text" = NS.stat_text(), "ref" = REF(NS), ))) + data["modules"] = modules return data diff --git a/code/modules/nifsoft/software/05_health.dm b/code/modules/nifsoft/software/05_health.dm index dfab36df3e..f19a652748 100644 --- a/code/modules/nifsoft/software/05_health.dm +++ b/code/modules/nifsoft/software/05_health.dm @@ -17,7 +17,7 @@ if((. = ..())) mode = 1 -/datum/nifsoft/medichines_org/deactivate() +/datum/nifsoft/medichines_org/deactivate(var/force = FALSE) if((. = ..())) a_drain = initial(a_drain) mode = initial(mode) @@ -90,7 +90,7 @@ if((. = ..())) mode = 1 -/datum/nifsoft/medichines_syn/deactivate() +/datum/nifsoft/medichines_syn/deactivate(var/force = FALSE) if((. = ..())) mode = 0 @@ -144,7 +144,7 @@ if((. = ..())) nif.notify("Now taking air from reserves.") -/datum/nifsoft/spare_breath/deactivate() +/datum/nifsoft/spare_breath/deactivate(var/force = FALSE) if((. = ..())) nif.notify("Now taking air from environment and refilling reserves.") @@ -195,7 +195,7 @@ deactivate() return TRUE -/datum/nifsoft/mindbackup/deactivate() +/datum/nifsoft/mindbackup/deactivate(var/force = FALSE) if((. = ..())) return TRUE diff --git a/code/modules/nifsoft/software/06_screens.dm b/code/modules/nifsoft/software/06_screens.dm index 253ed17c8d..3d20514074 100644 --- a/code/modules/nifsoft/software/06_screens.dm +++ b/code/modules/nifsoft/software/06_screens.dm @@ -20,7 +20,7 @@ arscreen.tgui_interact(nif.human) return TRUE -/datum/nifsoft/crewmonitor/deactivate() +/datum/nifsoft/crewmonitor/deactivate(var/force = FALSE) if((. = ..())) return TRUE @@ -49,7 +49,7 @@ tgarscreen.tgui_interact(nif.human) return TRUE -/datum/nifsoft/alarmmonitor/deactivate() +/datum/nifsoft/alarmmonitor/deactivate(var/force = FALSE) if((. = ..())) return TRUE diff --git a/code/modules/nifsoft/software/13_soulcatcher.dm b/code/modules/nifsoft/software/13_soulcatcher.dm index 9912556fdc..717474abc9 100644 --- a/code/modules/nifsoft/software/13_soulcatcher.dm +++ b/code/modules/nifsoft/software/13_soulcatcher.dm @@ -35,7 +35,7 @@ spawn(0) deactivate() -/datum/nifsoft/soulcatcher/deactivate() +/datum/nifsoft/soulcatcher/deactivate(var/force = FALSE) if((. = ..())) return TRUE @@ -336,7 +336,7 @@ return FALSE ..() -/mob/living/carbon/brain/caught_soul/show_message() +/mob/living/carbon/brain/caught_soul/show_message(msg, type, alt, alt_type) if(ext_blind || !client) return FALSE ..() @@ -363,7 +363,7 @@ else return ..(direction) -/mob/living/carbon/brain/caught_soul/say(var/message) +/mob/living/carbon/brain/caught_soul/say(var/message, var/datum/language/speaking = null, var/whispering = 0) if(silent) return FALSE soulcatcher.say_into(message,src,eyeobj) diff --git a/code/modules/nifsoft/software/15_misc.dm b/code/modules/nifsoft/software/15_misc.dm index 79592fa030..b4a4e40933 100644 --- a/code/modules/nifsoft/software/15_misc.dm +++ b/code/modules/nifsoft/software/15_misc.dm @@ -23,7 +23,7 @@ H.visible_message("Thin snakelike tendrils grow from [H] and connect to \the [apc].","Thin snakelike tendrils grow from you and connect to \the [apc].") -/datum/nifsoft/apc_recharge/deactivate() +/datum/nifsoft/apc_recharge/deactivate(var/force = FALSE) if((. = ..())) apc = null @@ -140,7 +140,7 @@ spawn(0) deactivate() -/datum/nifsoft/sizechange/deactivate() +/datum/nifsoft/sizechange/deactivate(var/force = FALSE) if((. = ..())) return TRUE @@ -164,7 +164,7 @@ H.display_alt_appearance("animals", justme) alt_farmanimals += nif.human -/datum/nifsoft/worldbend/deactivate() +/datum/nifsoft/worldbend/deactivate(var/force = FALSE) if((. = ..())) var/list/justme = list(nif.human) for(var/human in human_mob_list) diff --git a/code/modules/resleeving/infomorph.dm b/code/modules/resleeving/infomorph.dm index fed79fe078..77eae4e51d 100644 --- a/code/modules/resleeving/infomorph.dm +++ b/code/modules/resleeving/infomorph.dm @@ -424,11 +424,11 @@ var/list/infomorph_emotions = list( else to_chat(src, "You don't have a radio!") -/mob/living/silicon/infomorph/say(var/msg) +/mob/living/silicon/infomorph/say(var/message, var/datum/language/speaking = null, var/whispering = 0) if(silence_time) to_chat(src, "Communication circuits remain uninitialized.") else - ..(msg) + ..(message) /mob/living/silicon/infomorph/handle_message_mode(message_mode, message, verb, speaking, used_radios, alt_name) switch(message_mode) diff --git a/code/modules/tables/presets_vr.dm b/code/modules/tables/presets_vr.dm index 37ddf0c933..35fc8f8bd7 100644 --- a/code/modules/tables/presets_vr.dm +++ b/code/modules/tables/presets_vr.dm @@ -14,7 +14,7 @@ ..() -/obj/structure/table/darkglass/dismantle(obj/item/weapon/wrench/W, mob/user) +/obj/structure/table/darkglass/dismantle(obj/item/weapon/tool/wrench/W, mob/user) to_chat(user, "You cannot dismantle \the [src].") return /obj/structure/table/alien/blue @@ -37,7 +37,7 @@ ..() -/obj/structure/table/fancyblack/dismantle(obj/item/weapon/wrench/W, mob/user) +/obj/structure/table/fancyblack/dismantle(obj/item/weapon/tool/wrench/W, mob/user) to_chat(user, "You cannot dismantle \the [src].") return diff --git a/code/modules/tgui/external.dm b/code/modules/tgui/external.dm index bb39c721d0..6f9a3fc8e3 100644 --- a/code/modules/tgui/external.dm +++ b/code/modules/tgui/external.dm @@ -15,7 +15,7 @@ * optional parent_ui datum/tgui A parent UI that, when closed, closes this UI as well. */ -/datum/proc/tgui_interact(mob/user, datum/tgui/ui = null, datum/tgui/parent_ui = null) +/datum/proc/tgui_interact(mob/user, datum/tgui/ui = null, datum/tgui/parent_ui = null, custom_state = null) return FALSE // Not implemented. /** From 28a6962d514aaae71a27409a608f19c10dab36a0 Mon Sep 17 00:00:00 2001 From: Aronai Sieyes Date: Thu, 27 May 2021 12:10:30 -0400 Subject: [PATCH 13/13] VS: One more disambig --- code/modules/rogueminer_vr/controller.dm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/modules/rogueminer_vr/controller.dm b/code/modules/rogueminer_vr/controller.dm index 8f7d883992..4c6c710120 100644 --- a/code/modules/rogueminer_vr/controller.dm +++ b/code/modules/rogueminer_vr/controller.dm @@ -143,7 +143,7 @@ var/datum/controller/rogue/rm_controller return oldest_zone /datum/controller/rogue/proc/mark_clean(var/datum/rogue/zonemaster/ZM) - if(!ZM in all_zones) //What? Who? + if(!(ZM in all_zones)) //What? Who? rm_controller.dbg("RMC(mc): Some unknown zone asked to be listed.") if(ZM in ready_zones) @@ -152,7 +152,7 @@ var/datum/controller/rogue/rm_controller clean_zones += ZM /datum/controller/rogue/proc/mark_ready(var/datum/rogue/zonemaster/ZM) - if(!ZM in all_zones) //What? Who? + if(!(ZM in all_zones)) //What? Who? rm_controller.dbg("RMC(mr): Some unknown zone asked to be listed.") if(ZM in clean_zones) @@ -161,19 +161,19 @@ var/datum/controller/rogue/rm_controller ready_zones += ZM /datum/controller/rogue/proc/unmark_clean(var/datum/rogue/zonemaster/ZM) - if(!ZM in all_zones) //What? Who? + if(!(ZM in all_zones)) //What? Who? rm_controller.dbg("RMC(umc): Some unknown zone asked to be listed.") - if(!ZM in clean_zones) + if(!(ZM in clean_zones)) rm_controller.dbg("RMC(umc): Finite state machine broken.") clean_zones -= ZM /datum/controller/rogue/proc/unmark_ready(var/datum/rogue/zonemaster/ZM) - if(!ZM in all_zones) //What? Who? + if(!(ZM in all_zones)) //What? Who? rm_controller.dbg("RMC(umr): Some unknown zone asked to be listed.") - if(!ZM in ready_zones) + if(!(ZM in ready_zones)) rm_controller.dbg("RMC(umr): Finite state machine broken.") ready_zones -= ZM