Replace cells with Eris cells

This commit is contained in:
Chompstation Bot
2021-07-04 01:53:41 +00:00
parent c21ee657fe
commit c31b28755f
9 changed files with 124 additions and 72 deletions

View File

@@ -1,38 +1,84 @@
#define CHARGER_EMPTY 0
#define CHARGER_WORKING 1
#define CHARGER_DONE 2
/obj/machinery/cell_charger
name = "heavy-duty cell charger"
desc = "A much more powerful version of the standard recharger that is specially designed for charging power cells."
icon = 'icons/obj/power.dmi'
icon_state = "ccharger0"
icon_state = "recharger"
anchored = 1
use_power = USE_POWER_IDLE
power_channel = EQUIP
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
var/efficiency = 60000 //will provide the modified power rate when upgraded
var/obj/item/weapon/cell/charging = null
var/charging_vis_flags = NONE
var/charge_state = CHARGER_EMPTY
/obj/machinery/cell_charger/Initialize()
. = ..()
default_apply_parts()
/obj/machinery/cell_charger/update_icon()
icon_state = "ccharger[charging ? 1 : 0]"
var/new_state
if(!anchored)
new_state = "[initial(icon_state)]4"
return
if(charging && !(stat & (BROKEN|NOPOWER)))
if(stat & (BROKEN|NOPOWER))
new_state = "[initial(icon_state)]3"
return
var/newlevel = round(charging.percent() * 4.0 / 99)
//to_world("nl: [newlevel]")
switch(charge_state)
if(CHARGER_EMPTY)
new_state = "[initial(icon_state)]0"
if(CHARGER_WORKING)
new_state = "[initial(icon_state)]1"
if(CHARGER_DONE)
new_state = "[initial(icon_state)]2"
if(chargelevel != newlevel)
if(icon_state != new_state)
icon_state = new_state
cut_overlays()
add_overlay("ccharger-o[newlevel]")
/obj/machinery/cell_charger/proc/insert_item(obj/item/W, mob/user)
if(!W || !user)
return
chargelevel = newlevel
user.drop_item()
charging = W
charging.loc = src
charging_vis_flags = charging.vis_flags
charging.vis_flags = VIS_INHERIT_ID
vis_contents += charging
charge_state = CHARGER_WORKING
update_icon()
if((stat & (BROKEN|NOPOWER)) || !anchored)
update_use_power(USE_POWER_OFF)
else
cut_overlays()
update_use_power(USE_POWER_ACTIVE)
/obj/machinery/cell_charger/proc/remove_item(mob/user)
if(!charging || !user)
return
vis_contents -= charging
charging.vis_flags = charging_vis_flags
user.put_in_hands(charging)
charging = null
charge_state = CHARGER_EMPTY
update_icon()
if((stat & (BROKEN|NOPOWER)) || !anchored)
update_use_power(USE_POWER_OFF)
else
update_use_power(USE_POWER_IDLE)
/obj/machinery/cell_charger/examine(mob/user)
. = ..()
@@ -60,11 +106,8 @@
to_chat(user, "<span class='warning'>\The [src] blinks red as you try to insert [W]!</span>")
return
user.drop_item()
W.loc = src
charging = W
insert_item(W, user)
user.visible_message("[user] inserts [charging] into [src].", "You insert [charging] into [src].")
chargelevel = -1
update_icon()
else if(W.is_wrench())
if(charging)
@@ -85,12 +128,8 @@
add_fingerprint(user)
if(charging)
user.put_in_hands(charging)
charging.update_icon()
remove_item(user)
user.visible_message("[user] removes [charging] from [src].", "You remove [charging] from [src].")
charging = null
chargelevel = -1
update_icon()
/obj/machinery/cell_charger/attack_ai(mob/user)
@@ -109,6 +148,9 @@
charging.emp_act(severity)
..(severity)
/obj/machinery/cell_charger/power_change()
. = ..()
update_icon()
/obj/machinery/cell_charger/process()
//to_world("ccpt [charging] [stat]")
@@ -116,16 +158,22 @@
update_use_power(USE_POWER_OFF)
return
if(charging && !charging.fully_charged())
if(charging)
if(!charging.fully_charged())
charge_state = CHARGER_WORKING
charging.give(efficiency*CELLRATE)
update_use_power(USE_POWER_ACTIVE)
update_icon()
else
charge_state = CHARGER_DONE
update_use_power(USE_POWER_IDLE)
update_icon()
/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)
#undef CHARGER_EMPTY
#undef CHARGER_WORKING
#undef CHARGER_DONE

View File

@@ -5,8 +5,8 @@
/obj/item/weapon/cell
name = "power cell"
desc = "A rechargable electrochemical power cell."
icon = 'icons/obj/power.dmi'
icon_state = "cell"
icon = 'icons/obj/power_cells.dmi'
icon_state = "b_st"
item_state = "cell"
origin_tech = list(TECH_POWER = 1)
force = 5.0
@@ -29,8 +29,7 @@
pickup_sound = 'sound/items/pickup/component.ogg'
// Overlay stuff.
var/overlay_half_state = "cell-o1" // Overlay used when not fully charged but not empty.
var/overlay_full_state = "cell-o2" // Overlay used when fully charged.
var/standard_overlays = TRUE
var/last_overlay_state = null // Used to optimize update_icon() calls.
/obj/item/weapon/cell/New()
@@ -73,29 +72,14 @@
#define OVERLAY_EMPTY 0
/obj/item/weapon/cell/update_icon()
var/new_overlay = null // The overlay that is needed.
// If it's different than the current overlay, then it'll get changed.
// Otherwise nothing happens, to save on CPU.
if(charge < 0.01) // Empty.
new_overlay = OVERLAY_EMPTY
if(last_overlay_state != new_overlay)
cut_overlays()
else if(charge/maxcharge >= 0.995) // Full
new_overlay = OVERLAY_FULL
if(last_overlay_state != new_overlay)
cut_overlay(overlay_half_state)
add_overlay(overlay_full_state)
else // Inbetween.
new_overlay = OVERLAY_PARTIAL
if(last_overlay_state != new_overlay)
cut_overlay(overlay_full_state)
add_overlay(overlay_half_state)
last_overlay_state = new_overlay
if(!standard_overlays)
return
var/ratio = clamp(round(charge / maxcharge, 0.25) * 100, 0, 100)
var/new_state = "[icon_state]_[ratio]"
if(new_state != last_overlay_state)
cut_overlay(last_overlay_state)
add_overlay(new_state)
last_overlay_state = new_state
#undef OVERLAY_FULL
#undef OVERLAY_PARTIAL

View File

@@ -2,7 +2,7 @@
/obj/item/weapon/cell/device
name = "device power cell"
desc = "A small power cell designed to power handheld devices."
icon_state = "dcell"
icon_state = "m_st"
item_state = "egg6"
w_class = ITEMSIZE_SMALL
force = 0
@@ -13,11 +13,23 @@
matter = list("metal" = 350, "glass" = 50)
preserve_item = 1
<<<<<<< HEAD
//Yawn changes
/obj/item/weapon/cell/device/weapon //Aka adv
name = "advanced device power cell"
desc = "A small upgraded power cell designed to power handheld devices."
icon_state = "wcell"
||||||| parent of 26525b8677... Merge pull request #10824 from VOREStation/Icons/cells
/obj/item/weapon/cell/device/weapon
name = "weapon power cell"
desc = "A small power cell designed to power handheld weaponry."
icon_state = "wcell"
=======
/obj/item/weapon/cell/device/weapon
name = "weapon power cell"
desc = "A small power cell designed to power handheld weaponry."
icon_state = "m_sup"
>>>>>>> 26525b8677... Merge pull request #10824 from VOREStation/Icons/cells
maxcharge = 2400
charge_amount = 20
origin_tech = list(TECH_POWER = 2)
@@ -63,7 +75,13 @@
/obj/item/weapon/cell/device/weapon/recharge
name = "self-charging weapon power cell"
desc = "A small power cell designed to power handheld weaponry. This one recharges itself."
<<<<<<< HEAD
// icon_state = "wcell" //doesn't matter, not seen anywhere (all weapons that have it are batterylocked)
||||||| parent of 26525b8677... Merge pull request #10824 from VOREStation/Icons/cells
// icon_state = "wcell" //TODO: Different sprite
=======
icon_state = "meb_m_nu"
>>>>>>> 26525b8677... Merge pull request #10824 from VOREStation/Icons/cells
self_recharge = TRUE
charge_amount = 120
charge_delay = 75

View File

@@ -3,6 +3,7 @@
/obj/item/weapon/cell/device/weapon/recharge/alien
name = "void cell (device)"
var/swaps_to = /obj/item/weapon/cell/void
standard_overlays = FALSE
/obj/item/weapon/cell/device/weapon/recharge/alien/attack_self(var/mob/user)
user.remove_from_mob(src)
@@ -13,10 +14,6 @@
newcell.charge = newcell.maxcharge * percentage
qdel(src)
/obj/item/weapon/cell/device/weapon/recharge/alien/update_icon()
return
//The machine cell
/obj/item/weapon/cell/void
name = "void cell (machinery)"
@@ -29,6 +26,7 @@
self_recharge = TRUE
charge_delay = 50
matter = null
standard_overlays = FALSE
var/swaps_to = /obj/item/weapon/cell/device/weapon/recharge/alien
/obj/item/weapon/cell/void/attack_self(var/mob/user)
@@ -40,9 +38,6 @@
newcell.charge = newcell.maxcharge * percentage
qdel(src)
/obj/item/weapon/cell/void/update_icon()
return
// Bloo friendlier hybrid tech
/obj/item/weapon/cell/device/weapon/recharge/alien/hybrid
icon = 'icons/obj/power_vr.dmi'

View File

@@ -3,7 +3,7 @@
name = "modified power cell"
desc = "A modified power cell sitting in a highly conductive chassis."
origin_tech = list(TECH_POWER = 2)
icon_state = "spikecell"
icon_state = "exs_m"
maxcharge = 10000
matter = list(DEFAULT_WALL_MATERIAL = 1000, MAT_GLASS = 80, MAT_SILVER = 100)
self_recharge = TRUE

View File

@@ -2,6 +2,7 @@
name = "\improper rechargable AA battery"
desc = "You can't top the plasma top." //TOTALLY TRADEMARK INFRINGEMENT
origin_tech = list(TECH_POWER = 0)
icon_state = "s_st"
maxcharge = 500
matter = list(DEFAULT_WALL_MATERIAL = 700, "glass" = 40)
@@ -12,6 +13,7 @@
/obj/item/weapon/cell/secborg
name = "security borg rechargable D battery"
origin_tech = list(TECH_POWER = 0)
icon_state = "meb_s_st"
maxcharge = 600 //600 max charge / 100 charge per shot = six shots
matter = list(DEFAULT_WALL_MATERIAL = 700, "glass" = 40)
@@ -23,13 +25,14 @@
/obj/item/weapon/cell/apc
name = "heavy-duty power cell"
origin_tech = list(TECH_POWER = 1)
icon_state = "meb_b_st"
maxcharge = 5000
matter = list(DEFAULT_WALL_MATERIAL = 700, "glass" = 50)
/obj/item/weapon/cell/high
name = "high-capacity power cell"
origin_tech = list(TECH_POWER = 2)
icon_state = "hcell"
icon_state = "b_hi"
maxcharge = 10000
matter = list(DEFAULT_WALL_MATERIAL = 700, "glass" = 60)
@@ -41,7 +44,7 @@
/obj/item/weapon/cell/super
name = "super-capacity power cell"
origin_tech = list(TECH_POWER = 5)
icon_state = "scell"
icon_state = "b_sup"
maxcharge = 20000
matter = list(DEFAULT_WALL_MATERIAL = 700, "glass" = 70)
@@ -53,7 +56,7 @@
/obj/item/weapon/cell/hyper
name = "hyper-capacity power cell"
origin_tech = list(TECH_POWER = 6)
icon_state = "hpcell"
icon_state = "b_hy"
maxcharge = 30000
matter = list(DEFAULT_WALL_MATERIAL = 700, "glass" = 80)
@@ -64,12 +67,13 @@
/obj/item/weapon/cell/mech
name = "mecha power cell"
icon_state = "exs_l"
charge = 15000
maxcharge = 15000
/obj/item/weapon/cell/infinite
name = "infinite-capacity power cell!"
icon_state = "icell"
icon_state = "infinite_b"
origin_tech = null
maxcharge = 30000 //determines how badly mobs get shocked
matter = list(DEFAULT_WALL_MATERIAL = 700, "glass" = 80)
@@ -89,6 +93,7 @@
charge = 100
maxcharge = 300
minor_fault = 1
standard_overlays = FALSE
/obj/item/weapon/cell/slime
name = "charged slime core"
@@ -100,13 +105,14 @@
maxcharge = 10000
matter = null
self_recharge = TRUE
standard_overlays = FALSE
//Not actually a cell, but if people look for it, they'll probably look near other cells
/obj/item/device/fbp_backup_cell
name = "backup battery"
desc = "A small one-time-use chemical battery for synthetic crew when they are low on power in emergency situations."
icon = 'icons/obj/power.dmi'
icon_state = "fbp_cell"
icon = 'icons/obj/power_cells.dmi'
icon_state = "exs_s"
w_class = ITEMSIZE_SMALL
var/amount = 100
var/used = FALSE
@@ -144,6 +150,7 @@
desc = "A tiny power cell with a very low power capacity. Used in light fixtures to power them in the event of an outage."
maxcharge = 120 //Emergency lights use 0.2 W per tick, meaning ~10 minutes of emergency power from a cell
matter = list("glass" = 20)
icon_state = "meb_s_sup"
w_class = ITEMSIZE_TINY
/obj/item/weapon/cell/emergency_light/Initialize()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 82 KiB

BIN
icons/obj/power_cells.dmi Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 27 KiB