diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index cfa8b21e3b..db0cb28c4d 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -377,8 +377,8 @@ "},"OOC Warning") return -/obj/item/attack_ai(mob/user as mob) - if (istype(src.loc, /obj/item/robot_module)) +/obj/item/attack_ai(mob/user) + if(istype(src.loc, /obj/item/robot_module)) //If the item is part of a cyborg module, equip it if(!isrobot(user)) return @@ -386,7 +386,7 @@ R.activate_module(src) R.hud_used.update_robot_modules_display() -/obj/item/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/attackby(obj/item/W, mob/user) . = ..() if(istype(W, /obj/item/storage)) var/obj/item/storage/S = W diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index 077e74eb32..f2ff2ec7a5 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -265,7 +265,7 @@ var/datum/component/overlay_lighting/OL = GetComponent(/datum/component/overlay_lighting) //BEWARE, ESOTERIC BULLSHIT HERE. if(flicker_color && light_color != flicker_color) set_light_color(flicker_color) - OL.directional_atom.color = flicker_color + OL.directional_atom?.color = flicker_color do_flicker(amount, flicker_color, original_color, original_on, OL, 1) diff --git a/code/game/objects/items/devices/personal_shield_generator_vr.dm b/code/game/objects/items/devices/personal_shield_generator_vr.dm index 5b16cf910c..ffb01abe36 100644 --- a/code/game/objects/items/devices/personal_shield_generator_vr.dm +++ b/code/game/objects/items/devices/personal_shield_generator_vr.dm @@ -51,19 +51,17 @@ if(has_weapon) if(ispath(active_weapon)) active_weapon = new active_weapon(src, src) - active_weapon.power_supply = bcell else active_weapon = new(src, src) - active_weapon.power_supply = bcell else verbs -= /obj/item/personal_shield_generator/verb/weapon_toggle STOP_PROCESSING(SSobj, src) //We do this so it doesn't start processing until it's first used. update_icon() /obj/item/personal_shield_generator/Destroy() - . = ..() QDEL_NULL(active_weapon) QDEL_NULL(bcell) + . = ..() /obj/item/personal_shield_generator/loaded //starts with a cell bcell = /obj/item/cell/device/shield_generator/backpack @@ -178,8 +176,6 @@ return W.forceMove(src) bcell = W - if(active_weapon) - active_weapon.power_supply = bcell to_chat(user, span_notice("You install a cell in \the [src].")) update_icon() @@ -190,30 +186,25 @@ return //CHOMPedit: No cell removal. if(istype(bcell, /obj/item/cell/device/shield_generator)) //No stealing self charging batteries! var/choice = tgui_alert(user, "A popup appears on the device 'REMOVING THE INTERNAL CELL WILL DESTROY THE BATTERY. DO YOU WISH TO CONTINUE?'...Well, do you?", "Selection List", list("Cancel", "Remove")) - if(choice == "Remove") //Warned you... - var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread - s.set_up(5, 1, src) - s.start() - bcell.forceMove(get_turf(src.loc)) - qdel(bcell) - bcell = null //Sanity. - if(active_weapon) - reattach_gun() //Put the gun back if it's out. No shooting if we don't have a cell! - active_weapon.power_supply = null //No power cell anymore! - to_chat(user, span_notice("You remove the cell from \the [src], destroying the battery.")) - update_icon() + if(choice != "Remove") //Warned you... return - else - return - else - bcell.update_icon() - bcell.forceMove(get_turf(src.loc)) - bcell = null + var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread + s.set_up(5, 1, src) + s.start() + QDEL_NULL(bcell) if(active_weapon) reattach_gun() //Put the gun back if it's out. No shooting if we don't have a cell! - active_weapon.power_supply = null //No power cell anymore! - to_chat(user, span_notice("You remove the cell from \the [src].")) + to_chat(user, span_notice("You remove the cell from \the [src], destroying the battery.")) update_icon() + return + + bcell.update_icon() + bcell.forceMove(get_turf(src.loc)) + bcell = null + if(active_weapon) + reattach_gun() //Put the gun back if it's out. No shooting if we don't have a cell! + to_chat(user, span_notice("You remove the cell from \the [src].")) + update_icon() else if(istype(W,/obj/item/multitool)) var/new_color = tgui_color_picker(usr, "Choose a color to set the shield to!", "", effect_color) if(new_color) @@ -323,7 +314,6 @@ if(active_weapon) //Retract the gun. There's about to be no cell anymore. reattach_gun() - active_weapon.power_supply = null bcell.use(generator_active_cost) //Causes it to go boom. bcell = null @@ -392,6 +382,7 @@ fire_delay = 8 use_external_power = TRUE cell_type = null //No cell! It runs off the cell in the shield_gen! + battery_lock = TRUE projectile_type = /obj/item/projectile/beam/stun/med modifystate = "egunstun" @@ -409,7 +400,15 @@ /obj/item/gun/energy/gun/generator/Initialize(mapload, obj/item/personal_shield_generator/shield_gen) . = ..() shield_generator = shield_gen - power_supply = shield_generator.bcell + +/obj/item/gun/energy/gun/generator/Destroy() + shield_generator = null + . = ..() + +/obj/item/gun/energy/gun/generator/get_external_power_supply() + if(shield_generator) + return shield_generator.bcell + return null /* //Unused. Use for large guns. /obj/item/gun/energy/gun/generator/update_held_icon() diff --git a/code/modules/food/kitchen/cooking_machines/foodsynthesizer.dm b/code/modules/food/kitchen/cooking_machines/foodsynthesizer.dm index 34b3102f3b..1366463c39 100644 --- a/code/modules/food/kitchen/cooking_machines/foodsynthesizer.dm +++ b/code/modules/food/kitchen/cooking_machines/foodsynthesizer.dm @@ -557,7 +557,7 @@ if(W.is_wrench()) playsound(src, W.usesound, 50, 1) to_chat(user, span_notice("You begin to [anchored ? "un" : ""]fasten \the [src].")) - if (do_after(user, 20 * W.toolspeed)) + if (do_after(user, 20 * W.toolspeed, src)) user.visible_message( span_notice("\The [user] [anchored ? "un" : ""]fastens \the [src]."), span_notice("You have [anchored ? "un" : ""]fastened \the [src]."), diff --git a/code/modules/mob/living/silicon/robot/inventory.dm b/code/modules/mob/living/silicon/robot/inventory.dm index 7cddc93c81..ec97fef8fe 100644 --- a/code/modules/mob/living/silicon/robot/inventory.dm +++ b/code/modules/mob/living/silicon/robot/inventory.dm @@ -73,7 +73,7 @@ for(var/datum/action/A as anything in I.actions) A.Remove(src) - after_equip() + handle_removal(I) update_icon() if(shown_robot_modules) hud_used.update_robot_modules_display() @@ -102,6 +102,7 @@ for(var/datum/action/A as anything in I.actions) A.Remove(src) module_state_1:loc = module + handle_removal(module_state_1) module_state_1 = null inv1.icon_state = "inv1" removed_any_module = TRUE @@ -116,6 +117,7 @@ A.Remove(src) contents -= module_state_2 module_state_2:loc = module + handle_removal(module_state_2) module_state_2 = null inv2.icon_state = "inv2" removed_any_module = TRUE @@ -130,11 +132,11 @@ A.Remove(src) contents -= module_state_3 module_state_3:loc = module + handle_removal(module_state_3) module_state_3 = null inv3.icon_state = "inv3" removed_any_module = TRUE - after_equip() update_icon() // Refresh inventory if needed @@ -372,6 +374,20 @@ return after_equip(O) +/mob/living/silicon/robot/proc/handle_removal(obj/item/O) + if(istype(O, /obj/item/dogborg/sleeper)) //gross, fuck you diana! THAT does NOT Fucking work! + var/obj/item/dogborg/sleeper/our_compactor = O + if(our_compactor.ore_storage) + our_compactor.ore_bag.dropped(src) + + if(!(sight_mode & BORGANOMALOUS)) + var/obj/item/dogborg/pounce/pounce = has_upgrade_module(/obj/item/dogborg/pounce) + if(pounce) + pounce.name = initial(pounce.name) + pounce.icon_state = initial(pounce.icon_state) + pounce.desc = initial(pounce.desc) + pounce.bluespace = initial(pounce.bluespace) + /mob/living/silicon/robot/proc/after_equip(obj/item/O) if(istype(O, /obj/item/gps)) var/obj/item/gps/tracker = O @@ -381,23 +397,13 @@ if(istype(O, /obj/item/dogborg/sleeper)) //gross var/obj/item/dogborg/sleeper/our_compactor = O if(our_compactor.ore_storage) - if(O in get_all_held_items()) - our_compactor.ore_bag.equipped(src) - else - our_compactor.ore_bag.dropped(src) + our_compactor.ore_bag.equipped(src) if(sight_mode & BORGANOMALOUS) var/obj/item/dogborg/pounce/pounce = has_upgrade_module(/obj/item/dogborg/pounce) if(pounce) pounce.name = "bluespace pounce" pounce.icon_state = "bluespace_pounce" pounce.bluespace = TRUE - else - var/obj/item/dogborg/pounce/pounce = has_upgrade_module(/obj/item/dogborg/pounce) - if(pounce) - pounce.name = initial(pounce.name) - pounce.icon_state = initial(pounce.icon_state) - pounce.desc = initial(pounce.desc) - pounce.bluespace = initial(pounce.bluespace) if(O) for(var/datum/action/A as anything in O.actions) A.Grant(src) diff --git a/code/modules/modular_computers/computers/modular_computer/core.dm b/code/modules/modular_computers/computers/modular_computer/core.dm index bb67b79950..6fb2eecfe7 100644 --- a/code/modules/modular_computers/computers/modular_computer/core.dm +++ b/code/modules/modular_computers/computers/modular_computer/core.dm @@ -58,7 +58,7 @@ for(var/obj/item/computer_hardware/CH in src.get_all_components()) uninstall_component(null, CH) qdel(CH) - paired_uavs.Cut() + LAZYCLEARLIST(paired_uavs) return ..() /obj/item/modular_computer/emag_act(remaining_charges, mob/user) diff --git a/code/modules/power/fusion/fusion_reactions.dm b/code/modules/power/fusion/fusion_reactions.dm index 0da23918fa..2262d75faf 100644 --- a/code/modules/power/fusion/fusion_reactions.dm +++ b/code/modules/power/fusion/fusion_reactions.dm @@ -58,7 +58,7 @@ GLOBAL_LIST(fusion_reactions) /datum/decl/fusion_reaction/deuterium_tritium p_react = REAGENT_ID_DEUTERIUM - s_react = REAGENT_ID_SLIMEJELLY + s_react = REAGENT_ID_TRITIUM energy_consumption = 1 energy_production = 1 products = list(REAGENT_ID_HELIUM3 = 1) @@ -70,7 +70,7 @@ GLOBAL_LIST(fusion_reactions) energy_consumption = 2 energy_production = 0 radiation = 3 - products = list(REAGENT_ID_SLIMEJELLY= 1) + products = list(REAGENT_ID_TRITIUM = 1) instability = 1 // Unideal/material production reactions