mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-13 08:03:43 +01:00
Remove the snowflake power cells (#12637)
This commit is contained in:
committed by
variableundefined
parent
4714a2d5ed
commit
af8916732b
@@ -600,7 +600,7 @@ REAGENT SCANNER
|
||||
throw_speed = 5
|
||||
throw_range = 10
|
||||
origin_tech = "magnets=6;biotech=6"
|
||||
var/obj/item/stock_parts/cell/power_supply
|
||||
var/obj/item/stock_parts/cell/cell
|
||||
var/cell_type = /obj/item/stock_parts/cell/upgraded
|
||||
var/ready = TRUE // Ready to scan
|
||||
var/time_to_use = 0 // How much time remaining before next scan is available.
|
||||
@@ -609,7 +609,7 @@ REAGENT SCANNER
|
||||
var/scan_cd = 60 SECONDS //how long before we can scan again
|
||||
|
||||
/obj/item/bodyanalyzer/get_cell()
|
||||
return power_supply
|
||||
return cell
|
||||
|
||||
/obj/item/bodyanalyzer/advanced
|
||||
cell_type = /obj/item/stock_parts/cell/upgraded/plus
|
||||
@@ -624,8 +624,8 @@ REAGENT SCANNER
|
||||
|
||||
/obj/item/bodyanalyzer/New()
|
||||
..()
|
||||
power_supply = new cell_type(src)
|
||||
power_supply.give(power_supply.maxcharge)
|
||||
cell = new cell_type(src)
|
||||
cell.give(cell.maxcharge)
|
||||
update_icon()
|
||||
|
||||
/obj/item/bodyanalyzer/proc/setReady()
|
||||
@@ -635,7 +635,7 @@ REAGENT SCANNER
|
||||
|
||||
/obj/item/bodyanalyzer/update_icon(printing = FALSE)
|
||||
overlays.Cut()
|
||||
var/percent = power_supply.percent()
|
||||
var/percent = cell.percent()
|
||||
if(ready)
|
||||
icon_state = "bodyanalyzer_1"
|
||||
else
|
||||
@@ -657,7 +657,7 @@ REAGENT SCANNER
|
||||
playsound(user.loc, 'sound/machines/buzz-sigh.ogg', 50, 1)
|
||||
return
|
||||
|
||||
if(power_supply.charge >= usecharge)
|
||||
if(cell.charge >= usecharge)
|
||||
mobScan(M, user)
|
||||
else
|
||||
to_chat(user, "<span class='notice'>The scanner beeps angrily at you! It's out of charge!</span>")
|
||||
@@ -691,7 +691,7 @@ REAGENT SCANNER
|
||||
var/mob/living/silicon/robot/R = user
|
||||
R.cell.use(usecharge)
|
||||
else
|
||||
power_supply.use(usecharge)
|
||||
cell.use(usecharge)
|
||||
ready = FALSE
|
||||
update_icon(TRUE)
|
||||
addtimer(CALLBACK(src, /obj/item/bodyanalyzer/.proc/setReady), scan_cd)
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
var/safety = 1 //if you can zap people with the defibs on harm mode
|
||||
var/powered = 0 //if there's a cell in the defib with enough power for a revive, blocks paddles from reviving otherwise
|
||||
var/obj/item/twohanded/shockpaddles/paddles
|
||||
var/obj/item/stock_parts/cell/high/bcell = null
|
||||
var/obj/item/stock_parts/cell/high/cell = null
|
||||
var/combat = 0 //can we revive through space suits?
|
||||
|
||||
/obj/item/defibrillator/get_cell()
|
||||
return bcell
|
||||
return cell
|
||||
|
||||
/obj/item/defibrillator/New() //starts without a cell for rnd
|
||||
..()
|
||||
@@ -35,7 +35,7 @@
|
||||
/obj/item/defibrillator/loaded/New() //starts with hicap
|
||||
..()
|
||||
paddles = make_paddles()
|
||||
bcell = new(src)
|
||||
cell = new(src)
|
||||
update_icon()
|
||||
return
|
||||
|
||||
@@ -49,8 +49,8 @@
|
||||
. += "<span class='notice'>Ctrl-click to remove the paddles from the defibrillator.</span>"
|
||||
|
||||
/obj/item/defibrillator/proc/update_power()
|
||||
if(bcell)
|
||||
if(bcell.charge < paddles.revivecost)
|
||||
if(cell)
|
||||
if(cell.charge < paddles.revivecost)
|
||||
powered = 0
|
||||
else
|
||||
powered = 1
|
||||
@@ -63,21 +63,21 @@
|
||||
overlays += "[icon_state]-paddles"
|
||||
if(powered)
|
||||
overlays += "[icon_state]-powered"
|
||||
if(!bcell)
|
||||
if(!cell)
|
||||
overlays += "[icon_state]-nocell"
|
||||
if(!safety)
|
||||
overlays += "[icon_state]-emagged"
|
||||
|
||||
/obj/item/defibrillator/proc/update_charge()
|
||||
if(powered) //so it doesn't show charge if it's unpowered
|
||||
if(bcell)
|
||||
var/ratio = bcell.charge / bcell.maxcharge
|
||||
if(cell)
|
||||
var/ratio = cell.charge / cell.maxcharge
|
||||
ratio = Ceiling(ratio*4) * 25
|
||||
overlays += "[icon_state]-charge[ratio]"
|
||||
|
||||
/obj/item/defibrillator/CheckParts(list/parts_list)
|
||||
..()
|
||||
bcell = locate(/obj/item/stock_parts/cell) in contents
|
||||
cell = locate(/obj/item/stock_parts/cell) in contents
|
||||
update_icon()
|
||||
|
||||
/obj/item/defibrillator/ui_action_click()
|
||||
@@ -90,7 +90,7 @@
|
||||
/obj/item/defibrillator/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/stock_parts/cell))
|
||||
var/obj/item/stock_parts/cell/C = W
|
||||
if(bcell)
|
||||
if(cell)
|
||||
to_chat(user, "<span class='notice'>[src] already has a cell.</span>")
|
||||
else
|
||||
if(C.maxcharge < paddles.revivecost)
|
||||
@@ -98,14 +98,14 @@
|
||||
return
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
bcell = W
|
||||
cell = W
|
||||
to_chat(user, "<span class='notice'>You install a cell in [src].</span>")
|
||||
|
||||
if(istype(W, /obj/item/screwdriver))
|
||||
if(bcell)
|
||||
bcell.update_icon()
|
||||
bcell.loc = get_turf(src.loc)
|
||||
bcell = null
|
||||
if(cell)
|
||||
cell.update_icon()
|
||||
cell.loc = get_turf(src.loc)
|
||||
cell = null
|
||||
to_chat(user, "<span class='notice'>You remove the cell from the [src].</span>")
|
||||
|
||||
update_icon()
|
||||
@@ -120,7 +120,7 @@
|
||||
to_chat(user, "<span class='notice'>You silently enable [src]'s safety protocols with the card.")
|
||||
|
||||
/obj/item/defibrillator/emp_act(severity)
|
||||
if(bcell)
|
||||
if(cell)
|
||||
deductcharge(1000 / severity)
|
||||
if(safety)
|
||||
safety = 0
|
||||
@@ -182,15 +182,15 @@
|
||||
var/M = get(paddles, /mob)
|
||||
remove_paddles(M)
|
||||
QDEL_NULL(paddles)
|
||||
QDEL_NULL(bcell)
|
||||
QDEL_NULL(cell)
|
||||
return ..()
|
||||
|
||||
/obj/item/defibrillator/proc/deductcharge(var/chrgdeductamt)
|
||||
if(bcell)
|
||||
if(bcell.charge < (paddles.revivecost+chrgdeductamt))
|
||||
if(cell)
|
||||
if(cell.charge < (paddles.revivecost+chrgdeductamt))
|
||||
powered = 0
|
||||
update_icon()
|
||||
if(bcell.use(chrgdeductamt))
|
||||
if(cell.use(chrgdeductamt))
|
||||
update_icon()
|
||||
return 1
|
||||
else
|
||||
@@ -199,8 +199,8 @@
|
||||
|
||||
/obj/item/defibrillator/proc/cooldowncheck(var/mob/user)
|
||||
spawn(50)
|
||||
if(bcell)
|
||||
if(bcell.charge >= paddles.revivecost)
|
||||
if(cell)
|
||||
if(cell.charge >= paddles.revivecost)
|
||||
user.visible_message("<span class='notice'>[src] beeps: Unit ready.</span>")
|
||||
playsound(get_turf(src), 'sound/machines/defib_ready.ogg', 50, 0)
|
||||
else
|
||||
@@ -226,7 +226,7 @@
|
||||
/obj/item/defibrillator/compact/loaded/New()
|
||||
..()
|
||||
paddles = make_paddles()
|
||||
bcell = new(src)
|
||||
cell = new(src)
|
||||
update_icon()
|
||||
return
|
||||
|
||||
@@ -239,7 +239,7 @@
|
||||
/obj/item/defibrillator/compact/combat/loaded/New()
|
||||
..()
|
||||
paddles = make_paddles()
|
||||
bcell = new /obj/item/stock_parts/cell/infinite(src)
|
||||
cell = new /obj/item/stock_parts/cell/infinite(src)
|
||||
update_icon()
|
||||
return
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 50, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 80)
|
||||
var/stunforce = 7
|
||||
var/status = 0
|
||||
var/obj/item/stock_parts/cell/high/bcell = null
|
||||
var/obj/item/stock_parts/cell/high/cell = null
|
||||
var/hitcost = 1000
|
||||
var/throw_hit_chance = 35
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
return FIRELOSS
|
||||
|
||||
/obj/item/melee/baton/get_cell()
|
||||
return bcell
|
||||
return cell
|
||||
|
||||
/obj/item/melee/baton/New()
|
||||
..()
|
||||
@@ -30,7 +30,7 @@
|
||||
return
|
||||
|
||||
/obj/item/melee/baton/Destroy()
|
||||
QDEL_NULL(bcell)
|
||||
QDEL_NULL(cell)
|
||||
return ..()
|
||||
|
||||
/obj/item/melee/baton/throw_impact(atom/hit_atom)
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
/obj/item/melee/baton/loaded/New() //this one starts with a cell pre-installed.
|
||||
..()
|
||||
bcell = new(src)
|
||||
cell = new(src)
|
||||
update_icon()
|
||||
return
|
||||
|
||||
@@ -55,12 +55,12 @@
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
if(bcell)
|
||||
if(bcell.charge < (hitcost+chrgdeductamt)) // If after the deduction the baton doesn't have enough charge for a stun hit it turns off.
|
||||
if(cell)
|
||||
if(cell.charge < (hitcost+chrgdeductamt)) // If after the deduction the baton doesn't have enough charge for a stun hit it turns off.
|
||||
status = 0
|
||||
update_icon()
|
||||
playsound(loc, "sparks", 75, 1, -1)
|
||||
if(bcell.use(chrgdeductamt))
|
||||
if(cell.use(chrgdeductamt))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
@@ -68,7 +68,7 @@
|
||||
/obj/item/melee/baton/update_icon()
|
||||
if(status)
|
||||
icon_state = "[base_icon]_active"
|
||||
else if(!bcell)
|
||||
else if(!cell)
|
||||
icon_state = "[base_icon]_nocell"
|
||||
else
|
||||
icon_state = "[base_icon]"
|
||||
@@ -77,15 +77,15 @@
|
||||
. = ..()
|
||||
if(isrobot(loc))
|
||||
. += "<span class='notice'>This baton is drawing power directly from your own internal charge.</span>"
|
||||
if(bcell)
|
||||
. += "<span class='notice'>The baton is [round(bcell.percent())]% charged.</span>"
|
||||
if(!bcell)
|
||||
if(cell)
|
||||
. += "<span class='notice'>The baton is [round(cell.percent())]% charged.</span>"
|
||||
if(!cell)
|
||||
. += "<span class='warning'>The baton does not have a power source installed.</span>"
|
||||
|
||||
/obj/item/melee/baton/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/stock_parts/cell))
|
||||
var/obj/item/stock_parts/cell/C = W
|
||||
if(bcell)
|
||||
if(cell)
|
||||
to_chat(user, "<span class='notice'>[src] already has a cell.</span>")
|
||||
else
|
||||
if(C.maxcharge < hitcost)
|
||||
@@ -94,15 +94,15 @@
|
||||
if(!user.unEquip(W))
|
||||
return
|
||||
W.loc = src
|
||||
bcell = W
|
||||
cell = W
|
||||
to_chat(user, "<span class='notice'>You install a cell in [src].</span>")
|
||||
update_icon()
|
||||
|
||||
else if(istype(W, /obj/item/screwdriver))
|
||||
if(bcell)
|
||||
bcell.update_icon()
|
||||
bcell.loc = get_turf(src.loc)
|
||||
bcell = null
|
||||
if(cell)
|
||||
cell.update_icon()
|
||||
cell.loc = get_turf(src.loc)
|
||||
cell = null
|
||||
to_chat(user, "<span class='notice'>You remove the cell from the [src].</span>")
|
||||
status = 0
|
||||
update_icon()
|
||||
@@ -121,13 +121,13 @@
|
||||
else
|
||||
status = 0
|
||||
to_chat(user, "<span class='warning'>You do not have enough reserve power to charge the [src]!</span>")
|
||||
else if(bcell && bcell.charge >= hitcost)
|
||||
else if(cell && cell.charge >= hitcost)
|
||||
status = !status
|
||||
to_chat(user, "<span class='notice'>[src] is now [status ? "on" : "off"].</span>")
|
||||
playsound(loc, "sparks", 75, 1, -1)
|
||||
else
|
||||
status = 0
|
||||
if(!bcell)
|
||||
if(!cell)
|
||||
to_chat(user, "<span class='warning'>[src] does not have a power source!</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>[src] is out of charge.</span>")
|
||||
@@ -203,13 +203,13 @@
|
||||
H.forcesay(GLOB.hit_appends)
|
||||
|
||||
/obj/item/melee/baton/emp_act(severity)
|
||||
if(bcell)
|
||||
if(cell)
|
||||
deductcharge(1000 / severity)
|
||||
..()
|
||||
|
||||
/obj/item/melee/baton/wash(mob/user, atom/source)
|
||||
if(bcell)
|
||||
if(bcell.charge > 0 && status == 1)
|
||||
if(cell)
|
||||
if(cell.charge > 0 && status == 1)
|
||||
flick("baton_active", source)
|
||||
user.Stun(stunforce)
|
||||
user.Weaken(stunforce)
|
||||
|
||||
Reference in New Issue
Block a user