From ba135eed28da77ed6f4b57ae1153979fac1973f7 Mon Sep 17 00:00:00 2001 From: Shaps <3589655+Shapsy@users.noreply.github.com> Date: Fri, 15 Nov 2019 00:56:13 -0500 Subject: [PATCH] Lets you tape knives to cleanbots. You know, if you really want to. (#47590) This PR lets you tape knives to cleanbots. Anyone who steps on the armed cleanbot will get stabbed in the ankle and fall over for a moment. If the person who got stabbed was someone with a title, the cleanbot will steal their title if they aren't already the victim's superior. There are six "career tracks" for cleanbots, the first three grant prefixes, the last three grant suffixes Command: HoP -> Captain -> Spec Ops Officer -> Admiral Security: Officer -> Detective -> Warden -> HoS Engineering: Atmos -> Engineer -> CE Medical: MD -> CMO Research: RD/Scientist (same thing) Legal: Lawyer The cleanbot in the above picture has stabbed the Captain, HoS, CE, an MD, the RD, and a lawyer. Busy little fella aren't they? TODO: Make it so they don't show an attack message on top of the stab message (also make them actually target the legs) Why It's Good For The Game space roombas cleanbots with knives stuck to them are funny and sound like something a bored assistant would do Changelog cl Ryll/Shaps add: You can now attach knives to cleanbots! Laugh as Officer Stabby sneaks up and jabs the HoS! Sigh because you are now outranked by a cleanbot! Fun for everyone! /cl --- .../mob/living/simple_animal/bot/bot.dm | 12 +++ .../mob/living/simple_animal/bot/cleanbot.dm | 87 +++++++++++++++++- icons/mob/aibots.dmi | Bin 64012 -> 64014 bytes 3 files changed, 98 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index eaa35c5a438..3303e400690 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -91,6 +91,10 @@ var/ignorelistcleanuptimer = 1 // This ticks up every automated action, at 300 we clean the ignore list var/robot_arm = /obj/item/bodypart/r_arm/robot + var/commissioned = FALSE // Will other (noncommissioned) bots salute this bot? + var/can_salute = TRUE + var/salute_delay = 60 SECONDS + hud_possible = list(DIAG_STAT_HUD, DIAG_BOT_HUD, DIAG_HUD, DIAG_PATH_HUD = HUD_LIST_LIST) //Diagnostic HUD views /mob/living/simple_animal/bot/proc/get_mode() @@ -240,6 +244,14 @@ if(!on || client) return + if(!commissioned && can_salute) + for(var/mob/living/simple_animal/bot/B in get_hearers_in_view(5, get_turf(src))) + if(B.commissioned) + visible_message("[src] performs an elaborate salute for [B]!") + can_salute = FALSE + addtimer(VARSET_CALLBACK(src, can_salute, TRUE), salute_delay) + break + switch(mode) //High-priority overrides are processed first. Bots can do nothing else while under direct command. if(BOT_RESPONDING) //Called by the AI. call_mode() diff --git a/code/modules/mob/living/simple_animal/bot/cleanbot.dm b/code/modules/mob/living/simple_animal/bot/cleanbot.dm index dbbad683f5d..5ff19e28c6c 100644 --- a/code/modules/mob/living/simple_animal/bot/cleanbot.dm +++ b/code/modules/mob/living/simple_animal/bot/cleanbot.dm @@ -14,7 +14,7 @@ model = "Cleanbot" bot_core_type = /obj/machinery/bot_core/cleanbot window_id = "autoclean" - window_name = "Automatic Station Cleaner v1.3" + window_name = "Automatic Station Cleaner v1.4" pass_flags = PASSMOB path_image_color = "#993299" @@ -33,6 +33,59 @@ var/next_dest var/next_dest_loc + var/obj/item/weapon + var/weapon_orig_force = 0 + + var/list/stolen_valor + + var/static/list/officers = list("Captain", "Head of Personnel", "Head of Security") + var/static/list/command = list("Captain" = "Cpt.","Head of Personnel" = "Lt.") + var/static/list/security = list("Head of Security" = "Maj.", "Warden" = "Sgt.", "Detective" = "Det.", "Security Officer" = "Officer") + var/static/list/engineering = list("Chief Engineer" = "Chief Engineer", "Station Engineer" = "Engineer", "Atmospherics Technician" = "Technician") + var/static/list/medical = list("Chief Medical Officer" = "C.M.O.", "Medical Doctor" = "M.D.", "Chemist" = "Pharm.D.") + var/static/list/research = list("Research Director" = "Ph.D.", "Roboticist" = "M.S.", "Scientist" = "B.S.") + var/static/list/legal = list("Lawyer" = "Esq.") + + var/list/prefixes + var/list/suffixes + + +/mob/living/simple_animal/bot/cleanbot/proc/deputize(obj/item/W, mob/user) + if(in_range(src, user)) + to_chat(user, "You attach \the [W] to \the [src].") + user.transferItemToLoc(W, src) + weapon = W + weapon_orig_force = weapon.force + weapon.force = weapon.force / 2 + icon_state = "cleanbot[on]" + add_overlay(image(icon=weapon.lefthand_file,icon_state=weapon.item_state)) + +/mob/living/simple_animal/bot/cleanbot/proc/update_titles() + var/working_title = "" + + for(var/pref in prefixes) + for(var/title in pref) + if(title in stolen_valor) + working_title += pref[title] + " " + if(title in officers) + commissioned = TRUE + break + + working_title += initial(name) + + for(var/suf in suffixes) + for(var/title in suf) + if(title in stolen_valor) + working_title += " " + suf[title] + break + + name = working_title + +/mob/living/simple_animal/bot/cleanbot/examine(mob/user) + . = ..() + if(weapon) + . += " Is that \a [weapon] taped to it...?" + /mob/living/simple_animal/bot/cleanbot/Initialize() . = ..() get_targets() @@ -41,6 +94,17 @@ var/datum/job/janitor/J = new/datum/job/janitor access_card.access += J.get_access() prev_access = access_card.access + stolen_valor = list() + + prefixes = list(command, security, engineering) + suffixes = list(research, medical, legal) + +/mob/living/simple_animal/bot/cleanbot/Destroy() + if(weapon) + var/atom/Tsec = drop_location() + weapon.force = weapon_orig_force + drop_part(weapon, Tsec) + return ..() /mob/living/simple_animal/bot/cleanbot/turn_on() ..() @@ -63,6 +127,23 @@ text_dehack = "[name]'s software has been reset!" text_dehack_fail = "[name] does not seem to respond to your repair code!" +/mob/living/simple_animal/bot/cleanbot/Crossed(atom/movable/AM) + . = ..() + + zone_selected = pick(BODY_ZONE_L_LEG, BODY_ZONE_R_LEG) + if(weapon && has_gravity() && ismob(AM)) + var/mob/living/carbon/C = AM + if(!istype(C)) + return + + weapon.attack(C, src) + C.Knockdown(20) + + if(!(C.job in stolen_valor)) + stolen_valor += C.job + update_titles() + return + /mob/living/simple_animal/bot/cleanbot/attackby(obj/item/W, mob/user, params) if(istype(W, /obj/item/card/id)||istype(W, /obj/item/pda)) if(bot_core.allowed(user) && !open && !emagged) @@ -75,6 +156,10 @@ to_chat(user, "Please close the access panel before locking it.") else to_chat(user, "\The [src] doesn't seem to respect your authority.") + else if(istype(W, /obj/item/kitchen/knife) && user.a_intent != INTENT_HARM) + to_chat(user, "You start attaching the [W] to \the [src]...") + if(do_after(user, 40, target = src)) + deputize(W, user) else return ..() diff --git a/icons/mob/aibots.dmi b/icons/mob/aibots.dmi index 27acffbbc9aeaca8188032cfbc380cc8903fc9a8..680d93bb54360193db6c774cb550d877f738eca0 100644 GIT binary patch delta 992 zcmV<610Vd1^aGCc1CS(t!g^F#bVOxyV{&P5bZKvH004NLrI^i*qc{-9&&gAunJXOu zP47$}a#{6g)rXl^uxzM+6=S2a)7|XT?}3nz4sMs(15zUW$}az@FY`V5``16Of0CEq zuiH03D~(R}Nx93mn|E2eHrXeS#dgzzY+5(|v5q@P_Q|(O0oTHRxa`|@Q%khTKFPP6 z1M&{W-xpGxsv|hoqxl$u@U(1BCLgM0wAgNHP<%-CNuJK^I;bVd?=u+ocBB88_gA9(B0Ou)+nHGFpw~g zT@X7+w2sUA7WPDt=FC=H>-lN?WyT(*X3l(&StGUUKs&O3fxwgV_|h@84L@02H87zzC8Zx z?iJp?#%YOv)_CIms~DJ!4}eap$aXgw3p7Xi-W!B>sq1AOXyE{Lkv+2m@-Cd>Bir(D zp&3a94V|<^v`0ei8d2MVQbg8qOQ`-(7uj<-6rnD%XJ2>y%!M2NrH_PX`)f}Kv)8#P zh+4omV~?k~oFz3cz*Q|RgU@8xA7MU-_r_^W-)%5|R1z>Il#rew7!l1F6QW3rQKSYb z5~EbaC?)7hi3p`cj8cNAl%OglsQE0l)D5fA=QO|Es%cqelEJ_bI}>2g!y1jDhSV3H#D=LtqB*Ybm*213{{S&4 OEo!{)OXsug10VLMoBx9V delta 990 zcmV<410np5^aG6a1CS(tzw$!2UJvSd(7Tkq+2aGW@eRZ-p{K>~cFsNW<-`8N6a>-Wo_s1Ac_sKTdq!YUqDoKj_2!16xgIw23 zjcWwZ%Xb?ec4PE^UL2~b57*-f-LS@JPexDI$z~U7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