mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-01-04 06:23:19 +00:00
Updates instances of if(cell.use(...))
This commit is contained in:
@@ -167,7 +167,8 @@
|
||||
return
|
||||
if(!R.cell.fully_charged())
|
||||
var/diff = min(R.cell.maxcharge - R.cell.charge, charge_rate) // Capped at charge_rate charge / tick
|
||||
if (cell.use(diff))
|
||||
if (cell.charge >= diff)
|
||||
cell.use(diff)
|
||||
R.cell.give(diff)
|
||||
if(weld_rate && R.getBruteLoss())
|
||||
R.adjustBruteLoss(-1)
|
||||
|
||||
@@ -35,7 +35,8 @@
|
||||
|
||||
/obj/item/weapon/melee/baton/proc/deductcharge(var/chrgdeductamt)
|
||||
if(bcell)
|
||||
if(bcell.use(chrgdeductamt))
|
||||
if(bcell.charge >= chrgdeductamt)
|
||||
bcell.use(chrgdeductamt)
|
||||
return 1
|
||||
else
|
||||
status = 0
|
||||
|
||||
@@ -1233,8 +1233,10 @@ var/list/robot_verbs_default = list(
|
||||
if(cell.charge == 0)
|
||||
return 0
|
||||
|
||||
if(cell.use(amount * CELLRATE * CYBORG_POWER_USAGE_MULTIPLIER))
|
||||
used_power_this_tick += amount * CYBORG_POWER_USAGE_MULTIPLIER
|
||||
var/power_use = amount * CYBORG_POWER_USAGE_MULTIPLIER
|
||||
if(cell.charge >= CELLRATE * power_use)
|
||||
cell.use(CELLRATE * power_use)
|
||||
used_power_this_tick += power_use
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
/obj/item/weapon/gun/energy/consume_next_projectile()
|
||||
if(!power_supply) return null
|
||||
if(!ispath(projectile_type)) return null
|
||||
if(!power_supply.use(charge_cost)) return null
|
||||
if(power_supply.charge < charge_cost || !power_supply.use(charge_cost)) return null
|
||||
return new projectile_type(src)
|
||||
|
||||
/obj/item/weapon/gun/energy/proc/get_external_power_supply()
|
||||
|
||||
Reference in New Issue
Block a user