diff --git a/code/game/machinery/transformer.dm b/code/game/machinery/transformer.dm index 79428fce6f..fe18365a9c 100644 --- a/code/game/machinery/transformer.dm +++ b/code/game/machinery/transformer.dm @@ -98,9 +98,7 @@ use_power(5000) // Use a lot of power. var/mob/living/silicon/robot/R = H.Robotize() - - R.cell.maxcharge = robot_cell_charge - R.cell.charge = robot_cell_charge + R.cell = new /obj/item/stock_parts/cell/upgraded/plus(R, robot_cell_charge) // So he can't jump out the gate right away. R.SetLockdown() diff --git a/code/game/mecha/combat/gygax.dm b/code/game/mecha/combat/gygax.dm index df66127cc7..d5228b9130 100644 --- a/code/game/mecha/combat/gygax.dm +++ b/code/game/mecha/combat/gygax.dm @@ -1,68 +1,65 @@ -/obj/mecha/combat/gygax - desc = "A lightweight, security exosuit. Popular among private and corporate security." - name = "\improper Gygax" - icon_state = "gygax" - step_in = 3 - dir_in = 1 //Facing North. +/obj/mecha/combat/gygax + desc = "A lightweight, security exosuit. Popular among private and corporate security." + name = "\improper Gygax" + icon_state = "gygax" + step_in = 3 + dir_in = 1 //Facing North. max_integrity = 250 - deflect_chance = 5 - armor = list(melee = 25, bullet = 20, laser = 30, energy = 15, bomb = 0, bio = 0, rad = 0, fire = 100, acid = 100) - max_temperature = 25000 - infra_luminosity = 6 - wreckage = /obj/structure/mecha_wreckage/gygax - internal_damage_threshold = 35 - max_equip = 3 - step_energy_drain = 3 - -/obj/mecha/combat/gygax/dark - desc = "A lightweight exosuit, painted in a dark scheme. This model appears to have some modifications." - name = "\improper Dark Gygax" - icon_state = "darkgygax" + deflect_chance = 5 + armor = list(melee = 25, bullet = 20, laser = 30, energy = 15, bomb = 0, bio = 0, rad = 0, fire = 100, acid = 100) + max_temperature = 25000 + infra_luminosity = 6 + wreckage = /obj/structure/mecha_wreckage/gygax + internal_damage_threshold = 35 + max_equip = 3 + step_energy_drain = 3 + +/obj/mecha/combat/gygax/dark + desc = "A lightweight exosuit, painted in a dark scheme. This model appears to have some modifications." + name = "\improper Dark Gygax" + icon_state = "darkgygax" max_integrity = 300 - deflect_chance = 15 - armor = list(melee = 40, bullet = 40, laser = 50, energy = 35, bomb = 20, bio = 0, rad = 0, fire = 100, acid = 100) - max_temperature = 35000 - leg_overload_coeff = 100 + deflect_chance = 15 + armor = list(melee = 40, bullet = 40, laser = 50, energy = 35, bomb = 20, bio = 0, rad = 0, fire = 100, acid = 100) + max_temperature = 35000 + leg_overload_coeff = 100 operation_req_access = list(ACCESS_SYNDICATE) - wreckage = /obj/structure/mecha_wreckage/gygax/dark - max_equip = 4 - -/obj/mecha/combat/gygax/dark/loaded/New() - ..() - var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/carbine - ME.attach(src) - ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/flashbang - ME.attach(src) - ME = new /obj/item/mecha_parts/mecha_equipment/teleporter - ME.attach(src) - ME = new /obj/item/mecha_parts/mecha_equipment/tesla_energy_relay - ME.attach(src) - return - -/obj/mecha/combat/gygax/dark/add_cell(obj/item/stock_parts/cell/C=null) - if(C) - C.forceMove(src) - cell = C - return - cell = new(src) - cell.charge = 30000 - cell.maxcharge = 30000 - - -/obj/mecha/combat/gygax/GrantActions(mob/living/user, human_occupant = 0) - ..() - overload_action.Grant(user, src) - -/obj/mecha/combat/gygax/dark/GrantActions(mob/living/user, human_occupant = 0) - ..() - thrusters_action.Grant(user, src) - - -/obj/mecha/combat/gygax/RemoveActions(mob/living/user, human_occupant = 0) - ..() - overload_action.Remove(user) - -/obj/mecha/combat/gygax/dark/RemoveActions(mob/living/user, human_occupant = 0) - ..() - thrusters_action.Remove(user) - + wreckage = /obj/structure/mecha_wreckage/gygax/dark + max_equip = 4 + +/obj/mecha/combat/gygax/dark/loaded/New() + ..() + var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/carbine + ME.attach(src) + ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/flashbang + ME.attach(src) + ME = new /obj/item/mecha_parts/mecha_equipment/teleporter + ME.attach(src) + ME = new /obj/item/mecha_parts/mecha_equipment/tesla_energy_relay + ME.attach(src) + return + +/obj/mecha/combat/gygax/dark/add_cell(obj/item/stock_parts/cell/C=null) + if(C) + C.forceMove(src) + cell = C + return + cell = new /obj/item/stock_parts/cell/hyper(src) + + +/obj/mecha/combat/gygax/GrantActions(mob/living/user, human_occupant = 0) + ..() + overload_action.Grant(user, src) + +/obj/mecha/combat/gygax/dark/GrantActions(mob/living/user, human_occupant = 0) + ..() + thrusters_action.Grant(user, src) + + +/obj/mecha/combat/gygax/RemoveActions(mob/living/user, human_occupant = 0) + ..() + overload_action.Remove(user) + +/obj/mecha/combat/gygax/dark/RemoveActions(mob/living/user, human_occupant = 0) + ..() + thrusters_action.Remove(user) diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index ba41609fca..d5ad847afd 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -231,9 +231,7 @@ C.forceMove(src) cell = C return - cell = new(src) - cell.charge = 15000 - cell.maxcharge = 15000 + cell = new /obj/item/stock_parts/cell/high/plus(src) /obj/mecha/proc/add_cabin() cabin_air = new diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index e8b05bac9e..db10f4a81c 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -115,9 +115,7 @@ ident = rand(1, 999) if(!cell) - cell = new /obj/item/stock_parts/cell(src) - cell.maxcharge = 7500 - cell.charge = 7500 + cell = new /obj/item/stock_parts/cell/high(src, 7500) if(lawupdate) make_laws() @@ -854,8 +852,7 @@ /mob/living/silicon/robot/modules/syndicate/Initialize() . = ..() - cell.maxcharge = 25000 - cell.charge = 25000 + cell = new /obj/item/stock_parts/cell/hyper(src, 25000) radio = new /obj/item/device/radio/borg/syndicate(src) laws = new /datum/ai_laws/syndicate_override() addtimer(CALLBACK(src, .proc/show_playstyle), 5) diff --git a/code/modules/mob/living/simple_animal/bot/mulebot.dm b/code/modules/mob/living/simple_animal/bot/mulebot.dm index e7116db53e..570481933b 100644 --- a/code/modules/mob/living/simple_animal/bot/mulebot.dm +++ b/code/modules/mob/living/simple_animal/bot/mulebot.dm @@ -54,9 +54,7 @@ var/datum/job/cargo_tech/J = new/datum/job/cargo_tech access_card.access = J.get_access() prev_access = access_card.access - cell = new(src) - cell.charge = 2000 - cell.maxcharge = 2000 + cell = new /obj/item/stock_parts/cell/upgraded(src, 2000) var/static/mulebot_count = 0 mulebot_count += 1 diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index f763c3ea86..534307f727 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -378,10 +378,7 @@ var/mob/living/silicon/robot/R = new /mob/living/silicon/robot(loc) // cyborgs produced by Robotize get an automatic power cell - R.cell = new(R) - R.cell.maxcharge = 7500 - R.cell.charge = 7500 - + R.cell = new /obj/item/stock_parts/cell/high(R, 7500) R.gender = gender R.invisibility = 0 diff --git a/code/modules/power/cell.dm b/code/modules/power/cell.dm index 36d99c2f65..1e1407e852 100644 --- a/code/modules/power/cell.dm +++ b/code/modules/power/cell.dm @@ -23,9 +23,11 @@ /obj/item/stock_parts/cell/get_cell() return src -/obj/item/stock_parts/cell/New() +/obj/item/stock_parts/cell/Initialize(mapload, override_maxcharge) . = ..() START_PROCESSING(SSobj, src) + if (override_maxcharge) + maxcharge = override_maxcharge charge = maxcharge if(ratingdesc) desc += " This one has a rating of [DisplayEnergy(maxcharge)], and you should not swallow it."