diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm index bad819a985..7c7f704392 100644 --- a/code/game/machinery/cell_charger.dm +++ b/code/game/machinery/cell_charger.dm @@ -7,9 +7,19 @@ use_power = 1 idle_power_usage = 5 active_power_usage = 60000 //60 kW. (this the power drawn when charging) + var/efficiency = 60000 //will provide the modified power rate when upgraded power_channel = EQUIP var/obj/item/weapon/cell/charging = null var/chargelevel = -1 + circuit = /obj/item/weapon/circuitboard/cell_charger + +/obj/machinery/cell_charger/New() + component_parts = list() + component_parts += new /obj/item/weapon/stock_parts/capacitor(src) + component_parts += new /obj/item/stack/cable_coil(src, 5) + RefreshParts() + ..() + return /obj/machinery/cell_charger/update_icon() icon_state = "ccharger[charging ? 1 : 0]" @@ -32,9 +42,9 @@ if(!..(user, 5)) return - user << "There's [charging ? "a" : "no"] cell in the charger." + to_chat(user, "[charging ? "[charging]" : "Nothing"] is in [src].") if(charging) - user << "Current charge: [charging.charge]" + to_chat(user, "Current charge: [charging.charge] / [charging.maxcharge]") /obj/machinery/cell_charger/attackby(obj/item/weapon/W, mob/user) if(stat & BROKEN) @@ -42,56 +52,60 @@ if(istype(W, /obj/item/weapon/cell) && anchored) if(istype(W, /obj/item/weapon/cell/device)) - user << " The charger isn't fitted for that type of cell." + to_chat(user, "\The [src] isn't fitted for that type of cell.") return if(charging) - user << "There is already a cell in the charger." + to_chat(user, "There is already [charging] in [src].") return else var/area/a = loc.loc // Gets our locations location, like a dream within a dream if(!isarea(a)) return if(a.power_equip == 0) // There's no APC in this area, don't try to cheat power! - user << "The [name] blinks red as you try to insert the cell!" + to_chat(user, "\The [src] blinks red as you try to insert [W]!") return user.drop_item() W.loc = src charging = W - user.visible_message("[user] inserts a cell into the charger.", "You insert a cell into the charger.") + user.visible_message("[user] inserts [charging] into [src].", "You insert [charging] into [src].") chargelevel = -1 update_icon() else if(W.is_wrench()) if(charging) - user << "Remove the cell first!" + to_chat(user, "Remove [charging] first!") return anchored = !anchored - user << "You [anchored ? "attach" : "detach"] the cell charger [anchored ? "to" : "from"] the ground" + to_chat(user, "You [anchored ? "attach" : "detach"] [src] [anchored ? "to" : "from"] the ground") playsound(src, W.usesound, 75, 1) + else if(default_deconstruction_screwdriver(user, W)) + return + else if(default_deconstruction_crowbar(user, W)) + return + else if(default_part_replacement(user, W)) + return /obj/machinery/cell_charger/attack_hand(mob/user) + add_fingerprint(user) + if(charging) - usr.put_in_hands(charging) - charging.add_fingerprint(user) + user.put_in_hands(charging) charging.update_icon() + user.visible_message("[user] removes [charging] from [src].", "You remove [charging] from [src].") charging = null - user.visible_message("[user] removes the cell from the charger.", "You remove the cell from the charger.") chargelevel = -1 update_icon() /obj/machinery/cell_charger/attack_ai(mob/user) if(istype(user, /mob/living/silicon/robot) && Adjacent(user)) // Borgs can remove the cell if they are near enough - if(!charging) - return - - charging.loc = src.loc - charging.update_icon() - charging = null - update_icon() - user.visible_message("[user] removes the cell from the charger.", "You remove the cell from the charger.") - + if(charging) + user.visible_message("[user] removes [charging] from [src].", "You remove [charging] from [src].") + charging.loc = src.loc + charging.update_icon() + charging = null + update_icon() /obj/machinery/cell_charger/emp_act(severity) if(stat & (BROKEN|NOPOWER)) @@ -108,9 +122,15 @@ return if(charging && !charging.fully_charged()) - charging.give(active_power_usage*CELLRATE) + charging.give(efficiency*CELLRATE) update_use_power(2) update_icon() else update_use_power(1) + +/obj/machinery/cell_charger/RefreshParts() + var/E = 0 + for(var/obj/item/weapon/stock_parts/capacitor/C in component_parts) + E += C.rating + efficiency = active_power_usage * (1+ (E - 1)*0.5) \ No newline at end of file diff --git a/code/game/machinery/frame.dm b/code/game/machinery/frame.dm index c54734aec0..88bf735f53 100644 --- a/code/game/machinery/frame.dm +++ b/code/game/machinery/frame.dm @@ -90,6 +90,12 @@ circuit = /obj/item/weapon/circuitboard/recharger frame_size = 3 +/datum/frame/frame_types/cell_charger + name = "Heavy-Duty Cell Charger" + frame_class = FRAME_CLASS_MACHINE + circuit = /obj/item/weapon/circuitboard/cell_charger + frame_size = 3 + /datum/frame/frame_types/grinder name = "Grinder" frame_class = FRAME_CLASS_MACHINE diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm index 3205d16a61..445f92465a 100644 --- a/code/game/machinery/recharger.dm +++ b/code/game/machinery/recharger.dm @@ -1,7 +1,12 @@ //This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 -obj/machinery/recharger +/obj/machinery/recharger name = "recharger" +<<<<<<< HEAD icon = 'icons/obj/stationobjs_vr.dmi' //VOREStation Edit +======= + desc = "A standard recharger for all devices that use power." + icon = 'icons/obj/stationobjs.dmi' +>>>>>>> da7ced3... Merge pull request #6328 from Nalarac/recharger icon_state = "recharger0" anchored = 1 use_power = 1 @@ -24,10 +29,16 @@ obj/machinery/recharger ..() return -/obj/machinery/recharger/attackby(obj/item/weapon/G as obj, mob/user as mob) - if(istype(user,/mob/living/silicon)) +/obj/machinery/recharger/examine(mob/user) + if(!..(user, 5)) return + to_chat(user, "[charging ? "[charging]" : "Nothing"] is in [src].") + if(charging) + var/obj/item/weapon/cell/C = charging.get_cell() + to_chat(user, "Current charge: [C.charge] / [C.maxcharge]") + +/obj/machinery/recharger/attackby(obj/item/weapon/G as obj, mob/user as mob) var/allowed = 0 for (var/allowed_type in allowed_devices) if(istype(G, allowed_type)) allowed = 1 @@ -38,32 +49,54 @@ obj/machinery/recharger return // Checks to make sure he's not in space doing it, and that the area got proper power. if(!powered()) - to_chat(user, "The [name] blinks red as you try to insert the item!") + to_chat(user, "\The [src] blinks red as you try to insert [G]!") return if(istype(G, /obj/item/weapon/gun/energy)) var/obj/item/weapon/gun/energy/E = G if(E.self_recharge) - to_chat(user, "Your gun has no recharge port.") + to_chat(user, "\The [E] has no recharge port.") return if(istype(G, /obj/item/modular_computer)) var/obj/item/modular_computer/C = G if(!C.battery_module) - to_chat(user, "This device does not have a battery installed.") + to_chat(user, "\The [C] does not have a battery installed. ") return + if(istype(G, /obj/item/weapon/melee/baton)) + var/obj/item/weapon/melee/baton/B = G + if(B.use_external_power) + to_chat(user, "\The [B] has no recharge port.") + return + if(istype(G, /obj/item/device/flash)) + var/obj/item/device/flash/F = G + if(F.use_external_power) + to_chat(user, "\The [F] has no recharge port.") + return + if(istype(G, /obj/item/weapon/weldingtool/electric)) + var/obj/item/weapon/weldingtool/electric/EW = G + if(EW.use_external_power) + to_chat(user, "\The [EW] has no recharge port.") + return +<<<<<<< HEAD else if(!G.get_cell() && !istype(G, /obj/item/ammo_casing/nsfw_batt)) //VOREStation Edit: NSFW charging to_chat(user, "This device does not have a battery installed.") +======= + else if(!G.get_cell()) + to_chat(user, "\The [G] does not have a battery installed.") +>>>>>>> da7ced3... Merge pull request #6328 from Nalarac/recharger return user.drop_item() G.loc = src charging = G update_icon() + user.visible_message("[user] inserts [charging] into [src].", "You insert [charging] into [src].") + else if(portable && G.is_wrench()) if(charging) to_chat(user, "Remove [charging] first!") return anchored = !anchored - to_chat(user, "You [anchored ? "attached" : "detached"] the recharger.") + to_chat(user, "You [anchored ? "attached" : "detached"] [src].") playsound(loc, G.usesound, 75, 1) else if(default_deconstruction_screwdriver(user, G)) return @@ -73,17 +106,24 @@ obj/machinery/recharger return /obj/machinery/recharger/attack_hand(mob/user as mob) - if(istype(user,/mob/living/silicon)) - return - add_fingerprint(user) if(charging) + user.visible_message("[user] removes [charging] from [src].", "You remove [charging] from [src].") charging.update_icon() user.put_in_hands(charging) charging = null update_icon() +/obj/machinery/cell_charger/attack_ai(mob/user) + if(istype(user, /mob/living/silicon/robot) && Adjacent(user)) // Borgs can remove the cell if they are near enough + if(charging) + user.visible_message("[user] removes [charging] from [src].", "You remove [charging] from [src].") + charging.update_icon() + charging.loc = src.loc + charging = null + update_icon() + /obj/machinery/recharger/process() if(stat & (NOPOWER|BROKEN) || !anchored) update_use_power(0) @@ -164,6 +204,7 @@ obj/machinery/recharger /obj/machinery/recharger/wallcharger name = "wall recharger" + desc = "A more powerful recharger designed for energy weapons." icon = 'icons/obj/stationobjs.dmi' icon_state = "wrecharger0" plane = TURF_PLANE diff --git a/code/game/objects/items/weapons/circuitboards/frame.dm b/code/game/objects/items/weapons/circuitboards/frame.dm index 913506c9e6..63308e6caa 100644 --- a/code/game/objects/items/weapons/circuitboards/frame.dm +++ b/code/game/objects/items/weapons/circuitboards/frame.dm @@ -144,6 +144,14 @@ build_path = /obj/machinery/recharger/wallcharger board_type = new /datum/frame/frame_types/wall_charger +/obj/item/weapon/circuitboard/cell_charger + name = T_BOARD("heavy-duty cell charger") + build_path = /obj/machinery/cell_charger + board_type = new /datum/frame/frame_types/cell_charger + req_components = list( + /obj/item/weapon/stock_parts/capacitor = 1, + /obj/item/stack/cable_coil = 5) + /obj/item/weapon/circuitboard/washing name = T_BOARD("washing machine") build_path = /obj/machinery/washing_machine diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm index 53c092d923..9d5a4a8671 100644 --- a/code/game/objects/items/weapons/stunbaton.dm +++ b/code/game/objects/items/weapons/stunbaton.dm @@ -18,6 +18,7 @@ var/status = 0 //whether the thing is on or not var/obj/item/weapon/cell/bcell = null var/hitcost = 240 + var/use_external_power = FALSE //only used to determine if it's a cyborg baton /obj/item/weapon/melee/baton/New() ..() @@ -108,6 +109,8 @@ user <<"The baton does not have a power source installed." /obj/item/weapon/melee/baton/attackby(obj/item/weapon/W, mob/user) + if(use_external_power) + return if(istype(W, /obj/item/weapon/cell)) if(istype(W, /obj/item/weapon/cell/device)) if(!bcell) @@ -136,6 +139,11 @@ return ..() /obj/item/weapon/melee/baton/attack_self(mob/user) + if(use_external_power) + //try to find our power cell + var/mob/living/silicon/robot/R = loc + if (istype(R)) + bcell = R.cell if(bcell && bcell.charge > hitcost) status = !status user << "[src] is now [status ? "on" : "off"]." @@ -204,16 +212,7 @@ //secborg stun baton module /obj/item/weapon/melee/baton/robot hitcost = 500 - -/obj/item/weapon/melee/baton/robot/attack_self(mob/user) - //try to find our power cell - var/mob/living/silicon/robot/R = loc - if (istype(R)) - bcell = R.cell - return ..() - -/obj/item/weapon/melee/baton/robot/attackby(obj/item/weapon/W, mob/user) - return + use_external_power = TRUE //Makeshift stun baton. Replacement for stun gloves. /obj/item/weapon/melee/baton/cattleprod @@ -274,13 +273,4 @@ // Borg version, for the lost module. /obj/item/weapon/melee/baton/shocker/robot - -/obj/item/weapon/melee/baton/shocker/robot/attack_self(mob/user) - //try to find our power cell - var/mob/living/silicon/robot/R = loc - if (istype(R)) - bcell = R.cell - return ..() - -/obj/item/weapon/melee/baton/shocker/robot/attackby(obj/item/weapon/W, mob/user) - return \ No newline at end of file + use_external_power = TRUE \ No newline at end of file diff --git a/code/modules/xenobio/items/weapons.dm b/code/modules/xenobio/items/weapons.dm index 4abb89ffea..b44c73a032 100644 --- a/code/modules/xenobio/items/weapons.dm +++ b/code/modules/xenobio/items/weapons.dm @@ -37,17 +37,7 @@ // Research borg's version /obj/item/weapon/melee/baton/slime/robot hitcost = 200 - -/obj/item/weapon/melee/baton/slime/robot/attack_self(mob/user) - //try to find our power cell - var/mob/living/silicon/robot/R = loc - if (istype(R)) - bcell = R.cell - return ..() - -/obj/item/weapon/melee/baton/slime/robot/attackby(obj/item/weapon/W, mob/user) - return - + use_external_power = TRUE // Xeno stun gun + projectile /obj/item/weapon/gun/energy/taser/xeno diff --git a/html/changelogs/Nalarac - Rechargers.yml b/html/changelogs/Nalarac - Rechargers.yml new file mode 100644 index 0000000000..497f18a7c0 --- /dev/null +++ b/html/changelogs/Nalarac - Rechargers.yml @@ -0,0 +1,37 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +################################# + +# Your name. +author: Nalarac + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - tweak: "Heavy-duty cell chargers can be built and upgraded." + - bugfix: "Cyborgs can upgrade rechargers now." \ No newline at end of file diff --git a/icons/obj/stock_parts.dmi b/icons/obj/stock_parts.dmi index afabe6ebfc..2bab59a487 100644 Binary files a/icons/obj/stock_parts.dmi and b/icons/obj/stock_parts.dmi differ