mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-20 18:47:20 +01:00
This commit does the following: - Ports progress bars from -tg- (tgstation/-tg-station#9921) - Refactors wall attackby code to make it 100% less insane; Instead of manually checking every little thing, it uses do_after, consequentially, making the new progress bars affect dealing with walls as well. Wall code makes a tiger sad.
24 lines
1.0 KiB
Plaintext
24 lines
1.0 KiB
Plaintext
|
|
|
|
/obj/item/clothing/suit/space/space_ninja/attackby(obj/item/I, mob/U, params)
|
|
if(U==suitOccupant)//Safety, in case you try doing this without wearing the suit/being the person with the suit.
|
|
if(istype(I, /obj/item/weapon/stock_parts/cell))
|
|
var/obj/item/weapon/stock_parts/cell/CELL
|
|
if(CELL.maxcharge > cell.maxcharge && suitGloves)
|
|
U << "<span class='notice'>Higher maximum capacity detected.\nUpgrading...</span>"
|
|
if (n_gloves && n_gloves.candrain && do_after(U,s_delay, target = U))
|
|
U.drop_item()
|
|
CELL.loc = src
|
|
CELL.charge = min(CELL.charge+cell.charge, CELL.maxcharge)
|
|
var/obj/item/weapon/stock_parts/cell/old_cell = cell
|
|
old_cell.charge = 0
|
|
U.put_in_hands(old_cell)
|
|
old_cell.add_fingerprint(U)
|
|
old_cell.corrupt()
|
|
old_cell.updateicon()
|
|
cell = CELL
|
|
U << "<span class='notice'>Upgrade complete. Maximum capacity: <b>[round(cell.maxcharge/100)]</b>%</span>"
|
|
else
|
|
U << "<span class='danger'>Procedure interrupted. Protocol terminated.</span>"
|
|
return
|
|
..() |