From b8e15e1dce583a32727cc6f13e63021f86e7cd4d Mon Sep 17 00:00:00 2001 From: moxian Date: Wed, 27 Jul 2022 14:07:49 +0000 Subject: [PATCH] Initialize bots (#18558) --- code/game/jobs/job/job.dm | 6 ------ .../mob/living/simple_animal/bot/bot.dm | 20 +++++-------------- .../mob/living/simple_animal/bot/cleanbot.dm | 4 ++-- .../mob/living/simple_animal/bot/ed209bot.dm | 4 ++-- .../mob/living/simple_animal/bot/floorbot.dm | 4 ++-- .../mob/living/simple_animal/bot/griefsky.dm | 11 +++++----- .../mob/living/simple_animal/bot/medbot.dm | 8 ++++---- .../mob/living/simple_animal/bot/mulebot.dm | 4 ++-- .../mob/living/simple_animal/bot/secbot.dm | 12 +++++------ .../mob/living/simple_animal/bot/syndicate.dm | 4 ++-- 10 files changed, 30 insertions(+), 47 deletions(-) diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm index 6291465094b..2d9d70faf3a 100644 --- a/code/game/jobs/job/job.dm +++ b/code/game/jobs/job/job.dm @@ -88,12 +88,6 @@ announce(H) /datum/job/proc/get_access() - if(!GLOB?.configuration?.jobs) //Needed for robots. - // AA TODO: Remove this once mulebots and stuff use Initialize() - // Update: Now that the map is loaded after SSjobs this might not be needed - // However, I dont want to take that chance - return src.minimal_access.Copy() - if(GLOB.configuration.jobs.jobs_have_minimal_access) return src.minimal_access.Copy() else diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index c5c09ca6bd6..084fc3e45b1 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -141,18 +141,8 @@ update_icon(UPDATE_ICON_STATE) update_controls() -/mob/living/simple_animal/bot/New() - /* - HEY! LISTEN! - - I see you're poking the the bot/New() proc - Assuming you are converting this to Initialize() [yay], please see my note in - code\game\jobs\job\job.dm | /datum/job/proc/get_access() - - Theres a useless check that bugs me but needs to exist because these things New() - -AA07 - */ - ..() +/mob/living/simple_animal/bot/Initialize(mapload) + . = ..() GLOB.bots_list += src icon_living = icon_state icon_dead = icon_state @@ -170,9 +160,9 @@ default_language = GLOB.all_languages["Galactic Common"] bot_core = new bot_core_type(src) - spawn(30) - if(SSradio && bot_filter) - SSradio.add_object(bot_core, control_freq, bot_filter) + + if(SSradio && bot_filter) + SSradio.add_object(bot_core, control_freq, bot_filter) prepare_huds() for(var/datum/atom_hud/data/diagnostic/diag_hud in GLOB.huds) diff --git a/code/modules/mob/living/simple_animal/bot/cleanbot.dm b/code/modules/mob/living/simple_animal/bot/cleanbot.dm index d32aba98e9d..52ce08554cc 100644 --- a/code/modules/mob/living/simple_animal/bot/cleanbot.dm +++ b/code/modules/mob/living/simple_animal/bot/cleanbot.dm @@ -31,8 +31,8 @@ var/next_dest var/next_dest_loc -/mob/living/simple_animal/bot/cleanbot/New() - ..() +/mob/living/simple_animal/bot/cleanbot/Initialize(mapload) + . = ..() get_targets() icon_state = "cleanbot[on]" diff --git a/code/modules/mob/living/simple_animal/bot/ed209bot.dm b/code/modules/mob/living/simple_animal/bot/ed209bot.dm index 3065ed5f44a..7c5185c3a3e 100644 --- a/code/modules/mob/living/simple_animal/bot/ed209bot.dm +++ b/code/modules/mob/living/simple_animal/bot/ed209bot.dm @@ -47,8 +47,8 @@ var/baton_delayed = FALSE -/mob/living/simple_animal/bot/ed209/New(loc, created_name, created_lasercolor) - ..() +/mob/living/simple_animal/bot/ed209/Initialize(mapload, created_name, created_lasercolor) + . = ..() if(created_name) name = created_name if(created_lasercolor) diff --git a/code/modules/mob/living/simple_animal/bot/floorbot.dm b/code/modules/mob/living/simple_animal/bot/floorbot.dm index 36174f02b72..c941e18e3a5 100644 --- a/code/modules/mob/living/simple_animal/bot/floorbot.dm +++ b/code/modules/mob/living/simple_animal/bot/floorbot.dm @@ -41,8 +41,8 @@ #define REPLACE_TILE 5 #define TILE_EMAG 6 -/mob/living/simple_animal/bot/floorbot/New(mapload, new_toolbox_color) - ..() +/mob/living/simple_animal/bot/floorbot/Initialize(mapload, new_toolbox_color) + . = ..() toolbox_color = new_toolbox_color update_icon() var/datum/job/engineer/J = new/datum/job/engineer diff --git a/code/modules/mob/living/simple_animal/bot/griefsky.dm b/code/modules/mob/living/simple_animal/bot/griefsky.dm index 4e16ed14594..db1ed4e3db1 100644 --- a/code/modules/mob/living/simple_animal/bot/griefsky.dm +++ b/code/modules/mob/living/simple_animal/bot/griefsky.dm @@ -55,13 +55,12 @@ visible_message("[src] flails his swords and pushes [C] out of it's way!" ) C.Weaken(4 SECONDS) -/mob/living/simple_animal/bot/secbot/griefsky/New() - ..() +/mob/living/simple_animal/bot/secbot/griefsky/Initialize(mapload) + . = ..() icon_state = "[base_icon][on]" - spawn(3) - var/datum/job/detective/J = new/datum/job/detective - access_card.access += J.get_access() - prev_access = access_card.access + var/datum/job/detective/J = new/datum/job/detective + access_card.access += J.get_access() + prev_access = access_card.access /mob/living/simple_animal/bot/secbot/griefsky/Destroy() QDEL_NULL(weapon) diff --git a/code/modules/mob/living/simple_animal/bot/medbot.dm b/code/modules/mob/living/simple_animal/bot/medbot.dm index d915ffcbe50..16bae48ce8c 100644 --- a/code/modules/mob/living/simple_animal/bot/medbot.dm +++ b/code/modules/mob/living/simple_animal/bot/medbot.dm @@ -92,8 +92,8 @@ radio_channel = "Syndicate" radio_config = list("Common" = 1, "Medical" = 1, "Syndicate" = 1) -/mob/living/simple_animal/bot/medbot/syndicate/New() - ..() +/mob/living/simple_animal/bot/medbot/syndicate/Initialize(mapload) + . = ..() Radio.syndiekey = new /obj/item/encryptionkey/syndicate /mob/living/simple_animal/bot/medbot/syndicate/emagged @@ -118,8 +118,8 @@ if(skin) . += "medskin_[skin]" -/mob/living/simple_animal/bot/medbot/New(loc, new_skin) - ..() +/mob/living/simple_animal/bot/medbot/Initialize(mapload, new_skin) + . = ..() var/datum/job/doctor/J = new /datum/job/doctor access_card.access += J.get_access() prev_access = access_card.access diff --git a/code/modules/mob/living/simple_animal/bot/mulebot.dm b/code/modules/mob/living/simple_animal/bot/mulebot.dm index 6a0f09230fd..e693f5f6306 100644 --- a/code/modules/mob/living/simple_animal/bot/mulebot.dm +++ b/code/modules/mob/living/simple_animal/bot/mulebot.dm @@ -53,8 +53,8 @@ /mob/living/simple_animal/bot/mulebot/get_cell() return cell -/mob/living/simple_animal/bot/mulebot/New() - ..() +/mob/living/simple_animal/bot/mulebot/Initialize(mapload) + . = ..() wires = new /datum/wires/mulebot(src) var/datum/job/cargo_tech/J = new/datum/job/cargo_tech access_card.access = J.get_access() diff --git a/code/modules/mob/living/simple_animal/bot/secbot.dm b/code/modules/mob/living/simple_animal/bot/secbot.dm index 4533596fc22..675aa80f79d 100644 --- a/code/modules/mob/living/simple_animal/bot/secbot.dm +++ b/code/modules/mob/living/simple_animal/bot/secbot.dm @@ -85,13 +85,13 @@ arrest_type = TRUE weaponscheck = TRUE -/mob/living/simple_animal/bot/secbot/New() - ..() +/mob/living/simple_animal/bot/secbot/Initialize(mapload) + . = ..() icon_state = "[base_icon][on]" - spawn(3) - var/datum/job/detective/J = new/datum/job/detective - access_card.access += J.get_access() - prev_access = access_card.access + + var/datum/job/detective/J = new/datum/job/detective + access_card.access += J.get_access() + prev_access = access_card.access //SECHUD var/datum/atom_hud/secsensor = GLOB.huds[DATA_HUD_SECURITY_ADVANCED] diff --git a/code/modules/mob/living/simple_animal/bot/syndicate.dm b/code/modules/mob/living/simple_animal/bot/syndicate.dm index 94855a636ce..bbe55ccdfa7 100644 --- a/code/modules/mob/living/simple_animal/bot/syndicate.dm +++ b/code/modules/mob/living/simple_animal/bot/syndicate.dm @@ -25,8 +25,8 @@ var/pathing_failed = FALSE var/turf/spawn_turf -/mob/living/simple_animal/bot/ed209/syndicate/New() - ..() +/mob/living/simple_animal/bot/ed209/syndicate/Initialize(mapload) + . = ..() set_weapon() update_icon() spawn_turf = get_turf(src)