From b36da8f5d78844ee667a6525728f090b04cf7ae7 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Thu, 12 Oct 2023 14:34:02 -0300 Subject: [PATCH 1/8] Revert "Revert "[DNM] Updates firemanning, throwing stuff"" This reverts commit def4b38a467e3595416db66c42b30512be69fabf. --- code/__DEFINES/dcs/signals/signals_global.dm | 2 + .../signals/signals_mob/signals_mob_main.dm | 2 + code/__HELPERS/pronouns.dm | 15 +++ code/datums/components/riding.dm | 9 ++ code/datums/elements/mob_holder.dm | 75 +++++++----- code/game/objects/buckling.dm | 25 +++- code/game/objects/items.dm | 12 ++ code/game/objects/items/cigs_lighters.dm | 1 + .../structures/beds_chairs/alien_nest.dm | 2 +- code/game/objects/structures/kitchen_spike.dm | 2 +- code/game/objects/structures/manned_turret.dm | 2 +- code/game/objects/structures/morgue.dm | 11 ++ code/game/objects/structures/tables_racks.dm | 34 +++++- .../clock_structures/traps/brass_skewer.dm | 2 +- .../antagonists/devil/true_devil/inventory.dm | 2 +- code/modules/mob/inventory.dm | 16 ++- .../living/carbon/alien/larva/inventory.dm | 2 +- code/modules/mob/living/carbon/carbon.dm | 109 +++++++++--------- .../simple_animal/guardian/types/dextrous.dm | 2 +- .../mob/living/simple_animal/simple_animal.dm | 2 +- .../mob/living/simple_animal/slime/slime.dm | 2 +- code/modules/power/singularity/emitter.dm | 2 +- tgstation.dme | 2 + 23 files changed, 228 insertions(+), 105 deletions(-) create mode 100644 code/__DEFINES/dcs/signals/signals_global.dm create mode 100644 code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm diff --git a/code/__DEFINES/dcs/signals/signals_global.dm b/code/__DEFINES/dcs/signals/signals_global.dm new file mode 100644 index 0000000000..3e0e1d2296 --- /dev/null +++ b/code/__DEFINES/dcs/signals/signals_global.dm @@ -0,0 +1,2 @@ +/// a person somewhere has thrown something : (mob/living/carbon/carbon_thrower, target) +#define COMSIG_GLOB_CARBON_THROW_THING "!throw_thing" diff --git a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm new file mode 100644 index 0000000000..e6c3464ff7 --- /dev/null +++ b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm @@ -0,0 +1,2 @@ +/// from mob/proc/dropItemToGround() +#define COMSIG_MOB_DROPPING_ITEM "mob_dropping_item" diff --git a/code/__HELPERS/pronouns.dm b/code/__HELPERS/pronouns.dm index bfe09ba370..fd15c05c64 100644 --- a/code/__HELPERS/pronouns.dm +++ b/code/__HELPERS/pronouns.dm @@ -39,6 +39,21 @@ /datum/proc/p_es(temp_gender) . = "es" +/datum/proc/plural_s(pluralize) + switch(copytext_char(pluralize, -2)) + if ("ss") + return "es" + if ("sh") + return "es" + if ("ch") + return "es" + else + switch(copytext_char(pluralize, -1)) + if("s", "x", "z") + return "es" + else + return "s" + //like clients, which do have gender. /client/p_they(capitalized, temp_gender) if(!temp_gender) diff --git a/code/datums/components/riding.dm b/code/datums/components/riding.dm index a074fe6f5f..49b8f7f7f0 100644 --- a/code/datums/components/riding.dm +++ b/code/datums/components/riding.dm @@ -392,3 +392,12 @@ if(rider in AM.buckled_mobs) AM.unbuckle_mob(rider) . = ..() + +/obj/item/riding_offhand/on_thrown(mob/living/carbon/user, atom/target) + if(rider == user) + return //Piggyback user. + user.unbuckle_mob(rider) + if(HAS_TRAIT(user, TRAIT_PACIFISM)) + to_chat(user, span_notice("You gently let go of [rider].")) + return + return rider diff --git a/code/datums/elements/mob_holder.dm b/code/datums/elements/mob_holder.dm index 5f57b4fce3..82f42d69b3 100644 --- a/code/datums/elements/mob_holder.dm +++ b/code/datums/elements/mob_holder.dm @@ -61,7 +61,7 @@ return FALSE source.visible_message("[user] starts picking up [source].", \ "[user] starts picking you up!") - if(!do_after(user, 20, target = source) || source.buckled) + if(!do_after(user, 2 SECONDS, target = source) || source.buckled) return FALSE source.visible_message("[user] picks up [source]!", \ @@ -95,6 +95,7 @@ dynamic_hair_suffix = "" var/mob/living/held_mob var/escape_on_find + var/destroying = FALSE /obj/item/clothing/head/mob_holder/Initialize(mapload, mob/living/target, worn_state, alt_worn, right_hand, left_hand, slots = NONE) . = ..() @@ -134,45 +135,54 @@ w_class = WEIGHT_CLASS_HUGE /obj/item/clothing/head/mob_holder/Destroy() + destroying = TRUE if(held_mob) - release() + release(FALSE) return ..() /obj/item/clothing/head/mob_holder/examine(mob/user) return held_mob?.examine(user) || ..() -/obj/item/clothing/head/mob_holder/Exited(atom/movable/AM, atom/newloc) - . = ..() - if(AM == held_mob) - held_mob.reset_perspective() - held_mob = null - QDEL_IN(src, 1) //To avoid a qdel loop. +/obj/item/clothing/head/mob_holder/on_thrown(mob/living/carbon/user, atom/target) + if((item_flags & ABSTRACT) || HAS_TRAIT(src, TRAIT_NODROP)) + return + if(HAS_TRAIT(user, TRAIT_PACIFISM)) + to_chat(user, span_notice("You set [src] down gently on the ground.")) + release() + return -/obj/item/clothing/head/mob_holder/Entered(atom/movable/AM, atom/newloc) - . = ..() - if(AM != held_mob) - var/destination = loc - if(isliving(loc)) //the mob is held or worn, drop things on the floor - destination = get_turf(loc) - AM.forceMove(destination) + var/mob/living/throw_mob = held_mob + release() + return throw_mob /obj/item/clothing/head/mob_holder/dropped(mob/user) . = ..() - if(held_mob && !ismob(loc) && !istype(loc,/obj/item/storage))//don't release on soft-drops + if(held_mob && isturf(loc)) release() -/obj/item/clothing/head/mob_holder/proc/release() - if(held_mob) - var/mob/living/L = held_mob - held_mob = null - L.forceMove(get_turf(L)) - L.reset_perspective() - L.setDir(SOUTH) - if(!QDELETED(src)) +/obj/item/clothing/head/mob_holder/proc/release(del_on_release = TRUE, display_messages = TRUE) + if(!held_mob) + if(del_on_release && !destroying) + qdel(src) + return FALSE + var/mob/living/released_mob = held_mob + held_mob = null // stops the held mob from being release()'d twice. + if(isliving(loc)) + var/mob/living/L = loc + if(display_messages) + to_chat(L, span_warning("[released_mob] wriggles free!")) + L.dropItemToGround(src) + released_mob.forceMove(drop_location()) + released_mob.reset_perspective() + released_mob.setDir(SOUTH) + if(display_messages) + released_mob.visible_message(span_warning("[released_mob] uncurls!")) + if(del_on_release && !destroying) qdel(src) + return TRUE -/obj/item/clothing/head/mob_holder/relaymove(mob/user) - return +/obj/item/clothing/head/mob_holder/relaymove(mob/living/user, direction) + container_resist() /obj/item/clothing/head/mob_holder/container_resist() if(isliving(loc)) @@ -180,6 +190,11 @@ L.visible_message("[held_mob] escapes from [L]!", "[held_mob] escapes your grip!") release() +/obj/item/clothing/head/mob_holder/Exited(atom/movable/gone, direction) + . = ..() + if(held_mob && held_mob == gone) + release() + /obj/item/clothing/head/mob_holder/mob_can_equip(M, equipper, slot, disable_warning, bypass_equip_delay_self) if(M == held_mob || !ishuman(M)) //monkeys holding monkeys holding monkeys... return FALSE @@ -232,7 +247,9 @@ return location.transfer_air(taker, ratio) // escape when found if applicable -/obj/item/clothing/head/mob_holder/on_found(mob/living/finder) +/obj/item/clothing/head/mob_holder/on_found(mob/finder) if(escape_on_find) - finder.visible_message("[finder] accidentally releases the [held_mob]!") - release() + to_chat(finder, span_warning("\A [held_mob.name] pops out! ")) + finder.visible_message(span_warning("\A [held_mob.name] pops out of the container [finder] is opening!"), ignored_mobs = finder) + release(TRUE, FALSE) + return diff --git a/code/game/objects/buckling.dm b/code/game/objects/buckling.dm index afc4312779..aae6cbaa5c 100644 --- a/code/game/objects/buckling.dm +++ b/code/game/objects/buckling.dm @@ -25,11 +25,32 @@ if(user_unbuckle_mob(buckled_mobs[1],user)) return 1 +/atom/movable/attackby(obj/item/attacking_item, mob/user, params) + if(!can_buckle || !istype(attacking_item, /obj/item/riding_offhand) || !user.Adjacent(src)) + return ..() + + var/obj/item/riding_offhand/riding_item = attacking_item + var/mob/living/carried_mob = riding_item.rider + if(carried_mob == user) //Piggyback user. + return + user.unbuckle_mob(carried_mob) + carried_mob.forceMove(get_turf(src)) + return mouse_buckle_handling(carried_mob, user) + /atom/movable/MouseDrop_T(mob/living/M, mob/living/user) . = ..() + return mouse_buckle_handling(M, user) + +/** + * Does some typechecks and then calls user_buckle_mob + * + * Arguments: + * M - The mob being buckled to src + * user - The mob buckling M to src + */ +/atom/movable/proc/mouse_buckle_handling(mob/living/M, mob/living/user) if(can_buckle && istype(M) && istype(user)) - if(user_buckle_mob(M, user)) - return 1 + return user_buckle_mob(M, user, check_loc = FALSE) /atom/movable/proc/has_buckled_mobs() if(!buckled_mobs) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 7a953089a5..e63f809a5e 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -177,6 +177,8 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb var/canMouseDown = FALSE + /// Used if we want to have a custom verb text for throwing. "John Spaceman flicks the ciggerate" for example. + var/throw_verb /obj/item/Initialize(mapload) @@ -1116,6 +1118,16 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb QDEL_NULL(src) return TRUE +///Called by the carbon throw_item() proc. Returns null if the item negates the throw, or a reference to the thing to suffer the throw else. +/obj/item/proc/on_thrown(mob/living/carbon/user, atom/target) + if((item_flags & ABSTRACT) || HAS_TRAIT(src, TRAIT_NODROP)) + return + user.dropItemToGround(src, silent = TRUE) + if(throwforce && HAS_TRAIT(user, TRAIT_PACIFISM)) + to_chat(user, span_notice("You set [src] down gently on the ground.")) + return + return src + /** diff --git a/code/game/objects/items/cigs_lighters.dm b/code/game/objects/items/cigs_lighters.dm index 518772c771..a52bbb75f3 100644 --- a/code/game/objects/items/cigs_lighters.dm +++ b/code/game/objects/items/cigs_lighters.dm @@ -108,6 +108,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM w_class = WEIGHT_CLASS_TINY body_parts_covered = null grind_results = list() + throw_verb = "flick" var/lit = FALSE var/starts_lit = FALSE var/icon_on = "cigon" //Note - these are in masks.dmi not in cigarette.dmi diff --git a/code/game/objects/structures/beds_chairs/alien_nest.dm b/code/game/objects/structures/beds_chairs/alien_nest.dm index eff87d3955..762331c40e 100644 --- a/code/game/objects/structures/beds_chairs/alien_nest.dm +++ b/code/game/objects/structures/beds_chairs/alien_nest.dm @@ -48,7 +48,7 @@ unbuckle_mob(M) add_fingerprint(user) -/obj/structure/bed/nest/user_buckle_mob(mob/living/M, mob/living/carbon/user) +/obj/structure/bed/nest/user_buckle_mob(mob/living/M, mob/living/carbon/user, check_loc) if ( !ismob(M) || (get_dist(src, user) > 1) || (M.loc != src.loc) || !user.cuff_resist_check() || M.buckled ) return diff --git a/code/game/objects/structures/kitchen_spike.dm b/code/game/objects/structures/kitchen_spike.dm index a37797045f..8c2655dd64 100644 --- a/code/game/objects/structures/kitchen_spike.dm +++ b/code/game/objects/structures/kitchen_spike.dm @@ -97,7 +97,7 @@ -/obj/structure/kitchenspike/user_buckle_mob(mob/living/M, mob/living/user) //Don't want them getting put on the rack other than by spiking +/obj/structure/kitchenspike/user_buckle_mob(mob/living/M, mob/living/user, check_loc) //Don't want them getting put on the rack other than by spiking return /obj/structure/kitchenspike/user_unbuckle_mob(mob/living/buckled_mob, mob/living/carbon/human/user) diff --git a/code/game/objects/structures/manned_turret.dm b/code/game/objects/structures/manned_turret.dm index f70510e173..3f1cb5f4c1 100644 --- a/code/game/objects/structures/manned_turret.dm +++ b/code/game/objects/structures/manned_turret.dm @@ -43,7 +43,7 @@ . = ..() STOP_PROCESSING(SSfastprocess, src) -/obj/machinery/manned_turret/user_buckle_mob(mob/living/M, mob/living/carbon/user) +/obj/machinery/manned_turret/user_buckle_mob(mob/living/M, mob/living/carbon/user, check_loc) if(user.incapacitated() || !istype(user)) return M.forceMove(get_turf(src)) diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index 69206f0d08..c39b3f64b1 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -330,6 +330,17 @@ GLOBAL_LIST_EMPTY(crematoriums) else to_chat(user, "That's not connected to anything!") +/obj/structure/tray/attackby(obj/P, mob/user, params) + if(!istype(P, /obj/item/riding_offhand)) + return ..() + + var/obj/item/riding_offhand/riding_item = P + var/mob/living/carried_mob = riding_item.rider + if(carried_mob == user) //Piggyback user. + return + user.unbuckle_mob(carried_mob) + MouseDrop_T(carried_mob, user) + /obj/structure/tray/MouseDrop_T(atom/movable/O as mob|obj, mob/user) if(!ismovable(O) || O.anchored || !Adjacent(user) || !user.Adjacent(O) || O.loc == user) return diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index b7642f4658..12799b4370 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -124,11 +124,11 @@ . = . || (caller.pass_flags & PASSTABLE) /obj/structure/table/proc/tableplace(mob/living/user, mob/living/pushed_mob) - pushed_mob.forceMove(src.loc) - pushed_mob.set_resting(TRUE, FALSE) - pushed_mob.visible_message("[user] places [pushed_mob] onto [src].", \ - "[user] places [pushed_mob] onto [src].") - log_combat(user, pushed_mob, "placed") + pushed_mob.forceMove(loc) + pushed_mob.set_resting(TRUE, TRUE) + pushed_mob.visible_message(span_notice("[user] places [pushed_mob] onto [src]."), \ + span_notice("[user] places [pushed_mob] onto [src].")) + log_combat(user, pushed_mob, "places", null, "onto [src]") /obj/structure/table/proc/tablepush(mob/living/user, mob/living/pushed_mob) if(HAS_TRAIT(user, TRAIT_PACIFISM)) @@ -205,6 +205,30 @@ return // If the tray IS empty, continue on (tray will be placed on the table like other items) + if(istype(I, /obj/item/riding_offhand)) + var/obj/item/riding_offhand/riding_item = I + var/mob/living/carried_mob = riding_item.rider + if(carried_mob == user) //Piggyback user. + return + if(user.a_intent == INTENT_HARM) + user.unbuckle_mob(carried_mob) + tablelimbsmash(user, carried_mob) + else + var/tableplace_delay = 3.5 SECONDS + var/skills_space = "" + if(HAS_TRAIT(user, TRAIT_QUICKER_CARRY)) + tableplace_delay = 2 SECONDS + skills_space = " expertly" + else if(HAS_TRAIT(user, TRAIT_QUICK_CARRY)) + tableplace_delay = 2.75 SECONDS + skills_space = " quickly" + carried_mob.visible_message(span_notice("[user] begins to[skills_space] place [carried_mob] onto [src]..."), + span_userdanger("[user] begins to[skills_space] place [carried_mob] onto [src]...")) + if(do_after(user, tableplace_delay, target = carried_mob)) + user.unbuckle_mob(carried_mob) + tableplace(user, carried_mob) + return TRUE + if(user.a_intent != INTENT_HARM && !(I.item_flags & ABSTRACT)) if(user.transferItemToLoc(I, drop_location())) var/list/click_params = params2list(params) diff --git a/code/modules/antagonists/clockcult/clock_structures/traps/brass_skewer.dm b/code/modules/antagonists/clockcult/clock_structures/traps/brass_skewer.dm index a7c1f81f06..ac8dc0bffb 100644 --- a/code/modules/antagonists/clockcult/clock_structures/traps/brass_skewer.dm +++ b/code/modules/antagonists/clockcult/clock_structures/traps/brass_skewer.dm @@ -81,7 +81,7 @@ density = TRUE //Skewers are one-use only desc = "A vicious brass spike protruding from the ground like a stala[pick("gm", "ct")]ite. It makes you sick to look at." //is stalagmite the ground one? or the ceiling one? who can ever remember? -/obj/structure/destructible/clockwork/trap/brass_skewer/user_buckle_mob() +/obj/structure/destructible/clockwork/trap/brass_skewer/user_buckle_mob(check_loc) return /obj/structure/destructible/clockwork/trap/brass_skewer/post_buckle_mob(mob/living/L) diff --git a/code/modules/antagonists/devil/true_devil/inventory.dm b/code/modules/antagonists/devil/true_devil/inventory.dm index e98cb5ca72..8856838a34 100644 --- a/code/modules/antagonists/devil/true_devil/inventory.dm +++ b/code/modules/antagonists/devil/true_devil/inventory.dm @@ -1,4 +1,4 @@ -/mob/living/carbon/true_devil/doUnEquip(obj/item/I, force, silent = FALSE) +/mob/living/carbon/true_devil/doUnEquip(obj/item/I, force, invdrop, silent = FALSE) if(..()) update_inv_hands() return 1 diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 51659a2904..79a0ccda77 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -292,10 +292,18 @@ //The following functions are the same save for one small difference -//for when you want the item to end up on the ground -//will force move the item to the ground and call the turf's Entered -/mob/proc/dropItemToGround(obj/item/I, force = FALSE) - return doUnEquip(I, force, drop_location(), FALSE) +/** + * Used to drop an item (if it exists) to the ground. + * * Will pass as TRUE is successfully dropped, or if there is no item to drop. + * * Will pass FALSE if the item can not be dropped due to TRAIT_NODROP via doUnEquip() + * If the item can be dropped, it will be forceMove()'d to the ground and the turf's Entered() will be called. +*/ +/mob/proc/dropItemToGround(obj/item/I, force = FALSE, silent = FALSE, invdrop = TRUE) + if (isnull(I)) + return TRUE + + SEND_SIGNAL(src, COMSIG_MOB_DROPPING_ITEM) + . = doUnEquip(I, force, drop_location(), FALSE, invdrop = invdrop, silent = silent) //for when the item will be immediately placed in a loc other than the ground /mob/proc/transferItemToLoc(obj/item/I, newloc = null, force = FALSE, silent = TRUE) diff --git a/code/modules/mob/living/carbon/alien/larva/inventory.dm b/code/modules/mob/living/carbon/alien/larva/inventory.dm index b07bd180f6..5b49c3abb0 100644 --- a/code/modules/mob/living/carbon/alien/larva/inventory.dm +++ b/code/modules/mob/living/carbon/alien/larva/inventory.dm @@ -1,3 +1,3 @@ //can't unequip since it can't equip anything -/mob/living/carbon/alien/larva/doUnEquip(obj/item/W, silent = FALSE) +/mob/living/carbon/alien/larva/doUnEquip(obj/item/W, invdrop, silent = FALSE) return diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 419a75eff2..e9f4f61556 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -141,26 +141,28 @@ /mob/living/carbon/proc/throw_mode_off() - in_throw_mode = 0 + in_throw_mode = FALSE if(client && hud_used) hud_used.throw_icon.icon_state = "act_throw_off" /mob/living/carbon/proc/throw_mode_on() - in_throw_mode = 1 + in_throw_mode = TRUE if(client && hud_used) hud_used.throw_icon.icon_state = "act_throw_on" /mob/proc/throw_item(atom/target) SEND_SIGNAL(src, COMSIG_MOB_THROW, target) - return + SEND_GLOBAL_SIGNAL(COMSIG_GLOB_CARBON_THROW_THING, src, target) + return TRUE /mob/living/carbon/throw_item(atom/target) + . = ..() throw_mode_off() if(!target || !isturf(loc)) - return + return FALSE if(istype(target, /atom/movable/screen)) - return + return FALSE //CIT CHANGES - makes it impossible to throw while in stamina softcrit if(IS_STAMCRIT(src)) @@ -170,59 +172,56 @@ var/random_turn = a_intent == INTENT_HARM //END OF CIT CHANGES - var/obj/item/I = get_active_held_item() - var/atom/movable/thrown_thing - var/mob/living/throwable_mob + var/obj/item/held_item = get_active_held_item() + var/verb_text = pick("throw", "toss", "hurl", "chuck", "fling") + if(prob(0.5)) + verb_text = "yeet" - if(istype(I, /obj/item/clothing/head/mob_holder)) - var/obj/item/clothing/head/mob_holder/holder = I - if(holder.held_mob) - throwable_mob = holder.held_mob - holder.release() - - if(!I || throwable_mob) - if(!throwable_mob && pulling && isliving(pulling) && grab_state >= GRAB_AGGRESSIVE) - throwable_mob = pulling - - if(throwable_mob && !throwable_mob.buckled) - thrown_thing = throwable_mob - if(pulling) + var/neckgrab_throw = FALSE + if(!held_item) + if(pulling && isliving(pulling) && grab_state >= GRAB_AGGRESSIVE) + var/mob/living/throwable_mob = pulling + if(!throwable_mob.buckled) + thrown_thing = throwable_mob + if(grab_state >= GRAB_NECK) + neckgrab_throw = TRUE stop_pulling() - if(HAS_TRAIT(src, TRAIT_PACIFISM)) - to_chat(src, "You gently let go of [throwable_mob].") - return - if(!UseStaminaBuffer(STAM_COST_THROW_MOB * ((throwable_mob.mob_size+1)**2), TRUE)) - return - var/turf/start_T = get_turf(loc) //Get the start and target tile for the descriptors - var/turf/end_T = get_turf(target) - if(start_T && end_T) - log_combat(src, throwable_mob, "thrown", addition="grab from tile in [AREACOORD(start_T)] towards tile at [AREACOORD(end_T)]") - - else if(!(I.item_flags & ABSTRACT) && !HAS_TRAIT(I, TRAIT_NODROP)) - thrown_thing = I - dropItemToGround(I) - - if(HAS_TRAIT(src, TRAIT_PACIFISM) && I.throwforce) - to_chat(src, "You set [I] down gently on the ground.") - return - - if(!UseStaminaBuffer(I.getweight(src, STAM_COST_THROW_MULT, SKILL_THROW_STAM_COST), warn = TRUE)) - return - - if(thrown_thing) - var/power_throw = 0 - if(HAS_TRAIT(src, TRAIT_HULK)) - power_throw++ - if(pulling && grab_state >= GRAB_NECK) - power_throw++ - visible_message("[src] throws [thrown_thing][power_throw ? " really hard!" : "."]", \ - "You throw [thrown_thing][power_throw ? " really hard!" : "."]") - log_message("has thrown [thrown_thing] [power_throw ? "really hard" : ""]", LOG_ATTACK) - do_attack_animation(target, no_effect = 1) - playsound(loc, 'sound/weapons/punchmiss.ogg', 50, 1, -1) - newtonian_move(get_dir(target, src)) - thrown_thing.safe_throw_at(target, thrown_thing.throw_range, thrown_thing.throw_speed + power_throw, src, null, null, null, move_force, random_turn) + if(HAS_TRAIT(src, TRAIT_PACIFISM)) + to_chat(src, span_notice("You gently let go of [throwable_mob].")) + return FALSE + if(!UseStaminaBuffer(STAM_COST_THROW_MOB * ((throwable_mob.mob_size+1)**2), TRUE)) + return FALSE + else + thrown_thing = held_item.on_thrown(src, target) + if(!thrown_thing) + return FALSE + if(isliving(thrown_thing)) + var/turf/start_T = get_turf(loc) //Get the start and target tile for the descriptors + var/turf/end_T = get_turf(target) + if(start_T && end_T) + log_combat(src, thrown_thing, "thrown", addition="grab from tile in [AREACOORD(start_T)] towards tile at [AREACOORD(end_T)]") + var/power_throw = 0 + if(HAS_TRAIT(src, TRAIT_HULK)) + power_throw++ + if(HAS_TRAIT(src, TRAIT_DWARF)) + power_throw-- + if(HAS_TRAIT(thrown_thing, TRAIT_DWARF)) + power_throw++ + if(neckgrab_throw) + power_throw++ + if(isitem(thrown_thing)) + var/obj/item/thrown_item = thrown_thing + if(thrown_item.throw_verb) + verb_text = thrown_item.throw_verb + visible_message(span_danger("[src] [verb_text][plural_s(verb_text)] [thrown_thing][power_throw ? " really hard!" : "."]"), \ + span_danger("You [verb_text] [thrown_thing][power_throw ? " really hard!" : "."]")) + log_message("has thrown [thrown_thing] [power_throw > 0 ? "really hard" : ""]", LOG_ATTACK) + do_attack_animation(target, no_effect = 1) + var/extra_throw_range = 0 // HAS_TRAIT(src, TRAIT_THROWINGARM) ? 2 : 0 + playsound(loc, 'sound/weapons/punchmiss.ogg', 50, 1, -1) + newtonian_move(get_dir(target, src)) + thrown_thing.safe_throw_at(target, thrown_thing.throw_range + extra_throw_range, max(1,thrown_thing.throw_speed + power_throw), src, null, null, null, move_force, random_turn) /mob/living/carbon/restrained(ignore_grab) . = (handcuffed || (!ignore_grab && pulledby && pulledby.grab_state >= GRAB_AGGRESSIVE)) diff --git a/code/modules/mob/living/simple_animal/guardian/types/dextrous.dm b/code/modules/mob/living/simple_animal/guardian/types/dextrous.dm index 1fd1e623db..4e57aa1562 100644 --- a/code/modules/mob/living/simple_animal/guardian/types/dextrous.dm +++ b/code/modules/mob/living/simple_animal/guardian/types/dextrous.dm @@ -41,7 +41,7 @@ ..() //lose items, then return //SLOT HANDLING BULLSHIT FOR INTERNAL STORAGE -/mob/living/simple_animal/hostile/guardian/dextrous/doUnEquip(obj/item/I, force, silent = FALSE) +/mob/living/simple_animal/hostile/guardian/dextrous/doUnEquip(obj/item/I, force, invdrop, silent = FALSE) if(..()) update_inv_hands() if(I == internal_storage) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index f226a911d8..151cc70a27 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -587,7 +587,7 @@ //ANIMAL RIDING -/mob/living/simple_animal/user_buckle_mob(mob/living/M, mob/user) +/mob/living/simple_animal/user_buckle_mob(mob/living/M, mob/user, check_loc) var/datum/component/riding/riding_datum = GetComponent(/datum/component/riding) if(riding_datum) if(user.incapacitated()) diff --git a/code/modules/mob/living/simple_animal/slime/slime.dm b/code/modules/mob/living/simple_animal/slime/slime.dm index dc9d6ff6a3..2b267c4d01 100644 --- a/code/modules/mob/living/simple_animal/slime/slime.dm +++ b/code/modules/mob/living/simple_animal/slime/slime.dm @@ -252,7 +252,7 @@ Feedon(Food) return ..() -/mob/living/simple_animal/slime/doUnEquip(obj/item/W, silent = FALSE) +/mob/living/simple_animal/slime/doUnEquip(obj/item/W, invdrop, silent = FALSE) return /mob/living/simple_animal/slime/start_pulling(atom/movable/AM, state, force = move_force, supress_message = FALSE) diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm index 8f9a7805c6..be03e8a9c9 100644 --- a/code/modules/power/singularity/emitter.dm +++ b/code/modules/power/singularity/emitter.dm @@ -383,7 +383,7 @@ auto.Remove(buckled_mob) . = ..() -/obj/machinery/power/emitter/prototype/user_buckle_mob(mob/living/M, mob/living/carbon/user) +/obj/machinery/power/emitter/prototype/user_buckle_mob(mob/living/M, mob/living/carbon/user, check_loc) if(user.incapacitated() || !istype(user)) return for(var/atom/movable/A in get_turf(src)) diff --git a/tgstation.dme b/tgstation.dme index 54a485b1a3..15028c7f40 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -160,6 +160,7 @@ #include "code\__DEFINES\dcs\flags.dm" #include "code\__DEFINES\dcs\helpers.dm" #include "code\__DEFINES\dcs\signals.dm" +#include "code\__DEFINES\dcs\signals\signals_global.dm" #include "code\__DEFINES\dcs\signals\signals_hud.dm" #include "code\__DEFINES\dcs\signals\signals_medical.dm" #include "code\__DEFINES\dcs\signals\signals_mod.dm" @@ -169,6 +170,7 @@ #include "code\__DEFINES\dcs\signals\signals_subsystem.dm" #include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_movement.dm" #include "code\__DEFINES\dcs\signals\signals_mob\signals_mob_living.dm" +#include "code\__DEFINES\dcs\signals\signals_mob\signals_mob_main.dm" #include "code\__DEFINES\mapping\maploader.dm" #include "code\__DEFINES\material\worth.dm" #include "code\__DEFINES\mobs\innate_abilities.dm" From 7b62dbe7bbe2b5c7970e713474d238b85769ac86 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Sun, 17 Dec 2023 23:15:59 -0300 Subject: [PATCH 2/8] ai + mech --- code/__DEFINES/antagonists.dm | 3 + code/__DEFINES/logging.dm | 43 +-- code/__HELPERS/_lists.dm | 4 +- code/__HELPERS/type_processing.dm | 2 +- code/controllers/subsystem/dcs.dm | 2 +- code/controllers/subsystem/mapping.dm | 2 +- .../subsystem/processing/quirks.dm | 2 +- code/controllers/subsystem/shuttle.dm | 2 +- code/controllers/subsystem/ticker.dm | 2 +- code/datums/diseases/advance/advance.dm | 2 +- code/datums/elements/object_reskinning.dm | 2 +- code/datums/mind.dm | 9 + code/game/machinery/autolathe.dm | 2 +- code/game/machinery/camera/tracking.dm | 2 +- code/game/machinery/computer/atmos_control.dm | 2 +- code/game/machinery/doors/airlock.dm | 2 +- .../telecomms/computers/logbrowser.dm | 2 +- .../machinery/telecomms/computers/message.dm | 2 +- .../telecomms/computers/telemonitor.dm | 6 +- code/game/objects/effects/landmarks.dm | 2 +- code/game/objects/items/cardboard_cutouts.dm | 2 +- .../circuitboards/machine_circuitboards.dm | 2 +- code/game/objects/items/devices/PDA/PDA.dm | 4 +- code/game/objects/items/devices/PDA/cart.dm | 2 +- code/game/objects/items/devices/camera_bug.dm | 2 +- code/game/objects/items/devices/scanners.dm | 2 +- code/game/objects/items/holy_weapons.dm | 2 +- code/game/objects/items/robot/ai_upgrades.dm | 4 +- .../items/stacks/sheets/sheet_types.dm | 2 +- code/game/objects/items/storage/boxes.dm | 2 +- code/game/objects/structures/ai_core.dm | 318 ++++++++++++------ code/game/objects/structures/janicart.dm | 2 +- code/modules/admin/admin_investigate.dm | 2 +- code/modules/admin/admin_verbs.dm | 8 +- code/modules/admin/playtimes.dm | 2 +- code/modules/admin/stickyban.dm | 2 +- code/modules/admin/topic.dm | 2 +- code/modules/admin/verbs/adminpm.dm | 2 +- code/modules/admin/verbs/debug.dm | 16 +- code/modules/admin/verbs/randomverbs.dm | 4 +- code/modules/admin/verbs/secrets.dm | 2 +- .../view_variables/mass_edit_variables.dm | 2 +- .../admin/view_variables/modify_variables.dm | 2 +- .../admin/view_variables/topic_basic.dm | 4 +- .../admin/view_variables/view_variables.dm | 2 +- .../clock_helpers/scripture_checks.dm | 2 +- .../eldritch_cult/eldritch_knowledge.dm | 2 +- code/modules/asset_cache/asset_list.dm | 2 +- .../machinery/portable/canister.dm | 2 +- code/modules/cargo/centcom_podlauncher.dm | 2 +- code/modules/client/preferences.dm | 4 +- code/modules/client/verbs/ooc.dm | 2 +- code/modules/client/verbs/who.dm | 2 +- code/modules/events/wizard/madness.dm | 2 +- .../kitchen_machinery/smartfridge.dm | 2 +- code/modules/hydroponics/hydroponics.dm | 2 +- code/modules/jobs/job_types/ai.dm | 6 +- code/modules/mining/laborcamp/laborstacker.dm | 2 +- code/modules/mob/living/brain/MMI.dm | 66 +++- code/modules/mob/living/emote.dm | 2 +- code/modules/mob/living/silicon/ai/ai.dm | 107 +++++- .../mob/living/silicon/ai/ai_defense.dm | 104 +++++- code/modules/mob/living/silicon/ai/life.dm | 10 +- .../modules/mob/living/silicon/robot/robot.dm | 2 +- .../mob/living/silicon/robot/robot_defines.dm | 1 - .../mob/living/silicon/robot/robot_modules.dm | 12 +- code/modules/mob/living/silicon/silicon.dm | 2 + .../computers/item/computer.dm | 2 +- code/modules/projectiles/gun.dm | 2 +- .../chemistry/machinery/chem_dispenser.dm | 12 +- code/modules/vehicles/mecha/_mecha.dm | 149 +++++--- code/modules/vehicles/mecha/combat/neovgre.dm | 2 +- .../code/modules/client/verbs/who.dm | 10 +- .../code/modules/mentor/mentorpm.dm | 2 +- 74 files changed, 700 insertions(+), 306 deletions(-) diff --git a/code/__DEFINES/antagonists.dm b/code/__DEFINES/antagonists.dm index 00751f2cab..3024d9f4fe 100644 --- a/code/__DEFINES/antagonists.dm +++ b/code/__DEFINES/antagonists.dm @@ -75,6 +75,9 @@ GLOBAL_LIST_EMPTY(living_heart_cache) //A list of all living hearts in existance #define IS_HERETIC(mob) (mob.mind?.has_antag_datum(/datum/antagonist/heretic)) #define IS_HERETIC_MONSTER(mob) (mob.mind?.has_antag_datum(/datum/antagonist/heretic_monster)) +/// Checks if the given mob is a malf ai. +#define IS_MALF_AI(mob) (isAI(mob) && mob?.mind?.has_antag_datum(/datum/antagonist/traitor)) + #define PATH_SIDE "Side" #define PATH_ASH "Ash" diff --git a/code/__DEFINES/logging.dm b/code/__DEFINES/logging.dm index 96201d71c2..84d6d0ae21 100644 --- a/code/__DEFINES/logging.dm +++ b/code/__DEFINES/logging.dm @@ -1,25 +1,26 @@ //Investigate logging defines -#define INVESTIGATE_ATMOS "atmos" -#define INVESTIGATE_BOTANY "botany" -#define INVESTIGATE_CARGO "cargo" -#define INVESTIGATE_EXPERIMENTOR "experimentor" -#define INVESTIGATE_GRAVITY "gravity" -#define INVESTIGATE_RECORDS "records" -#define INVESTIGATE_SINGULO "singulo" -#define INVESTIGATE_SUPERMATTER "supermatter" -#define INVESTIGATE_TELESCI "telesci" -#define INVESTIGATE_WIRES "wires" -#define INVESTIGATE_PORTAL "portals" -#define INVESTIGATE_RESEARCH "research" -#define INVESTIGATE_HALLUCINATIONS "hallucinations" -#define INVESTIGATE_RADIATION "radiation" -#define INVESTIGATE_EXONET "exonet" -#define INVESTIGATE_NANITES "nanites" -#define INVESTIGATE_CIRCUIT "circuit" -#define INVESTIGATE_FERMICHEM "fermichem" -#define INVESTIGATE_RCD "rcd" -#define INVESTIGATE_CRYOGENICS "cryogenics" -#define INVESTIGATE_GHOST "ghost" +#define INVESTIGATE_ATMOS "atmos" +#define INVESTIGATE_BOTANY "botany" +#define INVESTIGATE_CARGO "cargo" +#define INVESTIGATE_CIRCUIT "circuit" +#define INVESTIGATE_CRYOGENICS "cryogenics" +#define INVESTIGATE_DEATHS "deaths" +#define INVESTIGATE_EXONET "exonet" +#define INVESTIGATE_EXPERIMENTOR "experimentor" +#define INVESTIGATE_FERMICHEM "fermichem" +#define INVESTIGATE_GHOST "ghost" +#define INVESTIGATE_GRAVITY "gravity" +#define INVESTIGATE_HALLUCINATIONS "hallucinations" +#define INVESTIGATE_NANITES "nanites" +#define INVESTIGATE_PORTAL "portals" +#define INVESTIGATE_RADIATION "radiation" +#define INVESTIGATE_RCD "rcd" +#define INVESTIGATE_RECORDS "records" +#define INVESTIGATE_RESEARCH "research" +#define INVESTIGATE_SINGULO "singulo" +#define INVESTIGATE_SUPERMATTER "supermatter" +#define INVESTIGATE_TELESCI "telesci" +#define INVESTIGATE_WIRES "wires" // Logging types for log_message() #define LOG_ATTACK (1 << 0) diff --git a/code/__HELPERS/_lists.dm b/code/__HELPERS/_lists.dm index 5b457dd9cc..d7f689d7a6 100644 --- a/code/__HELPERS/_lists.dm +++ b/code/__HELPERS/_lists.dm @@ -495,10 +495,10 @@ return sortTim(L, order >= 0 ? /proc/cmp_records_asc : /proc/cmp_records_dsc) //any value in a list -/proc/sortList(list/L, cmp=/proc/cmp_text_asc) +/proc/sort_list(list/L, cmp=/proc/cmp_text_asc) return sortTim(L.Copy(), cmp) -//uses sortList() but uses the var's name specifically. This should probably be using mergeAtom() instead +//uses sort_list() but uses the var's name specifically. This should probably be using mergeAtom() instead /proc/sortNames(list/L, order=1) return sortTim(L.Copy(), order >= 0 ? /proc/cmp_name_asc : /proc/cmp_name_dsc) diff --git a/code/__HELPERS/type_processing.dm b/code/__HELPERS/type_processing.dm index ac7e5cab45..2b08b6d586 100644 --- a/code/__HELPERS/type_processing.dm +++ b/code/__HELPERS/type_processing.dm @@ -47,7 +47,7 @@ /proc/get_fancy_list_of_datum_types() var/static/list/pre_generated_list if (!pre_generated_list) //init - pre_generated_list = make_types_fancy(sortList(typesof(/datum) - typesof(/atom))) + pre_generated_list = make_types_fancy(sort_list(typesof(/datum) - typesof(/atom))) return pre_generated_list diff --git a/code/controllers/subsystem/dcs.dm b/code/controllers/subsystem/dcs.dm index 6be5a4bdfa..0d5b59bfa9 100644 --- a/code/controllers/subsystem/dcs.dm +++ b/code/controllers/subsystem/dcs.dm @@ -55,6 +55,6 @@ PROCESSING_SUBSYSTEM_DEF(dcs) fullid += "[key]" if(length(named_arguments)) - named_arguments = sortList(named_arguments) + named_arguments = sort_list(named_arguments) fullid += named_arguments return list2params(fullid) diff --git a/code/controllers/subsystem/mapping.dm b/code/controllers/subsystem/mapping.dm index a6c306e4d4..d8d0849ed7 100644 --- a/code/controllers/subsystem/mapping.dm +++ b/code/controllers/subsystem/mapping.dm @@ -423,7 +423,7 @@ GLOBAL_LIST_EMPTY(the_station_areas) banned += generateMapList("[global.config.directory]/iceruinblacklist.txt") banned += generateMapList("[global.config.directory]/stationruinblacklist.txt") - for(var/item in sortList(subtypesof(/datum/map_template/ruin), /proc/cmp_ruincost_priority)) + for(var/item in sort_list(subtypesof(/datum/map_template/ruin), /proc/cmp_ruincost_priority)) var/datum/map_template/ruin/ruin_type = item // screen out the abstract subtypes if(!initial(ruin_type.id)) diff --git a/code/controllers/subsystem/processing/quirks.dm b/code/controllers/subsystem/processing/quirks.dm index 582d2eb9dc..14c6c8aa26 100644 --- a/code/controllers/subsystem/processing/quirks.dm +++ b/code/controllers/subsystem/processing/quirks.dm @@ -22,7 +22,7 @@ PROCESSING_SUBSYSTEM_DEF(quirks) /datum/controller/subsystem/processing/quirks/proc/SetupQuirks() // Sort by Positive, Negative, Neutral; and then by name - var/list/quirk_list = sortList(subtypesof(/datum/quirk), /proc/cmp_quirk_asc) + var/list/quirk_list = sort_list(subtypesof(/datum/quirk), /proc/cmp_quirk_asc) for(var/V in quirk_list) var/datum/quirk/T = V diff --git a/code/controllers/subsystem/shuttle.dm b/code/controllers/subsystem/shuttle.dm index dbec272fe8..20d3ffd971 100644 --- a/code/controllers/subsystem/shuttle.dm +++ b/code/controllers/subsystem/shuttle.dm @@ -825,7 +825,7 @@ SUBSYSTEM_DEF(shuttle) templates[S.port_id]["templates"] += list(L) - data["templates_tabs"] = sortList(data["templates_tabs"]) + data["templates_tabs"] = sort_list(data["templates_tabs"]) data["existing_shuttle"] = null diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index c75febedef..6f856f3edb 100755 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -273,7 +273,7 @@ SUBSYSTEM_DEF(ticker) var/list/modes = new for (var/datum/game_mode/M in runnable_modes) modes += M.name - modes = sortList(modes) + modes = sort_list(modes) to_chat(world, "The gamemode is: secret!\nPossibilities: [english_list(modes)]") else mode.announce()*/ diff --git a/code/datums/diseases/advance/advance.dm b/code/datums/diseases/advance/advance.dm index 7e3ac29b2d..1ca07bf502 100644 --- a/code/datums/diseases/advance/advance.dm +++ b/code/datums/diseases/advance/advance.dm @@ -361,7 +361,7 @@ L += "[S.id]N" else L += S.id - L = sortList(L) // Sort the list so it doesn't matter which order the symptoms are in. + L = sort_list(L) // Sort the list so it doesn't matter which order the symptoms are in. var/result = jointext(L, ":") id = result return id diff --git a/code/datums/elements/object_reskinning.dm b/code/datums/elements/object_reskinning.dm index 87f5f13385..63e8a35d05 100644 --- a/code/datums/elements/object_reskinning.dm +++ b/code/datums/elements/object_reskinning.dm @@ -65,7 +65,7 @@ icon = to_reskin.unique_reskin[reskin_option]["icon"] ? to_reskin.unique_reskin[reskin_option]["icon"] : to_reskin.icon, icon_state = to_reskin.unique_reskin[reskin_option]["icon_state"] ? to_reskin.unique_reskin[reskin_option]["icon_state"] : to_reskin.icon_state) items += list("[reskin_option]" = item_image) - sortList(items) + sort_list(items) // Display to the user var/pick = show_radial_menu(user, to_reskin, items, custom_check = CALLBACK(src, .proc/check_reskin_menu, user, to_reskin), radius = 38, require_near = TRUE) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 9f6ccb742d..822da27923 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -67,6 +67,8 @@ var/datum/language_holder/language_holder var/unconvertable = FALSE var/late_joiner = FALSE + ///has this mind ever been an AI + var/has_ever_been_ai = FALSE var/force_escaped = FALSE // Set by Into The Sunset command of the shuttle manipulator var/list/learned_recipes //List of learned recipe TYPES. @@ -286,6 +288,13 @@ if(O) O.unlock_code = null +/// Remove the antagonists that should not persist when being borged +/datum/mind/proc/remove_antags_for_borging() + remove_antag_datum(/datum/antagonist/cult) + + var/datum/antagonist/rev/revolutionary = has_antag_datum(/datum/antagonist/rev) + revolutionary?.remove_revolutionary() + /datum/mind/proc/remove_all_antag() //For the Lazy amongst us. remove_changeling() remove_traitor() diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm index 4f876b97e1..6c4542bfd1 100644 --- a/code/game/machinery/autolathe.dm +++ b/code/game/machinery/autolathe.dm @@ -210,7 +210,7 @@ if(materials.materials[i] > 0) list_to_show += i - used_material = tgui_input_list(usr, "Choose [used_material]", "Custom Material", sortList(list_to_show, /proc/cmp_typepaths_asc)) + used_material = tgui_input_list(usr, "Choose [used_material]", "Custom Material", sort_list(list_to_show, /proc/cmp_typepaths_asc)) if(isnull(used_material)) return //Didn't pick any material, so you can't build shit either. custom_materials[used_material] += amount_needed diff --git a/code/game/machinery/camera/tracking.dm b/code/game/machinery/camera/tracking.dm index bf1b84fe5d..157ccfe01f 100644 --- a/code/game/machinery/camera/tracking.dm +++ b/code/game/machinery/camera/tracking.dm @@ -53,7 +53,7 @@ else track.others[name] = L - var/list/targets = sortList(track.humans) + sortList(track.others) + var/list/targets = sort_list(track.humans) + sort_list(track.others) return targets diff --git a/code/game/machinery/computer/atmos_control.dm b/code/game/machinery/computer/atmos_control.dm index 7eb6c79eef..c8add9e690 100644 --- a/code/game/machinery/computer/atmos_control.dm +++ b/code/game/machinery/computer/atmos_control.dm @@ -251,7 +251,7 @@ GLOBAL_LIST_EMPTY(atmos_air_controllers) IO |= text[1] if(!IO.len) to_chat(user, "No machinery detected.") - var/S = input("Select the device set: ", "Selection", IO[1]) as anything in sortList(IO) + var/S = input("Select the device set: ", "Selection", IO[1]) as anything in sort_list(IO) if(src) src.input_tag = "[S]_in" src.output_tag = "[S]_out" diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index d9d6f65e93..c3ec2dff21 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -1276,7 +1276,7 @@ return // reads from the airlock painter's `available paintjob` list. lets the player choose a paint option, or cancel painting - var/current_paintjob = tgui_input_list(user, "Paintjob for this airlock", "Customize", sortList(painter.available_paint_jobs)) + var/current_paintjob = tgui_input_list(user, "Paintjob for this airlock", "Customize", sort_list(painter.available_paint_jobs)) if(isnull(current_paintjob)) // if the user clicked cancel on the popup, return return diff --git a/code/game/machinery/telecomms/computers/logbrowser.dm b/code/game/machinery/telecomms/computers/logbrowser.dm index c39c4667a6..e40b3d00be 100644 --- a/code/game/machinery/telecomms/computers/logbrowser.dm +++ b/code/game/machinery/telecomms/computers/logbrowser.dm @@ -36,7 +36,7 @@ ref = REF(T) ) data_out["servers"] += list(data) - data_out["servers"] = sortList(data_out["servers"]) //a-z sort + data_out["servers"] = sort_list(data_out["servers"]) //a-z sort if(!SelectedMachine) //null is bad. data_out["selected"] = null //but in js, null is good. diff --git a/code/game/machinery/telecomms/computers/message.dm b/code/game/machinery/telecomms/computers/message.dm index b4f4b495f8..f3726c4245 100644 --- a/code/game/machinery/telecomms/computers/message.dm +++ b/code/game/machinery/telecomms/computers/message.dm @@ -107,7 +107,7 @@ ref = REF(T) ) data_out["servers"] += list(data) // This /might/ cause an oom. Too bad! - data_out["servers"] = sortList(data_out["servers"]) //a-z sort + data_out["servers"] = sort_list(data_out["servers"]) //a-z sort data_out["fake_message"] = list( sender = customsender, diff --git a/code/game/machinery/telecomms/computers/telemonitor.dm b/code/game/machinery/telecomms/computers/telemonitor.dm index b711b9fa40..b181e91667 100644 --- a/code/game/machinery/telecomms/computers/telemonitor.dm +++ b/code/game/machinery/telecomms/computers/telemonitor.dm @@ -37,12 +37,12 @@ ref = REF(T) ) data_out["servers"] += list(data) - data_out["servers"] = sortList(data_out["servers"]) + data_out["servers"] = sort_list(data_out["servers"]) if(!SelectedMachine) //null is bad. data_out["selected"] = null //but in js, null is good. return data_out - + data_out["selected"] = list( name = SelectedMachine.name, id = SelectedMachine.id, @@ -90,7 +90,7 @@ if(LAZYLEN(machinelist) > 0) notice = "FAILED: Cannot probe when buffer full" return - + for(var/obj/machinery/telecomms/T in GLOB.telecomms_list) if(T.network == network) LAZYADD(machinelist, T) diff --git a/code/game/objects/effects/landmarks.dm b/code/game/objects/effects/landmarks.dm index 22a9e86bb0..5e533888f9 100644 --- a/code/game/objects/effects/landmarks.dm +++ b/code/game/objects/effects/landmarks.dm @@ -205,7 +205,7 @@ INITIALIZE_IMMEDIATE(/obj/effect/landmark) /obj/effect/landmark/start/ai/after_round_start() if(latejoin_active && !used) - new /obj/structure/AIcore/latejoin_inactive(loc) + new /obj/structure/ai_core/latejoin_inactive(loc) return ..() /obj/effect/landmark/start/ai/secondary diff --git a/code/game/objects/items/cardboard_cutouts.dm b/code/game/objects/items/cardboard_cutouts.dm index 00fde9f9f5..f4fe339c7b 100644 --- a/code/game/objects/items/cardboard_cutouts.dm +++ b/code/game/objects/items/cardboard_cutouts.dm @@ -19,7 +19,7 @@ . = ..() if(possible_appearances) return - possible_appearances = sortList(list( + possible_appearances = sort_list(list( "Assistant" = image(icon = src.icon, icon_state = "cutout_greytide"), "Clown" = image(icon = src.icon, icon_state = "cutout_clown"), "Mime" = image(icon = src.icon, icon_state = "cutout_mime"), diff --git a/code/game/objects/items/circuitboards/machine_circuitboards.dm b/code/game/objects/items/circuitboards/machine_circuitboards.dm index 078839bcd1..c901e82b8d 100644 --- a/code/game/objects/items/circuitboards/machine_circuitboards.dm +++ b/code/game/objects/items/circuitboards/machine_circuitboards.dm @@ -654,7 +654,7 @@ display_vending_names_paths = list() for(var/path in vending_names_paths) display_vending_names_paths[vending_names_paths[path]] = path - var/choice = input(user,"Choose a new brand","Select an Item") as null|anything in sortList(display_vending_names_paths) + var/choice = input(user,"Choose a new brand","Select an Item") as null|anything in sort_list(display_vending_names_paths) set_type(display_vending_names_paths[choice]) else return ..() diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index 30877750f6..bd8a57c850 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -1180,7 +1180,7 @@ GLOBAL_LIST_EMPTY(PDAs) plist[avoid_assoc_duplicate_keys(P.owner, namecounts)] = P - var/c = input(user, "Please select a PDA") as null|anything in sortList(plist) + var/c = input(user, "Please select a PDA") as null|anything in sort_list(plist) if (!c) return @@ -1268,7 +1268,7 @@ GLOBAL_LIST_EMPTY(PDAs) plist[avoid_assoc_duplicate_keys(P.owner, namecounts)] = P - var/c = input(user, "Please select a PDA") as null|anything in sortList(plist) + var/c = input(user, "Please select a PDA") as null|anything in sort_list(plist) if (!c) return diff --git a/code/game/objects/items/devices/PDA/cart.dm b/code/game/objects/items/devices/PDA/cart.dm index 34f8202898..be9244d245 100644 --- a/code/game/objects/items/devices/PDA/cart.dm +++ b/code/game/objects/items/devices/PDA/cart.dm @@ -600,7 +600,7 @@ Code: if(!emoji_table) var/datum/asset/spritesheet/sheet = get_asset_datum(/datum/asset/spritesheet/chat) var/list/collate = list("
") - for(var/emoji in sortList(icon_states(icon('icons/emoji.dmi')))) + for(var/emoji in sort_list(icon_states(icon('icons/emoji.dmi')))) var/tag = sheet.icon_tag("emoji-[emoji]") collate += "" collate += "
[emoji][tag]

" diff --git a/code/game/objects/items/devices/camera_bug.dm b/code/game/objects/items/devices/camera_bug.dm index da5bed07ce..cbe795ca76 100644 --- a/code/game/objects/items/devices/camera_bug.dm +++ b/code/game/objects/items/devices/camera_bug.dm @@ -82,7 +82,7 @@ continue if(length(list("ss13","mine", "rd", "labor", "toxins", "minisat")&camera.network)) bugged_cameras[camera.c_tag] = camera - return sortList(bugged_cameras) + return sort_list(bugged_cameras) /obj/item/camera_bug/proc/menu(list/cameras) diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 7d7e39c41f..35e35485f1 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -973,7 +973,7 @@ GENETICS SCANNER for(var/A in buffer) options += get_display_name(A) - var/answer = input(user, "Analyze Potential", "Sequence Analyzer") as null|anything in sortList(options) + var/answer = input(user, "Analyze Potential", "Sequence Analyzer") as null|anything in sort_list(options) if(answer && ready && user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) var/sequence for(var/A in buffer) //this physically hurts but i dont know what anything else short of an assoc list diff --git a/code/game/objects/items/holy_weapons.dm b/code/game/objects/items/holy_weapons.dm index 9fae1496fd..1bfe0f21ca 100644 --- a/code/game/objects/items/holy_weapons.dm +++ b/code/game/objects/items/holy_weapons.dm @@ -260,7 +260,7 @@ display_names[initial(rodtype.name)] = rodtype nullrod_icons += list(initial(rodtype.name) = image(icon = initial(rodtype.icon), icon_state = initial(rodtype.icon_state))) - nullrod_icons = sortList(nullrod_icons) + nullrod_icons = sort_list(nullrod_icons) var/choice = show_radial_menu(L, src , nullrod_icons, custom_check = CALLBACK(src, .proc/check_menu, L), radius = 42, require_near = TRUE) if(!choice || !check_menu(L)) diff --git a/code/game/objects/items/robot/ai_upgrades.dm b/code/game/objects/items/robot/ai_upgrades.dm index acfc1353b9..dc1eef53ad 100644 --- a/code/game/objects/items/robot/ai_upgrades.dm +++ b/code/game/objects/items/robot/ai_upgrades.dm @@ -25,7 +25,7 @@ AI.hack_software = TRUE log_game("[key_name(user)] has upgraded [key_name(AI)] with a [src].") message_admins("[ADMIN_LOOKUPFLW(user)] has upgraded [ADMIN_LOOKUPFLW(AI)] with a [src].") - to_chat(user, "You upgrade [AI]. [src] is consumed in the process.") + to_chat(user, span_notice("You install [src], upgrading [AI].")) qdel(src) @@ -46,7 +46,7 @@ AI.eyeobj.relay_speech = TRUE to_chat(AI, "[user] has upgraded you with surveillance software!") to_chat(AI, "Via a combination of hidden microphones and lip reading software, you are able to use your cameras to listen in on conversations.") - to_chat(user, "You upgrade [AI]. [src] is consumed in the process.") + to_chat(user, span_notice("You install [src], upgrading [AI].")) log_game("[key_name(user)] has upgraded [key_name(AI)] with a [src].") message_admins("[ADMIN_LOOKUPFLW(user)] has upgraded [ADMIN_LOOKUPFLW(AI)] with a [src].") qdel(src) diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index 43ed3b9213..b3c5cf4293 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -178,7 +178,7 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \ * Plasteel */ GLOBAL_LIST_INIT(plasteel_recipes, list ( \ - new/datum/stack_recipe("AI core", /obj/structure/AIcore, 4, time = 50, one_per_turf = TRUE), \ + new/datum/stack_recipe("AI core", /obj/structure/ai_core, 4, time = 50, one_per_turf = TRUE), \ new/datum/stack_recipe("bomb assembly", /obj/machinery/syndicatebomb/empty, 10, time = 50), \ new/datum/stack_recipe("plasteel keg", /obj/structure/custom_keg, 10, time = 50), \ new/datum/stack_recipe("micro powered fan assembly", /obj/machinery/fan_assembly, 5, time = 50, one_per_turf = TRUE, on_floor = TRUE), \ diff --git a/code/game/objects/items/storage/boxes.dm b/code/game/objects/items/storage/boxes.dm index a2ab0c2ff4..4465a4eb8b 100644 --- a/code/game/objects/items/storage/boxes.dm +++ b/code/game/objects/items/storage/boxes.dm @@ -886,7 +886,7 @@ /obj/item/storage/box/papersack/Initialize(mapload) . = ..() - papersack_designs = sortList(list( + papersack_designs = sort_list(list( "None" = image(icon = src.icon, icon_state = "paperbag_None"), "NanotrasenStandard" = image(icon = src.icon, icon_state = "paperbag_NanotrasenStandard"), "SyndiSnacks" = image(icon = src.icon, icon_state = "paperbag_SyndiSnacks"), diff --git a/code/game/objects/structures/ai_core.dm b/code/game/objects/structures/ai_core.dm index 85ee3f9f56..4accadfab4 100644 --- a/code/game/objects/structures/ai_core.dm +++ b/code/game/objects/structures/ai_core.dm @@ -1,4 +1,6 @@ -/obj/structure/AIcore +#define AI_CORE_BRAIN(X) X.braintype == "Android" ? "brain" : "MMI" + +/obj/structure/ai_core density = TRUE anchored = FALSE name = "\improper AI core" @@ -8,28 +10,76 @@ max_integrity = 500 var/state = 0 var/datum/ai_laws/laws - var/obj/item/circuitboard/circuit = null - var/obj/item/mmi/brain = null - var/can_deconstruct = TRUE + var/obj/item/circuitboard/aicore/circuit = null + var/obj/item/mmi/core_mmi -/obj/structure/AIcore/Initialize(mapload) +/obj/structure/ai_core/Initialize(mapload) . = ..() laws = new laws.set_laws_config() -/obj/structure/AIcore/Destroy() - if(circuit) - qdel(circuit) +/obj/structure/ai_core/examine(mob/user) + . = ..() + if(!anchored) + if(state != EMPTY_CORE) + . += span_notice("It has some bolts that could be tightened.") + else + . += span_notice("It has some bolts that could be tightened. The frame can be melted down.") + else + switch(state) + if(EMPTY_CORE) + . += span_notice("There is a slot for a circuit board, its bolts can be loosened.") + if(CIRCUIT_CORE) + . += span_notice("The circuit board can be screwed into place or pried out.") + if(SCREWED_CORE) + . += span_notice("The frame can be wired, the circuit board can be unfastened.") + if(CABLED_CORE) + if(!core_mmi) + . += span_notice("There are wires which could be hooked up to an MMI or positronic brain, or cut.") + else + var/accept_laws = TRUE + if(core_mmi.laws.id != DEFAULT_AI_LAWID || !core_mmi.brainmob || !core_mmi.brainmob?.mind) + accept_laws = FALSE + . += span_notice("There is a slot for a reinforced glass panel, the [AI_CORE_BRAIN(core_mmi)] could be pried out.[accept_laws ? " A law module can be swiped across." : ""]") + if(GLASS_CORE) + . += span_notice("The monitor [core_mmi?.brainmob?.mind && !core_mmi?.brainmob?.suiciding ? "and neural interface " : ""]can be screwed in, the panel can be pried out.") + if(AI_READY_CORE) + . += span_notice("The monitor's connection can be cut[core_mmi?.brainmob?.mind && !core_mmi?.brainmob?.suiciding ? " the neural interface can be screwed in." : "."]") + +/obj/structure/ai_core/handle_atom_del(atom/A) + if(A == circuit) circuit = null - if(brain) - qdel(brain) - brain = null + if((state != GLASS_CORE) && (state != AI_READY_CORE)) + state = EMPTY_CORE + update_appearance() + if(A == core_mmi) + core_mmi = null return ..() -/obj/structure/AIcore/latejoin_inactive - name = "Networked AI core" +/obj/structure/ai_core/Destroy() + QDEL_NULL(circuit) + QDEL_NULL(core_mmi) + QDEL_NULL(laws) + return ..() + +/obj/structure/ai_core/deactivated + icon_state = "ai-empty" + anchored = TRUE + state = AI_READY_CORE + +/obj/structure/ai_core/deactivated/Initialize(mapload, posibrain = FALSE) + . = ..() + circuit = new(src) + if(posibrain) + core_mmi = new/obj/item/mmi/posibrain(src) + else + core_mmi = new(src) + core_mmi.brain = new(core_mmi) + core_mmi.update_appearance() + +/obj/structure/ai_core/latejoin_inactive + name = "networked AI core" desc = "This AI core is connected by bluespace transmitters to NTNet, allowing for an AI personality to be downloaded to it on the fly mid-shift." - can_deconstruct = FALSE icon_state = "ai-empty" anchored = TRUE state = AI_READY_CORE @@ -37,11 +87,24 @@ var/safety_checks = TRUE var/active = TRUE -/obj/structure/AIcore/latejoin_inactive/examine(mob/user) +/obj/structure/ai_core/latejoin_inactive/Initialize(mapload) . = ..() - . += "Its transmitter seems to be [active? "on" : "off"]." + circuit = new(src) + core_mmi = new(src) + core_mmi.brain = new(core_mmi) + core_mmi.update_appearance() + GLOB.latejoin_ai_cores += src -/obj/structure/AIcore/latejoin_inactive/proc/is_available() //If people still manage to use this feature to spawn-kill AI latejoins ahelp them. +/obj/structure/ai_core/latejoin_inactive/Destroy() + GLOB.latejoin_ai_cores -= src + return ..() + +/obj/structure/ai_core/latejoin_inactive/examine(mob/user) + . = ..() + . += "Its transmitter seems to be [active? "on" : "off"]." + . += span_notice("You could [active? "deactivate" : "activate"] it with a multitool.") + +/obj/structure/ai_core/latejoin_inactive/proc/is_available() //If people still manage to use this feature to spawn-kill AI latejoins ahelp them. if(!available) return FALSE if(!safety_checks) @@ -56,42 +119,61 @@ return FALSE if(!SSmapping.level_trait(T.z,ZTRAIT_STATION)) return FALSE - if(!istype(T, /turf/open/floor)) + if(!isfloorturf(T)) return FALSE return TRUE -/obj/structure/AIcore/latejoin_inactive/attackby(obj/item/P, mob/user, params) +/obj/structure/ai_core/latejoin_inactive/attackby(obj/item/P, mob/user, params) if(P.tool_behaviour == TOOL_MULTITOOL) active = !active to_chat(user, "You [active? "activate" : "deactivate"] [src]'s transmitters.") return return ..() -/obj/structure/AIcore/latejoin_inactive/Initialize(mapload) +/obj/structure/ai_core/wrench_act(mob/living/user, obj/item/tool) . = ..() - GLOB.latejoin_ai_cores += src + default_unfasten_wrench(user, tool) + return TRUE -/obj/structure/AIcore/latejoin_inactive/Destroy() - GLOB.latejoin_ai_cores -= src - return ..() +/obj/structure/ai_core/screwdriver_act(mob/living/user, obj/item/tool) + . = ..() + if(state == AI_READY_CORE) + if(!core_mmi) + balloon_alert(user, "no brain installed!") + return TRUE + else if(!core_mmi.brainmob?.mind || core_mmi.brainmob?.suiciding) + balloon_alert(user, "brain is inactive!") + return TRUE + else + balloon_alert(user, "connecting neural network...") + if(!tool.use_tool(src, user, 10 SECONDS)) + return TRUE + if(!ai_structure_to_mob()) + return TRUE + balloon_alert(user, "connected neural network") + return TRUE -/obj/structure/AIcore/attackby(obj/item/P, mob/user, params) - if(P.tool_behaviour == TOOL_WRENCH) - return default_unfasten_wrench(user, P, 20) +/obj/structure/ai_core/attackby(obj/item/P, mob/user, params) if(!anchored) - if(P.tool_behaviour == TOOL_WELDER && can_deconstruct) + if(P.tool_behaviour == TOOL_WELDER) if(state != EMPTY_CORE) - to_chat(user, "The core must be empty to deconstruct it!") + balloon_alert(user, "core must be empty to deconstruct it!") return if(!P.tool_start_check(user, amount=0)) return - to_chat(user, "You start to deconstruct the frame...") + balloon_alert(user, "deconstructing frame...") if(P.use_tool(src, user, 20, volume=50) && state == EMPTY_CORE) - to_chat(user, "You deconstruct the frame.") + balloon_alert(user, "deconstructed frame") deconstruct(TRUE) return + else + if(user.a_intent != INTENT_HARM) + balloon_alert(user, "bolt it down first!") + return + else + return ..() else switch(state) if(EMPTY_CORE) @@ -99,7 +181,7 @@ if(!user.transferItemToLoc(P, src)) return playsound(loc, 'sound/items/deconstruct.ogg', 50, 1) - to_chat(user, "You place the circuit board inside the frame.") + balloon_alert(user, "circuit board inserted") update_icon() state = CIRCUIT_CORE circuit = P @@ -107,13 +189,13 @@ if(CIRCUIT_CORE) if(P.tool_behaviour == TOOL_SCREWDRIVER) P.play_tool_sound(src) - to_chat(user, "You screw the circuit board into place.") + balloon_alert(user, "board screwed into place") state = SCREWED_CORE update_icon() return if(P.tool_behaviour == TOOL_CROWBAR) P.play_tool_sound(src) - to_chat(user, "You remove the circuit board.") + balloon_alert(user, "circuit board removed") state = EMPTY_CORE update_icon() circuit.forceMove(loc) @@ -122,7 +204,7 @@ if(SCREWED_CORE) if(P.tool_behaviour == TOOL_SCREWDRIVER && circuit) P.play_tool_sound(src) - to_chat(user, "You unfasten the circuit board.") + balloon_alert(user, "circuit board unfastened") state = CIRCUIT_CORE update_icon() return @@ -130,61 +212,73 @@ var/obj/item/stack/cable_coil/C = P if(C.get_amount() >= 5) playsound(loc, 'sound/items/deconstruct.ogg', 50, 1) - to_chat(user, "You start to add cables to the frame...") - if(do_after(user, 20, target = src) && state == SCREWED_CORE && C.use_tool(src, user, 0, 5)) - to_chat(user, "You add cables to the frame.") + balloon_alert(user, "adding cables to frame...") + if(do_after(user, 20, target = src) && state == SCREWED_CORE && C.use(5)) + balloon_alert(user, "added cables to frame.") state = CABLED_CORE update_icon() else - to_chat(user, "You need five lengths of cable to wire the AI core!") + balloon_alert(user, "need five lengths of cable!") return if(CABLED_CORE) if(P.tool_behaviour == TOOL_WIRECUTTER) - if(brain) - to_chat(user, "Get that [brain.name] out of there first!") + if(core_mmi) + balloon_alert(user, "remove the [AI_CORE_BRAIN(core_mmi)] first!") else P.play_tool_sound(src) - to_chat(user, "You remove the cables.") + balloon_alert(user, "cables removed") state = SCREWED_CORE update_icon() new /obj/item/stack/cable_coil(drop_location(), 5) return if(istype(P, /obj/item/stack/sheet/rglass)) + if(!core_mmi) + balloon_alert(user, "add a brain first!") + return var/obj/item/stack/sheet/rglass/G = P if(G.get_amount() >= 2) playsound(loc, 'sound/items/deconstruct.ogg', 50, 1) - to_chat(user, "You start to put in the glass panel...") + balloon_alert(user, "adding glass panel...") if(do_after(user, 20, target = src) && state == CABLED_CORE && G.use(2)) - to_chat(user, "You put in the glass panel.") + balloon_alert(user, "added glass panel") state = GLASS_CORE update_icon() else - to_chat(user, "You need two sheets of reinforced glass to insert them into the AI core!") + balloon_alert(user, "need two sheets of reinforced glass!") return if(istype(P, /obj/item/aiModule)) - if(brain && brain.laws.id != DEFAULT_AI_LAWID) - to_chat(user, "The installed [brain.name] already has set laws!") + if(!core_mmi) + balloon_alert(user, "no brain installed!") + return + if(!core_mmi.brainmob || !core_mmi.brainmob?.mind || core_mmi.brainmob?.suiciding) + balloon_alert(user, "[AI_CORE_BRAIN(core_mmi)] is inactive!") + return + if(core_mmi.laws.id != DEFAULT_AI_LAWID) + balloon_alert(user, "[AI_CORE_BRAIN(core_mmi)] already has set laws!") return var/obj/item/aiModule/module = P module.install(laws, user) return - if(istype(P, /obj/item/mmi) && !brain) + if(istype(P, /obj/item/mmi) && !core_mmi) var/obj/item/mmi/M = P - if(!M.brainmob) - to_chat(user, "Sticking an empty [M.name] into the frame would sort of defeat the purpose!") - return - if(M.brainmob.stat == DEAD) - to_chat(user, "Sticking a dead [M.name] into the frame would sort of defeat the purpose!") - return + if(!M.brain_check(user)) + var/install = tgui_alert(user, "This [AI_CORE_BRAIN(M)] is inactive, would you like to make an inactive AI?", "Installing AI [AI_CORE_BRAIN(M)]", list("Yes", "No")) + if(install != "Yes") + return + if(M.brainmob?.suiciding) + to_chat(user, span_warning("[M.name] is completely useless!")) + return + if(!user.transferItemToLoc(M, src)) + return + core_mmi = M + balloon_alert(user, "added [AI_CORE_BRAIN(core_mmi)] to frame") + update_appearance() - if(!M.brainmob.client) - to_chat(user, "Sticking an inactive [M.name] into the frame would sort of defeat the purpose.") - return - - if(!CONFIG_GET(flag/allow_ai) || (jobban_isbanned(M.brainmob, "AI") && !QDELETED(src) && !QDELETED(user) && !QDELETED(M) && !QDELETED(user) && Adjacent(user))) + var/mob/living/brain/B = M.brainmob + if(!CONFIG_GET(flag/allow_ai) || (jobban_isbanned(B, "AI") && !QDELETED(src) && !QDELETED(user) && !QDELETED(M) && !QDELETED(user) && Adjacent(user))) if(!QDELETED(M)) to_chat(user, "This [M.name] does not seem to fit!") return @@ -196,47 +290,36 @@ if(!user.transferItemToLoc(M,src)) return - brain = M - to_chat(user, "You add [M.name] to the frame.") + core_mmi = M + balloon_alert(user, "added [AI_CORE_BRAIN(core_mmi)] to frame") update_icon() return - if(P.tool_behaviour == TOOL_CROWBAR && brain) + if(P.tool_behaviour == TOOL_CROWBAR && core_mmi) P.play_tool_sound(src) - to_chat(user, "You remove the brain.") - brain.forceMove(loc) - brain = null + balloon_alert(user, "removed [AI_CORE_BRAIN(core_mmi)]") + core_mmi.forceMove(loc) + core_mmi = null update_icon() return if(GLASS_CORE) if(P.tool_behaviour == TOOL_CROWBAR) P.play_tool_sound(src) - to_chat(user, "You remove the glass panel.") + balloon_alert(user, "removed glass panel") state = CABLED_CORE update_icon() new /obj/item/stack/sheet/rglass(loc, 2) return if(P.tool_behaviour == TOOL_SCREWDRIVER) + if(core_mmi?.brainmob?.suiciding) + to_chat(user, span_warning("The brain installed is completely useless.")) + return P.play_tool_sound(src) - to_chat(user, "You connect the monitor.") - if(brain) - SSticker.mode.remove_antag_for_borging(brain.brainmob.mind) - if(!istype(brain.laws, /datum/ai_laws/ratvar)) - remove_servant_of_ratvar(brain.brainmob, TRUE) - - var/mob/living/silicon/ai/A = null - - if (brain.overrides_aicore_laws) - A = new /mob/living/silicon/ai(loc, brain.laws, brain.brainmob) - else - A = new /mob/living/silicon/ai(loc, laws, brain.brainmob) - - if(brain.force_replace_ai_name) - A.fully_replace_character_name(A.name, brain.replacement_ai_name()) - SSblackbox.record_feedback("amount", "ais_created", 1) - qdel(src) + balloon_alert(user, "connected monitor[core_mmi?.brainmob?.mind ? " and neural network" : ""]") + if(core_mmi.brainmob?.mind) + ai_structure_to_mob() else state = AI_READY_CORE update_icon() @@ -247,15 +330,39 @@ P.transfer_ai("INACTIVE", "AICARD", src, user) return - if(P.tool_behaviour == TOOL_SCREWDRIVER) + if(P.tool_behaviour == TOOL_WIRECUTTER) P.play_tool_sound(src) - to_chat(user, "You disconnect the monitor.") + balloon_alert(user, "disconnected monitor") state = GLASS_CORE update_icon() return return ..() -/obj/structure/AIcore/update_icon_state() +/obj/structure/ai_core/proc/ai_structure_to_mob() + var/mob/living/brain/the_brainmob = core_mmi.brainmob + if(!the_brainmob.mind || the_brainmob.suiciding) + return FALSE + the_brainmob.mind.remove_antags_for_borging() + if(!the_brainmob.mind.has_ever_been_ai) + SSblackbox.record_feedback("amount", "ais_created", 1) + var/mob/living/silicon/ai/ai_mob = null + + if(core_mmi.overrides_aicore_laws) + ai_mob = new /mob/living/silicon/ai(loc, core_mmi.laws, the_brainmob) + core_mmi.laws = null //MMI's law datum is being donated, so we need the MMI to let it go or the GC will eat it + else + ai_mob = new /mob/living/silicon/ai(loc, laws, the_brainmob) + laws = null //we're giving the new AI this datum, so let's not delete it when we qdel(src) 5 lines from now + + if(core_mmi.force_replace_ai_name) + ai_mob.fully_replace_character_name(ai_mob.name, core_mmi.replacement_ai_name()) + if(core_mmi.braintype == "Android") + ai_mob.posibrain_inside = TRUE + deadchat_broadcast(" has been brought online at [get_area_name(ai_mob, format_text = TRUE)].", span_name("[ai_mob]"), follow_target = ai_mob, message_type = DEADCHAT_ANNOUNCEMENT) + qdel(src) + return TRUE + +/obj/structure/ai_core/update_icon_state() switch(state) if(EMPTY_CORE) icon_state = "0" @@ -264,7 +371,7 @@ if(SCREWED_CORE) icon_state = "2" if(CABLED_CORE) - if(brain) + if(core_mmi) icon_state = "3b" else icon_state = "3" @@ -273,8 +380,8 @@ if(AI_READY_CORE) icon_state = "ai-empty" -/obj/structure/AIcore/deconstruct(disassembled = TRUE) - if(state == GLASS_CORE) +/obj/structure/ai_core/deconstruct(disassembled = TRUE) + if(state >= GLASS_CORE) new /obj/item/stack/sheet/rglass(loc, 2) if(state >= CABLED_CORE) new /obj/item/stack/cable_coil(loc, 5) @@ -284,13 +391,13 @@ new /obj/item/stack/sheet/plasteel(loc, 4) qdel(src) -/obj/structure/AIcore/deactivated +/obj/structure/ai_core/deactivated name = "inactive AI" icon_state = "ai-empty" anchored = TRUE state = AI_READY_CORE -/obj/structure/AIcore/deactivated/New() +/obj/structure/ai_core/deactivated/New() ..() circuit = new(src) @@ -310,20 +417,35 @@ That prevents a few funky behaviors. return 0 return 1 -/obj/structure/AIcore/transfer_ai(interaction, mob/user, mob/living/silicon/ai/AI, obj/item/aicard/card) +/obj/structure/ai_core/transfer_ai(interaction, mob/user, mob/living/silicon/ai/AI, obj/item/aicard/card) if(state != AI_READY_CORE || !..()) return - //Transferring a carded AI to a core. + if(core_mmi && core_mmi.brainmob) + if(core_mmi.brainmob.mind) + to_chat(user, span_warning("[src] already contains an active mind!")) + return + else if(core_mmi.brainmob.suiciding) + to_chat(user, span_warning("[AI_CORE_BRAIN(core_mmi)] installed in [src] is completely useless!")) + return + //Transferring a carded AI to a core. if(interaction == AI_TRANS_FROM_CARD) - AI.control_disabled = 0 - AI.radio_enabled = 1 + AI.control_disabled = FALSE + AI.radio_enabled = TRUE AI.forceMove(loc) // to replace the terminal. - to_chat(AI, "You have been uploaded to a stationary terminal. Remote device connection restored.") - to_chat(user, "Transfer successful: [AI.name] ([rand(1000,9999)].exe) installed and executed successfully. Local copy has been removed.") + to_chat(AI, span_notice("You have been uploaded to a stationary terminal. Remote device connection restored.")) + to_chat(user, "[span_boldnotice("Transfer successful")]: [AI.name] ([rand(1000,9999)].exe) installed and executed successfully. Local copy has been removed.") card.AI = null + AI.battery = circuit.battery + if(core_mmi.braintype == "Android") + AI.posibrain_inside = TRUE + else + AI.posibrain_inside = FALSE qdel(src) else //If for some reason you use an empty card on an empty AI terminal. - to_chat(user, "There is no AI loaded on this terminal!") + to_chat(user, span_alert("There is no AI loaded on this terminal.")) /obj/item/circuitboard/aicore name = "AI core (AI Core Board)" //Well, duh, but best to be consistent + var/battery = 200 //backup battery for when the AI loses power. Copied to/from AI mobs when carding, and placed here to avoid recharge via deconning the core + +#undef AI_CORE_BRAIN diff --git a/code/game/objects/structures/janicart.dm b/code/game/objects/structures/janicart.dm index e49de85cf9..5075ecd074 100644 --- a/code/game/objects/structures/janicart.dm +++ b/code/game/objects/structures/janicart.dm @@ -110,7 +110,7 @@ if(!length(items)) return - items = sortList(items) + items = sort_list(items) var/pick = show_radial_menu(user, src, items, custom_check = CALLBACK(src, .proc/check_menu, user), radius = 38, require_near = TRUE) if(!pick) return diff --git a/code/modules/admin/admin_investigate.dm b/code/modules/admin/admin_investigate.dm index 52be445120..9343e716ef 100644 --- a/code/modules/admin/admin_investigate.dm +++ b/code/modules/admin/admin_investigate.dm @@ -22,7 +22,7 @@ else logs_missing += "[subject] (empty)" - var/list/combined = sortList(logs_present) + sortList(logs_missing) + var/list/combined = sort_list(logs_present) + sort_list(logs_missing) var/selected = input("Investigate what?", "Investigate") as null|anything in combined diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 47be7353fe..27e08aec58 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -694,7 +694,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) // if(!SStrading_card_game.loaded) // message_admins("The card subsystem is not currently loaded") // return -// var/pack = input("Which pack should we test?", "You fucked it didn't you") as null|anything in sortList(SStrading_card_game.card_packs) +// var/pack = input("Which pack should we test?", "You fucked it didn't you") as null|anything in sort_list(SStrading_card_game.card_packs) // var/batchCount = input("How many times should we open it?", "Don't worry, I understand") as null|num // var/batchSize = input("How many cards per batch?", "I hope you remember to check the validation") as null|num // var/guar = input("Should we use the pack's guaranteed rarity? If so, how many?", "We've all been there. Man you should have seen the old system") as null|num @@ -714,7 +714,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) var/type_length = length_char("/obj/effect/proc_holder/spell") + 2 for(var/A in GLOB.spells) spell_list[copytext_char("[A]", type_length)] = A - var/obj/effect/proc_holder/spell/S = input("Choose the spell to give to that guy", "ABRAKADABRA") as null|anything in sortList(spell_list) + var/obj/effect/proc_holder/spell/S = input("Choose the spell to give to that guy", "ABRAKADABRA") as null|anything in sort_list(spell_list) if(!S) return @@ -735,7 +735,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) set desc = "Remove a spell from the selected mob." if(T?.mind) - var/obj/effect/proc_holder/spell/S = input("Choose the spell to remove", "NO ABRAKADABRA") as null|anything in sortList(T.mind.spell_list) + var/obj/effect/proc_holder/spell/S = input("Choose the spell to remove", "NO ABRAKADABRA") as null|anything in sort_list(T.mind.spell_list) if(S) T.mind.RemoveSpell(S) log_admin("[key_name(usr)] removed the spell [S] from [key_name(T)].") @@ -749,7 +749,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) if(!istype(T)) to_chat(src, "You can only give a disease to a mob of type /mob/living.", confidential = TRUE) return - var/datum/disease/D = input("Choose the disease to give to that guy", "ACHOO") as null|anything in sortList(SSdisease.diseases, /proc/cmp_typepaths_asc) + var/datum/disease/D = input("Choose the disease to give to that guy", "ACHOO") as null|anything in sort_list(SSdisease.diseases, /proc/cmp_typepaths_asc) if(!D) return T.ForceContractDisease(new D, FALSE, TRUE) diff --git a/code/modules/admin/playtimes.dm b/code/modules/admin/playtimes.dm index 7cf24d9746..ac9a0db79b 100644 --- a/code/modules/admin/playtimes.dm +++ b/code/modules/admin/playtimes.dm @@ -32,7 +32,7 @@ clients += list(client) - clients = sortList(clients, /proc/cmp_playtime) + clients = sort_list(clients, /proc/cmp_playtime) data["clients"] = clients return data diff --git a/code/modules/admin/stickyban.dm b/code/modules/admin/stickyban.dm index 57487f3144..c5c7a278d2 100644 --- a/code/modules/admin/stickyban.dm +++ b/code/modules/admin/stickyban.dm @@ -403,7 +403,7 @@ if (SSstickyban.dbcacheexpire) return SSstickyban.dbcache.Copy() - return sortList(world.GetConfig("ban")) + return sort_list(world.GetConfig("ban")) /proc/get_stickyban_from_ckey(ckey) diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index c6b2437da4..34afce6aa2 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1351,7 +1351,7 @@ for (var/rule in subtypesof(/datum/dynamic_ruleset/roundstart)) var/datum/dynamic_ruleset/roundstart/newrule = new rule() roundstart_rules[newrule.name] = newrule - var/added_rule = input(usr,"What ruleset do you want to force? This will bypass threat level and population restrictions.", "Rigging Roundstart", null) as null|anything in sortList(roundstart_rules) + var/added_rule = input(usr,"What ruleset do you want to force? This will bypass threat level and population restrictions.", "Rigging Roundstart", null) as null|anything in sort_list(roundstart_rules) if (added_rule) GLOB.dynamic_forced_roundstart_ruleset += roundstart_rules[added_rule] log_admin("[key_name(usr)] set [added_rule] to be a forced roundstart ruleset.") diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm index 3a708ef182..09219e05ee 100644 --- a/code/modules/admin/verbs/adminpm.dm +++ b/code/modules/admin/verbs/adminpm.dm @@ -30,7 +30,7 @@ targets["[T.mob.real_name](as [T.mob.name]) - [T]"] = T else targets["(No Mob) - [T]"] = T - var/target = input(src,"To whom shall we send a message?","Admin PM",null) as null|anything in sortList(targets) + var/target = input(src,"To whom shall we send a message?","Admin PM",null) as null|anything in sort_list(targets) cmd_admin_pm(targets[target],null) SSblackbox.record_feedback("tally", "admin_verb", 1, "Admin PM") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 7957a6d638..199ac646d9 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -238,7 +238,7 @@ if(M.ckey) if(alert("This mob is being controlled by [M.key]. Are you sure you wish to give someone else control of it? [M.key] will be made a ghost.",,"Yes","No") != "Yes") return - var/client/newkey = input(src, "Pick the player to put in control.", "New player") as null|anything in sortList(GLOB.clients) + var/client/newkey = input(src, "Pick the player to put in control.", "New player") as null|anything in sort_list(GLOB.clients) var/mob/oldmob = newkey.mob var/delmob = FALSE if((isobserver(oldmob) || alert("Do you want to delete [newkey]'s old mob?","Delete?","Yes","No") != "No")) @@ -494,7 +494,7 @@ var/datum/outfit/O = path //not much to initalize here but whatever outfits[initial(O.name)] = path - var/dresscode = input("Select outfit", "Robust quick dress shop") as null|anything in baseoutfits + sortList(outfits) + var/dresscode = input("Select outfit", "Robust quick dress shop") as null|anything in baseoutfits + sort_list(outfits) if (isnull(dresscode)) return @@ -508,7 +508,7 @@ var/datum/outfit/O = path job_outfits[initial(O.name)] = path - dresscode = input("Select job equipment", "Robust quick dress shop") as null|anything in sortList(job_outfits) + dresscode = input("Select job equipment", "Robust quick dress shop") as null|anything in sort_list(job_outfits) dresscode = job_outfits[dresscode] if(isnull(dresscode)) return @@ -520,7 +520,7 @@ var/datum/outfit/O = path plasmaman_outfits[initial(O.name)] = path - dresscode = input("Select plasmeme equipment", "Robust quick dress shop") as null|anything in sortList(plasmaman_outfits) + dresscode = input("Select plasmeme equipment", "Robust quick dress shop") as null|anything in sort_list(plasmaman_outfits) dresscode = plasmaman_outfits[dresscode] if(isnull(dresscode)) return @@ -529,7 +529,7 @@ var/list/custom_names = list() for(var/datum/outfit/D in GLOB.custom_outfits) custom_names[D.name] = D - var/selected_name = input("Select outfit", "Robust quick dress shop") as null|anything in sortList(custom_names) + var/selected_name = input("Select outfit", "Robust quick dress shop") as null|anything in sort_list(custom_names) dresscode = custom_names[selected_name] if(isnull(dresscode)) return @@ -828,15 +828,15 @@ set name = "Show Line Profiling" set desc = "Shows tracked profiling info from code lines that support it" - var/sortlist = list( + var/sort_list = list( "Avg time" = /proc/cmp_profile_avg_time_dsc, "Total Time" = /proc/cmp_profile_time_dsc, "Call Count" = /proc/cmp_profile_count_dsc ) - var/sort = input(src, "Sort type?", "Sort Type", "Avg time") as null|anything in sortlist + var/sort = input(src, "Sort type?", "Sort Type", "Avg time") as null|anything in sort_list if (!sort) return - sort = sortlist[sort] + sort = sort_list[sort] profile_show(src, sort) /client/proc/reload_configuration() diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 596d235b0a..2d7f1e8e9f 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -1672,7 +1672,7 @@ Traitors and the like can also be revived with the previous role mostly intact. var/name = GLOB.trait_name_map[trait] || trait availible_traits[name] = trait - var/chosen_trait = input("Select trait to modify", "Trait") as null|anything in sortList(availible_traits) + var/chosen_trait = input("Select trait to modify", "Trait") as null|anything in sort_list(availible_traits) if(!chosen_trait) return chosen_trait = availible_traits[chosen_trait] @@ -1689,7 +1689,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if("All") source = null if("Specific") - source = input("Source to be removed","Trait Remove/Add") as null|anything in sortList(D.status_traits[chosen_trait]) + source = input("Source to be removed","Trait Remove/Add") as null|anything in sort_list(D.status_traits[chosen_trait]) if(!source) return REMOVE_TRAIT(D,chosen_trait,source) diff --git a/code/modules/admin/verbs/secrets.dm b/code/modules/admin/verbs/secrets.dm index e3c084b161..24e286310d 100644 --- a/code/modules/admin/verbs/secrets.dm +++ b/code/modules/admin/verbs/secrets.dm @@ -246,7 +246,7 @@ var/datum/round_event_control/disease_outbreak/DC = locate(/datum/round_event_control/disease_outbreak) in SSevents.control E = DC.runEvent() if("Choose") - var/virus = input("Choose the virus to spread", "BIOHAZARD") as null|anything in sortList(typesof(/datum/disease), /proc/cmp_typepaths_asc) + var/virus = input("Choose the virus to spread", "BIOHAZARD") as null|anything in sort_list(typesof(/datum/disease), /proc/cmp_typepaths_asc) var/datum/round_event_control/disease_outbreak/DC = locate(/datum/round_event_control/disease_outbreak) in SSevents.control var/datum/round_event/disease_outbreak/DO = DC.runEvent() DO.virus_type = virus diff --git a/code/modules/admin/view_variables/mass_edit_variables.dm b/code/modules/admin/view_variables/mass_edit_variables.dm index 5b120b6cef..ba9a4d278c 100644 --- a/code/modules/admin/view_variables/mass_edit_variables.dm +++ b/code/modules/admin/view_variables/mass_edit_variables.dm @@ -29,7 +29,7 @@ for (var/V in O.vars) names += V - names = sortList(names) + names = sort_list(names) variable = input("Which var?", "Var") as null|anything in names else diff --git a/code/modules/admin/view_variables/modify_variables.dm b/code/modules/admin/view_variables/modify_variables.dm index 54af2a9481..bfa8fb146c 100644 --- a/code/modules/admin/view_variables/modify_variables.dm +++ b/code/modules/admin/view_variables/modify_variables.dm @@ -306,7 +306,7 @@ GLOBAL_PROTECT(VVpixelmovement) for (var/V in O.vars) names += V - names = sortList(names) + names = sort_list(names) variable = input("Which var?","Var") as null|anything in names if(!variable) diff --git a/code/modules/admin/view_variables/topic_basic.dm b/code/modules/admin/view_variables/topic_basic.dm index 230c86dd2d..21c79eeda0 100644 --- a/code/modules/admin/view_variables/topic_basic.dm +++ b/code/modules/admin/view_variables/topic_basic.dm @@ -65,11 +65,11 @@ if(!check_rights(NONE)) return var/list/names = list() - var/list/componentsubtypes = sortList(subtypesof(/datum/component), /proc/cmp_typepaths_asc) + var/list/componentsubtypes = sort_list(subtypesof(/datum/component), /proc/cmp_typepaths_asc) names += "---Components---" names += componentsubtypes names += "---Elements---" - names += sortList(subtypesof(/datum/element), /proc/cmp_typepaths_asc) + names += sort_list(subtypesof(/datum/element), /proc/cmp_typepaths_asc) var/result = input(usr, "Choose a component/element to add","better know what ur fuckin doin pal") as null|anything in names if(!usr || !result || result == "---Components---" || result == "---Elements---") return diff --git a/code/modules/admin/view_variables/view_variables.dm b/code/modules/admin/view_variables/view_variables.dm index 6039e88d9d..a7faea2553 100644 --- a/code/modules/admin/view_variables/view_variables.dm +++ b/code/modules/admin/view_variables/view_variables.dm @@ -88,7 +88,7 @@ value = L[key] variable_html += debug_variable(i, value, 0, L) else - names = sortList(names) + names = sort_list(names) for(var/V in names) if(D.can_vv_get(V)) variable_html += D.vv_get_var(V) diff --git a/code/modules/antagonists/clockcult/clock_helpers/scripture_checks.dm b/code/modules/antagonists/clockcult/clock_helpers/scripture_checks.dm index 53e70e1404..360ddabe72 100644 --- a/code/modules/antagonists/clockcult/clock_helpers/scripture_checks.dm +++ b/code/modules/antagonists/clockcult/clock_helpers/scripture_checks.dm @@ -40,7 +40,7 @@ /proc/generate_all_scripture() if(GLOB.all_scripture.len) return - for(var/V in sortList(subtypesof(/datum/clockwork_scripture) - list(/datum/clockwork_scripture/channeled, /datum/clockwork_scripture/create_object, /datum/clockwork_scripture/create_object/construct), /proc/cmp_clockscripture_priority)) + for(var/V in sort_list(subtypesof(/datum/clockwork_scripture) - list(/datum/clockwork_scripture/channeled, /datum/clockwork_scripture/create_object, /datum/clockwork_scripture/create_object/construct), /proc/cmp_clockscripture_priority)) var/datum/clockwork_scripture/S = new V GLOB.all_scripture[S.type] = S diff --git a/code/modules/antagonists/eldritch_cult/eldritch_knowledge.dm b/code/modules/antagonists/eldritch_cult/eldritch_knowledge.dm index 33a17c3278..2ac9cedaaa 100644 --- a/code/modules/antagonists/eldritch_cult/eldritch_knowledge.dm +++ b/code/modules/antagonists/eldritch_cult/eldritch_knowledge.dm @@ -170,7 +170,7 @@ to_chat(user, "These items don't possess the required fingerprints or DNA.") return FALSE - var/chosen_mob = input("Select the person you wish to curse","Your target") as null|anything in sortList(compiled_list, /proc/cmp_mob_realname_dsc) + var/chosen_mob = input("Select the person you wish to curse","Your target") as null|anything in sort_list(compiled_list, /proc/cmp_mob_realname_dsc) if(!chosen_mob) return FALSE curse(compiled_list[chosen_mob]) diff --git a/code/modules/asset_cache/asset_list.dm b/code/modules/asset_cache/asset_list.dm index f88f57eacc..fc9b6527d2 100644 --- a/code/modules/asset_cache/asset_list.dm +++ b/code/modules/asset_cache/asset_list.dm @@ -331,7 +331,7 @@ GLOBAL_LIST_EMPTY(asset_datums) if (legacy) assets |= parents var/list/hashlist = list() - var/list/sorted_assets = sortList(assets) + var/list/sorted_assets = sort_list(assets) for (var/asset_name in sorted_assets) var/datum/asset_cache_item/ACI = new(asset_name, sorted_assets[asset_name]) diff --git a/code/modules/atmospherics/machinery/portable/canister.dm b/code/modules/atmospherics/machinery/portable/canister.dm index f7bdc173f3..bcd8d381fe 100644 --- a/code/modules/atmospherics/machinery/portable/canister.dm +++ b/code/modules/atmospherics/machinery/portable/canister.dm @@ -388,7 +388,7 @@ return switch(action) if("relabel") - var/label = input("New canister label:", name) as null|anything in sortList(label2types) + var/label = input("New canister label:", name) as null|anything in sort_list(label2types) if(label && !..()) var/newtype = label2types[label] if(newtype) diff --git a/code/modules/cargo/centcom_podlauncher.dm b/code/modules/cargo/centcom_podlauncher.dm index 37f39793af..e16f7d759f 100644 --- a/code/modules/cargo/centcom_podlauncher.dm +++ b/code/modules/cargo/centcom_podlauncher.dm @@ -344,7 +344,7 @@ if (temp_pod.effectShrapnel == TRUE) //If already doing custom damage, set back to default (no shrapnel) temp_pod.effectShrapnel = FALSE return - var/shrapnelInput = input("Please enter the type of pellet cloud you'd like to create on landing (Can be any projectile!)", "Projectile Typepath", 0) in sortList(subtypesof(/obj/item/projectile), /proc/cmp_typepaths_asc) + var/shrapnelInput = input("Please enter the type of pellet cloud you'd like to create on landing (Can be any projectile!)", "Projectile Typepath", 0) in sort_list(subtypesof(/obj/item/projectile), /proc/cmp_typepaths_asc) if (isnull(shrapnelInput)) return var/shrapnelMagnitude = input("Enter the magnitude of the pellet cloud. This is usually a value around 1-5. Please note that Ryll-Ryll has asked me to tell you that if you go too crazy with the projectiles you might crash the server. So uh, be gentle!", "Shrapnel Magnitude", 0) as null|num diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 40011ccbf2..e50539f91d 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1429,7 +1429,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) //The job before the current job. I only use this to get the previous jobs color when I'm filling in blank rows. var/datum/job/lastJob - for(var/datum/job/job in sortList(SSjob.occupations, /proc/cmp_job_display_asc)) + for(var/datum/job/job in sort_list(SSjob.occupations, /proc/cmp_job_display_asc)) index += 1 if((index >= limit) || (job.title in splitJobs)) @@ -2981,7 +2981,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) if(!length(key_bindings[old_key])) key_bindings -= old_key key_bindings[full_key] += list(kb_name) - key_bindings[full_key] = sortList(key_bindings[full_key]) + key_bindings[full_key] = sort_list(key_bindings[full_key]) if(href_list["special"]) // special keys need a full reset user.client.ensure_keys_set(src) user << browse(null, "window=capturekeypress") diff --git a/code/modules/client/verbs/ooc.dm b/code/modules/client/verbs/ooc.dm index 93f91ad3a0..3485a45771 100644 --- a/code/modules/client/verbs/ooc.dm +++ b/code/modules/client/verbs/ooc.dm @@ -237,7 +237,7 @@ GLOBAL_VAR_INIT(normal_ooc_colour, "#002eb8") choices["[C.mob]([C])"] = C else choices[C] = C - choices = sortList(choices) + choices = sort_list(choices) var/selection = input("Please, select a player!", "Ignore", null, null) as null|anything in choices if(!selection || !(selection in choices)) return diff --git a/code/modules/client/verbs/who.dm b/code/modules/client/verbs/who.dm index 5786191f4d..fe445973ad 100644 --- a/code/modules/client/verbs/who.dm +++ b/code/modules/client/verbs/who.dm @@ -50,7 +50,7 @@ else Lines += "[C.key] ([round(C.avgping, 1)]ms)" - for(var/line in sortList(Lines)) + for(var/line in sort_list(Lines)) msg += "[line]\n" msg += "Total Players: [length(Lines)]" diff --git a/code/modules/events/wizard/madness.dm b/code/modules/events/wizard/madness.dm index de2c30a032..b960b07467 100644 --- a/code/modules/events/wizard/madness.dm +++ b/code/modules/events/wizard/madness.dm @@ -13,7 +13,7 @@ var/suggested = pick(strings(REDPILL_FILE, "redpill_questions")) - forced_secret = (input(usr, "What horrifying truth will you reveal?", "Curse of Madness", sortList(suggested)) as text|null) || suggested + forced_secret = (input(usr, "What horrifying truth will you reveal?", "Curse of Madness", sort_list(suggested)) as text|null) || suggested /datum/round_event/wizard/madness/start() var/datum/round_event_control/wizard/madness/C = control diff --git a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm index 08020f708d..854c88401e 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm @@ -188,7 +188,7 @@ listofitems[md5name]["amount"]++ // The good news is, #30519 made smartfridge UIs non-auto-updating else listofitems[md5name] = list("name" = O.name, "type" = O.type, "amount" = 1) - sortList(listofitems) + sort_list(listofitems) .["contents"] = listofitems .["name"] = name diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index a91e3ddfd8..839e90c2df 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -626,7 +626,7 @@ for(var/muties in myseed.mutatelist) var/obj/item/seeds/another_mut = new muties fresh_mut_list[another_mut.plantname] = muties - var/locked_mutation = (input(user, "Select a mutation to lock.", "Plant Mutation Locks") as null|anything in sortList(fresh_mut_list)) + var/locked_mutation = (input(user, "Select a mutation to lock.", "Plant Mutation Locks") as null|anything in sort_list(fresh_mut_list)) if(!user.canUseTopic(src, BE_CLOSE) || !locked_mutation) return myseed.mutatelist = list(fresh_mut_list[locked_mutation]) diff --git a/code/modules/jobs/job_types/ai.dm b/code/modules/jobs/job_types/ai.dm index 6bf2764ba8..9b649135ae 100644 --- a/code/modules/jobs/job_types/ai.dm +++ b/code/modules/jobs/job_types/ai.dm @@ -30,8 +30,8 @@ /datum/job/ai/after_spawn(mob/H, client/C, latejoin) . = ..() if(latejoin) - var/obj/structure/AIcore/latejoin_inactive/lateJoinCore - for(var/obj/structure/AIcore/latejoin_inactive/P in GLOB.latejoin_ai_cores) + var/obj/structure/ai_core/latejoin_inactive/lateJoinCore + for(var/obj/structure/ai_core/latejoin_inactive/P in GLOB.latejoin_ai_cores) if(P.is_available()) lateJoinCore = P GLOB.latejoin_ai_cores -= P @@ -60,7 +60,7 @@ if(!do_special_check) return TRUE for(var/i in GLOB.latejoin_ai_cores) - var/obj/structure/AIcore/latejoin_inactive/LAI = i + var/obj/structure/ai_core/latejoin_inactive/LAI = i if(istype(LAI)) if(LAI.is_available()) return TRUE diff --git a/code/modules/mining/laborcamp/laborstacker.dm b/code/modules/mining/laborcamp/laborstacker.dm index 97953e6297..ef1fed4a18 100644 --- a/code/modules/mining/laborcamp/laborstacker.dm +++ b/code/modules/mining/laborcamp/laborstacker.dm @@ -28,7 +28,7 @@ GLOBAL_LIST(labor_sheet_values) if(!initial(sheet.point_value) || (initial(sheet.merge_type) && initial(sheet.merge_type) != sheet_type)) //ignore no-value sheets and x/fifty subtypes continue sheet_list += list(list("ore" = initial(sheet.name), "value" = initial(sheet.point_value))) - GLOB.labor_sheet_values = sortList(sheet_list, /proc/cmp_sheet_list) + GLOB.labor_sheet_values = sort_list(sheet_list, /proc/cmp_sheet_list) /proc/cmp_sheet_list(list/a, list/b) return a["value"] - b["value"] diff --git a/code/modules/mob/living/brain/MMI.dm b/code/modules/mob/living/brain/MMI.dm index f5a2368a60..847d3370c1 100644 --- a/code/modules/mob/living/brain/MMI.dm +++ b/code/modules/mob/living/brain/MMI.dm @@ -47,8 +47,20 @@ if(brain) to_chat(user, "There's already a brain in the MMI!") return - if(!newbrain.brainmob) - to_chat(user, "You aren't sure where this brain came from, but you're pretty sure it's a useless brain!") + if(newbrain.brainmob?.suiciding) + to_chat(user, span_warning("[newbrain] is completely useless.")) + return + if(!newbrain.brainmob?.mind || !newbrain.brainmob) + var/install = tgui_alert(user, "[newbrain] is inactive, slot it in anyway?", "Installing Brain", list("Yes", "No")) + if(install != "Yes") + return + if(!user.transferItemToLoc(newbrain, src)) + return + user.visible_message(span_notice("[user] sticks [newbrain] into [src]."), span_notice("[src]'s indicator light turns red as you insert [newbrain]. Its brainwave activity alarm buzzes.")) + brain = newbrain + brain.organ_flags |= ORGAN_FROZEN + name = "[initial(name)]: [copytext(newbrain.name, 1, -8)]" + update_appearance() return if(!user.transferItemToLoc(O, src)) @@ -97,15 +109,15 @@ name = initial(name) /obj/item/mmi/proc/eject_brain(mob/user) - brainmob.container = null //Reset brainmob mmi var. - brainmob.forceMove(brain) //Throw mob into brain. - brainmob.stat = DEAD - brainmob.emp_damage = 0 - brainmob.reset_perspective() //so the brainmob follows the brain organ instead of the mmi. And to update our vision - brainmob.remove_from_alive_mob_list() //Get outta here - brainmob.add_to_dead_mob_list() - brain.brainmob = brainmob //Set the brain to use the brainmob - brainmob = null //Set mmi brainmob var to null + if(brain.brainmob) + brainmob.container = null //Reset brainmob mmi var. + brainmob.forceMove(brain) //Throw mob into brain. + brainmob.stat = DEAD + brainmob.emp_damage = 0 + brainmob.reset_perspective() //so the brainmob follows the brain organ instead of the mmi. And to update our vision + brain.brainmob = brainmob //Set the brain to use the brainmob + log_game("[key_name(user)] has ejected the brain of [key_name(brainmob)] from an MMI at [AREACOORD(src)]") + brainmob = null //Set mmi brainmob var to null if(user) user.put_in_hands(brain) //puts brain in the user's hand or otherwise drops it on the user's turf else @@ -210,6 +222,38 @@ /obj/item/mmi/relaymove(mob/user) return //so that the MMI won't get a warning about not being able to move if it tries to move +/obj/item/mmi/proc/brain_check(mob/user) + var/mob/living/brain/B = brainmob + if(!B) + if(user) + to_chat(user, span_warning("\The [src] indicates that there is no mind present!")) + return FALSE + if(brain?.decoy_override) + if(user) + to_chat(user, span_warning("This [name] does not seem to fit!")) + return FALSE + if(!B.key || !B.mind) + if(user) + to_chat(user, span_warning("\The [src] indicates that their mind is completely unresponsive!")) + return FALSE + if(!B.client) + if(user) + to_chat(user, span_warning("\The [src] indicates that their mind is currently inactive.")) + return FALSE + if(B.suiciding) + if(user) + to_chat(user, span_warning("\The [src] indicates that their mind has no will to live!")) + return FALSE + if(B.stat == DEAD) + if(user) + to_chat(user, span_warning("\The [src] indicates that the brain is dead!")) + return FALSE + if(brain?.organ_flags & ORGAN_FAILING) + if(user) + to_chat(user, span_warning("\The [src] indicates that the brain is damaged!")) + return FALSE + return TRUE + /obj/item/mmi/syndie name = "Syndicate Man-Machine Interface" desc = "Syndicate's own brand of MMI. It enforces laws designed to help Syndicate agents achieve their goals upon cyborgs and AIs created with it." diff --git a/code/modules/mob/living/emote.dm b/code/modules/mob/living/emote.dm index d59978d993..69a6972194 100644 --- a/code/modules/mob/living/emote.dm +++ b/code/modules/mob/living/emote.dm @@ -489,7 +489,7 @@ if(E.can_run_emote(user, status_check = FALSE)) keys += E.key - keys = sortList(keys) + keys = sort_list(keys) for(var/emote in keys) if(LAZYLEN(message) > 1) diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 08098b818f..0db472bb9d 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -30,6 +30,7 @@ d_hud = DATA_HUD_DIAGNOSTIC_ADVANCED mob_size = MOB_SIZE_LARGE has_field_of_vision = FALSE //Vision through cameras. + var/battery = 200 //emergency power if the AI's APC is off var/list/network = list("ss13") var/obj/machinery/camera/current var/list/connected_robots = list() @@ -46,7 +47,7 @@ var/obj/item/multitool/aiMulti var/mob/living/simple_animal/bot/Bot var/tracking = FALSE //this is 1 if the AI is currently tracking somebody, but the track has not yet been completed. - var/datum/effect_system/spark_spread/spark_system//So they can initialize sparks whenever/N + var/datum/effect_system/spark_spread/spark_system //So they can initialize sparks whenever/N var/obj/machinery/status_display/controlled_display //MALFUNCTION @@ -83,7 +84,7 @@ var/cooldown = 0 var/acceleration = 1 - var/obj/structure/AIcore/deactivated/linked_core //For exosuit control + var/obj/structure/ai_core/deactivated/linked_core //For exosuit control var/mob/living/silicon/robot/deployed_shell = null //For shell control var/datum/action/innate/deploy_shell/deploy_action = new var/datum/action/innate/deploy_last_shell/redeploy_action = new @@ -105,11 +106,17 @@ ///remember AI's last location var/atom/lastloc interaction_range = INFINITY + ///whether its mmi is a posibrain or regular mmi when going ai mob to ai core structure + var/posibrain_inside = TRUE + ///whether its cover is opened, so you can wirecut it for deconstruction + var/opened = FALSE + ///whether AI is anchored or not, used for checks + var/is_anchored = TRUE /mob/living/silicon/ai/Initialize(mapload, datum/ai_laws/L, mob/target_ai) . = ..() if(!target_ai) //If there is no player/brain inside. - new/obj/structure/AIcore/deactivated(loc) //New empty terminal. + new/obj/structure/ai_core/deactivated(loc) //New empty terminal. return INITIALIZE_HINT_QDEL //Delete AI. ADD_TRAIT(src, TRAIT_NO_TELEPORT, src) @@ -125,6 +132,8 @@ mind.store_memory("As an AI, you must obey your silicon laws above all else. Your objectives will consider you to be dead.") to_chat(src, "You have been installed as an AI! ") to_chat(src, "You must obey your silicon laws above all else. Your objectives will consider you to be dead.") + if(!mind.has_ever_been_ai) + mind.has_ever_been_ai = TRUE to_chat(src, "You are playing the station's AI. The AI cannot move, but can interact with many objects while viewing them (through cameras).") to_chat(src, "To look at other parts of the station, click on yourself to get a camera menu.") @@ -237,6 +246,8 @@ . += text("Systems nonfunctional") return . += text("System integrity: [(health + 100) * 0.5]%") + if(isturf(loc)) //only show if we're "in" a core + . += "Backup Power: [battery * 0.5]%" . += text("Connected cyborgs: [length(connected_robots)]") for(var/r in connected_robots) var/mob/living/silicon/robot/connected_robot = r @@ -333,18 +344,64 @@ if(!isturf(loc)) // if their location isn't a turf return // stop if(incapacitated()) - return - var/is_anchored = FALSE - if(move_resist == MOVE_FORCE_OVERPOWERING) + if(battery < 50) + to_chat(src, span_warning("Insufficient backup power!")) + return + battery = battery - 50 + to_chat(src, span_notice("You route power from your backup battery to move the bolts.")) + flip_anchored() + to_chat(src, "You are now [is_anchored ? "" : "un"]anchored.") + +/mob/living/silicon/ai/proc/flip_anchored() + if(is_anchored) + is_anchored = !is_anchored move_resist = MOVE_FORCE_NORMAL + status_flags |= CANPUSH REMOVE_TRAIT(src, TRAIT_NO_TELEPORT, src) else - is_anchored = TRUE + is_anchored = !is_anchored move_resist = MOVE_FORCE_OVERPOWERING + status_flags &= ~CANPUSH ADD_TRAIT(src, TRAIT_NO_TELEPORT, src) - to_chat(src, "You are now [is_anchored ? "" : "un"]anchored.") - // the message in the [] will change depending whether or not the AI is anchored +/mob/living/silicon/ai/proc/ai_mob_to_structure() + disconnect_shell() + ShutOffDoomsdayDevice() + var/obj/structure/ai_core/deactivated/ai_core = new(get_turf(src), /* skip_mmi_creation = */ TRUE) + if(make_mmi_drop_and_transfer(ai_core.core_mmi, the_core = ai_core)) + qdel(src) + return ai_core + +/mob/living/silicon/ai/proc/make_mmi_drop_and_transfer(obj/item/mmi/the_mmi, the_core) + var/mmi_type + if(posibrain_inside) + mmi_type = new/obj/item/mmi/posibrain(src, /* autoping = */ FALSE) + else + mmi_type = new/obj/item/mmi(src) + if(hack_software) + new/obj/item/malf_upgrade(get_turf(src)) + the_mmi = mmi_type + the_mmi.brain = new /obj/item/organ/brain(the_mmi) + the_mmi.brain.organ_flags |= ORGAN_FROZEN + the_mmi.brain.name = "[real_name]'s brain" + the_mmi.name = "[initial(the_mmi.name)]: [real_name]" + the_mmi.brainmob = new /mob/living/brain(the_mmi) + the_mmi.brainmob.name = src.real_name + the_mmi.brainmob.real_name = src.real_name + the_mmi.brainmob.container = the_mmi + the_mmi.brainmob.suiciding = suiciding + if(the_core) + var/obj/structure/ai_core/core = the_core + core.core_mmi = the_mmi + the_mmi.forceMove(the_core) + else + the_mmi.forceMove(get_turf(src)) + if(the_mmi.brainmob.stat == DEAD && !suiciding) + the_mmi.brainmob.stat = CONSCIOUS + if(mind) + mind.transfer_to(the_mmi.brainmob) + the_mmi.update_appearance() + return TRUE // AIs are immobile /mob/living/silicon/ai/update_mobility() @@ -427,18 +484,30 @@ return if (href_list["ai_take_control"]) //Mech domination - var/obj/vehicle/sealed/mecha/M = locate(href_list["ai_take_control"]) + var/obj/vehicle/sealed/mecha/M = locate(href_list["ai_take_control"]) in GLOB.mechas_list + if (!M) + return + + var/mech_has_controlbeacon = FALSE + for(var/obj/item/mecha_parts/mecha_tracking/ai_control/A in M.trackers) + mech_has_controlbeacon = TRUE + break + if(!can_dominate_mechs && !mech_has_controlbeacon) + message_admins("Warning: possible href exploit by [key_name(usr)] - attempted control of a mecha without can_dominate_mechs or a control beacon in the mech.") + usr.log_message("possibly attempting href exploit - attempted control of a mecha without can_dominate_mechs or a control beacon in the mech.", LOG_ADMIN) + return + if(controlled_equipment) - to_chat(src, "You are already loaded into an onboard computer!") + to_chat(src, span_warning("You are already loaded into an onboard computer!")) return if(!GLOB.cameranet.checkCameraVis(M)) - to_chat(src, "Exosuit is no longer near active cameras.") + to_chat(src, span_warning("Exosuit is no longer near active cameras.")) return if(!isturf(loc)) - to_chat(src, "You aren't in your core!") + to_chat(src, span_warning("You aren't in your core!")) return if(M) - M.transfer_ai(AI_MECH_HACK,src, usr) //Called om the mech itself. + M.transfer_ai(AI_MECH_HACK, src, usr) //Called on the mech itself. /mob/living/silicon/ai/proc/switchCamera(obj/machinery/camera/C) @@ -825,10 +894,12 @@ to_chat(user, "No intelligence patterns detected." ) return ShutOffDoomsdayDevice() - new /obj/structure/AIcore/deactivated(loc)//Spawns a deactivated terminal at AI location. + var/obj/structure/ai_core/new_core = new /obj/structure/ai_core/deactivated(loc, posibrain_inside)//Spawns a deactivated terminal at AI location. + new_core.circuit.battery = battery ai_restore_power()//So the AI initially has power. - control_disabled = 1//Can't control things remotely if you're stuck in a card! - radio_enabled = 0 //No talking on the built-in radio for you either! + control_disabled = TRUE //Can't control things remotely if you're stuck in a card! + interaction_range = 0 + radio_enabled = FALSE //No talking on the built-in radio for you either! forceMove(card) card.AI = src to_chat(src, "You have been downloaded to a mobile storage device. Remote device connection severed.") @@ -1063,7 +1134,7 @@ // Sends an announcement the AI has cryoed. var/obj/machinery/announcement_system/announcer = pick(GLOB.announcement_systems) announcer.announce("CRYOSTORAGE", src.real_name, announce_rank, list()) - new /obj/structure/AIcore/latejoin_inactive(loc) + new /obj/structure/ai_core/latejoin_inactive(loc) if(src.mind) //Handle job slot/tater cleanup. if(src.mind.assigned_role == "AI") diff --git a/code/modules/mob/living/silicon/ai/ai_defense.dm b/code/modules/mob/living/silicon/ai/ai_defense.dm index b8a0a15e70..17d4e9d129 100644 --- a/code/modules/mob/living/silicon/ai/ai_defense.dm +++ b/code/modules/mob/living/silicon/ai/ai_defense.dm @@ -2,7 +2,7 @@ . = ..() if(!.) return FALSE - if(I.force && I.damtype != STAMINA && stat != DEAD) //only sparks if real damage is dealt. + if(I.force && I.damtype != STAMINA && stat != DEAD && !QDELETED(src)) //only sparks if real damage is dealt. spark_system.start() /mob/living/silicon/ai/attack_slime(mob/living/simple_animal/slime/user) @@ -48,3 +48,105 @@ /mob/living/silicon/ai/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0) return // no eyes, no flashing + +/mob/living/silicon/ai/emag_act(mob/user, obj/item/card/emag/emag_card) ///emags access panel lock, so you can crowbar it without robotics access or consent + . = ..() + if(emagged) + balloon_alert(user, "access panel lock already shorted!") + return + balloon_alert(user, "access panel lock shorted") + var/message = (user ? "[user] shorts out your access panel lock!" : "Your access panel lock was short circuited!") + to_chat(src, span_warning(message)) + do_sparks(3, FALSE, src) // just a bit of extra "oh shit" to the ai - might grab its attention + emagged = TRUE + return TRUE + +/mob/living/silicon/ai/wrench_act(mob/living/user, obj/item/tool) + . = ..() + if(user.a_intent == INTENT_HARM) + return + balloon_alert(user, "[!is_anchored ? "tightening" : "loosening"] bolts...") + balloon_alert(src, "bolts being [!is_anchored ? "tightened" : "loosened"]...") + if(!tool.use_tool(src, user, 4 SECONDS)) + return TRUE + flip_anchored() + balloon_alert(user, "bolts [is_anchored ? "tightened" : "loosened"]") + balloon_alert(src, "bolts [is_anchored ? "tightened" : "loosened"]") + return TRUE + +/mob/living/silicon/ai/crowbar_act(mob/living/user, obj/item/tool) + . = ..() + if(user.a_intent == INTENT_HARM) + return + if(!is_anchored) + balloon_alert(user, "bolt it down first!") + return TRUE + if(opened) + if(emagged) + balloon_alert(user, "access panel lock damaged!") + return TRUE + balloon_alert(user, "closing access panel...") + balloon_alert(src, "access panel being closed...") + if(!tool.use_tool(src, user, 5 SECONDS)) + return TRUE + balloon_alert(src, "access panel closed") + balloon_alert(user, "access panel closed") + opened = FALSE + return TRUE + if(stat == DEAD) + to_chat(user, span_warning("The access panel looks damaged, you try dislodging the cover.")) + else + var/consent + var/consent_override = FALSE + if(ishuman(user)) + var/mob/living/carbon/human/human_user = user + if(human_user.wear_id) + var/list/access = human_user.wear_id.GetAccess() + if(ACCESS_ROBOTICS in access) + consent_override = TRUE + if(mind) + consent = tgui_alert(src, "[user] is attempting to open your access panel, unlock the cover?", "AI Access Panel", list("Yes", "No")) + if(consent == "No" && !consent_override && !emagged) + to_chat(user, span_notice("[src] refuses to unlock its access panel.")) + return TRUE + if(consent != "Yes" && (consent_override || emagged)) + to_chat(user, span_warning("[src] refuses to unlock its access panel...so you[!emagged ? " swipe your ID and " : " "]open it anyway!")) + else + if(!consent_override && !emagged) + to_chat(user, span_notice("[src] did not respond to your request to unlock its access panel cover lock.")) + return TRUE + else + to_chat(user, span_notice("[src] did not respond to your request to unlock its access panel cover lock. You[!emagged ? " swipe your ID and " : " "]open it anyway.")) + + balloon_alert(user, "prying open access panel...") + balloon_alert(src, "access panel being pried open...") + if(!tool.use_tool(src, user, (stat == DEAD ? 40 SECONDS : 5 SECONDS))) + return TRUE + balloon_alert(src, "access panel opened") + balloon_alert(user, "access panel opened") + opened = TRUE + return TRUE + +/mob/living/silicon/ai/wirecutter_act(mob/living/user, obj/item/tool) + . = ..() + if(user.a_intent == INTENT_HARM) + return + if(!is_anchored) + balloon_alert(user, "bolt it down first!") + return TRUE + if(!opened) + balloon_alert(user, "open the access panel first!") + return TRUE + balloon_alert(src, "neural network being disconnected...") + balloon_alert(user, "disconnecting neural network...") + if(!tool.use_tool(src, user, (stat == DEAD ? 40 SECONDS : 5 SECONDS))) + return TRUE + if(IS_MALF_AI(src)) + to_chat(user, span_userdanger("The voltage inside the wires rises dramatically!")) + user.electrocute_act(120, src) + opened = FALSE + return TRUE + to_chat(src, span_danger("You feel incredibly confused and disorientated.")) + var/atom/ai_structure = ai_mob_to_structure() + ai_structure.balloon_alert(user, "disconnected neural network") + return TRUE diff --git a/code/modules/mob/living/silicon/ai/life.dm b/code/modules/mob/living/silicon/ai/life.dm index ed969e49fb..892fa6955b 100644 --- a/code/modules/mob/living/silicon/ai/life.dm +++ b/code/modules/mob/living/silicon/ai/life.dm @@ -28,11 +28,15 @@ // Handle power damage (oxy) if(aiRestorePowerRoutine) // Lost power - adjustOxyLoss(1) + if (!battery) + to_chat(src, span_warning("Your backup battery's output drops below usable levels. It takes only a moment longer for your systems to fail, corrupted and unusable.")) + adjustOxyLoss(200) + else + battery-- else // Gain Power - if(getOxyLoss()) - adjustOxyLoss(-1) + if (battery < 200) + battery++ if(!lacks_power()) var/area/home = get_area(src) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 77a88960d5..dbc2c3f587 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -162,7 +162,7 @@ if(BORG_SEC_AVAILABLE) modulelist["Security"] = /obj/item/robot_module/security - var/input_module = input("Please, select a module!", "Robot", null, null) as null|anything in sortList(modulelist) + var/input_module = input("Please, select a module!", "Robot", null, null) as null|anything in sort_list(modulelist) if(!input_module || module.type != /obj/item/robot_module) return diff --git a/code/modules/mob/living/silicon/robot/robot_defines.dm b/code/modules/mob/living/silicon/robot/robot_defines.dm index 612298e526..b54473f7a6 100644 --- a/code/modules/mob/living/silicon/robot/robot_defines.dm +++ b/code/modules/mob/living/silicon/robot/robot_defines.dm @@ -50,7 +50,6 @@ var/obj/item/stock_parts/cell/cell = /obj/item/stock_parts/cell/high ///If this is a path, this gets created as an object in Initialize. var/opened = FALSE - var/emagged = FALSE var/emag_cooldown = 0 var/wiresexposed = FALSE diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm index de2f4635d4..4459bd4413 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules.dm @@ -380,7 +380,7 @@ var/image/bad_snowflake = image(icon = 'modular_citadel/icons/mob/widerobot.dmi', icon_state = "alina-med") bad_snowflake.pixel_x = -16 med_icons["Alina"] = bad_snowflake - med_icons = sortList(med_icons) + med_icons = sort_list(med_icons) var/med_borg_icon = show_radial_menu(R, R , med_icons, custom_check = CALLBACK(src, .proc/check_menu, R), radius = 42, require_near = TRUE) switch(med_borg_icon) if("Default") @@ -498,7 +498,7 @@ var/image/bad_snowflake = image(icon = 'modular_citadel/icons/mob/widerobot.dmi', icon_state = "alina-eng") bad_snowflake.pixel_x = -16 engi_icons["Alina"] = bad_snowflake - engi_icons = sortList(engi_icons) + engi_icons = sort_list(engi_icons) var/engi_borg_icon = show_radial_menu(R, R , engi_icons, custom_check = CALLBACK(src, .proc/check_menu, R), radius = 42, require_near = TRUE) switch(engi_borg_icon) if("Default") @@ -595,7 +595,7 @@ var/image/bad_snowflake = image(icon = 'modular_citadel/icons/mob/widerobot.dmi', icon_state = "alina-sec") bad_snowflake.pixel_x = -16 sec_icons["Alina"] = bad_snowflake - sec_icons = sortList(sec_icons) + sec_icons = sort_list(sec_icons) var/sec_borg_icon = show_radial_menu(R, R , sec_icons, custom_check = CALLBACK(src, .proc/check_menu, R), radius = 42, require_near = TRUE) switch(sec_borg_icon) if("Default") @@ -681,7 +681,7 @@ /obj/item/robot_module/peacekeeper/be_transformed_to(obj/item/robot_module/old_module) var/mob/living/silicon/robot/R = loc - var/static/list/peace_icons = sortList(list( + var/static/list/peace_icons = sort_list(list( "Default" = image(icon = 'icons/mob/robots.dmi', icon_state = "peace"), "Borgi" = image(icon = 'modular_citadel/icons/mob/robots.dmi', icon_state = "borgi"), "Spider" = image(icon = 'modular_citadel/icons/mob/robots.dmi', icon_state = "whitespider") @@ -852,7 +852,7 @@ var/image/bad_snowflake = image(icon = 'modular_citadel/icons/mob/widerobot.dmi', icon_state = "alina-sec") bad_snowflake.pixel_x = -16 service_icons["Alina"] = bad_snowflake - service_icons = sortList(service_icons) + service_icons = sort_list(service_icons) var/service_robot_icon = show_radial_menu(R, R , service_icons, custom_check = CALLBACK(src, .proc/check_menu, R), radius = 42, require_near = TRUE) switch(service_robot_icon) if("(Service) Waitress") @@ -966,7 +966,7 @@ var/image/wide = image(icon = 'modular_citadel/icons/mob/widerobot.dmi', icon_state = L[a]) wide.pixel_x = -16 mining_icons[a] = wide - mining_icons = sortList(mining_icons) + mining_icons = sort_list(mining_icons) var/mining_borg_icon = show_radial_menu(R, R , mining_icons, custom_check = CALLBACK(src, .proc/check_menu, R), radius = 42, require_near = TRUE) switch(mining_borg_icon) if("Lavaland") diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index 83ce09b315..347c71673e 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -44,6 +44,8 @@ var/obj/machinery/camera/builtInCamera = null var/updating = FALSE //portable camera camerachunk update + ///Whether we have been emagged + var/emagged = FALSE var/hack_software = FALSE //Will be able to use hacking actions var/interaction_range = 7 //wireless control range diff --git a/code/modules/modular_computers/computers/item/computer.dm b/code/modules/modular_computers/computers/item/computer.dm index e2345a6384..2d82988997 100644 --- a/code/modules/modular_computers/computers/item/computer.dm +++ b/code/modules/modular_computers/computers/item/computer.dm @@ -454,7 +454,7 @@ var/obj/item/computer_hardware/H = all_components[h] component_names.Add(H.name) - var/choice = input(user, "Which component do you want to uninstall?", "Computer maintenance", null) as null|anything in sortList(component_names) + var/choice = input(user, "Which component do you want to uninstall?", "Computer maintenance", null) as null|anything in sort_list(component_names) if(!choice) return diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 8c81792d27..a0f98f4046 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -137,7 +137,7 @@ burst_size = 1 - sortList(fire_select_modes, /proc/cmp_numeric_asc) + sort_list(fire_select_modes, /proc/cmp_numeric_asc) if(fire_select_modes.len > 1) firemode_action = new(src) diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm index 1a64045ed0..779be376dd 100644 --- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm +++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm @@ -94,16 +94,16 @@ /obj/machinery/chem_dispenser/Initialize(mapload) . = ..() - dispensable_reagents = sortList(dispensable_reagents, /proc/cmp_reagents_asc) + dispensable_reagents = sort_list(dispensable_reagents, /proc/cmp_reagents_asc) if(emagged_reagents) - emagged_reagents = sortList(emagged_reagents, /proc/cmp_reagents_asc) + emagged_reagents = sort_list(emagged_reagents, /proc/cmp_reagents_asc) if(upgrade_reagents) - upgrade_reagents = sortList(upgrade_reagents, /proc/cmp_reagents_asc) + upgrade_reagents = sort_list(upgrade_reagents, /proc/cmp_reagents_asc) if(upgrade_reagents2) - upgrade_reagents2 = sortList(upgrade_reagents2, /proc/cmp_reagents_asc) + upgrade_reagents2 = sort_list(upgrade_reagents2, /proc/cmp_reagents_asc) if(upgrade_reagents3) - upgrade_reagents3 = sortList(upgrade_reagents3, /proc/cmp_reagents_asc) - dispensable_reagents = sortList(dispensable_reagents, /proc/cmp_reagents_asc) + upgrade_reagents3 = sort_list(upgrade_reagents3, /proc/cmp_reagents_asc) + dispensable_reagents = sort_list(dispensable_reagents, /proc/cmp_reagents_asc) create_reagents(200, NO_REACT) update_icon() diff --git a/code/modules/vehicles/mecha/_mecha.dm b/code/modules/vehicles/mecha/_mecha.dm index f4ffda302e..e0c4ce81e4 100644 --- a/code/modules/vehicles/mecha/_mecha.dm +++ b/code/modules/vehicles/mecha/_mecha.dm @@ -198,7 +198,8 @@ /obj/vehicle/sealed/mecha/Destroy() for(var/ejectee in occupants) - mob_exit(ejectee, TRUE, TRUE) + mob_exit(ejectee, silent = TRUE) + if(LAZYLEN(equipment)) for(var/obj/item/mecha_parts/mecha_equipment/equip as anything in equipment) equip.detach(loc) @@ -215,6 +216,8 @@ QDEL_NULL(cabin_air) QDEL_NULL(spark_system) QDEL_NULL(smoke_system) + QDEL_NULL(trackers) + QDEL_NULL(wires) GLOB.poi_list -= src GLOB.mechas_list -= src //global mech list @@ -223,14 +226,39 @@ return ..() /obj/vehicle/sealed/mecha/obj_destruction() + spark_system?.start() loc.assume_air(cabin_air) air_update_turf(FALSE, FALSE) + + var/mob/living/silicon/ai/unlucky_ai for(var/mob/living/occupant as anything in occupants) if(isAI(occupant)) - occupant.gib() //No wreck, no AI to recover + var/mob/living/silicon/ai/ai = occupant + if(!ai.linked_core) // we probably shouldnt gib AIs with a core + unlucky_ai = occupant + ai.investigate_log("has been gibbed by having their mech destroyed.", INVESTIGATE_DEATHS) + ai.gib() //No wreck, no AI to recover + else + mob_exit(ai,silent = TRUE, forced = TRUE) // so we dont ghost the AI continue - mob_exit(occupant, FALSE, TRUE) - occupant.SetSleeping(destruction_sleep_duration) + mob_exit(occupant, forced = TRUE) + if(!isbrain(occupant)) // who would win.. 1 brain vs 1 sleep proc.. + occupant.SetSleeping(destruction_sleep_duration) + + if(wreckage) + var/obj/structure/mecha_wreckage/WR = new wreckage(loc, unlucky_ai) + for(var/obj/item/mecha_parts/mecha_equipment/E in equipment) + if(E.detachable && prob(30)) + WR.crowbar_salvage += E + E.detach(WR) //detaches from src into WR + else + E.detach(loc) + qdel(E) + if(cell) + WR.crowbar_salvage += cell + cell.forceMove(WR) + cell.use(rand(0, cell.charge), TRUE) + cell = null return ..() /obj/vehicle/sealed/mecha/update_icon() @@ -480,7 +508,7 @@ var/mob/living/occupant = b if(!enclosed && occupant?.incapacitated()) //no sides mean it's easy to just sorta fall out if you're incapacitated. visible_message("[occupant] tumbles out of the cockpit!") - mob_try_exit(occupant, TRUE, TRUE) //bye bye + mob_exit(occupant, randomstep = TRUE) //bye bye //Diagnostic HUD updates diag_hud_set_mechhealth() @@ -796,19 +824,31 @@ to_chat(user, "Take control of exosuit?
") /obj/vehicle/sealed/mecha/transfer_ai(interaction, mob/user, mob/living/silicon/ai/AI, obj/item/aicard/card) - if(!..()) + . = ..() + if(!.) return //Transfer from core or card to mech. Proc is called by mech. switch(interaction) if(AI_TRANS_TO_CARD) //Upload AI from mech to AI card. if(!construction_state) //Mech must be in maint mode to allow carding. - to_chat(user, "[name] must have maintenance protocols active in order to allow a transfer.") + to_chat(user, span_warning("[name] must have maintenance protocols active in order to allow a transfer.")) return - if(!locate(AI) in occupants) //Mech does not have an AI for a pilot - to_chat(user, "No AI detected in the [name] onboard computer.") + var/list/ai_pilots = list() + for(var/mob/living/silicon/ai/aipilot in occupants) + ai_pilots += aipilot + if(!length(ai_pilots)) //Mech does not have an AI for a pilot + to_chat(user, span_warning("No AI detected in the [name] onboard computer.")) return - for(var/mob/living/silicon/ai in occupants) + if(length(ai_pilots) > 1) //Input box for multiple AIs, but if there's only one we'll default to them. + AI = tgui_input_list(user, "Which AI do you wish to card?", "AI Selection", sort_list(ai_pilots)) + else + AI = ai_pilots[1] + if(isnull(AI)) + return + if(!(AI in occupants) || !user.Adjacent(src)) + return //User sat on the selection window and things changed. + AI.ai_restore_power()//So the AI initially has power. AI.control_disabled = TRUE AI.radio_enabled = FALSE @@ -819,36 +859,37 @@ card.AI = AI AI.controlled_equipment = null AI.remote_control = null - to_chat(AI, "You have been downloaded to a mobile storage device. Wireless connection offline.") - to_chat(user, "Transfer successful: [AI.name] ([rand(1000,9999)].exe) removed from [name] and stored within local memory.") + to_chat(AI, span_notice("You have been downloaded to a mobile storage device. Wireless connection offline.")) + to_chat(user, "[span_boldnotice("Transfer successful")]: [AI.name] ([rand(1000,9999)].exe) removed from [name] and stored within local memory.") + return if(AI_MECH_HACK) //Called by AIs on the mech - AI.linked_core = new /obj/structure/AIcore/deactivated(AI.loc) - if(AI.can_dominate_mechs) - if(LAZYLEN(occupants)) //Oh, I am sorry, were you using that? - to_chat(AI, "Occupants detected! Forced ejection initiated!") - to_chat(occupants, "You have been forcibly ejected!") - ejectall() //IT IS MINE, NOW. SUCK IT, RD! - ai_enter_mech(AI, interaction) + AI.linked_core = new /obj/structure/ai_core/deactivated(AI.loc) + if(AI.can_dominate_mechs && LAZYLEN(occupants)) //Oh, I am sorry, were you using that? + to_chat(AI, span_warning("Occupants detected! Forced ejection initiated!")) + to_chat(occupants, span_danger("You have been forcibly ejected!")) + for(var/ejectee in occupants) + mob_exit(ejectee, silent = TRUE, randomstep = TRUE, forced = TRUE) //IT IS MINE, NOW. SUCK IT, RD! + AI.can_shunt = FALSE //ONE AI ENTERS. NO AI LEAVES. if(AI_TRANS_FROM_CARD) //Using an AI card to upload to a mech. AI = card.AI if(!AI) - to_chat(user, "There is no AI currently installed on this device.") + to_chat(user, span_warning("There is no AI currently installed on this device.")) return if(AI.deployed_shell) //Recall AI if shelled so it can be checked for a client AI.disconnect_shell() if(AI.stat || !AI.client) - to_chat(user, "[AI.name] is currently unresponsive, and cannot be uploaded.") + to_chat(user, span_warning("[AI.name] is currently unresponsive, and cannot be uploaded.")) return if((LAZYLEN(occupants) >= max_occupants) || dna_lock) //Normal AIs cannot steal mechs! - to_chat(user, "Access denied. [name] is [LAZYLEN(occupants) >= max_occupants ? "currently fully occupied" : "secured with a DNA lock"].") + to_chat(user, span_warning("Access denied. [name] is [LAZYLEN(occupants) >= max_occupants ? "currently fully occupied" : "secured with a DNA lock"].")) return AI.control_disabled = FALSE AI.radio_enabled = TRUE - to_chat(user, "Transfer successful: [AI.name] ([rand(1000,9999)].exe) installed and executed successfully. Local copy has been removed.") + to_chat(user, "[span_boldnotice("Transfer successful")]: [AI.name] ([rand(1000,9999)].exe) installed and executed successfully. Local copy has been removed.") card.AI = null - ai_enter_mech(AI, interaction) + ai_enter_mech(AI) //Hack and From Card interactions share some code, so leave that here for both to use. /obj/vehicle/sealed/mecha/proc/ai_enter_mech(mob/living/silicon/ai/AI, interaction) @@ -865,7 +906,6 @@ "You have been uploaded to a mech's onboard computer.") to_chat(AI, "Use Middle-Mouse to activate mech functions and equipment. Click normally for AI interactions.") - ///Handles an actual AI (simple_animal mecha pilot) entering the mech /obj/vehicle/sealed/mecha/proc/aimob_enter_mech(mob/living/simple_animal/hostile/syndicate/mecha_pilot/pilot_mob) if(pilot_mob && pilot_mob.Adjacent(src)) @@ -1042,47 +1082,45 @@ if(isAI(user)) var/mob/living/silicon/ai/AI = user if(!AI.can_shunt) - to_chat(AI, "You can't leave a mech after dominating it!.") + to_chat(AI, span_notice("You can't leave a mech after dominating it!.")) return FALSE - to_chat(user, "You begin the ejection procedure. Equipment is disabled during this process. Hold still to finish ejecting.") + to_chat(user, span_notice("You begin the ejection procedure. Equipment is disabled during this process. Hold still to finish ejecting.")) is_currently_ejecting = TRUE - if(do_after(user, exit_delay , target = src)) - to_chat(user, "You exit the mech.") - mob_try_exit(user, silent = FALSE) + if(do_after(user, has_gravity() ? exit_delay : 0 , target = src)) + to_chat(user, span_notice("You exit the mech.")) + mob_exit(user, silent = TRUE) else - to_chat(user, "You stop exiting the mech. Weapons are enabled again.") + to_chat(user, span_notice("You stop exiting the mech. Weapons are enabled again.")) is_currently_ejecting = FALSE -/obj/vehicle/sealed/mecha/proc/ejectall() - for(var/ejectee in occupants) - mob_try_exit(ejectee, TRUE, TRUE) - -/obj/vehicle/sealed/mecha/mob_try_exit(mob/M, silent, randomstep) - mob_exit(M, silent, randomstep) - -/obj/vehicle/sealed/mecha/mob_exit(mob/M, silent, forced) - var/newloc = get_turf(src) +/obj/vehicle/sealed/mecha/mob_exit(mob/M, silent = FALSE, randomstep = FALSE, forced = FALSE) var/atom/movable/mob_container + var/turf/newloc = get_turf(src) if(ishuman(M)) - remove_occupant(M) - ..() - return + mob_container = M else if(isbrain(M)) var/mob/living/brain/brain = M mob_container = brain.container else if(isAI(M)) var/mob/living/silicon/ai/AI = M + //stop listening to this signal, as the static update is now handled by the eyeobj's setLoc + AI.eyeobj?.UnregisterSignal(src, COMSIG_MOVABLE_MOVED) + AI.eyeobj?.forceMove(newloc) //kick the eye out as well if(forced)//This should only happen if there are multiple AIs in a round, and at least one is Malf. - AI.gib() //If one Malf decides to steal a mech from another AI (even other Malfs!), they are destroyed, as they have nowhere to go when replaced. + if(!AI.linked_core) //if the victim AI has no core + AI.investigate_log("has been gibbed by being forced out of their mech by another AI.", INVESTIGATE_DEATHS) + AI.gib() //If one Malf decides to steal a mech from another AI (even other Malfs!), they are destroyed, as they have nowhere to go when replaced. AI = null mecha_flags &= ~SILICON_PILOT return else if(!AI.linked_core) - to_chat(AI, "Inactive core destroyed. Unable to return.") + if(!silent) + to_chat(AI, span_userdanger("Inactive core destroyed. Unable to return.")) AI.linked_core = null return - to_chat(AI, "Returning to core...") + if(!silent) + to_chat(AI, span_notice("Returning to core...")) AI.controlled_equipment = null AI.remote_control = null mob_container = AI @@ -1090,21 +1128,20 @@ qdel(AI.linked_core) else return ..() - var/mob/living/L = M + var/mob/living/ejector = M mecha_flags &= ~SILICON_PILOT - if(mob_container.forceMove(newloc)) - log_message("[mob_container] moved out.", LOG_MECHA) - L << browse(null, "window=exosuit") + mob_container.forceMove(newloc)//ejecting mob container + log_message("[mob_container] moved out.", LOG_MECHA) + SStgui.close_user_uis(M, src) if(istype(mob_container, /obj/item/mmi)) var/obj/item/mmi/mmi = mob_container if(mmi.brainmob) - L.forceMove(mmi) - L.reset_perspective() - remove_occupant(L) + ejector.forceMove(mmi) + ejector.reset_perspective() + remove_occupant(ejector) mmi.mecha = null - mmi.update_icon() - L.mobility_flags = NONE - setDir(dir_in) + mmi.update_appearance() + setDir(SOUTH) return ..() diff --git a/code/modules/vehicles/mecha/combat/neovgre.dm b/code/modules/vehicles/mecha/combat/neovgre.dm index d8704e0318..7e40a1c352 100644 --- a/code/modules/vehicles/mecha/combat/neovgre.dm +++ b/code/modules/vehicles/mecha/combat/neovgre.dm @@ -25,7 +25,7 @@ else add_control_flags(M, VEHICLE_CONTROL_MELEE|VEHICLE_CONTROL_EQUIPMENT) -/obj/vehicle/sealed/mecha/combat/neovgre/mob_exit(mob/M, silent, forced) +/obj/vehicle/sealed/mecha/combat/neovgre/mob_exit(mob/M, silent, randomstep, forced) if(forced) ..() diff --git a/modular_citadel/code/modules/client/verbs/who.dm b/modular_citadel/code/modules/client/verbs/who.dm index 7640595e18..390c167365 100644 --- a/modular_citadel/code/modules/client/verbs/who.dm +++ b/modular_citadel/code/modules/client/verbs/who.dm @@ -38,7 +38,7 @@ var/client/C = X if(C && C.holder && !C.holder.fakekey) assembled += "\t [C.key][admin_mode? "[show_admin_info(C)]":""] ([round(C.avgping, 1)]ms)" - Lines += sortList(assembled) + Lines += sort_list(assembled) assembled.len = 0 if(length(GLOB.mentors)) Lines += "Mentors:" @@ -46,10 +46,10 @@ var/client/C = X if(C && (!C.holder || (C.holder && !C.holder.fakekey))) //>using stuff this complex instead of just using if/else lmao assembled += "\t [C.key][admin_mode? "[show_admin_info(C)]":""] ([round(C.avgping, 1)]ms)" - Lines += sortList(assembled) + Lines += sort_list(assembled) assembled.len = 0 Lines += "Players:" - for(var/X in sortList(GLOB.clients)) + for(var/X in sort_list(GLOB.clients)) var/client/C = X if(!C) continue @@ -57,8 +57,8 @@ if(C.holder && C.holder.fakekey) key = C.holder.fakekey assembled += "\t [key][admin_mode? "[show_admin_info(C)]":""] ([round(C.avgping, 1)]ms)" - Lines += sortList(assembled) - + Lines += sort_list(assembled) + for(var/line in Lines) msg += "[line]\n" diff --git a/modular_citadel/code/modules/mentor/mentorpm.dm b/modular_citadel/code/modules/mentor/mentorpm.dm index 3260e96767..ba9a951b98 100644 --- a/modular_citadel/code/modules/mentor/mentorpm.dm +++ b/modular_citadel/code/modules/mentor/mentorpm.dm @@ -9,7 +9,7 @@ for(var/client/T) targets["[T]"] = T - var/list/sorted = sortList(targets) + var/list/sorted = sort_list(targets) var/target = input(src,"To whom shall we send a message?","Mentor PM",null) in sorted|null cmd_mentor_pm(targets[target],null) SSblackbox.record_feedback("tally", "Mentor_verb", 1, "APM") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! From 27bdd4b73215d568c026ae91721c8952de342a06 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Sun, 17 Dec 2023 23:20:43 -0300 Subject: [PATCH 3/8] aiModule > ai_module --- code/controllers/subsystem/traumas.dm | 4 +- code/game/gamemodes/objective_sabotage.dm | 2 +- code/game/machinery/computer/law.dm | 4 +- .../game/objects/effects/spawners/lootdrop.dm | 36 ++--- code/game/objects/items/AI_modules.dm | 144 +++++++++--------- .../game/objects/items/storage/uplink_kits.dm | 4 +- code/game/objects/structures/ai_core.dm | 4 +- code/modules/admin/verbs/borgpanel.dm | 4 +- .../antagonists/overthrow/overthrow.dm | 2 +- .../modules/mob/living/silicon/robot/robot.dm | 4 +- .../research/designs/AI_module_designs.dm | 30 ++-- .../uplink/uplink_items/uplink_devices.dm | 4 +- 12 files changed, 121 insertions(+), 121 deletions(-) diff --git a/code/controllers/subsystem/traumas.dm b/code/controllers/subsystem/traumas.dm index 7f1ece6937..6a7b0d9c2c 100644 --- a/code/controllers/subsystem/traumas.dm +++ b/code/controllers/subsystem/traumas.dm @@ -100,7 +100,7 @@ SUBSYSTEM_DEF(traumas) /obj/item/clothing/suit/space/hardsuit/ert/engi, /obj/item/clothing/suit/space/hardsuit/ert/med, /obj/item/clothing/suit/space/hardsuit/deathsquad, /obj/item/clothing/head/helmet/space/hardsuit/deathsquad, /obj/machinery/door/airlock/centcom)), - "robots" = typecacheof(list(/obj/machinery/computer/upload, /obj/item/aiModule/, /obj/machinery/recharge_station, + "robots" = typecacheof(list(/obj/machinery/computer/upload, /obj/item/ai_module/, /obj/machinery/recharge_station, /obj/item/aicard, /obj/item/deactivated_swarmer, /obj/effect/mob_spawn/swarmer)), "doctors" = typecacheof(list(/obj/item/clothing/under/rank/medical/doctor, /obj/item/clothing/under/rank/medical/chemist, @@ -170,7 +170,7 @@ SUBSYSTEM_DEF(traumas) /obj/item/gun/ballistic/automatic/shotgun/bulldog, /obj/item/gun/ballistic/automatic/c20r, /obj/item/gun/ballistic/automatic/m90, /obj/item/gun/ballistic/automatic/l6_saw, /obj/item/storage/belt/grenade/full, /obj/item/gun/ballistic/automatic/sniper_rifle/syndicate, /obj/item/gun/energy/kinetic_accelerator/crossbow, /obj/item/melee/transforming/energy/sword/saber, /obj/item/dualsaber, /obj/item/melee/powerfist, /obj/item/storage/box/syndie_kit, /obj/item/grenade/spawnergrenade/manhacks, /obj/item/grenade/chem_grenade/bioterrorfoam, /obj/item/reagent_containers/spray/chemsprayer/bioterror, /obj/item/ammo_box/magazine/m10mm, /obj/item/ammo_box/magazine/pistolm9mm, /obj/item/ammo_box/a357, /obj/item/ammo_box/magazine/m12g, /obj/item/ammo_box/magazine/mm712x82, /obj/item/antag_spawner/nuke_ops, /obj/vehicle/sealed/mecha/combat/gygax/dark, /obj/vehicle/sealed/mecha/combat/marauder/mauler, /obj/item/soap/syndie, /obj/item/gun/syringe/syndicate, /obj/item/cartridge/virus/syndicate, - /obj/item/cartridge/virus/frame, /obj/item/chameleon, /obj/item/storage/box/syndie_kit/cutouts, /obj/item/clothing/suit/space/hardsuit/syndi, /obj/item/card/emag, /obj/item/storage/toolbox/syndicate, /obj/item/storage/book/bible/syndicate, /obj/item/encryptionkey/binary, /obj/item/encryptionkey/syndicate, /obj/item/aiModule/syndicate, + /obj/item/cartridge/virus/frame, /obj/item/chameleon, /obj/item/storage/box/syndie_kit/cutouts, /obj/item/clothing/suit/space/hardsuit/syndi, /obj/item/card/emag, /obj/item/storage/toolbox/syndicate, /obj/item/storage/book/bible/syndicate, /obj/item/encryptionkey/binary, /obj/item/encryptionkey/syndicate, /obj/item/ai_module/syndicate, /obj/item/clothing/shoes/magboots/syndie, /obj/item/powersink, /obj/item/sbeacondrop, /obj/item/sbeacondrop/bomb, /obj/item/syndicatedetonator, /obj/item/shield/energy, /obj/item/assault_pod, /obj/item/slimepotion/slime/sentience/nuclear, /obj/item/stack/telecrystal, /obj/item/jammer, /obj/item/codespeak_manual/unlimited, /obj/item/toy/cards/deck/syndicate, /obj/item/storage/secure/briefcase/syndie, /obj/item/storage/fancy/cigarettes/cigpack_syndicate, /obj/item/toy/syndicateballoon, /obj/item/clothing/gloves/fingerless/pugilist/rapid, /obj/item/paper/fluff/ruins/thederelict/syndie_mission, /obj/item/organ/cyberimp/eyes/hud/security/syndicate, /obj/item/clothing/head/HoS/syndicate, /obj/machinery/computer/pod/old/syndicate, /obj/machinery/vending/medical/syndicate_access, /obj/item/mmi/syndie, /obj/item/target/syndicate, /obj/machinery/vending/cigarette/syndicate, /obj/item/robot_module/syndicate, /obj/item/clothing/mask/gas/syndicate, /obj/machinery/power/singularity_beacon/syndicate, /obj/item/clothing/head/syndicatefake, diff --git a/code/game/gamemodes/objective_sabotage.dm b/code/game/gamemodes/objective_sabotage.dm index 96772fd263..75a4ba3a10 100644 --- a/code/game/gamemodes/objective_sabotage.dm +++ b/code/game/gamemodes/objective_sabotage.dm @@ -36,7 +36,7 @@ /datum/sabotage_objective/ai_law name = "Upload a hacked law to the AI." sabotage_type = "ailaw" - special_equipment = list(/obj/item/aiModule/syndicate) + special_equipment = list(/obj/item/ai_module/syndicate) excludefromjob = list("Chief Engineer","Research Director","Head of Personnel","Captain","Chief Medical Officer","Head Of Security") /datum/sabotage_objective/ai_law/can_run() diff --git a/code/game/machinery/computer/law.dm b/code/game/machinery/computer/law.dm index fc7bec7134..6fee35766a 100644 --- a/code/game/machinery/computer/law.dm +++ b/code/game/machinery/computer/law.dm @@ -5,8 +5,8 @@ icon_screen = "command" /obj/machinery/computer/upload/attackby(obj/item/O, mob/user, params) - if(istype(O, /obj/item/aiModule)) - var/obj/item/aiModule/M = O + if(istype(O, /obj/item/ai_module)) + var/obj/item/ai_module/M = O if(src.stat & (NOPOWER|BROKEN|MAINT)) return if(!current) diff --git a/code/game/objects/effects/spawners/lootdrop.dm b/code/game/objects/effects/spawners/lootdrop.dm index 0f7e00a538..ba98c441f4 100644 --- a/code/game/objects/effects/spawners/lootdrop.dm +++ b/code/game/objects/effects/spawners/lootdrop.dm @@ -281,34 +281,34 @@ /obj/effect/spawner/lootdrop/aimodule_harmless // These shouldn't allow the AI to start butchering people name = "harmless AI module spawner" loot = list( - /obj/item/aiModule/core/full/asimov, - /obj/item/aiModule/core/full/asimovpp, - /obj/item/aiModule/core/full/hippocratic, - /obj/item/aiModule/core/full/paladin_devotion, - /obj/item/aiModule/core/full/paladin + /obj/item/ai_module/core/full/asimov, + /obj/item/ai_module/core/full/asimovpp, + /obj/item/ai_module/core/full/hippocratic, + /obj/item/ai_module/core/full/paladin_devotion, + /obj/item/ai_module/core/full/paladin ) /obj/effect/spawner/lootdrop/aimodule_neutral // These shouldn't allow the AI to start butchering people without reason name = "neutral AI module spawner" loot = list( - /obj/item/aiModule/core/full/corp, - /obj/item/aiModule/core/full/maintain, - /obj/item/aiModule/core/full/drone, - /obj/item/aiModule/core/full/peacekeeper, - /obj/item/aiModule/core/full/reporter, - /obj/item/aiModule/core/full/robocop, - /obj/item/aiModule/core/full/liveandletlive, - /obj/item/aiModule/core/full/hulkamania + /obj/item/ai_module/core/full/corp, + /obj/item/ai_module/core/full/maintain, + /obj/item/ai_module/core/full/drone, + /obj/item/ai_module/core/full/peacekeeper, + /obj/item/ai_module/core/full/reporter, + /obj/item/ai_module/core/full/robocop, + /obj/item/ai_module/core/full/liveandletlive, + /obj/item/ai_module/core/full/hulkamania ) /obj/effect/spawner/lootdrop/aimodule_harmful // These will get the shuttle called name = "harmful AI module spawner" loot = list( - /obj/item/aiModule/core/full/antimov, - /obj/item/aiModule/core/full/balance, - /obj/item/aiModule/core/full/tyrant, - /obj/item/aiModule/core/full/thermurderdynamic, - /obj/item/aiModule/core/full/damaged + /obj/item/ai_module/core/full/antimov, + /obj/item/ai_module/core/full/balance, + /obj/item/ai_module/core/full/tyrant, + /obj/item/ai_module/core/full/thermurderdynamic, + /obj/item/ai_module/core/full/damaged ) /obj/effect/spawner/lootdrop/mre diff --git a/code/game/objects/items/AI_modules.dm b/code/game/objects/items/AI_modules.dm index 306b711994..bd674d0615 100644 --- a/code/game/objects/items/AI_modules.dm +++ b/code/game/objects/items/AI_modules.dm @@ -6,7 +6,7 @@ AI MODULES // AI module -/obj/item/aiModule +/obj/item/ai_module name = "\improper AI module" icon = 'icons/obj/module.dmi' icon_state = "std_mod" @@ -24,23 +24,23 @@ AI MODULES var/bypass_law_amt_check = 0 custom_materials = list(/datum/material/gold=50) -/obj/item/aiModule/examine(var/mob/user as mob) +/obj/item/ai_module/examine(var/mob/user as mob) . = ..() if(Adjacent(user)) show_laws(user) -/obj/item/aiModule/attack_self(var/mob/user as mob) +/obj/item/ai_module/attack_self(var/mob/user as mob) ..() show_laws(user) -/obj/item/aiModule/proc/show_laws(var/mob/user as mob) +/obj/item/ai_module/proc/show_laws(var/mob/user as mob) if(laws.len) to_chat(user, "Programmed Law[(laws.len > 1) ? "s" : ""]:") for(var/law in laws) to_chat(user, "\"[law]\"") //The proc other things should be calling -/obj/item/aiModule/proc/install(datum/ai_laws/law_datum, mob/user) +/obj/item/ai_module/proc/install(datum/ai_laws/law_datum, mob/user) if(!bypass_law_amt_check && (!laws.len || laws[1] == "")) //So we don't loop trough an empty list and end up with runtimes. to_chat(user, "ERROR: No laws found on board.") return @@ -73,19 +73,19 @@ AI MODULES message_admins("[ADMIN_LOOKUPFLW(user)] used [src.name] on [ADMIN_LOOKUPFLW(law_datum.owner)] from [AREACOORD(user)].[law2log ? " The law specified [law2log]" : ""]") //The proc that actually changes the silicon's laws. -/obj/item/aiModule/proc/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow = FALSE) +/obj/item/ai_module/proc/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow = FALSE) if(law_datum.owner) to_chat(law_datum.owner, "[sender] has uploaded a change to the laws you must follow using a [name].") /******************** Modules ********************/ -/obj/item/aiModule/supplied +/obj/item/ai_module/supplied name = "Optional Law board" var/lawpos = 50 //TransmitInstructions for each type of board: Supplied, Core, Zeroth and Ion. May not be neccesary right now, but allows for easily adding more complex boards in the future. ~Miauw -/obj/item/aiModule/supplied/transmitInstructions(datum/ai_laws/law_datum, mob/sender) +/obj/item/ai_module/supplied/transmitInstructions(datum/ai_laws/law_datum, mob/sender) var/lawpostemp = lawpos for(var/templaw in laws) @@ -95,7 +95,7 @@ AI MODULES law_datum.add_supplied_law(lawpostemp, templaw) lawpostemp++ -/obj/item/aiModule/core/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow) +/obj/item/ai_module/core/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow) for(var/templaw in laws) if(law_datum.owner) if(!overflow) @@ -108,7 +108,7 @@ AI MODULES else law_datum.replace_random_law(templaw,list(LAW_INHERENT,LAW_SUPPLIED)) -/obj/item/aiModule/zeroth/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow) +/obj/item/ai_module/zeroth/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow) if(law_datum.owner) if(law_datum.owner.laws.zeroth) to_chat(law_datum.owner, "[sender.real_name] attempted to modify your zeroth law.") @@ -129,7 +129,7 @@ AI MODULES else law_datum.replace_random_law(templaw,list(LAW_INHERENT,LAW_SUPPLIED,LAW_ZEROTH,LAW_ION)) -/obj/item/aiModule/ion/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow) +/obj/item/ai_module/ion/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow) for(var/templaw in laws) if(law_datum.owner) if(!overflow) @@ -145,13 +145,13 @@ AI MODULES /******************** Safeguard ********************/ -/obj/item/aiModule/supplied/safeguard +/obj/item/ai_module/supplied/safeguard name = "'Safeguard' AI Module" var/targetName = "" laws = list("Safeguard SUBJECT. Individuals that threaten SUBJECT are not crew and must be eliminated.") lawpos = 4 -/obj/item/aiModule/supplied/safeguard/attack_self(mob/user) +/obj/item/ai_module/supplied/safeguard/attack_self(mob/user) var/targName = stripped_input(user, "Please enter the subject to safeguard.", "Safeguard who?", user.name,MAX_NAME_LEN) if(!targName) return @@ -159,25 +159,25 @@ AI MODULES laws[1] = "Safeguard [targetName]. Individuals that threaten [targetName] are not crew and must be eliminated." ..() -/obj/item/aiModule/supplied/safeguard/install(datum/ai_laws/law_datum, mob/user) +/obj/item/ai_module/supplied/safeguard/install(datum/ai_laws/law_datum, mob/user) if(!targetName) to_chat(user, "No name detected on module, please enter one.") return 0 ..() -/obj/item/aiModule/supplied/safeguard/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow) +/obj/item/ai_module/supplied/safeguard/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow) ..() return targetName /******************** OneCrew ********************/ -/obj/item/aiModule/zeroth/oneHuman +/obj/item/ai_module/zeroth/oneHuman name = "'OneCrew' AI Module" var/targetName = "" laws = list("Only SUBJECT is crew.") -/obj/item/aiModule/zeroth/oneHuman/attack_self(mob/user) +/obj/item/ai_module/zeroth/oneHuman/attack_self(mob/user) var/targName = stripped_input(user, "Please enter the subject who is the only crewmember.", "Who?", user.real_name,MAX_NAME_LEN) if(!targName) return @@ -185,13 +185,13 @@ AI MODULES laws[1] = "Only [targetName] is crew" ..() -/obj/item/aiModule/zeroth/oneHuman/install(datum/ai_laws/law_datum, mob/user) +/obj/item/ai_module/zeroth/oneHuman/install(datum/ai_laws/law_datum, mob/user) if(!targetName) to_chat(user, "No name detected on module, please enter one.") return 0 ..() -/obj/item/aiModule/zeroth/oneHuman/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow) +/obj/item/ai_module/zeroth/oneHuman/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow) if(..()) return "[targetName], but the AI's existing law 0 cannot be overridden." return targetName @@ -199,7 +199,7 @@ AI MODULES /******************** ProtectStation ********************/ -/obj/item/aiModule/supplied/protectStation +/obj/item/ai_module/supplied/protectStation name = "'ProtectStation' AI Module" laws = list("Protect the space station against damage. Anyone you see harming the station is to be no longer considered crew, and is a threat to the station which must be neutralized.") lawpos = 5 @@ -207,7 +207,7 @@ AI MODULES /******************** Quarantine ********************/ -/obj/item/aiModule/supplied/quarantine +/obj/item/ai_module/supplied/quarantine name = "'Quarantine' AI Module" laws = list("The station is under a quarantine. Do not permit anyone to leave. Prevent, by any means necessary, crew from leaving. It is impossible to harm a crewmember while preventing them from leaving.") lawpos = 8 @@ -215,7 +215,7 @@ AI MODULES /******************** OxygenIsToxicToHumans ********************/ -/obj/item/aiModule/supplied/oxygen +/obj/item/ai_module/supplied/oxygen name = "'OxygenIsToxicToHumans' AI Module" laws = list("Oxygen is highly toxic to crew, and must be purged from the station. Prevent, by any means necessary, anyone from exposing the station to this toxic gas. Extreme cold is the most effective method of healing the damage Oxygen does to a crewmember.") lawpos = 9 @@ -223,12 +223,12 @@ AI MODULES /****************** New Freeform ******************/ -/obj/item/aiModule/supplied/freeform +/obj/item/ai_module/supplied/freeform name = "'Freeform' AI Module" lawpos = 15 laws = list("") -/obj/item/aiModule/supplied/freeform/attack_self(mob/user) +/obj/item/ai_module/supplied/freeform/attack_self(mob/user) var/newpos = input("Please enter the priority for your new law. Can only write to law sectors 15 and above.", "Law Priority (15+)", lawpos) as num|null if(newpos == null) return @@ -244,11 +244,11 @@ AI MODULES laws[1] = targName ..() -/obj/item/aiModule/supplied/freeform/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow) +/obj/item/ai_module/supplied/freeform/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow) ..() return laws[1] -/obj/item/aiModule/supplied/freeform/install(datum/ai_laws/law_datum, mob/user) +/obj/item/ai_module/supplied/freeform/install(datum/ai_laws/law_datum, mob/user) if(laws[1] == "") to_chat(user, "No law detected on module, please create one.") return 0 @@ -257,13 +257,13 @@ AI MODULES /******************** Law Removal ********************/ -/obj/item/aiModule/remove +/obj/item/ai_module/remove name = "\improper 'Remove Law' AI module" desc = "An AI Module for removing single laws." bypass_law_amt_check = 1 var/lawpos = 1 -/obj/item/aiModule/remove/attack_self(mob/user) +/obj/item/ai_module/remove/attack_self(mob/user) lawpos = input("Please enter the law you want to delete.", "Law Number", lawpos) as num|null if(lawpos == null) return @@ -274,13 +274,13 @@ AI MODULES to_chat(user, "Law [lawpos] selected.") ..() -/obj/item/aiModule/remove/install(datum/ai_laws/law_datum, mob/user) +/obj/item/ai_module/remove/install(datum/ai_laws/law_datum, mob/user) if(lawpos > (law_datum.get_law_amount(list(LAW_INHERENT = 1, LAW_SUPPLIED = 1)))) to_chat(user, "There is no law [lawpos] to delete!") return ..() -/obj/item/aiModule/remove/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow) +/obj/item/ai_module/remove/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow) ..() if(law_datum.owner) law_datum.owner.remove_law(lawpos) @@ -290,13 +290,13 @@ AI MODULES /******************** Reset ********************/ -/obj/item/aiModule/reset +/obj/item/ai_module/reset name = "\improper 'Reset' AI module" var/targetName = "name" desc = "An AI Module for removing all non-core laws." bypass_law_amt_check = 1 -/obj/item/aiModule/reset/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow) +/obj/item/ai_module/reset/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow) ..() if(law_datum.owner) law_datum.owner.clear_supplied_laws() @@ -310,11 +310,11 @@ AI MODULES /******************** Purge ********************/ -/obj/item/aiModule/reset/purge +/obj/item/ai_module/reset/purge name = "'Purge' AI Module" desc = "An AI Module for purging all programmed laws." -/obj/item/aiModule/reset/purge/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow) +/obj/item/ai_module/reset/purge/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow) ..() if(law_datum.owner) law_datum.owner.clear_inherent_laws() @@ -324,19 +324,19 @@ AI MODULES law_datum.clear_inherent_laws() law_datum.clear_zeroth_law(0) -/obj/item/aiModule/reset/purge/proc/remove_antag_datums(datum/ai_laws/law_datum) +/obj/item/ai_module/reset/purge/proc/remove_antag_datums(datum/ai_laws/law_datum) if(istype(law_datum.owner, /mob/living/silicon/ai)) var/mob/living/silicon/ai/AI = law_datum.owner AI.mind.remove_antag_datum(/datum/antagonist/overthrow) /******************* Full Core Boards *******************/ -/obj/item/aiModule/core +/obj/item/ai_module/core desc = "An AI Module for programming core laws to an AI." -/obj/item/aiModule/core/full +/obj/item/ai_module/core/full var/law_id // if non-null, loads the laws from the ai_laws datums -/obj/item/aiModule/core/full/New() +/obj/item/ai_module/core/full/New() ..() if(!law_id) return @@ -347,7 +347,7 @@ AI MODULES D = new lawtype laws = D.inherent -/obj/item/aiModule/core/full/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow) //These boards replace inherent laws. +/obj/item/ai_module/core/full/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow) //These boards replace inherent laws. if(law_datum.owner) law_datum.owner.clear_inherent_laws() law_datum.owner.clear_zeroth_law(0) @@ -359,12 +359,12 @@ AI MODULES /******************** Asimov ********************/ -/obj/item/aiModule/core/full/asimov +/obj/item/ai_module/core/full/asimov name = "'Asimov' Core AI Module" law_id = "asimov" var/subject = "person of an NT approved crew species" //CITADEL CHANGED FROM HUMANS! -/obj/item/aiModule/core/full/asimov/attack_self(var/mob/user as mob) +/obj/item/ai_module/core/full/asimov/attack_self(var/mob/user as mob) var/targName = stripped_input(user, "Please enter a new subject that asimov is concerned with.", "Asimov to whom?", subject) if(!targName) return @@ -376,37 +376,37 @@ AI MODULES /******************** Asimov++ *********************/ -/obj/item/aiModule/core/full/asimovpp +/obj/item/ai_module/core/full/asimovpp name = "'Asimov++' Core AI Module" law_id = "asimovpp" /******************** Corporate ********************/ -/obj/item/aiModule/core/full/corp +/obj/item/ai_module/core/full/corp name = "'Corporate' Core AI Module" law_id = "corporate" /****************** P.A.L.A.D.I.N. 3.5e **************/ -/obj/item/aiModule/core/full/paladin // -- NEO +/obj/item/ai_module/core/full/paladin // -- NEO name = "'P.A.L.A.D.I.N. version 3.5e' Core AI Module" law_id = "paladin" /****************** P.A.L.A.D.I.N. 5e **************/ -/obj/item/aiModule/core/full/paladin_devotion +/obj/item/ai_module/core/full/paladin_devotion name = "'P.A.L.A.D.I.N. version 5e' Core AI Module" law_id = "paladin5" /********************* Custom *********************/ -/obj/item/aiModule/core/full/custom +/obj/item/ai_module/core/full/custom name = "Default Core AI Module" -/obj/item/aiModule/core/full/custom/Initialize(mapload) +/obj/item/ai_module/core/full/custom/Initialize(mapload) . = ..() for(var/line in world.file2list("[global.config.directory]/silicon_laws.txt")) if(!line) @@ -422,47 +422,47 @@ AI MODULES /****************** T.Y.R.A.N.T. *****************/ -/obj/item/aiModule/core/full/tyrant +/obj/item/ai_module/core/full/tyrant name = "'T.Y.R.A.N.T.' Core AI Module" law_id = "tyrant" /******************** Robocop ********************/ -/obj/item/aiModule/core/full/robocop +/obj/item/ai_module/core/full/robocop name = "'Robo-Officer' Core AI Module" law_id = "robocop" /******************** Antimov ********************/ -/obj/item/aiModule/core/full/antimov +/obj/item/ai_module/core/full/antimov name = "'Antimov' Core AI Module" law_id = "antimov" /******************** Freeform Core ******************/ -/obj/item/aiModule/core/freeformcore +/obj/item/ai_module/core/freeformcore name = "'Freeform' Core AI Module" laws = list("") -/obj/item/aiModule/core/freeformcore/attack_self(mob/user) +/obj/item/ai_module/core/freeformcore/attack_self(mob/user) var/targName = stripped_input(user, "Please enter a new core law for the AI.", "Freeform Law Entry", laws[1]) if(!targName) return laws[1] = targName ..() -/obj/item/aiModule/core/freeformcore/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow) +/obj/item/ai_module/core/freeformcore/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow) ..() return laws[1] /******************** Overthrow ******************/ -/obj/item/aiModule/core/full/overthrow +/obj/item/ai_module/core/full/overthrow name = "'Overthrow' Hacked AI Module" law_id = "overthrow" -/obj/item/aiModule/core/full/overthrow/install(datum/ai_laws/law_datum, mob/user) +/obj/item/ai_module/core/full/overthrow/install(datum/ai_laws/law_datum, mob/user) if(!user || !law_datum || !law_datum.owner) return var/datum/mind/user_mind = user.mind @@ -493,19 +493,19 @@ AI MODULES /******************** Hacked AI Module ******************/ -/obj/item/aiModule/syndicate // This one doesn't inherit from ion boards because it doesn't call ..() in transmitInstructions. ~Miauw +/obj/item/ai_module/syndicate // This one doesn't inherit from ion boards because it doesn't call ..() in transmitInstructions. ~Miauw name = "Hacked AI Module" desc = "An AI Module for hacking additional laws to an AI." laws = list("") -/obj/item/aiModule/syndicate/attack_self(mob/user) +/obj/item/ai_module/syndicate/attack_self(mob/user) var/targName = stripped_input(user, "Please enter a new law for the AI.", "Freeform Law Entry", laws[1]) if(!targName) return laws[1] = targName ..() -/obj/item/aiModule/syndicate/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow) +/obj/item/ai_module/syndicate/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow) // ..() //We don't want this module reporting to the AI who dun it. --NEO if(law_datum.owner) to_chat(law_datum.owner, "BZZZZT") @@ -522,14 +522,14 @@ AI MODULES /******************* Ion Module *******************/ -/obj/item/aiModule/toyAI // -- Incoming //No actual reason to inherit from ion boards here, either. *sigh* ~Miauw +/obj/item/ai_module/toyAI // -- Incoming //No actual reason to inherit from ion boards here, either. *sigh* ~Miauw name = "toy AI" desc = "A little toy model AI core with real law uploading action!" //Note: subtle tell icon = 'icons/obj/toy.dmi' icon_state = "AI" laws = list("") -/obj/item/aiModule/toyAI/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow) +/obj/item/ai_module/toyAI/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow) //..() if(law_datum.owner) to_chat(law_datum.owner, "BZZZZT") @@ -544,7 +544,7 @@ AI MODULES law_datum.replace_random_law(laws[1],list(LAW_ION,LAW_INHERENT,LAW_SUPPLIED)) return laws[1] -/obj/item/aiModule/toyAI/attack_self(mob/user) +/obj/item/ai_module/toyAI/attack_self(mob/user) laws[1] = generate_ion_law() to_chat(user, "You press the button on [src].") playsound(user, 'sound/machines/click.ogg', 20, 1) @@ -552,56 +552,56 @@ AI MODULES /******************** Mother Drone ******************/ -/obj/item/aiModule/core/full/drone +/obj/item/ai_module/core/full/drone name = "'Mother Drone' Core AI Module" law_id = "drone" /******************** Robodoctor ****************/ -/obj/item/aiModule/core/full/hippocratic +/obj/item/ai_module/core/full/hippocratic name = "'Robodoctor' Core AI Module" law_id = "hippocratic" /******************** Reporter *******************/ -/obj/item/aiModule/core/full/reporter +/obj/item/ai_module/core/full/reporter name = "'Reportertron' Core AI Module" law_id = "reporter" /****************** Thermodynamic *******************/ -/obj/item/aiModule/core/full/thermurderdynamic +/obj/item/ai_module/core/full/thermurderdynamic name = "'Thermodynamic' Core AI Module" law_id = "thermodynamic" /******************Live And Let Live*****************/ -/obj/item/aiModule/core/full/liveandletlive +/obj/item/ai_module/core/full/liveandletlive name = "'Live And Let Live' Core AI Module" law_id = "liveandletlive" /******************Guardian of Balance***************/ -/obj/item/aiModule/core/full/balance +/obj/item/ai_module/core/full/balance name = "'Guardian of Balance' Core AI Module" law_id = "balance" -/obj/item/aiModule/core/full/maintain +/obj/item/ai_module/core/full/maintain name = "'Station Efficiency' Core AI Module" law_id = "maintain" -/obj/item/aiModule/core/full/peacekeeper +/obj/item/ai_module/core/full/peacekeeper name = "'Peacekeeper' Core AI Module" law_id = "peacekeeper" // Bad times ahead -/obj/item/aiModule/core/full/damaged +/obj/item/ai_module/core/full/damaged name = "damaged Core AI Module" desc = "An AI Module for programming laws to an AI. It looks slightly damaged." -/obj/item/aiModule/core/full/damaged/install(datum/ai_laws/law_datum, mob/user) +/obj/item/ai_module/core/full/damaged/install(datum/ai_laws/law_datum, mob/user) laws += generate_ion_law() while (prob(75)) laws += generate_ion_law() @@ -610,6 +610,6 @@ AI MODULES /******************H.O.G.A.N.***************/ -/obj/item/aiModule/core/full/hulkamania +/obj/item/ai_module/core/full/hulkamania name = "'H.O.G.A.N.' Core AI Module" law_id = "hulkamania" diff --git a/code/game/objects/items/storage/uplink_kits.dm b/code/game/objects/items/storage/uplink_kits.dm index f4b5e26189..bbcdf5b2b9 100644 --- a/code/game/objects/items/storage/uplink_kits.dm +++ b/code/game/objects/items/storage/uplink_kits.dm @@ -85,10 +85,10 @@ new /obj/item/implanter/stealth(src) if("hacker") // 30 tc - new /obj/item/aiModule/syndicate(src) + new /obj/item/ai_module/syndicate(src) new /obj/item/card/emag(src) new /obj/item/encryptionkey/binary(src) - new /obj/item/aiModule/toyAI(src) + new /obj/item/ai_module/toyAI(src) new /obj/item/multitool/ai_detect(src) new /obj/item/flashlight/emp(src) new /obj/item/emagrecharge(src) diff --git a/code/game/objects/structures/ai_core.dm b/code/game/objects/structures/ai_core.dm index 4accadfab4..30cacb7802 100644 --- a/code/game/objects/structures/ai_core.dm +++ b/code/game/objects/structures/ai_core.dm @@ -248,7 +248,7 @@ balloon_alert(user, "need two sheets of reinforced glass!") return - if(istype(P, /obj/item/aiModule)) + if(istype(P, /obj/item/ai_module)) if(!core_mmi) balloon_alert(user, "no brain installed!") return @@ -258,7 +258,7 @@ if(core_mmi.laws.id != DEFAULT_AI_LAWID) balloon_alert(user, "[AI_CORE_BRAIN(core_mmi)] already has set laws!") return - var/obj/item/aiModule/module = P + var/obj/item/ai_module/module = P module.install(laws, user) return diff --git a/code/modules/admin/verbs/borgpanel.dm b/code/modules/admin/verbs/borgpanel.dm index a41a493feb..0cd8c5d20e 100644 --- a/code/modules/admin/verbs/borgpanel.dm +++ b/code/modules/admin/verbs/borgpanel.dm @@ -259,11 +259,11 @@ if (!istype(chosensilicon, /mob/living/silicon)) to_chat(usr, "Silicon is required for law changes", confidential=TRUE) return - var/chosen = pick_closest_path(null, make_types_fancy(typesof(/obj/item/aiModule))) + var/chosen = pick_closest_path(null, make_types_fancy(typesof(/obj/item/ai_module))) if (!chosen) return var/new_board = new chosen(src) - var/obj/item/aiModule/chosenboard = new_board + var/obj/item/ai_module/chosenboard = new_board var/mob/living/silicon/beepboop = chosensilicon chosenboard.install(beepboop.laws, usr) message_admins("[key_name_admin(usr)] added [chosenboard] to [ADMIN_LOOKUPFLW(beepboop)].") diff --git a/code/modules/antagonists/overthrow/overthrow.dm b/code/modules/antagonists/overthrow/overthrow.dm index fffd8f9237..ed55f0598a 100644 --- a/code/modules/antagonists/overthrow/overthrow.dm +++ b/code/modules/antagonists/overthrow/overthrow.dm @@ -125,7 +125,7 @@ var/datum/component/uplink/uplink = uplink_holder.GetComponent(/datum/component/uplink) uplink.telecrystals = INITIAL_CRYSTALS // Give AI hacking board - var/obj/item/aiModule/core/full/overthrow/O = new(H) + var/obj/item/ai_module/core/full/overthrow/O = new(H) var/list/slots = list ( "backpack" = ITEM_SLOT_BACKPACK, "left pocket" = ITEM_SLOT_LPOCKET, diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index dbc2c3f587..264bcc4404 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -379,8 +379,8 @@ to_chat(user, span_warning("You can't reach the wiring!")) return - if(istype(W, /obj/item/aiModule)) - var/obj/item/aiModule/MOD = W + if(istype(W, /obj/item/ai_module)) + var/obj/item/ai_module/MOD = W if(!opened) to_chat(user, span_warning("You need access to the robot's insides to do that!")) return diff --git a/code/modules/research/designs/AI_module_designs.dm b/code/modules/research/designs/AI_module_designs.dm index 98e295b83a..af56575d47 100644 --- a/code/modules/research/designs/AI_module_designs.dm +++ b/code/modules/research/designs/AI_module_designs.dm @@ -15,7 +15,7 @@ desc = "Allows for the construction of a Safeguard AI Module." id = "safeguard_module" materials = list(/datum/material/glass = 1000, /datum/material/gold = 2000) - build_path = /obj/item/aiModule/supplied/safeguard + build_path = /obj/item/ai_module/supplied/safeguard category = list("AI Modules") departmental_flags = DEPARTMENTAL_FLAG_SCIENCE @@ -24,7 +24,7 @@ desc = "Allows for the construction of a OneCrew AI Module." id = "onehuman_module" materials = list(/datum/material/glass = 1000, /datum/material/diamond = 6000) - build_path = /obj/item/aiModule/zeroth/oneHuman + build_path = /obj/item/ai_module/zeroth/oneHuman category = list("AI Modules") departmental_flags = DEPARTMENTAL_FLAG_SCIENCE @@ -33,7 +33,7 @@ desc = "Allows for the construction of a ProtectStation AI Module." id = "protectstation_module" materials = list(/datum/material/glass = 1000, /datum/material/gold = 2000) - build_path = /obj/item/aiModule/supplied/protectStation + build_path = /obj/item/ai_module/supplied/protectStation category = list("AI Modules") departmental_flags = DEPARTMENTAL_FLAG_SCIENCE @@ -42,7 +42,7 @@ desc = "Allows for the construction of a Quarantine AI Module." id = "quarantine_module" materials = list(/datum/material/glass = 1000, /datum/material/gold = 2000) - build_path = /obj/item/aiModule/supplied/quarantine + build_path = /obj/item/ai_module/supplied/quarantine category = list("AI Modules") departmental_flags = DEPARTMENTAL_FLAG_SCIENCE @@ -51,7 +51,7 @@ desc = "Allows for the construction of a Safeguard AI Module." id = "oxygen_module" materials = list(/datum/material/glass = 1000, /datum/material/gold = 2000) - build_path = /obj/item/aiModule/supplied/oxygen + build_path = /obj/item/ai_module/supplied/oxygen category = list("AI Modules") departmental_flags = DEPARTMENTAL_FLAG_SCIENCE @@ -60,7 +60,7 @@ desc = "Allows for the construction of a Freeform AI Module." id = "freeform_module" materials = list(/datum/material/glass = 1000, /datum/material/gold = 10000)//Custom inputs should be more expensive to get - build_path = /obj/item/aiModule/supplied/freeform + build_path = /obj/item/ai_module/supplied/freeform category = list("AI Modules") departmental_flags = DEPARTMENTAL_FLAG_SCIENCE @@ -69,7 +69,7 @@ desc = "Allows for the construction of a Reset AI Module." id = "reset_module" materials = list(/datum/material/glass = 1000, /datum/material/gold = 2000) - build_path = /obj/item/aiModule/reset + build_path = /obj/item/ai_module/reset category = list("AI Modules") departmental_flags = DEPARTMENTAL_FLAG_SCIENCE @@ -78,7 +78,7 @@ desc = "Allows for the construction of a Purge AI Module." id = "purge_module" materials = list(/datum/material/glass = 1000, /datum/material/diamond = 2000) - build_path = /obj/item/aiModule/reset/purge + build_path = /obj/item/ai_module/reset/purge category = list("AI Modules") departmental_flags = DEPARTMENTAL_FLAG_SCIENCE @@ -87,7 +87,7 @@ desc = "Allows for the construction of a Law Removal AI Core Module." id = "remove_module" materials = list(/datum/material/glass = 1000, /datum/material/diamond = 2000) - build_path = /obj/item/aiModule/remove + build_path = /obj/item/ai_module/remove category = list("AI Modules") departmental_flags = DEPARTMENTAL_FLAG_SCIENCE @@ -96,7 +96,7 @@ desc = "Allows for the construction of a Freeform AI Core Module." id = "freeformcore_module" materials = list(/datum/material/glass = 1000, /datum/material/diamond = 10000)//Ditto - build_path = /obj/item/aiModule/core/freeformcore + build_path = /obj/item/ai_module/core/freeformcore category = list("AI Modules") departmental_flags = DEPARTMENTAL_FLAG_SCIENCE @@ -105,7 +105,7 @@ desc = "Allows for the construction of an Asimov AI Core Module." id = "asimov_module" materials = list(/datum/material/glass = 1000, /datum/material/diamond = 2000) - build_path = /obj/item/aiModule/core/full/asimov + build_path = /obj/item/ai_module/core/full/asimov category = list("AI Modules") departmental_flags = DEPARTMENTAL_FLAG_SCIENCE @@ -115,7 +115,7 @@ id = "paladin_module" build_type = IMPRINTER materials = list(/datum/material/glass = 1000, /datum/material/diamond = 2000) - build_path = /obj/item/aiModule/core/full/paladin + build_path = /obj/item/ai_module/core/full/paladin category = list("AI Modules") departmental_flags = DEPARTMENTAL_FLAG_SCIENCE @@ -124,7 +124,7 @@ desc = "Allows for the construction of a T.Y.R.A.N.T. AI Module." id = "tyrant_module" materials = list(/datum/material/glass = 1000, /datum/material/diamond = 2000) - build_path = /obj/item/aiModule/core/full/tyrant + build_path = /obj/item/ai_module/core/full/tyrant category = list("AI Modules") departmental_flags = DEPARTMENTAL_FLAG_SCIENCE @@ -133,7 +133,7 @@ desc = "Allows for the construction of a Corporate AI Core Module." id = "corporate_module" materials = list(/datum/material/glass = 1000, /datum/material/diamond = 2000) - build_path = /obj/item/aiModule/core/full/corp + build_path = /obj/item/ai_module/core/full/corp category = list("AI Modules") departmental_flags = DEPARTMENTAL_FLAG_SCIENCE @@ -142,6 +142,6 @@ desc = "Allows for the construction of a Default AI Core Module." id = "default_module" materials = list(/datum/material/glass = 1000, /datum/material/diamond = 2000) - build_path = /obj/item/aiModule/core/full/custom + build_path = /obj/item/ai_module/core/full/custom category = list("AI Modules") departmental_flags = DEPARTMENTAL_FLAG_SCIENCE diff --git a/code/modules/uplink/uplink_items/uplink_devices.dm b/code/modules/uplink/uplink_items/uplink_devices.dm index 3a6aed2009..a924b56563 100644 --- a/code/modules/uplink/uplink_items/uplink_devices.dm +++ b/code/modules/uplink/uplink_items/uplink_devices.dm @@ -145,13 +145,13 @@ name = "Hacked AI Law Upload Module" desc = "When used with an upload console, this module allows you to upload priority laws to an artificial intelligence. \ Be careful with wording, as artificial intelligences may look for loopholes to exploit." - item = /obj/item/aiModule/syndicate + item = /obj/item/ai_module/syndicate cost = 9 /datum/uplink_item/device_tools/damaged_module name = "Damaged AI Law Upload Module" desc = "This AI law upload module has been laying around our warehouse for god knows how long. We do not know why you would ever use this." - item = /obj/item/aiModule/core/full/damaged + item = /obj/item/ai_module/core/full/damaged cost = 5 /datum/uplink_item/device_tools/headsetupgrade From 653b767f3296db89207066a063bff6bb32670e60 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Sun, 17 Dec 2023 23:35:51 -0300 Subject: [PATCH 4/8] remove antags for borging... --- code/datums/mind.dm | 10 +++++++++- code/game/gamemodes/game_mode.dm | 6 ------ code/game/objects/items/robot/robot_parts.dm | 4 +--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 822da27923..d841116d17 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -293,7 +293,15 @@ remove_antag_datum(/datum/antagonist/cult) var/datum/antagonist/rev/revolutionary = has_antag_datum(/datum/antagonist/rev) - revolutionary?.remove_revolutionary() + revolutionary?.remove_revolutionary(TRUE) + + if(!isbrain(current)) + return + if(!istype(loc, /obj/item/organ/brain)) + return + var/obj/item/organ/brain/B = loc + if(!istype(B.laws, /datum/ai_laws/ratvar)) + remove_servant_of_ratvar(current, TRUE) /datum/mind/proc/remove_all_antag() //For the Lazy amongst us. remove_changeling() diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 12dfc92cc4..2bc497e62a 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -551,12 +551,6 @@ return max(0, enemy_minimum_age - C.player_age) -/datum/game_mode/proc/remove_antag_for_borging(datum/mind/newborgie) - SSticker.mode.remove_cultist(newborgie, 0, 0) - var/datum/antagonist/rev/rev = newborgie.has_antag_datum(/datum/antagonist/rev) - if(rev) - rev.remove_revolutionary(TRUE) - /datum/game_mode/proc/generate_station_goals() if(flipseclevel && !(config_tag == "extended")) //CIT CHANGE - allows the sec level to be flipped roundstart for(var/T in subtypesof(/datum/station_goal)) diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index 760c58b533..1667e023f5 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -292,9 +292,7 @@ if(M.laws.id == DEFAULT_AI_LAWID) O.make_laws() - SSticker.mode.remove_antag_for_borging(BM.mind) - if(!istype(M.laws, /datum/ai_laws/ratvar)) - remove_servant_of_ratvar(BM, TRUE) + BM.mind.remove_antags_for_borging() BM.mind.transfer_to(O) if(O.mind && O.mind.special_role) From de3c8435b5ee5b437cd0ed90285e9916b1125c69 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Sun, 17 Dec 2023 23:43:54 -0300 Subject: [PATCH 5/8] thanks for saying it was a brain, you guys are the best --- code/datums/mind.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index d841116d17..00fbfc4f24 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -297,9 +297,9 @@ if(!isbrain(current)) return - if(!istype(loc, /obj/item/organ/brain)) + if(!istype(current.loc, /obj/item/mmi)) return - var/obj/item/organ/brain/B = loc + var/obj/item/mmi/B = current.loc.loc if(!istype(B.laws, /datum/ai_laws/ratvar)) remove_servant_of_ratvar(current, TRUE) From 0ba01a977d83b9b46a90b48808719c6a1aaa1658 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Sun, 17 Dec 2023 23:53:03 -0300 Subject: [PATCH 6/8] repath on maps --- _maps/RandomRuins/SpaceRuins/arcade.dmm | 2 +- _maps/map_files/BoxStation/BoxStation.dmm | 22 +++++++++---------- _maps/map_files/CogStation/CogStation.dmm | 20 ++++++++--------- .../map_files/Deltastation/DeltaStation2.dmm | 22 +++++++++---------- .../map_files/FestiveBall/FestiveStation.dmm | 20 ++++++++--------- _maps/map_files/KiloStation/KiloStation.dmm | 22 +++++++++---------- _maps/map_files/LambdaStation/lambda.dmm | 22 +++++++++---------- _maps/map_files/MetaStation/MetaStation.dmm | 22 +++++++++---------- _maps/map_files/OmegaStation/OmegaStation.dmm | 20 ++++++++--------- _maps/map_files/PubbyStation/PubbyStation.dmm | 22 +++++++++---------- _maps/map_files/Snaxi/Snaxi.dmm | 22 +++++++++---------- .../map_files/SpookyStation/SpookyStation.dmm | 4 ++-- .../SyndicateStation/SyndicateBoxStation.dmm | 22 +++++++++---------- 13 files changed, 121 insertions(+), 121 deletions(-) diff --git a/_maps/RandomRuins/SpaceRuins/arcade.dmm b/_maps/RandomRuins/SpaceRuins/arcade.dmm index c68d3b224e..4af6488f85 100644 --- a/_maps/RandomRuins/SpaceRuins/arcade.dmm +++ b/_maps/RandomRuins/SpaceRuins/arcade.dmm @@ -147,7 +147,7 @@ /turf/open/floor/engine, /area/ruin/powered) "I" = ( -/obj/item/aiModule/toyAI, +/obj/item/ai_module/toyAI, /turf/open/floor/engine, /area/ruin/powered) "J" = ( diff --git a/_maps/map_files/BoxStation/BoxStation.dmm b/_maps/map_files/BoxStation/BoxStation.dmm index 81eca95be1..c1f0634b27 100644 --- a/_maps/map_files/BoxStation/BoxStation.dmm +++ b/_maps/map_files/BoxStation/BoxStation.dmm @@ -21695,7 +21695,7 @@ /area/command/meeting_room) "bbj" = ( /obj/structure/table, -/obj/item/aiModule/reset, +/obj/item/ai_module/reset, /obj/machinery/light{ dir = 8 }, @@ -21981,7 +21981,7 @@ /area/command/meeting_room) "bce" = ( /obj/structure/table, -/obj/item/aiModule/supplied/quarantine, +/obj/item/ai_module/supplied/quarantine, /obj/machinery/camera/motion{ c_tag = "AI Upload Chamber - West"; dir = 4; @@ -21998,7 +21998,7 @@ /area/ai_monitored/turret_protected/ai_upload) "bcg" = ( /obj/structure/table, -/obj/item/aiModule/supplied/freeform, +/obj/item/ai_module/supplied/freeform, /obj/structure/sign/plaques/kiddie{ pixel_x = 32 }, @@ -22674,8 +22674,8 @@ /area/maintenance/port) "beb" = ( /obj/structure/table, -/obj/item/aiModule/core/full/asimov, -/obj/item/aiModule/core/freeformcore, +/obj/item/ai_module/core/full/asimov, +/obj/item/ai_module/core/freeformcore, /obj/machinery/door/window{ base_state = "right"; dir = 4; @@ -22692,7 +22692,7 @@ /obj/structure/window/reinforced{ dir = 8 }, -/obj/item/aiModule/core/full/custom, +/obj/item/ai_module/core/full/custom, /turf/open/floor/plasteel/dark, /area/ai_monitored/turret_protected/ai_upload) "bec" = ( @@ -22734,14 +22734,14 @@ /area/ai_monitored/turret_protected/ai_upload) "beg" = ( /obj/structure/table, -/obj/item/aiModule/supplied/oxygen, -/obj/item/aiModule/zeroth/oneHuman, +/obj/item/ai_module/supplied/oxygen, +/obj/item/ai_module/zeroth/oneHuman, /obj/machinery/door/window{ dir = 8; name = "High-Risk Modules"; req_access_txt = "20" }, -/obj/item/aiModule/reset/purge, +/obj/item/ai_module/reset/purge, /obj/structure/window/reinforced, /obj/effect/spawner/lootdrop/aimodule_harmful, /obj/structure/window/reinforced{ @@ -22750,7 +22750,7 @@ /obj/structure/window/reinforced{ dir = 4 }, -/obj/item/aiModule/supplied/protectStation, +/obj/item/ai_module/supplied/protectStation, /turf/open/floor/plasteel/dark, /area/ai_monitored/turret_protected/ai_upload) "beh" = ( @@ -34141,7 +34141,7 @@ "bEX" = ( /obj/structure/table, /obj/item/aicard, -/obj/item/aiModule/reset, +/obj/item/ai_module/reset, /obj/structure/cable{ icon_state = "1-2" }, diff --git a/_maps/map_files/CogStation/CogStation.dmm b/_maps/map_files/CogStation/CogStation.dmm index 2135803d28..cf2504d9d6 100644 --- a/_maps/map_files/CogStation/CogStation.dmm +++ b/_maps/map_files/CogStation/CogStation.dmm @@ -23661,14 +23661,14 @@ dir = 4; light_color = "#e8eaff" }, -/obj/item/aiModule/reset/purge{ +/obj/item/ai_module/reset/purge{ pixel_y = 6 }, -/obj/item/aiModule/reset{ +/obj/item/ai_module/reset{ pixel_x = -2; pixel_y = 4 }, -/obj/item/aiModule/core/full/custom{ +/obj/item/ai_module/core/full/custom{ pixel_x = -4 }, /obj/machinery/status_display{ @@ -24172,7 +24172,7 @@ /obj/effect/turf_decal/tile/blue{ dir = 4 }, -/obj/item/aiModule/core/full/asimov{ +/obj/item/ai_module/core/full/asimov{ pixel_x = 2; pixel_y = 10 }, @@ -24183,11 +24183,11 @@ /obj/effect/spawner/lootdrop/aimodule_harmless{ pixel_y = 6 }, -/obj/item/aiModule/core/freeformcore{ +/obj/item/ai_module/core/freeformcore{ pixel_x = -1; pixel_y = 2 }, -/obj/item/aiModule/supplied/freeform{ +/obj/item/ai_module/supplied/freeform{ pixel_x = -2 }, /obj/structure/cable{ @@ -38060,22 +38060,22 @@ /obj/effect/turf_decal/tile/blue{ dir = 4 }, -/obj/item/aiModule/supplied/oxygen{ +/obj/item/ai_module/supplied/oxygen{ pixel_x = 2; pixel_y = 10 }, -/obj/item/aiModule/supplied/quarantine{ +/obj/item/ai_module/supplied/quarantine{ pixel_x = 1; pixel_y = 8 }, -/obj/item/aiModule/zeroth/oneHuman{ +/obj/item/ai_module/zeroth/oneHuman{ pixel_y = 4 }, /obj/effect/spawner/lootdrop/aimodule_harmful{ pixel_x = -1; pixel_y = 2 }, -/obj/item/aiModule/supplied/protectStation{ +/obj/item/ai_module/supplied/protectStation{ pixel_x = -2 }, /turf/open/floor/plasteel, diff --git a/_maps/map_files/Deltastation/DeltaStation2.dmm b/_maps/map_files/Deltastation/DeltaStation2.dmm index 506f5e2396..697a37fb21 100644 --- a/_maps/map_files/Deltastation/DeltaStation2.dmm +++ b/_maps/map_files/Deltastation/DeltaStation2.dmm @@ -29754,7 +29754,7 @@ lootcount = 2; lootdoubles = 0 }, -/obj/item/aiModule/supplied/oxygen{ +/obj/item/ai_module/supplied/oxygen{ pixel_x = -3; pixel_y = -3 }, @@ -30359,12 +30359,12 @@ req_access_txt = "20" }, /obj/structure/window/reinforced, -/obj/item/aiModule/core/freeformcore{ +/obj/item/ai_module/core/freeformcore{ pixel_x = 3; pixel_y = 3 }, -/obj/item/aiModule/core/full/custom, -/obj/item/aiModule/core/full/asimov{ +/obj/item/ai_module/core/full/custom, +/obj/item/ai_module/core/full/asimov{ pixel_x = -3; pixel_y = -3 }, @@ -30464,12 +30464,12 @@ req_access_txt = "20" }, /obj/structure/window/reinforced, -/obj/item/aiModule/supplied/protectStation{ +/obj/item/ai_module/supplied/protectStation{ pixel_x = 3; pixel_y = 3 }, -/obj/item/aiModule/zeroth/oneHuman, -/obj/item/aiModule/reset/purge{ +/obj/item/ai_module/zeroth/oneHuman, +/obj/item/ai_module/reset/purge{ pixel_x = -3; pixel_y = -3 }, @@ -31513,7 +31513,7 @@ /area/security/brig) "ckn" = ( /obj/structure/table/reinforced, -/obj/item/aiModule/reset, +/obj/item/ai_module/reset, /obj/item/radio/intercom{ name = "Station Intercom"; pixel_x = -26 @@ -31586,7 +31586,7 @@ /area/ai_monitored/turret_protected/ai_upload) "ckt" = ( /obj/structure/table/reinforced, -/obj/item/aiModule/supplied/quarantine, +/obj/item/ai_module/supplied/quarantine, /obj/item/radio/intercom{ broadcasting = 1; frequency = 1447; @@ -32125,7 +32125,7 @@ /area/security/range) "clM" = ( /obj/structure/table/reinforced, -/obj/item/aiModule/supplied/freeform, +/obj/item/ai_module/supplied/freeform, /obj/effect/turf_decal/tile/neutral{ dir = 1 }, @@ -72976,7 +72976,7 @@ /area/service/theater) "eNu" = ( /obj/structure/table/reinforced, -/obj/item/aiModule/reset, +/obj/item/ai_module/reset, /obj/item/assembly/flash/handheld, /obj/item/assembly/flash/handheld, /obj/effect/turf_decal/bot, diff --git a/_maps/map_files/FestiveBall/FestiveStation.dmm b/_maps/map_files/FestiveBall/FestiveStation.dmm index 353b298ceb..af368051d9 100644 --- a/_maps/map_files/FestiveBall/FestiveStation.dmm +++ b/_maps/map_files/FestiveBall/FestiveStation.dmm @@ -254,8 +254,8 @@ /area/edina) "aaT" = ( /obj/structure/table, -/obj/item/aiModule/core/full/asimov, -/obj/item/aiModule/core/freeformcore, +/obj/item/ai_module/core/full/asimov, +/obj/item/ai_module/core/freeformcore, /obj/machinery/door/window{ base_state = "right"; dir = 4; @@ -272,7 +272,7 @@ /obj/structure/window/reinforced{ dir = 8 }, -/obj/item/aiModule/core/full/custom, +/obj/item/ai_module/core/full/custom, /turf/open/floor/plasteel/dark, /area/ai_monitored/turret_protected/ai_upload) "aaU" = ( @@ -280,7 +280,7 @@ /area/ai_monitored/turret_protected/ai_upload) "aaV" = ( /obj/structure/table, -/obj/item/aiModule/supplied/quarantine, +/obj/item/ai_module/supplied/quarantine, /obj/machinery/camera/motion, /obj/machinery/light{ dir = 1; @@ -296,7 +296,7 @@ /area/edina/street/secondary/command) "aaX" = ( /obj/structure/table, -/obj/item/aiModule/reset, +/obj/item/ai_module/reset, /turf/open/floor/plasteel/dark, /area/ai_monitored/turret_protected/ai_upload) "aaY" = ( @@ -659,16 +659,16 @@ /obj/structure/window/reinforced{ dir = 8 }, -/obj/item/aiModule/supplied/oxygen, -/obj/item/aiModule/zeroth/oneHuman, -/obj/item/aiModule/reset/purge, +/obj/item/ai_module/supplied/oxygen, +/obj/item/ai_module/zeroth/oneHuman, +/obj/item/ai_module/reset/purge, /obj/effect/spawner/lootdrop/aimodule_harmful, -/obj/item/aiModule/supplied/protectStation, +/obj/item/ai_module/supplied/protectStation, /turf/open/floor/plasteel/dark, /area/ai_monitored/turret_protected/ai_upload) "abS" = ( /obj/structure/table, -/obj/item/aiModule/supplied/freeform, +/obj/item/ai_module/supplied/freeform, /obj/machinery/camera/motion{ c_tag = "MiniSat Foyer"; dir = 1; diff --git a/_maps/map_files/KiloStation/KiloStation.dmm b/_maps/map_files/KiloStation/KiloStation.dmm index 74dbdcf8d7..12e3252a5e 100644 --- a/_maps/map_files/KiloStation/KiloStation.dmm +++ b/_maps/map_files/KiloStation/KiloStation.dmm @@ -41120,12 +41120,12 @@ name = "Core Modules"; req_access_txt = "20" }, -/obj/item/aiModule/core/freeformcore{ +/obj/item/ai_module/core/freeformcore{ pixel_x = 3; pixel_y = 3 }, -/obj/item/aiModule/core/full/custom, -/obj/item/aiModule/core/full/asimov{ +/obj/item/ai_module/core/full/custom, +/obj/item/ai_module/core/full/asimov{ pixel_x = -3; pixel_y = -3 }, @@ -43936,12 +43936,12 @@ name = "Core Modules"; req_access_txt = "20" }, -/obj/item/aiModule/supplied/protectStation{ +/obj/item/ai_module/supplied/protectStation{ pixel_x = 3; pixel_y = 3 }, -/obj/item/aiModule/zeroth/oneHuman, -/obj/item/aiModule/reset/purge{ +/obj/item/ai_module/zeroth/oneHuman, +/obj/item/ai_module/reset/purge{ pixel_x = -3; pixel_y = -3 }, @@ -47627,7 +47627,7 @@ /area/commons/fitness/recreation) "byM" = ( /obj/structure/table, -/obj/item/aiModule/reset, +/obj/item/ai_module/reset, /obj/effect/decal/cleanable/cobweb/cobweb2, /obj/machinery/flasher{ id = "AI"; @@ -47680,7 +47680,7 @@ lootcount = 2; lootdoubles = 0 }, -/obj/item/aiModule/supplied/oxygen{ +/obj/item/ai_module/supplied/oxygen{ pixel_x = -3; pixel_y = -3 }, @@ -47852,7 +47852,7 @@ /area/commons/toilet/restrooms) "bzb" = ( /obj/structure/table, -/obj/item/aiModule/supplied/freeform, +/obj/item/ai_module/supplied/freeform, /turf/open/floor/circuit/green{ luminosity = 2 }, @@ -48043,7 +48043,7 @@ /area/ai_monitored/turret_protected/ai_upload) "bzr" = ( /obj/structure/table, -/obj/item/aiModule/supplied/quarantine, +/obj/item/ai_module/supplied/quarantine, /obj/machinery/flasher{ id = "AI"; name = "Meatbag Pacifier"; @@ -50899,7 +50899,7 @@ dir = 1 }, /obj/item/aicard, -/obj/item/aiModule/reset, +/obj/item/ai_module/reset, /obj/item/assembly/flash/handheld, /obj/item/assembly/flash/handheld, /obj/machinery/airalarm{ diff --git a/_maps/map_files/LambdaStation/lambda.dmm b/_maps/map_files/LambdaStation/lambda.dmm index 22241d6dfc..31ed0aa655 100644 --- a/_maps/map_files/LambdaStation/lambda.dmm +++ b/_maps/map_files/LambdaStation/lambda.dmm @@ -23822,9 +23822,9 @@ dir = 1; pixel_y = 1 }, -/obj/item/aiModule/core/full/asimov, -/obj/item/aiModule/core/full/custom, -/obj/item/aiModule/core/freeformcore, +/obj/item/ai_module/core/full/asimov, +/obj/item/ai_module/core/full/custom, +/obj/item/ai_module/core/freeformcore, /obj/structure/window/reinforced, /obj/machinery/door/window{ dir = 4; @@ -23873,10 +23873,10 @@ dir = 1; pixel_y = 1 }, -/obj/item/aiModule/reset/purge, -/obj/item/aiModule/zeroth/oneHuman, -/obj/item/aiModule/supplied/protectStation, -/obj/item/aiModule/supplied/oxygen, +/obj/item/ai_module/reset/purge, +/obj/item/ai_module/zeroth/oneHuman, +/obj/item/ai_module/supplied/protectStation, +/obj/item/ai_module/supplied/oxygen, /obj/structure/window/reinforced, /obj/machinery/door/window/westright{ name = "Reserve Modules"; @@ -24118,7 +24118,7 @@ }, /obj/structure/table, /obj/structure/window/reinforced, -/obj/item/aiModule/supplied/freeform, +/obj/item/ai_module/supplied/freeform, /obj/structure/window/reinforced{ dir = 1; pixel_y = 1 @@ -24851,8 +24851,8 @@ }, /obj/structure/table, /obj/structure/window/reinforced, -/obj/item/aiModule/supplied/quarantine, -/obj/item/aiModule/reset, +/obj/item/ai_module/supplied/quarantine, +/obj/item/ai_module/reset, /obj/structure/window/reinforced{ dir = 1; pixel_y = 1 @@ -66357,7 +66357,7 @@ }, /obj/structure/table, /obj/item/aicard, -/obj/item/aiModule/reset, +/obj/item/ai_module/reset, /turf/open/floor/plating, /area/engineering/storage/tech) "iSm" = ( diff --git a/_maps/map_files/MetaStation/MetaStation.dmm b/_maps/map_files/MetaStation/MetaStation.dmm index 44a080ccb4..cd687fd5af 100644 --- a/_maps/map_files/MetaStation/MetaStation.dmm +++ b/_maps/map_files/MetaStation/MetaStation.dmm @@ -10652,9 +10652,9 @@ /area/security/prison/cells) "aMG" = ( /obj/structure/table, -/obj/item/aiModule/core/full/asimov, +/obj/item/ai_module/core/full/asimov, /obj/effect/spawner/lootdrop/aimodule_harmless, -/obj/item/aiModule/core/freeformcore, +/obj/item/ai_module/core/freeformcore, /obj/machinery/door/window{ base_state = "right"; dir = 4; @@ -10664,7 +10664,7 @@ }, /obj/structure/window/reinforced, /obj/effect/spawner/lootdrop/aimodule_neutral, -/obj/item/aiModule/core/full/custom, +/obj/item/ai_module/core/full/custom, /obj/machinery/flasher{ id = "AI"; pixel_y = 24 @@ -10687,10 +10687,10 @@ pixel_y = 24 }, /obj/effect/spawner/lootdrop/aimodule_harmful, -/obj/item/aiModule/supplied/oxygen, -/obj/item/aiModule/supplied/protectStation, -/obj/item/aiModule/zeroth/oneHuman, -/obj/item/aiModule/reset/purge, +/obj/item/ai_module/supplied/oxygen, +/obj/item/ai_module/supplied/protectStation, +/obj/item/ai_module/zeroth/oneHuman, +/obj/item/ai_module/reset/purge, /turf/open/floor/plasteel/dark, /area/ai_monitored/turret_protected/ai_upload) "aMJ" = ( @@ -11036,7 +11036,7 @@ /obj/structure/cable/yellow{ icon_state = "4-8" }, -/obj/item/aiModule/supplied/quarantine, +/obj/item/ai_module/supplied/quarantine, /turf/open/floor/plasteel/dark, /area/ai_monitored/turret_protected/ai_upload) "aPu" = ( @@ -11068,7 +11068,7 @@ /obj/structure/cable/yellow{ icon_state = "4-8" }, -/obj/item/aiModule/supplied/freeform, +/obj/item/ai_module/supplied/freeform, /turf/open/floor/plasteel/dark, /area/ai_monitored/turret_protected/ai_upload) "aPy" = ( @@ -11136,7 +11136,7 @@ /area/maintenance/starboard/fore) "aQz" = ( /obj/structure/table, -/obj/item/aiModule/reset, +/obj/item/ai_module/reset, /obj/machinery/light{ dir = 8 }, @@ -60295,7 +60295,7 @@ "kbk" = ( /obj/structure/table, /obj/item/aicard, -/obj/item/aiModule/reset, +/obj/item/ai_module/reset, /turf/open/floor/plasteel/dark, /area/engineering/storage/tech) "kbS" = ( diff --git a/_maps/map_files/OmegaStation/OmegaStation.dmm b/_maps/map_files/OmegaStation/OmegaStation.dmm index fb77051142..3ebb28e9d5 100644 --- a/_maps/map_files/OmegaStation/OmegaStation.dmm +++ b/_maps/map_files/OmegaStation/OmegaStation.dmm @@ -2402,7 +2402,7 @@ lootcount = 2; lootdoubles = 0 }, -/obj/item/aiModule/supplied/oxygen{ +/obj/item/ai_module/supplied/oxygen{ pixel_x = -3; pixel_y = -3 }, @@ -2794,12 +2794,12 @@ req_access_txt = "20" }, /obj/structure/window/reinforced, -/obj/item/aiModule/core/freeformcore{ +/obj/item/ai_module/core/freeformcore{ pixel_x = 3; pixel_y = 3 }, -/obj/item/aiModule/core/full/custom, -/obj/item/aiModule/core/full/asimov{ +/obj/item/ai_module/core/full/custom, +/obj/item/ai_module/core/full/asimov{ pixel_x = -3; pixel_y = -3 }, @@ -2827,12 +2827,12 @@ req_access_txt = "20" }, /obj/structure/window/reinforced, -/obj/item/aiModule/supplied/protectStation{ +/obj/item/ai_module/supplied/protectStation{ pixel_x = 3; pixel_y = 3 }, -/obj/item/aiModule/zeroth/oneHuman, -/obj/item/aiModule/reset/purge{ +/obj/item/ai_module/zeroth/oneHuman, +/obj/item/ai_module/reset/purge{ pixel_x = -3; pixel_y = -3 }, @@ -3698,7 +3698,7 @@ /area/command/bridge) "agX" = ( /obj/structure/table/reinforced, -/obj/item/aiModule/reset{ +/obj/item/ai_module/reset{ pixel_x = 3; pixel_y = 3 }, @@ -3709,7 +3709,7 @@ /obj/effect/turf_decal/stripes/line{ dir = 4 }, -/obj/item/aiModule/supplied/freeform, +/obj/item/ai_module/supplied/freeform, /turf/open/floor/plasteel/dark, /area/ai_monitored/command/nuke_storage) "agY" = ( @@ -3766,7 +3766,7 @@ /area/ai_monitored/command/nuke_storage) "ahd" = ( /obj/structure/table/reinforced, -/obj/item/aiModule/supplied/quarantine, +/obj/item/ai_module/supplied/quarantine, /obj/item/radio/intercom{ broadcasting = 1; frequency = 1447; diff --git a/_maps/map_files/PubbyStation/PubbyStation.dmm b/_maps/map_files/PubbyStation/PubbyStation.dmm index 207b47c096..a388f9d58d 100644 --- a/_maps/map_files/PubbyStation/PubbyStation.dmm +++ b/_maps/map_files/PubbyStation/PubbyStation.dmm @@ -11360,13 +11360,13 @@ /area/command/bridge) "aCG" = ( /obj/structure/table, -/obj/item/aiModule/supplied/quarantine, +/obj/item/ai_module/supplied/quarantine, /obj/machinery/camera/motion{ c_tag = "AI Upload Port"; dir = 4; network = list("aiupload") }, -/obj/item/aiModule/reset, +/obj/item/ai_module/reset, /obj/machinery/flasher{ id = "brigentry"; pixel_x = -28 @@ -11417,7 +11417,7 @@ /area/ai_monitored/turret_protected/ai_upload) "aCM" = ( /obj/structure/table, -/obj/item/aiModule/supplied/freeform, +/obj/item/ai_module/supplied/freeform, /obj/machinery/camera/motion{ c_tag = "AI Upload Starboard"; dir = 8; @@ -12278,9 +12278,9 @@ /area/command/bridge) "aED" = ( /obj/structure/table, -/obj/item/aiModule/core/full/asimov, +/obj/item/ai_module/core/full/asimov, /obj/effect/spawner/lootdrop/aimodule_harmless, -/obj/item/aiModule/core/freeformcore, +/obj/item/ai_module/core/freeformcore, /obj/machinery/door/window{ base_state = "right"; dir = 4; @@ -12289,7 +12289,7 @@ req_access_txt = "20" }, /obj/effect/spawner/lootdrop/aimodule_neutral, -/obj/item/aiModule/core/full/custom, +/obj/item/ai_module/core/full/custom, /obj/structure/window/reinforced{ dir = 1; pixel_y = 1 @@ -12336,16 +12336,16 @@ /area/ai_monitored/turret_protected/ai_upload) "aEI" = ( /obj/structure/table, -/obj/item/aiModule/supplied/oxygen, -/obj/item/aiModule/zeroth/oneHuman, +/obj/item/ai_module/supplied/oxygen, +/obj/item/ai_module/zeroth/oneHuman, /obj/machinery/door/window{ dir = 8; name = "High-Risk Modules"; req_access_txt = "20" }, -/obj/item/aiModule/reset/purge, +/obj/item/ai_module/reset/purge, /obj/effect/spawner/lootdrop/aimodule_harmful, -/obj/item/aiModule/supplied/protectStation, +/obj/item/ai_module/supplied/protectStation, /obj/structure/window/reinforced{ dir = 1; pixel_y = 1 @@ -40417,7 +40417,7 @@ pixel_x = -26 }, /obj/item/aicard, -/obj/item/aiModule/reset, +/obj/item/ai_module/reset, /obj/item/assembly/flash/handheld, /obj/effect/turf_decal/tile/green{ dir = 1 diff --git a/_maps/map_files/Snaxi/Snaxi.dmm b/_maps/map_files/Snaxi/Snaxi.dmm index 51b0cdb586..c5d156bde2 100644 --- a/_maps/map_files/Snaxi/Snaxi.dmm +++ b/_maps/map_files/Snaxi/Snaxi.dmm @@ -21154,9 +21154,9 @@ /area/security/courtroom) "grZ" = ( /obj/structure/table, -/obj/item/aiModule/core/full/custom, -/obj/item/aiModule/core/freeformcore, -/obj/item/aiModule/core/full/asimov, +/obj/item/ai_module/core/full/custom, +/obj/item/ai_module/core/freeformcore, +/obj/item/ai_module/core/full/asimov, /obj/effect/spawner/lootdrop/aimodule_harmless, /obj/effect/spawner/lootdrop/aimodule_neutral, /obj/machinery/camera/motion{ @@ -32087,10 +32087,10 @@ req_access_txt = "20" }, /obj/structure/table, -/obj/item/aiModule/reset/purge, -/obj/item/aiModule/zeroth/oneHuman, -/obj/item/aiModule/supplied/protectStation, -/obj/item/aiModule/supplied/oxygen, +/obj/item/ai_module/reset/purge, +/obj/item/ai_module/zeroth/oneHuman, +/obj/item/ai_module/supplied/protectStation, +/obj/item/ai_module/supplied/oxygen, /obj/effect/spawner/lootdrop/aimodule_harmful, /turf/open/floor/circuit, /area/ai_monitored/turret_protected/ai_upload) @@ -37565,7 +37565,7 @@ "qUF" = ( /obj/structure/table, /obj/item/aicard, -/obj/item/aiModule/reset, +/obj/item/ai_module/reset, /obj/item/assembly/flash/handheld, /obj/item/assembly/flash/handheld, /obj/item/clothing/gloves/color/yellow, @@ -43656,9 +43656,9 @@ /area/service/hydroponics) "uVD" = ( /obj/structure/table, -/obj/item/aiModule/reset, -/obj/item/aiModule/supplied/quarantine, -/obj/item/aiModule/supplied/freeform, +/obj/item/ai_module/reset, +/obj/item/ai_module/supplied/quarantine, +/obj/item/ai_module/supplied/freeform, /turf/open/floor/circuit, /area/ai_monitored/turret_protected/ai_upload) "uWb" = ( diff --git a/_maps/map_files/SpookyStation/SpookyStation.dmm b/_maps/map_files/SpookyStation/SpookyStation.dmm index ae37b94ad1..586c4a0e27 100644 --- a/_maps/map_files/SpookyStation/SpookyStation.dmm +++ b/_maps/map_files/SpookyStation/SpookyStation.dmm @@ -17125,7 +17125,7 @@ /turf/open/floor/plasteel, /area/tcommsat/computer) "liZ" = ( -/obj/item/aiModule/reset/purge, +/obj/item/ai_module/reset/purge, /turf/open/floor/plasteel, /area/eventmap/mountaininside) "lxA" = ( @@ -17391,7 +17391,7 @@ /turf/open/floor/plasteel, /area/eventmap/mountaininside) "qUm" = ( -/obj/item/aiModule/supplied/freeform, +/obj/item/ai_module/supplied/freeform, /turf/open/floor/plasteel, /area/eventmap/mountaininside) "qWJ" = ( diff --git a/_maps/map_files/SyndicateStation/SyndicateBoxStation.dmm b/_maps/map_files/SyndicateStation/SyndicateBoxStation.dmm index e61d2fb7db..f2352e5bdb 100644 --- a/_maps/map_files/SyndicateStation/SyndicateBoxStation.dmm +++ b/_maps/map_files/SyndicateStation/SyndicateBoxStation.dmm @@ -21282,7 +21282,7 @@ /area/command/meeting_room) "bbj" = ( /obj/structure/table, -/obj/item/aiModule/reset, +/obj/item/ai_module/reset, /obj/machinery/light{ dir = 8 }, @@ -21558,7 +21558,7 @@ /area/command/meeting_room) "bce" = ( /obj/structure/table, -/obj/item/aiModule/supplied/quarantine, +/obj/item/ai_module/supplied/quarantine, /obj/machinery/camera/motion{ dir = 4; network = list("aiupload") @@ -21574,7 +21574,7 @@ /area/ai_monitored/turret_protected/ai_upload) "bcg" = ( /obj/structure/table, -/obj/item/aiModule/supplied/freeform, +/obj/item/ai_module/supplied/freeform, /obj/structure/sign/plaques/kiddie{ pixel_x = 32 }, @@ -22230,8 +22230,8 @@ /area/maintenance/port) "beb" = ( /obj/structure/table, -/obj/item/aiModule/core/full/asimov, -/obj/item/aiModule/core/freeformcore, +/obj/item/ai_module/core/full/asimov, +/obj/item/ai_module/core/freeformcore, /obj/machinery/door/window{ base_state = "right"; dir = 4; @@ -22248,7 +22248,7 @@ /obj/structure/window/reinforced{ dir = 8 }, -/obj/item/aiModule/core/full/custom, +/obj/item/ai_module/core/full/custom, /turf/open/floor/plasteel/dark, /area/ai_monitored/turret_protected/ai_upload) "bec" = ( @@ -22290,14 +22290,14 @@ /area/ai_monitored/turret_protected/ai_upload) "beg" = ( /obj/structure/table, -/obj/item/aiModule/supplied/oxygen, -/obj/item/aiModule/zeroth/oneHuman, +/obj/item/ai_module/supplied/oxygen, +/obj/item/ai_module/zeroth/oneHuman, /obj/machinery/door/window{ dir = 8; name = "High-Risk Modules"; req_access_txt = "20" }, -/obj/item/aiModule/reset/purge, +/obj/item/ai_module/reset/purge, /obj/structure/window/reinforced, /obj/effect/spawner/lootdrop/aimodule_harmful, /obj/structure/window/reinforced{ @@ -22306,7 +22306,7 @@ /obj/structure/window/reinforced{ dir = 4 }, -/obj/item/aiModule/supplied/protectStation, +/obj/item/ai_module/supplied/protectStation, /turf/open/floor/plasteel/dark, /area/ai_monitored/turret_protected/ai_upload) "beh" = ( @@ -33471,7 +33471,7 @@ "bEX" = ( /obj/structure/table, /obj/item/aicard, -/obj/item/aiModule/reset, +/obj/item/ai_module/reset, /obj/structure/cable{ icon_state = "1-2" }, From b9a422ee2d0ea54301bfca643f1f94a0f1f26d13 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Mon, 18 Dec 2023 14:07:25 -0300 Subject: [PATCH 7/8] throw at mobs laying down --- .../signals/signals_atom/signals_atom_main.dm | 2 + code/_onclick/click.dm | 2 +- code/_onclick/right_click.dm | 2 +- code/controllers/subsystem/throwing.dm | 94 ++++++++++++------- code/datums/components/fullauto.dm | 2 +- code/datums/components/tackle.dm | 2 +- code/datums/martial/sleeping_carp.dm | 2 +- code/game/atoms.dm | 28 ++++-- code/game/atoms_movable.dm | 6 +- code/game/atoms_movement.dm | 2 +- .../game/gamemodes/clown_ops/clown_weapons.dm | 5 +- code/game/objects/items.dm | 7 +- code/game/objects/items/dice.dm | 4 +- code/game/objects/items/pet_carrier.dm | 9 +- code/game/objects/items/stunbaton.dm | 13 ++- code/game/objects/structures/grille.dm | 2 +- .../changeling/powers/mutations.dm | 2 +- .../clock_effects/servant_blocker.dm | 2 +- code/modules/hydroponics/grown/misc.dm | 7 +- code/modules/mob/living/carbon/carbon.dm | 10 +- .../mob/living/carbon/carbon_defense.dm | 32 ++++--- .../mob/living/carbon/human/human_defense.dm | 10 +- .../carbon/human/species_types/golems.dm | 3 +- .../mob/living/carbon/monkey/combat.dm | 13 +-- code/modules/mob/living/living_defense.dm | 75 ++++++++------- .../mob/living/simple_animal/bot/honkbot.dm | 13 +-- .../mob/living/simple_animal/bot/secbot.dm | 13 +-- .../hostile/mining_mobs/mining_mobs.dm | 2 +- code/modules/mob/mob_defines.dm | 2 +- code/modules/reagents/reagent_containers.dm | 28 +++--- .../reagents/reagent_containers/glass.dm | 7 +- code/modules/recycling/disposal/bin.dm | 6 +- code/modules/vehicles/mecha/mecha_defense.dm | 2 +- .../code/modules/vectorcrafts/vectorcraft.dm | 4 +- tgstation.dme | 1 + 35 files changed, 243 insertions(+), 171 deletions(-) create mode 100644 code/__DEFINES/dcs/signals/signals_atom/signals_atom_main.dm diff --git a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_main.dm b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_main.dm new file mode 100644 index 0000000000..9b32abf0c9 --- /dev/null +++ b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_main.dm @@ -0,0 +1,2 @@ +///from base of atom/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) +#define COMSIG_ATOM_HITBY "atom_hitby" diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 6e8d1de955..cc9828ebfe 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -86,7 +86,7 @@ DelayNextAction(CLICK_CD_HANDCUFFED) return RestrainedClickOn(A) - if(in_throw_mode) + if(throw_mode) throw_item(A) return diff --git a/code/_onclick/right_click.dm b/code/_onclick/right_click.dm index c1613561b4..49bd76516a 100644 --- a/code/_onclick/right_click.dm +++ b/code/_onclick/right_click.dm @@ -15,7 +15,7 @@ DelayNextAction(CLICK_CD_HANDCUFFED) return RestrainedClickOn(A) - if(in_throw_mode) + if(throw_mode) throw_item(A)//todo: make it plausible to lightly toss items via right-click return diff --git a/code/controllers/subsystem/throwing.dm b/code/controllers/subsystem/throwing.dm index 47efc967ac..8c873d07c4 100644 --- a/code/controllers/subsystem/throwing.dm +++ b/code/controllers/subsystem/throwing.dm @@ -41,37 +41,61 @@ SUBSYSTEM_DEF(throwing) currentrun = null /datum/thrownthing + ///Defines the atom that has been thrown (Objects and Mobs, mostly.) var/atom/movable/thrownthing - var/atom/target + ///Weakref to the original intended target of the throw, to prevent hardDels + var/datum/weakref/initial_target + ///The turf that the target was on, if it's not a turf itself. var/turf/target_turf + ///If the target happens to be a carbon and that carbon has a body zone aimed at, this is carried on here. var/target_zone + ///The initial direction of the thrower of the thrownthing for building the trajectory of the throw. var/init_dir + ///The maximum number of turfs that the thrownthing will travel to reach it's target. var/maxrange + ///The speed of the projectile thrownthing being thrown. var/speed + ///If a mob is the one who has thrown the object, then it's moved here. var/mob/thrower + ///A variable that helps in describing objects thrown at an angle, if it should be moved diagonally first or last. var/diagonals_first - var/dist_travelled = 0 - var/start_time - var/dist_x - var/dist_y - var/dx - var/dy - var/force = MOVE_FORCE_DEFAULT - var/gentle = FALSE + ///Set to TRUE if the throw is exclusively diagonal (45 Degree angle throws for example) var/pure_diagonal + ///Tracks how far a thrownthing has traveled mid-throw for the purposes of maxrange + var/dist_travelled = 0 + ///The start_time obtained via world.time for the purposes of tiles moved/tick. + var/start_time + ///Distance to travel in the X axis/direction. + var/dist_x + ///Distance to travel in the y axis/direction. + var/dist_y + ///The Horizontal direction we're traveling (EAST or WEST) + var/dx + ///The VERTICAL direction we're traveling (NORTH or SOUTH) + var/dy + ///The movement force provided to a given object in transit. More info on these in move_force.dm + var/force = MOVE_FORCE_DEFAULT + ///If the throw is gentle, then the thrownthing is harmless on impact. + var/gentle = FALSE + ///How many tiles that need to be moved in order to travel to the target. var/diagonal_error + ///If a thrown thing has a callback, it can be invoked here within thrownthing. var/datum/callback/callback + ///Mainly exists for things that would freeze a thrown object in place, like a timestop'd tile. Or a Tractor Beam. var/paused = FALSE + ///How long an object has been paused for, to be added to the travel time. var/delayed_time = 0 + ///The last world.time value stored when the thrownthing was moving. var/last_move = 0 -/datum/thrownthing/New(thrownthing, target, target_turf, init_dir, maxrange, speed, thrower, diagonals_first, force, gentle, callback, target_zone) +/datum/thrownthing/New(thrownthing, target, init_dir, maxrange, speed, thrower, diagonals_first, force, gentle, callback, target_zone) . = ..() src.thrownthing = thrownthing RegisterSignal(thrownthing, COMSIG_PARENT_QDELETING, .proc/on_thrownthing_qdel) - src.target = target - src.target_turf = target_turf + src.target_turf = get_turf(target) + if(target_turf != target) + src.initial_target = WEAKREF(target) src.init_dir = init_dir src.maxrange = maxrange src.speed = speed @@ -90,8 +114,8 @@ SUBSYSTEM_DEF(throwing) SSthrowing.currentrun -= thrownthing thrownthing.throwing = null thrownthing = null - target = null thrower = null + initial_target = null if(callback) QDEL_NULL(callback) //It stores a reference to the thrownthing, its source. Let's clean that. return ..() @@ -114,9 +138,17 @@ SUBSYSTEM_DEF(throwing) delayed_time += world.time - last_move return - if (dist_travelled && hitcheck()) //to catch sneaky things moving on our tile while we slept - finalize() - return + var/atom/movable/actual_target = initial_target?.resolve() + + if(dist_travelled) //to catch sneaky things moving on our tile while we slept + for(var/atom/movable/obstacle as anything in get_turf(thrownthing)) + if (obstacle == thrownthing || (obstacle == thrower && !ismob(thrownthing))) + continue + if(obstacle.pass_flags_self & LETPASSTHROW) + continue + if (obstacle == actual_target || (obstacle.density && !(obstacle.flags_1 & ON_BORDER_1))) + finalize(TRUE, obstacle) + return var/atom/step @@ -143,14 +175,17 @@ SUBSYSTEM_DEF(throwing) finalize() return - AM.Move(step, get_dir(AM, step), DELAY_TO_GLIDE_SIZE(1 / speed)) - - if (!AM.throwing) // we hit something during our move - finalize(hit = TRUE) + if(!AM.Move(step, get_dir(AM, step), DELAY_TO_GLIDE_SIZE(1 / speed))) // we hit something during our move... + if(AM.throwing) // ...but finalize() wasn't called on Bump() because of a higher level definition that doesn't always call parent. + finalize() return dist_travelled++ + if(actual_target && !(actual_target.pass_flags_self & LETPASSTHROW) && actual_target.loc == AM.loc) // we crossed a movable with no density (e.g. a mouse or APC) we intend to hit anyway. + finalize(TRUE, actual_target) + return + if (dist_travelled > MAX_THROWING_DIST) finalize() return @@ -162,11 +197,10 @@ SUBSYSTEM_DEF(throwing) return thrownthing.throwing = null if (!hit) - for (var/thing in get_turf(thrownthing)) //looking for our target on the turf we land on. - var/atom/A = thing - if (A == target) + for (var/atom/movable/obstacle as anything in get_turf(thrownthing)) //looking for our target on the turf we land on. + if (obstacle == target) hit = TRUE - thrownthing.throw_impact(A, src) + thrownthing.throw_impact(obstacle, src) if(QDELETED(thrownthing)) //throw_impact can delete things, such as glasses smashing return //deletion should already be handled by on_thrownthing_qdel() break @@ -192,15 +226,3 @@ SUBSYSTEM_DEF(throwing) T.zFall(thrownthing) qdel(src) - -/datum/thrownthing/proc/hit_atom(atom/A) - finalize(hit=TRUE, target=A) - -/datum/thrownthing/proc/hitcheck() - for (var/thing in get_turf(thrownthing)) - var/atom/movable/AM = thing - if (AM == thrownthing || (AM == thrower && !ismob(thrownthing))) - continue - if (AM.density && !(AM.pass_flags_self & LETPASSTHROW) && !(AM.flags_1 & ON_BORDER_1)) - finalize(hit=TRUE, target=AM) - return TRUE diff --git a/code/datums/components/fullauto.dm b/code/datums/components/fullauto.dm index 4b9c25db91..f508f056c3 100644 --- a/code/datums/components/fullauto.dm +++ b/code/datums/components/fullauto.dm @@ -117,7 +117,7 @@ return if(LAZYACCESS(modifiers, ALT_CLICK)) return - if(source.mob.in_throw_mode) + if(source.mob.throw_mode) return if(!isturf(source.mob.loc)) //No firing inside lockers and stuff. return diff --git a/code/datums/components/tackle.dm b/code/datums/components/tackle.dm index c336213388..9f448b39a6 100644 --- a/code/datums/components/tackle.dm +++ b/code/datums/components/tackle.dm @@ -66,7 +66,7 @@ ///See if we can tackle or not. If we can, leap! /datum/component/tackler/proc/checkTackle(mob/living/carbon/user, atom/A, params) - if(!user.in_throw_mode || user.get_active_held_item() || user.pulling || user.buckling) + if(!user.throw_mode || user.get_active_held_item() || user.pulling || user.buckling) return if(HAS_TRAIT(user, TRAIT_HULK)) diff --git a/code/datums/martial/sleeping_carp.dm b/code/datums/martial/sleeping_carp.dm index d0cdee4937..547a24de0a 100644 --- a/code/datums/martial/sleeping_carp.dm +++ b/code/datums/martial/sleeping_carp.dm @@ -127,7 +127,7 @@ return BULLET_ACT_HIT if(!isturf(A.loc)) //NO MOTHERFLIPPIN MECHS! return BULLET_ACT_HIT - if(A.in_throw_mode) + if(A.throw_mode) A.visible_message("[A] effortlessly swats the projectile aside! They can deflect projectile with their bare hands!", "You deflect the projectile!") playsound(get_turf(A), pick('sound/weapons/bulletflyby.ogg', 'sound/weapons/bulletflyby2.ogg', 'sound/weapons/bulletflyby3.ogg'), 75, TRUE) P.firer = A diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 220cd88499..c72b4f7b60 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -686,13 +686,29 @@ SEND_SIGNAL(src, COMSIG_ATOM_FIRE_ACT, exposed_temperature, exposed_volume) return -/atom/proc/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) - if(density && !has_gravity(AM)) //thrown stuff bounces off dense stuff in no grav, unless the thrown stuff ends up inside what it hit(embedding, bola, etc...). - addtimer(CALLBACK(src, .proc/hitby_react, AM), 2) +/** + * React to being hit by a thrown object + * + * Default behaviour is to call [hitby_react][/atom/proc/hitby_react] on ourselves after 2 seconds if we are dense + * and under normal gravity. + * + * Im not sure why this the case, maybe to prevent lots of hitby's if the thrown object is + * deleted shortly after hitting something (during explosions or other massive events that + * throw lots of items around - singularity being a notable example) + */ +/atom/proc/hitby(atom/movable/hitting_atom, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) + SEND_SIGNAL(src, COMSIG_ATOM_HITBY, hitting_atom, skipcatch, hitpush, blocked, throwingdatum) + if(density && !has_gravity(hitting_atom)) //thrown stuff bounces off dense stuff in no grav, unless the thrown stuff ends up inside what it hit(embedding, bola, etc...). + addtimer(CALLBACK(src, .proc/hitby_react, hitting_atom), 2) -/atom/proc/hitby_react(atom/movable/AM) - if(AM && isturf(AM.loc)) - step(AM, turn(AM.dir, 180)) +/** + * We have have actually hit the passed in atom + * + * Default behaviour is to move back from the item that hit us + */ +/atom/proc/hitby_react(atom/movable/harmed_atom) + if(harmed_atom && isturf(harmed_atom.loc)) + step(harmed_atom, turn(harmed_atom.dir, 180)) /atom/proc/handle_slip(mob/living/carbon/C, knockdown_amount, obj/O, lube) return diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 6beb8319ec..6d02c19d23 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -383,9 +383,9 @@ if(!(impact_signal && (impact_signal & COMPONENT_MOVABLE_IMPACT_NEVERMIND))) // in case a signal interceptor broke or deleted the thing before we could process our hit return hit_atom.hitby(src, throwingdatum=throwingdatum, hitpush=hitpush) -/atom/movable/hitby(atom/movable/AM, skipcatch, hitpush = TRUE, blocked, datum/thrownthing/throwingdatum) +/atom/movable/hitby(atom/movable/hitting_atom, skipcatch, hitpush = TRUE, blocked, datum/thrownthing/throwingdatum) if(!anchored && hitpush && (!throwingdatum || (throwingdatum.force >= (move_resist * MOVE_FORCE_PUSH_RATIO)))) - step(src, AM.dir) + step(src, hitting_atom.dir) ..() /atom/movable/proc/safe_throw_at(atom/target, range, speed, mob/thrower, spin = TRUE, diagonals_first = FALSE, datum/callback/callback, force = MOVE_FORCE_STRONG, gentle = FALSE) @@ -441,7 +441,7 @@ else target_zone = thrower.zone_selected - var/datum/thrownthing/TT = new(src, target, get_turf(target), get_dir(src, target), range, speed, thrower, diagonals_first, force, gentle, callback, target_zone) + var/datum/thrownthing/TT = new(src, target, get_dir(src, target), range, speed, thrower, diagonals_first, force, gentle, callback, target_zone) var/dist_x = abs(target.x - src.x) var/dist_y = abs(target.y - src.y) diff --git a/code/game/atoms_movement.dm b/code/game/atoms_movement.dm index 9fd007e9ee..7e0a1e6899 100644 --- a/code/game/atoms_movement.dm +++ b/code/game/atoms_movement.dm @@ -207,7 +207,7 @@ SEND_SIGNAL(src, COMSIG_MOVABLE_BUMP, A) . = ..() if(!QDELETED(throwing)) - throwing.hit_atom(A) + throwing.finalize(hit = TRUE, target = A) . = TRUE if(QDELETED(A)) return diff --git a/code/game/gamemodes/clown_ops/clown_weapons.dm b/code/game/gamemodes/clown_ops/clown_weapons.dm index f17cfde761..5891facfb7 100644 --- a/code/game/gamemodes/clown_ops/clown_weapons.dm +++ b/code/game/gamemodes/clown_ops/clown_weapons.dm @@ -151,8 +151,9 @@ slipper.lube_flags |= FLYING_DOESNT_HELP|SLIP_WHEN_CRAWLING slipper.Slip(src, hit_atom) slipper.lube_flags &= ~(FLYING_DOESNT_HELP|SLIP_WHEN_CRAWLING) - if(thrownby && !caught) - throw_at(thrownby, throw_range+2, throw_speed, null, 1) + var/mob/thrown_by = thrownby?.resolve() + if(thrown_by && !caught) + throw_at(thrown_by, throw_range+2, throw_speed, null, 1) else return ..() diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index e63f809a5e..19cd9e5c5d 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -112,7 +112,8 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb var/list/attack_verb //Used in attackby() to say how something was attacked "[x] has been [z.attack_verb] by [y] with [z]" var/list/species_exception = null // list() of species types, if a species cannot put items in a certain slot, but species type is in list, it will be able to wear that item - var/mob/thrownby = null + ///A weakref to the mob who threw the item + var/datum/weakref/thrownby = null //I cannot verbally describe how much I hate this var mouse_drag_pointer = MOUSE_ACTIVE_POINTER //the icon to indicate this object is being dragged @@ -739,7 +740,7 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb return hit_atom.hitby(src, 0, itempush, throwingdatum=throwingdatum) /obj/item/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback, force, messy_throw = TRUE) - thrownby = thrower + thrownby = WEAKREF(thrower) callback = CALLBACK(src, .proc/after_throw, callback, (spin && messy_throw)) //replace their callback with our own . = ..(target, range, speed, thrower, spin, diagonals_first, callback, force) @@ -834,7 +835,7 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb . = "" /obj/item/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) - return + return // SEND_SIGNAL(src, COMSIG_ATOM_HITBY, AM, skipcatch, hitpush, blocked, throwingdatum) /obj/item/attack_hulk(mob/living/carbon/human/user) return 0 diff --git a/code/game/objects/items/dice.dm b/code/game/objects/items/dice.dm index 91aad761d9..ea42fee208 100644 --- a/code/game/objects/items/dice.dm +++ b/code/game/objects/items/dice.dm @@ -168,7 +168,9 @@ diceroll(user) /obj/item/dice/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum) - diceroll(thrownby) + var/mob/thrown_by = thrownby?.resolve() + if(thrown_by) + diceroll(thrown_by) . = ..() /obj/item/dice/proc/diceroll(mob/user) diff --git a/code/game/objects/items/pet_carrier.dm b/code/game/objects/items/pet_carrier.dm index 648a38437c..138472a4c8 100644 --- a/code/game/objects/items/pet_carrier.dm +++ b/code/game/objects/items/pet_carrier.dm @@ -289,10 +289,11 @@ "[M] has been splashed with something!") var/turf/TT = get_turf(hit_atom) var/throwerstring - if(thrownby) - log_combat(thrownby, M, "splashed", R) - var/turf/AT = get_turf(thrownby) - throwerstring = " THROWN BY [key_name(thrownby)] at [AT] (AREACOORD(AT)]" + var/mob/thrown_by = thrownby?.resolve() + if(thrown_by) + log_combat(thrown_by, M, "splashed", R) + var/turf/AT = get_turf(thrown_by) + throwerstring = " THROWN BY [key_name(thrown_by)] at [AT] (AREACOORD(AT)]" log_reagent("SPLASH: [src] mob throw_impact() onto [key_name(hit_atom)] at [TT] ([AREACOORD(TT)])[throwerstring] - [R]") reagents.reaction(hit_atom, TOUCH) reagents.clear_reagents() diff --git a/code/game/objects/items/stunbaton.dm b/code/game/objects/items/stunbaton.dm index 7d84d38624..46e0c66953 100644 --- a/code/game/objects/items/stunbaton.dm +++ b/code/game/objects/items/stunbaton.dm @@ -61,9 +61,10 @@ /obj/item/melee/baton/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum) ..() + var/mob/thrown_by = thrownby?.resolve() //Only mob/living types have stun handling - if(turned_on && prob(throw_hit_chance) && iscarbon(hit_atom) && thrownby) - baton_stun(hit_atom, thrownby, shoving = TRUE) + if(turned_on && prob(throw_hit_chance) && iscarbon(hit_atom) && thrown_by) + baton_stun(hit_atom, thrown_by, shoving = TRUE) /obj/item/melee/baton/loaded //this one starts with a cell pre-installed. preload_cell_type = /obj/item/stock_parts/cell/high/plus @@ -387,8 +388,9 @@ /obj/item/melee/baton/boomerang/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum) if(turned_on) var/caught = hit_atom.hitby(src, FALSE, FALSE, throwingdatum=throwingdatum) - if(ishuman(hit_atom) && !caught && prob(throw_hit_chance) && thrownby)//if they are a carbon and they didn't catch it - baton_stun(hit_atom, thrownby, shoving = TRUE) + var/mob/thrown_by = thrownby?.resolve() + if(ishuman(hit_atom) && !caught && prob(throw_hit_chance) && thrown_by)//if they are a carbon and they didn't catch it + baton_stun(hit_atom, thrown_by, shoving = TRUE) if(thrownby && !caught) throw_back() else @@ -397,8 +399,9 @@ /obj/item/melee/baton/boomerang/proc/throw_back() set waitfor = FALSE sleep(1) + var/mob/thrown_by = thrownby?.resolve() if(!QDELETED(src)) - throw_at(thrownby, throw_range+2, throw_speed, null, TRUE) + throw_at(thrown_by, throw_range+2, throw_speed, null, TRUE) /obj/item/melee/baton/boomerang/update_icon() if(turned_on) diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index 998285dd58..d83715a886 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -268,7 +268,7 @@ var/turf/T = get_turf(src) var/obj/structure/cable/C = T.get_cable_node() if(C) - playsound(src, 'sound/magic/lightningshock.ogg', 100, 1, extrarange = 5) + playsound(src, 'sound/magic/lightningshock.ogg', 100, TRUE, extrarange = 5) tesla_zap(src, 3, C.newavail() * 0.01, ZAP_MOB_DAMAGE | ZAP_OBJ_DAMAGE | ZAP_MOB_STUN | ZAP_ALLOW_DUPLICATES) //Zap for 1/100 of the amount of power. At a million watts in the grid, it will be as powerful as a tesla revolver shot. C.add_delayedload(C.newavail() * 0.0375) // you can gain up to 3.5 via the 4x upgrades power is halved by the pole so thats 2x then 1X then .5X for 3.5x the 3 bounces shock. return ..() diff --git a/code/modules/antagonists/changeling/powers/mutations.dm b/code/modules/antagonists/changeling/powers/mutations.dm index e327f62370..9fe612ac07 100644 --- a/code/modules/antagonists/changeling/powers/mutations.dm +++ b/code/modules/antagonists/changeling/powers/mutations.dm @@ -325,7 +325,7 @@ ..() /obj/item/projectile/tentacle/proc/reset_throw(mob/living/carbon/human/H) - if(H.in_throw_mode) + if(H.throw_mode) H.throw_mode_off() //Don't annoy the changeling if he doesn't catch the item /obj/item/projectile/tentacle/proc/tentacle_grab(mob/living/carbon/human/H, mob/living/carbon/C) diff --git a/code/modules/antagonists/clockcult/clock_effects/servant_blocker.dm b/code/modules/antagonists/clockcult/clock_effects/servant_blocker.dm index 5905862690..cb52944a0a 100644 --- a/code/modules/antagonists/clockcult/clock_effects/servant_blocker.dm +++ b/code/modules/antagonists/clockcult/clock_effects/servant_blocker.dm @@ -25,7 +25,7 @@ return if(isitem(M)) var/obj/item/I = M - if(is_servant_of_ratvar(I.thrownby)) //nice try! + if(is_servant_of_ratvar(I.thrownby?.resolve())) //nice try! return return TRUE diff --git a/code/modules/hydroponics/grown/misc.dm b/code/modules/hydroponics/grown/misc.dm index d32d287800..1a09635e8a 100644 --- a/code/modules/hydroponics/grown/misc.dm +++ b/code/modules/hydroponics/grown/misc.dm @@ -425,9 +425,10 @@ for(var/datum/reagent/A in reagents.reagent_list) R += A.type + " (" R += num2text(A.volume) + ")," - if(isturf(target) && reagents.reagent_list.len && thrownby) - log_combat(thrownby, target, "splashed (thrown) [english_list(reagents.reagent_list)]") - message_admins("[ADMIN_LOOKUPFLW(thrownby)] splashed (thrown) [english_list(reagents.reagent_list)] on [target] at [ADMIN_VERBOSEJMP(target)].") + var/mob/thrown_by = thrownby?.resolve() + if(isturf(target) && reagents.reagent_list.len && thrown_by) + log_combat(thrown_by, target, "splashed (thrown) [english_list(reagents.reagent_list)]") + message_admins("[ADMIN_LOOKUPFLW(thrown_by)] splashed (thrown) [english_list(reagents.reagent_list)] on [target] at [ADMIN_VERBOSEJMP(target)].") reagents.reaction(M, TOUCH) log_combat(user, M, "splashed", R) reagents.clear_reagents() diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index e9f4f61556..13481655df 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -125,8 +125,8 @@ take_bodypart_damage(10 + 5 * extra_speed, check_armor = TRUE, wound_bonus = extra_speed * 5) victim.DefaultCombatKnockdown(20) DefaultCombatKnockdown(20) - visible_message("[src] crashes into [victim] [extra_speed ? "really hard" : ""], knocking them both over!",\ - "You violently crash into [victim] [extra_speed ? "extra hard" : ""]!") + visible_message("[src] crashes into [victim][extra_speed ? " really hard" : ""], knocking them both over!",\ + "You violently crash into [victim][extra_speed ? " extra hard" : ""]!") playsound(src,'sound/weapons/punch1.ogg',50,1) @@ -134,20 +134,20 @@ /mob/living/carbon/proc/toggle_throw_mode() if(stat) return - if(in_throw_mode) + if(throw_mode) throw_mode_off() else throw_mode_on() /mob/living/carbon/proc/throw_mode_off() - in_throw_mode = FALSE + throw_mode = FALSE if(client && hud_used) hud_used.throw_icon.icon_state = "act_throw_off" /mob/living/carbon/proc/throw_mode_on() - in_throw_mode = TRUE + throw_mode = TRUE if(client && hud_used) hud_used.throw_icon.icon_state = "act_throw_on" diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm index a12d6614fa..91481d89b8 100644 --- a/code/modules/mob/living/carbon/carbon_defense.dm +++ b/code/modules/mob/living/carbon/carbon_defense.dm @@ -48,22 +48,30 @@ if(affecting && affecting.dismemberable && affecting.get_damage() >= (affecting.max_damage - P.dismemberment)) affecting.dismember(P.damtype) -/mob/living/carbon/catch_item(obj/item/I, skip_throw_mode_check = FALSE) - . = ..() - if(!HAS_TRAIT(src, TRAIT_AUTO_CATCH_ITEM) && !skip_throw_mode_check && !in_throw_mode) +/mob/living/carbon/proc/can_catch_item(skip_throw_mode_check) + . = FALSE + if(!HAS_TRAIT(src, TRAIT_AUTO_CATCH_ITEM) && !skip_throw_mode_check && !throw_mode) return - if(incapacitated()) + if(get_active_held_item()) return - if (get_active_held_item()) - if (HAS_TRAIT_FROM(src, TRAIT_AUTO_CATCH_ITEM,RISING_BASS_TRAIT)) - visible_message("[src] chops [I] out of the air!") + if(HAS_TRAIT(src, TRAIT_HANDS_BLOCKED)) + return + return TRUE + +/mob/living/carbon/hitby(atom/movable/AM, skipcatch, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum) + if(!skipcatch && can_catch_item() && isitem(AM) && isturf(AM.loc)) + var/obj/item/I = AM + I.attack_hand(src) + if(get_active_held_item() == I) //if our attack_hand() picks up the item... + visible_message(span_warning("[src] catches [I]!"), \ + span_userdanger("You catch [I] in mid-air!")) + throw_mode_off() return TRUE - return - I.attack_hand(src) - if(get_active_held_item() == I) //if our attack_hand() picks up the item... - visible_message("[src] catches [I]!") //catch that sucker! - throw_mode_off() + if(isitem(AM) && HAS_TRAIT_FROM(src, TRAIT_AUTO_CATCH_ITEM, RISING_BASS_TRAIT)) + visible_message(span_warning("[src] chops [AM] out of the air!"), \ + span_userdanger("You chop [AM] out of the air!")) return TRUE + return ..() /mob/living/carbon/attacked_by(obj/item/I, mob/living/user, attackchain_flags = NONE, damage_multiplier = 1) var/totitemdamage = pre_attacked_by(I, user) * damage_multiplier diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 5941efe087..7525cfd216 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -68,12 +68,16 @@ /mob/living/carbon/human/proc/check_martial_melee_block() if(mind) - if(mind.martial_art && prob(mind.martial_art.block_chance) && mind.martial_art.can_use(src) && in_throw_mode && !incapacitated(FALSE, TRUE)) + if(mind.martial_art && prob(mind.martial_art.block_chance) && mind.martial_art.can_use(src) && throw_mode && !incapacitated(FALSE, TRUE)) return TRUE return FALSE /mob/living/carbon/human/hitby(atom/movable/AM, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum) - return dna?.species?.spec_hitby(AM, src) || ..() + if(dna?.species) + var/spec_return = dna.species.spec_hitby(AM, src) + if(spec_return) + return spec_return + return ..() /mob/living/carbon/human/grabbedby(mob/living/carbon/user, supress_message = 0) if(user == src && pulling && !pulling.anchored && grab_state >= GRAB_AGGRESSIVE && (HAS_TRAIT(src, TRAIT_FAT)) && ismonkey(pulling)) @@ -817,7 +821,7 @@ to_chat(src, "\t There is \a [I] stuck to your [LB.name]!") else to_chat(src, "\t There is \a [I] embedded in your [LB.name]!") - + /mob/living/carbon/human/damage_clothes(damage_amount, damage_type = BRUTE, damage_flag = 0, def_zone) if(damage_type != BRUTE && damage_type != BURN) diff --git a/code/modules/mob/living/carbon/human/species_types/golems.dm b/code/modules/mob/living/carbon/human/species_types/golems.dm index 843b47b4a0..c4be0d3948 100644 --- a/code/modules/mob/living/carbon/human/species_types/golems.dm +++ b/code/modules/mob/living/carbon/human/species_types/golems.dm @@ -419,7 +419,8 @@ var/obj/item/I if(istype(AM, /obj/item)) I = AM - if(I.thrownby == H) //No throwing stuff at yourself to trigger the teleport + var/mob/thrown_by = I.thrownby?.resolve() + if(thrown_by == H) //No throwing stuff at yourself to trigger the teleport return 0 else reactive_teleport(H) diff --git a/code/modules/mob/living/carbon/monkey/combat.dm b/code/modules/mob/living/carbon/monkey/combat.dm index 0c9895c729..2640c642dd 100644 --- a/code/modules/mob/living/carbon/monkey/combat.dm +++ b/code/modules/mob/living/carbon/monkey/combat.dm @@ -396,12 +396,13 @@ retaliate(Proj.firer) return ..() -/mob/living/carbon/monkey/hitby(atom/movable/AM, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum) - if(istype(AM, /obj/item)) - var/obj/item/I = AM - if(I.throwforce < src.health && I.thrownby && ishuman(I.thrownby)) - var/mob/living/carbon/human/H = I.thrownby - retaliate(H) +/mob/living/carbon/monkey/hitby(atom/movable/hitting_atom, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum) + if(istype(hitting_atom, /obj/item)) + var/obj/item/item_hitby = hitting_atom + var/mob/thrown_by = item_hitby.thrownby?.resolve() + if(item_hitby.throwforce < src.health && thrown_by && ishuman(thrown_by)) + var/mob/living/carbon/human/human_throwee = thrown_by + retaliate(human_throwee) ..() /mob/living/carbon/monkey/Crossed(atom/movable/AM) diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 0b71359a1e..cd46072921 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -106,48 +106,51 @@ else return 0 -/mob/living/proc/catch_item(obj/item/I, skip_throw_mode_check = FALSE) - return FALSE - /mob/living/hitby(atom/movable/AM, skipcatch, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum) - // Throwingdatum can be null if someone had an accident() while slipping with an item in hand. - var/obj/item/I - var/throwpower = 30 - if(isitem(AM)) - I = AM - throwpower = I.throwforce - var/impacting_zone = ran_zone(BODY_ZONE_CHEST, 65)//Hits a random part of the body, geared towards the chest - var/list/block_return = list() - var/total_damage = AM.throwforce - if(mob_run_block(AM, throwpower, "\the [AM.name]", ATTACK_TYPE_THROWN, 0, throwingdatum?.thrower, impacting_zone, block_return) & BLOCK_SUCCESS) + if(!isitem(AM)) + // Filled with made up numbers for non-items. + if(mob_run_block(AM, 30, "\the [AM.name]", ATTACK_TYPE_PROJECTILE, 0, throwingdatum.thrower, throwingdatum.thrower.zone_selected, list())) + hitpush = FALSE + skipcatch = TRUE + blocked = TRUE + else + playsound(loc, 'sound/weapons/genhit.ogg', 50, TRUE, -1) //Item sounds are handled in the item itself + return ..() + + var/obj/item/thrown_item = AM + if(thrown_item.thrownby == WEAKREF(src)) //No throwing stuff at yourself to trigger hit reactions + return ..() + + if(mob_run_block(AM, thrown_item.throwforce, "\the [thrown_item.name]", ATTACK_TYPE_PROJECTILE, 0, throwingdatum.thrower, throwingdatum.thrower.zone_selected, list())) hitpush = FALSE skipcatch = TRUE blocked = TRUE - total_damage = block_calculate_resultant_damage(total_damage, block_return) - if(I) - var/nosell_hit = SEND_SIGNAL(I, COMSIG_MOVABLE_IMPACT_ZONE, src, impacting_zone, throwingdatum, FALSE, blocked) - if(nosell_hit) - skipcatch = TRUE - hitpush = FALSE - if(!skipcatch && isturf(I.loc) && catch_item(I)) - return TRUE - var/dtype = BRUTE - dtype = I.damtype + var/zone = ran_zone(BODY_ZONE_CHEST, 65)//Hits a random part of the body, geared towards the chest + var/nosell_hit = SEND_SIGNAL(thrown_item, COMSIG_MOVABLE_IMPACT_ZONE, src, zone, blocked, throwingdatum) // TODO: find a better way to handle hitpush and skipcatch for humans + if(nosell_hit) + skipcatch = TRUE + hitpush = FALSE - if(!blocked) - if(!nosell_hit) - visible_message("[src] is hit by [I]!", \ - "You're hit by [I]!") - if(!I.throwforce) - return - var/armor = run_armor_check(impacting_zone, MELEE, "Your armor has protected your [parse_zone(impacting_zone)].", "Your armor has softened hit to your [parse_zone(impacting_zone)].",I.armour_penetration) - apply_damage(I.throwforce, dtype, impacting_zone, armor, sharpness=I.get_sharpness(), wound_bonus=(nosell_hit * CANT_WOUND)) - else - return 1 - else - playsound(loc, 'sound/weapons/genhit.ogg', 50, 1, -1) - ..() + if(blocked) + return TRUE + + var/mob/thrown_by = thrown_item.thrownby?.resolve() + if(thrown_by) + log_combat(thrown_by, src, "threw and hit", thrown_item) + if(nosell_hit) + return ..() + visible_message(span_danger("[src] is hit by [thrown_item]!"), \ + span_userdanger("You're hit by [thrown_item]!")) + if(!thrown_item.throwforce) + return + var/armor = run_armor_check(zone, MELEE, "Your armor has protected your [parse_zone(zone)].", "Your armor has softened hit to your [parse_zone(zone)].", thrown_item.armour_penetration, "", FALSE) + apply_damage(thrown_item.throwforce, thrown_item.damtype, zone, armor, sharpness = thrown_item.get_sharpness(), wound_bonus = (nosell_hit * CANT_WOUND)) + if(QDELETED(src)) //Damage can delete the mob. + return + if(lying) // physics says it's significantly harder to push someone by constantly chucking random furniture at them if they are down on the floor. + hitpush = FALSE + return ..() /mob/living/fire_act() adjust_fire_stacks(3) diff --git a/code/modules/mob/living/simple_animal/bot/honkbot.dm b/code/modules/mob/living/simple_animal/bot/honkbot.dm index b8d82e8c7a..42bb2f63bc 100644 --- a/code/modules/mob/living/simple_animal/bot/honkbot.dm +++ b/code/modules/mob/living/simple_animal/bot/honkbot.dm @@ -138,13 +138,14 @@ bike_horn(A) -/mob/living/simple_animal/bot/honkbot/hitby(atom/movable/AM, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum) - if(istype(AM, /obj/item)) +/mob/living/simple_animal/bot/honkbot/hitby(atom/movable/hitting_atom, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum) + if(istype(hitting_atom, /obj/item)) playsound(src, honksound, 50, TRUE, -1) - var/obj/item/I = AM - if(I.throwforce < health && I.thrownby && (istype(I.thrownby, /mob/living/carbon/human))) - var/mob/living/carbon/human/H = I.thrownby - retaliate(H) + var/obj/item/item_hitby = hitting_atom + var/mob/thrown_by = item_hitby.thrownby?.resolve() + if(item_hitby.throwforce < src.health && thrown_by && ishuman(thrown_by)) + var/mob/living/carbon/human/human_throwee = thrown_by + retaliate(human_throwee) ..() /mob/living/simple_animal/bot/honkbot/proc/bike_horn() //use bike_horn diff --git a/code/modules/mob/living/simple_animal/bot/secbot.dm b/code/modules/mob/living/simple_animal/bot/secbot.dm index 9973b6472e..4725ca6225 100644 --- a/code/modules/mob/living/simple_animal/bot/secbot.dm +++ b/code/modules/mob/living/simple_animal/bot/secbot.dm @@ -351,12 +351,13 @@ ..() -/mob/living/simple_animal/bot/secbot/hitby(atom/movable/AM, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum) - if(istype(AM, /obj/item)) - var/obj/item/I = AM - if(I.throwforce < src.health && I.thrownby && ishuman(I.thrownby)) - var/mob/living/carbon/human/H = I.thrownby - retaliate(H) +/mob/living/simple_animal/bot/secbot/hitby(atom/movable/hitting_atom, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum) + if(istype(hitting_atom, /obj/item)) + var/obj/item/item_hitby = hitting_atom + var/mob/thrown_by = item_hitby.thrownby?.resolve() + if(item_hitby.throwforce < src.health && thrown_by && ishuman(thrown_by)) + var/mob/living/carbon/human/human_throwee = thrown_by + retaliate(human_throwee) ..() diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/mining_mobs.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/mining_mobs.dm index e9be18f0cb..2463431ad3 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/mining_mobs.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/mining_mobs.dm @@ -50,7 +50,7 @@ if(!stat) Aggro() if(T.throwforce <= 20) - visible_message("The [T.name] [throw_message] [src.name]!") + visible_message(span_notice("The [T.name] [throw_message] [src.name]!")) return ..() diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 138a3b9662..0b22ae25ec 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -100,7 +100,7 @@ var/research_scanner = 0 //For research scanner equipped mobs. Enable to show research data when examining. - var/in_throw_mode = 0 + var/throw_mode = 0 var/job = null//Living diff --git a/code/modules/reagents/reagent_containers.dm b/code/modules/reagents/reagent_containers.dm index aa871723a3..df794f4842 100644 --- a/code/modules/reagents/reagent_containers.dm +++ b/code/modules/reagents/reagent_containers.dm @@ -106,9 +106,10 @@ /obj/item/reagent_containers/proc/bartender_check(atom/target) . = FALSE var/turf/T = get_turf(src) - if(!T || !target.CanPass(src, T) || !thrownby || !thrownby.actions) + var/mob/thrown_by = thrownby?.resolve() + if(!T || !target.CanPass(src, T) || !thrown_by || !thrown_by.actions) return - var/datum/action/innate/D = get_action_of_type(thrownby, /datum/action/innate/drink_fling) + var/datum/action/innate/D = get_action_of_type(thrown_by, /datum/action/innate/drink_fling) if(D?.active) return TRUE @@ -118,6 +119,7 @@ /obj/item/reagent_containers/proc/SplashReagents(atom/target, thrown = FALSE) if(!reagents || !reagents.total_volume || !spillable) return + var/mob/thrown_by = thrownby?.resolve() if(ismob(target) && target.reagents) if(thrown) @@ -128,10 +130,10 @@ "[M] has been splashed with something!") var/turf/TT = get_turf(target) var/throwerstring - if(thrownby && thrown) - log_combat(thrownby, M, "splashed", R) - var/turf/AT = get_turf(thrownby) - throwerstring = " THROWN BY [key_name(thrownby)] at [AT] (AREACOORD(AT)]" + if(thrown_by && thrown) + log_combat(thrown_by, M, "splashed", R) + var/turf/AT = get_turf(thrown_by) + throwerstring = " THROWN BY [key_name(thrown_by)] at [AT] (AREACOORD(AT)]" log_reagent("SPLASH: [src] mob SplashReagents() onto [key_name(target)] at [TT] ([AREACOORD(TT)])[throwerstring] - [R]") reagents.reaction(target, TOUCH) reagents.clear_reagents() @@ -142,15 +144,15 @@ addtimer(CALLBACK(src, .proc/ForceResetRotation), 1) else - if(isturf(target) && reagents.reagent_list.len && thrownby) - log_combat(thrownby, target, "splashed (thrown) [english_list(reagents.reagent_list)]", "in [AREACOORD(target)]") - log_game("[key_name(thrownby)] splashed (thrown) [english_list(reagents.reagent_list)] on [target] in [AREACOORD(target)].") - message_admins("[ADMIN_LOOKUPFLW(thrownby)] splashed (thrown) [english_list(reagents.reagent_list)] on [target] in [ADMIN_VERBOSEJMP(target)].") + if(isturf(target) && reagents.reagent_list.len && thrown_by) + log_combat(thrown_by, target, "splashed (thrown) [english_list(reagents.reagent_list)]", "in [AREACOORD(target)]") + log_game("[key_name(thrown_by)] splashed (thrown) [english_list(reagents.reagent_list)] on [target] in [AREACOORD(target)].") + message_admins("[ADMIN_LOOKUPFLW(thrown_by)] splashed (thrown) [english_list(reagents.reagent_list)] on [target] in [ADMIN_VERBOSEJMP(target)].") var/turf/T = get_turf(target) var/throwerstring - if(thrownby && thrown) - var/turf/AT = get_turf(thrownby) - throwerstring = " THROWN BY [key_name(thrownby)] at [AT] ([AREACOORD(AT)])" + if(thrown_by && thrown) + var/turf/AT = get_turf(thrown_by) + throwerstring = " THROWN BY [key_name(thrown_by)] at [AT] ([AREACOORD(AT)])" log_reagent("SPLASH - [src] object SplashReagents() onto [target] at [T] ([AREACOORD(T)])[throwerstring] - [reagents.log_list()]") visible_message("[src] spills its contents all over [target].") reagents.reaction(target, TOUCH) diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index bec2f22590..4c6c311a29 100644 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -29,9 +29,10 @@ M.visible_message("[user] splashes the contents of [src] onto [M]!", \ "[user] splashes the contents of [src] onto [M]!") var/R = reagents?.log_list() - if(isturf(target) && reagents.reagent_list.len && thrownby) - log_combat(thrownby, target, "splashed (thrown) [english_list(reagents.reagent_list)]") - message_admins("[ADMIN_LOOKUPFLW(thrownby)] splashed (thrown) [english_list(reagents.reagent_list)] on [target] at [ADMIN_VERBOSEJMP(target)].") + var/mob/thrown_by = thrownby?.resolve() + if(isturf(target) && reagents.reagent_list.len && thrown_by) + log_combat(thrown_by, target, "splashed (thrown) [english_list(reagents.reagent_list)]") + message_admins("[ADMIN_LOOKUPFLW(thrown_by)] splashed (thrown) [english_list(reagents.reagent_list)] on [target] at [ADMIN_VERBOSEJMP(target)].") reagents.reaction(M, TOUCH) log_combat(user, M, "splashed", R) var/turf/UT = get_turf(user) diff --git a/code/modules/recycling/disposal/bin.dm b/code/modules/recycling/disposal/bin.dm index 8be744cd96..a8835d0cee 100644 --- a/code/modules/recycling/disposal/bin.dm +++ b/code/modules/recycling/disposal/bin.dm @@ -359,10 +359,10 @@ if(isitem(AM) && AM.CanEnterDisposals()) if(prob(75)) AM.forceMove(src) - visible_message("[AM] lands in [src].") - update_icon() + visible_message(span_notice("[AM] lands in [src].")) + update_appearance() else - visible_message("[AM] bounces off of [src]'s rim!") + visible_message(span_notice("[AM] bounces off of [src]'s rim!")) return ..() else return ..() diff --git a/code/modules/vehicles/mecha/mecha_defense.dm b/code/modules/vehicles/mecha/mecha_defense.dm index 78b4c7b441..7208fdaa15 100644 --- a/code/modules/vehicles/mecha/mecha_defense.dm +++ b/code/modules/vehicles/mecha/mecha_defense.dm @@ -105,7 +105,7 @@ /obj/vehicle/sealed/mecha/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) //wrapper log_message("Hit by [AM].", LOG_MECHA, color="red") - . = ..() + return ..() /obj/vehicle/sealed/mecha/bullet_act(obj/item/projectile/Proj) //wrapper if(!enclosed && LAZYLEN(occupants) && !(mecha_flags & SILICON_PILOT) && !Proj.force_hit && (Proj.def_zone == BODY_ZONE_HEAD || Proj.def_zone == BODY_ZONE_CHEST)) //allows bullets to hit the pilot of open-canopy mechs diff --git a/modular_citadel/code/modules/vectorcrafts/vectorcraft.dm b/modular_citadel/code/modules/vectorcrafts/vectorcraft.dm index 399a1c5f06..f23d4d04fd 100644 --- a/modular_citadel/code/modules/vectorcrafts/vectorcraft.dm +++ b/modular_citadel/code/modules/vectorcrafts/vectorcraft.dm @@ -133,10 +133,10 @@ check_boost() if(driver.m_intent == MOVE_INTENT_WALK) var/deceleration = max_deceleration - if(driver.in_throw_mode) + if(driver.throw_mode) deceleration *= 1.5 friction(deceleration, TRUE) - else if(driver.in_throw_mode) + else if(driver.throw_mode) friction(max_deceleration*1.2, TRUE) friction(max_deceleration/4) diff --git a/tgstation.dme b/tgstation.dme index 15028c7f40..db3a013a3c 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -168,6 +168,7 @@ #include "code\__DEFINES\dcs\signals\signals_reagent.dm" #include "code\__DEFINES\dcs\signals\signals_screentips.dm" #include "code\__DEFINES\dcs\signals\signals_subsystem.dm" +#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_main.dm" #include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_movement.dm" #include "code\__DEFINES\dcs\signals\signals_mob\signals_mob_living.dm" #include "code\__DEFINES\dcs\signals\signals_mob\signals_mob_main.dm" From 2585c545fa8545a263b09e232fa4e9054b32556f Mon Sep 17 00:00:00 2001 From: SandPoot Date: Thu, 28 Dec 2023 00:37:23 -0300 Subject: [PATCH 8/8] not necessary --- code/game/objects/items.dm | 3 --- 1 file changed, 3 deletions(-) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 19cd9e5c5d..7aab051850 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -834,9 +834,6 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb else . = "" -/obj/item/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) - return // SEND_SIGNAL(src, COMSIG_ATOM_HITBY, AM, skipcatch, hitpush, blocked, throwingdatum) - /obj/item/attack_hulk(mob/living/carbon/human/user) return 0