From e2a72e7ee60a3ab136d7b78f6f87be3b3ed84d93 Mon Sep 17 00:00:00 2001 From: martinlyra Date: Sun, 22 Oct 2023 22:38:06 +0200 Subject: [PATCH] OpenDream compatibility (#251) * Unshadow builtin name `src` * Remove unused changeling garbage * Vampires aren't real * Remove unused variable * `/var/var` -> `/var` * Xenoarcheology ain't real either * PAIs don't have records like this anymore * More unused shit * Do not treat verbs as objects --- code/_helpers/unsorted.dm | 6 +- code/_onclick/hud/ability_screen_objects.dm | 26 --- code/datums/mind.dm | 2 - .../tree_interdiction.dm | 8 +- .../tree_manipulation.dm | 10 +- .../newmalf_ability_trees/tree_networking.dm | 10 +- .../newmalf_ability_trees/tree_passive.dm | 4 +- .../mecha/equipment/tools/unused_tools.dm | 155 ------------------ code/modules/detectivework/forensics.dm | 6 +- code/modules/materials/materials_ore.dm | 1 - code/modules/mob/living/silicon/ai/malf.dm | 8 +- code/modules/mob/living/silicon/pai/pai.dm | 8 - code/modules/mob/mob_defines.dm | 1 - code/modules/organs/blood.dm | 2 +- code/modules/paperwork/pen.dm | 11 -- code/modules/power/generator.dm | 2 - .../urist/modules/newtrading/NPC/npc.dm | 2 - .../urist/modules/newtrading/NPC/npc_new.dm | 2 - 18 files changed, 27 insertions(+), 237 deletions(-) delete mode 100644 code/game/mecha/equipment/tools/unused_tools.dm diff --git a/code/_helpers/unsorted.dm b/code/_helpers/unsorted.dm index dc6504aa758..798a1efa8be 100644 --- a/code/_helpers/unsorted.dm +++ b/code/_helpers/unsorted.dm @@ -1054,13 +1054,13 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new) // get coordinates to an atom -/proc/coordinates(atom/src, jump_link = 0) - return src ? src.coordinates(jump_link) : "nullspace" - /atom/proc/coordinates(jump_link = 0) var/turf/T = src.loc return T ? "([T.x],[T.y],[T.z])[jump_link ? admin_jump_link(T) : ""]" : "nullspace" +/proc/coordinates(atom/source, jump_link = 0) + return source ? source.coordinates(jump_link) : "nullspace" + // get memory reference /proc/REF(input) return "\ref[input]" diff --git a/code/_onclick/hud/ability_screen_objects.dm b/code/_onclick/hud/ability_screen_objects.dm index b3c0fc015f4..1f9c0b319cd 100644 --- a/code/_onclick/hud/ability_screen_objects.dm +++ b/code/_onclick/hud/ability_screen_objects.dm @@ -247,35 +247,9 @@ if(my_mob.client) toggle_open(2) //forces the icons to refresh on screen -//Changeling Abilities -/atom/movable/screen/ability/verb_based/changeling - icon_state = "ling_spell_base" - background_base_state = "ling" - -/atom/movable/screen/movable/ability_master/proc/add_ling_ability(object_given, verb_given, name_given, ability_icon_given, arguments) - if(!object_given) - message_admins("ERROR: add_ling_ability() was not given an object in its arguments.") - if(!verb_given) - message_admins("ERROR: add_ling_ability() was not given a verb/proc in its arguments.") - if(get_ability_by_proc_ref(verb_given)) - return // Duplicate - var/atom/movable/screen/ability/verb_based/changeling/A = new /atom/movable/screen/ability/verb_based/changeling() - A.ability_master = src - A.object_used = object_given - A.verb_to_call = verb_given - A.ability_icon_state = ability_icon_given - A.SetName(name_given) - if(arguments) - A.arguments_to_use = arguments - ability_objects.Add(A) - if(my_mob.client) - toggle_open(2) //forces the icons to refresh on screen - - /////////Obj Abilities//////// //Buttons to trigger objects// ////////////////////////////// - /atom/movable/screen/ability/obj_based var/obj/object = null diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 847d2db33ce..8a31d8bcddc 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -53,8 +53,6 @@ var/has_been_rev = 0//Tracks if this mind has been a rev or not var/faction //associated faction - var/datum/changeling/changeling //changeling holder - var/datum/vampire/vampire //vamp holder; really have to clean this up someday. var/rev_cooldown = 0 diff --git a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_interdiction.dm b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_interdiction.dm index 07b1a0bbf3b..2f181d53617 100644 --- a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_interdiction.dm +++ b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_interdiction.dm @@ -10,28 +10,28 @@ // BEGIN RESEARCH DATUMS /datum/malf_research_ability/interdiction/recall_shuttle - ability = new/datum/game_mode/malfunction/verb/recall_shuttle() + ability = /datum/game_mode/malfunction/verb/recall_shuttle price = 250 next = new/datum/malf_research_ability/interdiction/unlock_cyborg() name = "T1 - Recall Shuttle" /datum/malf_research_ability/interdiction/unlock_cyborg - ability = new/datum/game_mode/malfunction/verb/unlock_cyborg() + ability = /datum/game_mode/malfunction/verb/unlock_cyborg price = 1000 next = new/datum/malf_research_ability/interdiction/hack_cyborg() name = "T2 - Unlock Cyborg" /datum/malf_research_ability/interdiction/hack_cyborg - ability = new/datum/game_mode/malfunction/verb/hack_cyborg() + ability = /datum/game_mode/malfunction/verb/hack_cyborg price = 2000 next = new/datum/malf_research_ability/interdiction/hack_ai() name = "T3 - Hack Cyborg" /datum/malf_research_ability/interdiction/hack_ai - ability = new/datum/game_mode/malfunction/verb/hack_ai() + ability = /datum/game_mode/malfunction/verb/hack_ai price = 4000 name = "T4 - Hack AI" diff --git a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_manipulation.dm b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_manipulation.dm index 2e41f1112f9..a2c8edc5b73 100644 --- a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_manipulation.dm +++ b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_manipulation.dm @@ -11,34 +11,34 @@ // BEGIN RESEARCH DATUMS /datum/malf_research_ability/manipulation/electrical_pulse - ability = new/datum/game_mode/malfunction/verb/electrical_pulse() + ability = /datum/game_mode/malfunction/verb/electrical_pulse price = 250 next = new/datum/malf_research_ability/manipulation/reboot_camera() name = "T1 - Electrical Pulse" /datum/malf_research_ability/manipulation/reboot_camera - ability = new/datum/game_mode/malfunction/verb/reboot_camera() + ability = /datum/game_mode/malfunction/verb/reboot_camera price = 1000 next = new/datum/malf_research_ability/manipulation/emergency_forcefield() name = "T2 - Reboot Camera" /datum/malf_research_ability/manipulation/emergency_forcefield - ability = new/datum/game_mode/malfunction/verb/emergency_forcefield() + ability = /datum/game_mode/malfunction/verb/emergency_forcefield price = 2000 next = new/datum/malf_research_ability/manipulation/machine_overload() name = "T3 - Emergency Forcefield" /datum/malf_research_ability/manipulation/machine_overload - ability = new/datum/game_mode/malfunction/verb/machine_overload() + ability = /datum/game_mode/malfunction/verb/machine_overload price = 4000 next = new/datum/malf_research_ability/manipulation/machine_upgrade() name = "T4 - Machine Overload" /datum/malf_research_ability/manipulation/machine_upgrade - ability = new/datum/game_mode/malfunction/verb/machine_upgrade() + ability = /datum/game_mode/malfunction/verb/machine_upgrade price = 4000 name = "T5 - Machine Upgrade" 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 494121c26b6..a9d47066dd8 100644 --- a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm +++ b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm @@ -10,28 +10,28 @@ // BEGIN RESEARCH DATUMS /datum/malf_research_ability/networking/basic_hack - ability = new/datum/game_mode/malfunction/verb/basic_encryption_hack() + ability = /datum/game_mode/malfunction/verb/basic_encryption_hack price = 25 // Until you have this ability your CPU generation sucks, therefore it's very cheap. next = new/datum/malf_research_ability/networking/advanced_hack() name = "T1 - Basic Encryption Hack" /datum/malf_research_ability/networking/advanced_hack - ability = new/datum/game_mode/malfunction/verb/advanced_encryption_hack() + ability = /datum/game_mode/malfunction/verb/advanced_encryption_hack price = 1000 next = new/datum/malf_research_ability/networking/elite_hack() name = "T2 - Advanced Encryption Hack" /datum/malf_research_ability/networking/elite_hack - ability = new/datum/game_mode/malfunction/verb/elite_encryption_hack() + ability = /datum/game_mode/malfunction/verb/elite_encryption_hack price = 2000 next = new/datum/malf_research_ability/networking/system_override() name = "T3 - Elite Encryption Hack" /datum/malf_research_ability/networking/system_override - ability = new/datum/game_mode/malfunction/verb/system_override() + ability = /datum/game_mode/malfunction/verb/system_override price = 4000 name = "T4 - System Override" @@ -216,4 +216,4 @@ command_announcement.Announce("Our system administrators just reported that we've been locked out from your control network. Whoever did this now has full access to [GLOB.using_map.station_name]'s systems.", "Network Administration Center") user.hack_can_fail = 0 user.system_override = 2 - user.verbs += new/datum/game_mode/malfunction/verb/ai_destroy_station() + user.verbs += /datum/game_mode/malfunction/verb/ai_destroy_station diff --git a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_passive.dm b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_passive.dm index 32c99c72940..49e9c33dfe2 100644 --- a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_passive.dm +++ b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_passive.dm @@ -10,14 +10,14 @@ // BEGIN RESEARCH DATUMS /datum/malf_research_ability/passive/intellicard_interception - ability = new/datum/game_mode/malfunction/verb/intellicard_interception() + ability = /datum/game_mode/malfunction/verb/intellicard_interception price = 250 next = new/datum/malf_research_ability/passive/subtle_algorithms() name = "T1 - Intellicard Interception" /datum/malf_research_ability/passive/subtle_algorithms - ability = new/datum/game_mode/malfunction/verb/subtle_algorithms() + ability = /datum/game_mode/malfunction/verb/subtle_algorithms price = 1000 next = new/datum/malf_research_ability/passive/relay_suppression() name = "T2 - Subtle Algorithms" diff --git a/code/game/mecha/equipment/tools/unused_tools.dm b/code/game/mecha/equipment/tools/unused_tools.dm deleted file mode 100644 index acd3fecde7e..00000000000 --- a/code/game/mecha/equipment/tools/unused_tools.dm +++ /dev/null @@ -1,155 +0,0 @@ - - - -/****** Do not tick this file in without looking over this code first ******/ - - - - - -//NEEDS SPRITE! (When this gets ticked in search for 'TODO MECHA JETPACK SPRITE MISSING' through code to uncomment the place where it's missing.) -/obj/item/mecha_parts/mecha_equipment/jetpack - name = "jetpack" - desc = "Using directed ion bursts and cunning solar wind reflection technique, this device enables controlled space flight." - icon_state = "mecha_equip" - equip_cooldown = 5 - energy_drain = 50 - var/wait = 0 - var/datum/effect/effect/system/ion_trail_follow/ion_trail - - - can_attach(obj/mecha/M as obj) - if(!(locate(src.type) in M.equipment) && !M.proc_res["dyndomove"]) - return ..() - - detach() - ..() - chassis.proc_res["dyndomove"] = null - return - - attach(obj/mecha/M as obj) - ..() - if(!ion_trail) - ion_trail = new - ion_trail.set_up(chassis) - return - - proc/toggle() - if(!chassis) - return - !equip_ready? turn_off() : turn_on() - return equip_ready - - proc/turn_on() - set_ready_state(0) - chassis.proc_res["dyndomove"] = src - ion_trail.start() - occupant_message("Activated") - log_message("Activated") - - proc/turn_off() - set_ready_state(1) - chassis.proc_res["dyndomove"] = null - ion_trail.stop() - occupant_message("Deactivated") - log_message("Deactivated") - - proc/dyndomove(direction) - if(!action_checks()) - return chassis.dyndomove(direction) - var/move_result = 0 - if(chassis.hasInternalDamage(MECHA_INT_CONTROL_LOST)) - move_result = step_rand(chassis) - else if(chassis.dir!=direction) - chassis.set_dir(direction) - move_result = 1 - else - move_result = step(chassis,direction) - if(chassis.occupant) - for(var/obj/effect/speech_bubble/B in range(1, chassis)) - if(B.parent == chassis.occupant) - B.loc = chassis.loc - if(move_result) - wait = 1 - chassis.use_power(energy_drain) - if(!chassis.pr_inertial_movement.active()) - chassis.pr_inertial_movement.start(list(chassis,direction)) - else - chassis.pr_inertial_movement.set_process_args(list(chassis,direction)) - do_after_cooldown() - return 1 - return 0 - - action_checks() - if(equip_ready || wait) - return 0 - if(energy_drain && !chassis.has_charge(energy_drain)) - return 0 - if(chassis.check_for_support()) - return 0 - return 1 - - get_equip_info() - if(!chassis) return - return "* [src.name] \[Toggle\]" - - - Topic(href,href_list) - ..() - if(href_list["toggle"]) - toggle() - - do_after_cooldown() - sleep(equip_cooldown) - wait = 0 - return 1 - - -/obj/item/mecha_parts/mecha_equipment/defence_shocker - name = "exosuit defence shocker" - desc = "" - icon_state = "mecha_teleport" - equip_cooldown = 10 - energy_drain = 100 - range = RANGED - var/shock_damage = 15 - var/active - - can_attach(obj/mecha/M as obj) - if(..()) - if(!istype(M, /obj/mecha/combat/honker)) - if(!M.proc_res["dynattackby"] && !M.proc_res["dynattackhand"] && !M.proc_res["dynattackalien"]) - return 1 - return 0 - - attach(obj/mecha/M as obj) - ..() - chassis.proc_res["dynattackby"] = src - return - - proc/dynattackby(obj/item/weapon/W as obj, mob/user as mob) - if(!action_checks(user) || !active) - return - user.electrocute_act(shock_damage, src) - return chassis.dynattackby(W,user) - - -/* -/obj/item/mecha_parts/mecha_equipment/book_stocker - - action(var/mob/target) - if(!istype(target)) - return - if(target.search_contents_for(/obj/item/book/WGW)) - target.gib() - target.client.gib() - target.client.mom.monkeyize() - target.client.mom.gib() - for(var/mob/M in range(target, 1000)) - M.gib() - explosion(target.loc,100000,100000,100000) - usr.gib() - world.Reboot() - return 1 - -*/ diff --git a/code/modules/detectivework/forensics.dm b/code/modules/detectivework/forensics.dm index 5660f50f582..742b117d932 100644 --- a/code/modules/detectivework/forensics.dm +++ b/code/modules/detectivework/forensics.dm @@ -9,9 +9,9 @@ var/const/FINGERPRINT_COMPLETE = 6 return stringpercent(print) <= FINGERPRINT_COMPLETE /atom/var/list/suit_fibers -/atom/var/var/list/fingerprints -/atom/var/var/list/fingerprintshidden -/atom/var/var/fingerprintslast +/atom/var/list/fingerprints +/atom/var/list/fingerprintshidden +/atom/var/fingerprintslast /obj/item/var/list/trace_DNA /mob/living/carbon/human/var/gunshot_residue /obj/item/clothing/var/gunshot_residue diff --git a/code/modules/materials/materials_ore.dm b/code/modules/materials/materials_ore.dm index 0627485890b..be4e97e7581 100644 --- a/code/modules/materials/materials_ore.dm +++ b/code/modules/materials/materials_ore.dm @@ -5,7 +5,6 @@ randpixel = 8 w_class = 2 var/material/material - var/datum/geosample/geologic_data /obj/item/weapon/ore/get_material() return material diff --git a/code/modules/mob/living/silicon/ai/malf.dm b/code/modules/mob/living/silicon/ai/malf.dm index ca3f95977dc..8c49f06c6ba 100644 --- a/code/modules/mob/living/silicon/ai/malf.dm +++ b/code/modules/mob/living/silicon/ai/malf.dm @@ -10,9 +10,9 @@ hacked_apcs = list() recalc_cpu() - verbs += new/datum/game_mode/malfunction/verb/ai_select_hardware() - verbs += new/datum/game_mode/malfunction/verb/ai_select_research() - verbs += new/datum/game_mode/malfunction/verb/ai_help() + verbs += /datum/game_mode/malfunction/verb/ai_select_hardware + verbs += /datum/game_mode/malfunction/verb/ai_select_research + verbs += /datum/game_mode/malfunction/verb/ai_help log_ability_use(src, "became malfunctioning AI") // And greet user with some OOC info. @@ -137,4 +137,4 @@ if(system_override == 1) stat("SYSTEM OVERRIDE INITIATED") else if(system_override == 2) - stat("SYSTEM OVERRIDE COMPLETED") \ No newline at end of file + stat("SYSTEM OVERRIDE COMPLETED") diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 1037672014f..b44b8a9d879 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -62,14 +62,6 @@ var/secHUD = 0 // Toggles whether the Security HUD is active or not var/medHUD = 0 // Toggles whether the Medical HUD is active or not - var/medical_cannotfind = 0 - var/datum/data/record/medicalActive1 // Datacore record declarations for record software - var/datum/data/record/medicalActive2 - - var/security_cannotfind = 0 - var/datum/data/record/securityActive1 // Could probably just combine all these into one - var/datum/data/record/securityActive2 - var/obj/machinery/door/hackdoor // The airlock being hacked var/hackprogress = 0 // Possible values: 0 - 1000, >= 1000 means the hack is complete and will be reset upon next check var/hack_aborted = 0 diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 9d41da0d4d2..808099c37fe 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -53,7 +53,6 @@ var/atom/movable/screen/gun/item/item_use_icon = null var/atom/movable/screen/gun/radio/radio_use_icon = null var/atom/movable/screen/gun/move/gun_move_icon = null - var/atom/movable/screen/gun/run/gun_run_icon = null var/atom/movable/screen/gun/mode/gun_setting_icon = null var/atom/movable/screen/movable/ability_master/ability_master = null diff --git a/code/modules/organs/blood.dm b/code/modules/organs/blood.dm index 5e3f66ae39a..2d0365b7fd4 100644 --- a/code/modules/organs/blood.dm +++ b/code/modules/organs/blood.dm @@ -3,7 +3,7 @@ ****************************************************/ /mob/living/carbon/human/var/datum/reagents/vessel // Container for blood and BLOOD ONLY. Do not transfer other chems here. -/mob/living/carbon/human/var/var/pale = 0 // Should affect how mob sprite is drawn, but currently doesn't. +/mob/living/carbon/human/var/pale = 0 // Should affect how mob sprite is drawn, but currently doesn't. //Initializes blood vessels /mob/living/carbon/human/proc/make_blood() diff --git a/code/modules/paperwork/pen.dm b/code/modules/paperwork/pen.dm index 668874248b9..0fc72b34ef4 100644 --- a/code/modules/paperwork/pen.dm +++ b/code/modules/paperwork/pen.dm @@ -132,17 +132,6 @@ var/signature = "" /obj/item/weapon/pen/chameleon/attack_self(mob/user as mob) - /* - // Limit signatures to official crew members - var/personnel_list[] = list() - for(var/datum/data/record/t in data_core.locked) //Look in data core locked. - personnel_list.Add(t.fields["name"]) - personnel_list.Add("Anonymous") - - var/new_signature = input("Enter new signature pattern.", "New Signature") as null|anything in personnel_list - if(new_signature) - signature = new_signature - */ signature = sanitize(input("Enter new signature. Leave blank for 'Anonymous'", "New Signature", signature)) /obj/item/weapon/pen/proc/get_signature(mob/user) diff --git a/code/modules/power/generator.dm b/code/modules/power/generator.dm index fb395012bbb..3b86af4f006 100644 --- a/code/modules/power/generator.dm +++ b/code/modules/power/generator.dm @@ -25,8 +25,6 @@ var/lastgenlev = 0 var/lubricated = 0 - var/datum/effect_system/sparks/spark_system - var/list/soundverb = list("shudders violently", "rumbles brutally", "vibrates disturbingly", "shakes with a deep rumble", "bangs and thumps") var/list/soundlist = list('resources/sound/ambience/ambigen9.ogg','resources/sound/effects/meteorimpact.ogg','resources/sound/effects/caution.ogg') diff --git a/code/modules/urist/modules/newtrading/NPC/npc.dm b/code/modules/urist/modules/newtrading/NPC/npc.dm index db9919ed2a6..efce927ea1e 100644 --- a/code/modules/urist/modules/newtrading/NPC/npc.dm +++ b/code/modules/urist/modules/newtrading/NPC/npc.dm @@ -79,8 +79,6 @@ var/say_time = 0 var/say_next = 0 - var/datum/controller/process/SStrade_controller/SStrade_controller_debug - var/sell_modifier = 0.90 //how much less than the sell price will the merchants buy items from you var/price_increase = 1.02 //how much does the price go up after they sell an item. a value of 1 means no increase. var/no_resell = 0 diff --git a/code/modules/urist/modules/newtrading/NPC/npc_new.dm b/code/modules/urist/modules/newtrading/NPC/npc_new.dm index 136a60dde51..b058e0d0cce 100644 --- a/code/modules/urist/modules/newtrading/NPC/npc_new.dm +++ b/code/modules/urist/modules/newtrading/NPC/npc_new.dm @@ -127,8 +127,6 @@ //update_interact_icon() - //SStrade_controller_debug = SStrade_controller - //this proc does not check the simple animal type! only use it on human type mobs /mob/living/simple_animal/hostile/npc/proc/sprite_set_human() src.icon = 'npc.dmi'