Merge pull request #14821 from Youtubeboy139/2023-EnerGen-Power-Cells

2023 EnerGen Power Cells
This commit is contained in:
Heroman3003
2023-06-04 05:09:19 +10:00
committed by CHOMPStation2
parent 515d0e49ba
commit e24b0b016c
7 changed files with 87 additions and 22 deletions

View File

@@ -16,15 +16,14 @@
/obj/machinery/cell_charger/Initialize()
. = ..()
default_apply_parts()
add_overlay("ccharger1")
/obj/machinery/cell_charger/update_icon()
icon_state = "ccharger[charging ? 1 : 0]"
if(!anchored)
cut_overlays()
icon_state = "ccharger2"
if(charging && !(stat & (BROKEN|NOPOWER)))
var/newlevel = round(charging.percent() * 4.0 / 99)
//to_world("nl: [newlevel]")
@@ -34,8 +33,14 @@
add_overlay("ccharger-o[newlevel]")
chargelevel = newlevel
else
add_overlay(image(charging.icon, charging.icon_state))
add_overlay("ccharger-[charging.connector_type]-on")
else if(anchored)
cut_overlays()
icon_state = "ccharger0"
add_overlay("ccharger1")
/obj/machinery/cell_charger/examine(mob/user)
. = ..()
@@ -77,6 +82,7 @@
anchored = !anchored
to_chat(user, "You [anchored ? "attach" : "detach"] [src] [anchored ? "to" : "from"] the ground")
playsound(src, W.usesound, 75, 1)
update_icon()
else if(default_deconstruction_screwdriver(user, W))
return
else if(default_deconstruction_crowbar(user, W))

View File

@@ -78,6 +78,15 @@
prob(9);/obj/item/weapon/cell/super,
prob(1);/obj/item/weapon/cell/hyper)
/obj/random/powercell/device
name = "random device powercell"
desc = "This is a random device powercell."
icon_state = "random_device"
/obj/random/powercell/device/item_to_spawn()
return pick(prob(80);/obj/item/weapon/cell/device,
prob(10);/obj/item/weapon/cell/device/hyper,
prob(10);/obj/item/weapon/cell/device/empproof)
/obj/random/bomb_supply
name = "bomb supply"

View File

@@ -25,6 +25,7 @@
var/self_recharge = FALSE // If true, the cell will recharge itself.
var/charge_amount = 25 // How much power to give, if self_recharge is true. The number is in absolute cell charge, as it gets divided by CELLRATE later.
var/last_use = 0 // A tracker for use in self-charging
var/connector_type = "standard" //What connector sprite to use when in a cell charger, null if no connectors
var/charge_delay = 0 // How long it takes for the cell to start recharging after last use
matter = list(MAT_STEEL = 700, MAT_GLASS = 50)
drop_sound = 'sound/items/drop/component.ogg'

View File

@@ -21,10 +21,45 @@
charge = 0
update_icon()
/*
* Crap Device
*/
/obj/item/weapon/cell/device/crap
name = "\improper rechargable D battery"
desc = "An older, cheap power cell designed to power handheld devices. It's probably been in use for quite some time now."
description_fluff = "You can't top the rust top." //TOTALLY TRADEMARK INFRINGEMENT
origin_tech = list(TECH_POWER = 0)
icon_state = "device_crap"
maxcharge = 240
matter = list(MAT_STEEL = 350, MAT_GLASS = 30)
/obj/item/weapon/cell/device/crap/update_icon() //No visible charge indicator
return
/obj/item/weapon/cell/device/crap/empty/Initialize()
. = ..()
charge = 0
update_icon()
/*
* Hyper Device
*/
/obj/item/weapon/cell/device/hyper
name = "hyper device power cell"
desc = "A small power cell designed to power handheld devices. Has a better charge than a standard device cell."
icon_state = "hype_device_cell"
maxcharge = 600
matter = list(MAT_STEEL = 400, MAT_GLASS = 60)
/obj/item/weapon/cell/device/hyper/empty/Initialize()
. = ..()
charge = 0
update_icon()
/*
* EMP Proof Device
*/
/obj/item/weapon/cell/device/empproof //UNUSED
/obj/item/weapon/cell/device/empproof
name = "shielded device power cell"
desc = "A small power cell designed to power handheld devices. Shielded from EMPs."
icon_state = "up_device_cell"

View File

@@ -1,34 +1,30 @@
//CHOMP Disabled in DME in favor of modular_chomp folder
/*
* Empty
*/
/obj/item/weapon/cell/empty/New()
..()
charge = 0
/*
* Crap
*/
/obj/item/weapon/cell/crap
name = "\improper rechargable AA battery"
desc = "You can't top the plasma top." //TOTALLY TRADEMARK INFRINGEMENT
name = "\improper rechargable DD battery"
desc = "An older, cheap power cell. It's probably been in use for quite some time now."
description_fluff = "You can't top the rust top." //TOTALLY TRADEMARK INFRINGEMENT
origin_tech = list(TECH_POWER = 0)
icon_state = "crap"
maxcharge = 500
matter = list(MAT_STEEL = 700, MAT_GLASS = 40)
/obj/item/weapon/cell/crap/update_icon() //No visible charge indicator
return
/obj/item/weapon/cell/crap/empty/New()
..()
charge = 0
/*
* Security Borg
*/
/obj/item/weapon/cell/secborg
name = "security borg rechargable D battery"
origin_tech = list(TECH_POWER = 0)
icon_state = "secborg"
maxcharge = 600 //600 max charge / 100 charge per shot = six shots
matter = list(MAT_STEEL = 700, MAT_GLASS = 40)
/obj/item/weapon/cell/secborg/empty/New()
..()
charge = 0
update_icon()
/*
* APC
*/
@@ -90,10 +86,23 @@
/obj/item/weapon/cell/mech
name = "mecha power cell"
icon_state = "mech"
connector_type = "mech"
charge = 15000
maxcharge = 15000
matter = list(MAT_STEEL = 800, MAT_GLASS = 60)
/obj/item/weapon/cell/mech/lead
name = "lead acid battery"
desc = "An ancient battery design not commonly seen anymore. It looks like it'd fit inside a mech however..."
origin_tech = list(TECH_POWER = 0) //Litteraly an old car battery, doesn't need tech
icon_state = "lead"
charge = 8000
maxcharge = 8000
matter = list(MAT_STEEL = 300, MAT_GLASS = 10)
/obj/item/weapon/cell/mech/lead/update_icon() //No visible charge indicator
return
/obj/item/weapon/cell/mech/high
name = "high-capacity mecha power cell"
origin_tech = list(TECH_POWER = 3)
@@ -147,6 +156,7 @@
origin_tech = list(TECH_POWER = 4, TECH_BIO = 5)
icon = 'icons/mob/slimes.dmi' //'icons/obj/harvest.dmi'
icon_state = "yellow slime extract" //"potato_battery"
connector_type = "slime"
description_info = "This 'cell' holds a max charge of 10k and self recharges over time."
maxcharge = 10000
matter = null
@@ -162,8 +172,12 @@
maxcharge = 120 //Emergency lights use 0.2 W per tick, meaning ~10 minutes of emergency power from a cell
matter = list(MAT_GLASS = 20)
icon_state = "em_light"
connector_type = "emergency"
w_class = ITEMSIZE_TINY
/obj/item/weapon/cell/emergency_light/update_icon() //No visible charge indicator
return
/obj/item/weapon/cell/emergency_light/Initialize()
. = ..()
var/area/A = get_area(src)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB