mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 03:33:21 +00:00
Merge remote-tracking branch 'upstream/master' into dev-freeze
Conflicts: code/game/objects/items/weapons/power_cells.dm
This commit is contained in:
@@ -217,7 +217,7 @@
|
|||||||
category = "Medical"
|
category = "Medical"
|
||||||
|
|
||||||
/datum/autolathe/recipe/syringegun_ammo
|
/datum/autolathe/recipe/syringegun_ammo
|
||||||
name = "syringe"
|
name = "syringe gun cartridge"
|
||||||
path = /obj/item/weapon/syringe_cartridge
|
path = /obj/item/weapon/syringe_cartridge
|
||||||
category = "Arms and Ammunition"
|
category = "Arms and Ammunition"
|
||||||
|
|
||||||
|
|||||||
@@ -169,7 +169,8 @@
|
|||||||
return
|
return
|
||||||
if(!R.cell.fully_charged())
|
if(!R.cell.fully_charged())
|
||||||
var/diff = min(R.cell.maxcharge - R.cell.charge, charge_rate) // Capped at charge_rate charge / tick
|
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)
|
R.cell.give(diff)
|
||||||
if(weld_rate && R.getBruteLoss())
|
if(weld_rate && R.getBruteLoss())
|
||||||
R.adjustBruteLoss(-1)
|
R.adjustBruteLoss(-1)
|
||||||
|
|||||||
@@ -108,7 +108,7 @@
|
|||||||
mode_nice = design
|
mode_nice = design
|
||||||
mode = "[replacetext(design, "-", "")]full"
|
mode = "[replacetext(design, "-", "")]full"
|
||||||
if("corner")
|
if("corner")
|
||||||
var/design = input("Which design?", "Floor painter") in list("black", "red", "blue", "green", "yellow", "purple", "neutral", "white", "white-grey", "white-red", "white-blue", "white-green", "white-yellow", "white-purple")
|
var/design = input("Which design?", "Floor painter") in list("black", "red", "blue", "green", "yellow", "purple", "neutral", "white", "white-red", "white-blue", "white-green", "white-yellow", "white-purple")
|
||||||
mode_nice = "[design] corner"
|
mode_nice = "[design] corner"
|
||||||
mode = "[replacetext(design, "-", "")]corner"
|
mode = "[replacetext(design, "-", "")]corner"
|
||||||
tile_dir_mode = 2
|
tile_dir_mode = 2
|
||||||
@@ -128,11 +128,13 @@
|
|||||||
if(design == "white")
|
if(design == "white")
|
||||||
mode = "whitehall"
|
mode = "whitehall"
|
||||||
mode_nice = "white side"
|
mode_nice = "white side"
|
||||||
tile_dir_mode = 1
|
else if(design == "black") // because SOMEONE made the black/grey side/corner sprite have the same name as the 'empty space' sprite :(
|
||||||
|
mode = "blackfloor"
|
||||||
|
mode_nice = design
|
||||||
else
|
else
|
||||||
mode_nice = design
|
mode_nice = design
|
||||||
mode = replacetext(design, "-", "")
|
mode = replacetext(design, "-", "")
|
||||||
tile_dir_mode = 1
|
tile_dir_mode = 1
|
||||||
if("special")
|
if("special")
|
||||||
var/design = input("Which design?", "Floor painter") in list("arrival", "escape", "caution", "warning", "white-warning", "white-blue-green", "loadingarea", "delivery", "bot", "white-delivery", "white-bot")
|
var/design = input("Which design?", "Floor painter") in list("arrival", "escape", "caution", "warning", "white-warning", "white-blue-green", "loadingarea", "delivery", "bot", "white-delivery", "white-bot")
|
||||||
if(design == "white-blue-green")
|
if(design == "white-blue-green")
|
||||||
|
|||||||
@@ -105,8 +105,11 @@
|
|||||||
name = "infinite-capacity power cell!"
|
name = "infinite-capacity power cell!"
|
||||||
icon_state = "icell"
|
icon_state = "icell"
|
||||||
origin_tech = null
|
origin_tech = null
|
||||||
maxcharge = 30000
|
maxcharge = 30000 //determines how badly mobs get shocked
|
||||||
matter = list(DEFAULT_WALL_MATERIAL = 700, "glass" = 80)
|
matter = list(DEFAULT_WALL_MATERIAL = 700, "glass" = 80)
|
||||||
|
|
||||||
|
check_charge()
|
||||||
|
return 1
|
||||||
use()
|
use()
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
|||||||
@@ -35,12 +35,13 @@
|
|||||||
|
|
||||||
/obj/item/weapon/melee/baton/proc/deductcharge(var/chrgdeductamt)
|
/obj/item/weapon/melee/baton/proc/deductcharge(var/chrgdeductamt)
|
||||||
if(bcell)
|
if(bcell)
|
||||||
if(bcell.use(chrgdeductamt))
|
if(bcell.checked_use(chrgdeductamt))
|
||||||
return 1
|
return 1
|
||||||
else
|
else
|
||||||
status = 0
|
status = 0
|
||||||
update_icon()
|
update_icon()
|
||||||
return 0
|
return 0
|
||||||
|
return null
|
||||||
|
|
||||||
/obj/item/weapon/melee/baton/update_icon()
|
/obj/item/weapon/melee/baton/update_icon()
|
||||||
if(status)
|
if(status)
|
||||||
|
|||||||
@@ -707,7 +707,7 @@
|
|||||||
take_hit((100/severity_class), "electrical pulse", 1)
|
take_hit((100/severity_class), "electrical pulse", 1)
|
||||||
|
|
||||||
/obj/item/weapon/rig/proc/shock(mob/user)
|
/obj/item/weapon/rig/proc/shock(mob/user)
|
||||||
if (electrocute_mob(user, cell, src))
|
if (electrocute_mob(user, cell, src)) //electrocute_mob() handles removing charge from the cell, no need to do that here.
|
||||||
spark_system.start()
|
spark_system.start()
|
||||||
if(user.stunned)
|
if(user.stunned)
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
@@ -3,9 +3,7 @@
|
|||||||
if(!istype(user,/mob/living)) return 0
|
if(!istype(user,/mob/living)) return 0
|
||||||
|
|
||||||
if(electrified != 0)
|
if(electrified != 0)
|
||||||
if(cell && cell.charge >= 100)
|
if(shock(user)) //Handles removing charge from the cell, as well. No need to do that here.
|
||||||
cell.use(100)
|
|
||||||
if(shock(user, 100))
|
|
||||||
return
|
return
|
||||||
|
|
||||||
// Pass repair items on to the chestpiece.
|
// Pass repair items on to the chestpiece.
|
||||||
@@ -193,8 +191,6 @@
|
|||||||
/obj/item/weapon/rig/attack_hand(var/mob/user)
|
/obj/item/weapon/rig/attack_hand(var/mob/user)
|
||||||
|
|
||||||
if(electrified != 0)
|
if(electrified != 0)
|
||||||
if(cell && cell.charge >= 100)
|
if(shock(user)) //Handles removing charge from the cell, as well. No need to do that here.
|
||||||
cell.use(100)
|
|
||||||
if(shock(user, 100))
|
|
||||||
return
|
return
|
||||||
..()
|
..()
|
||||||
@@ -1081,8 +1081,9 @@
|
|||||||
if(cell.charge == 0)
|
if(cell.charge == 0)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
if(cell.use(amount * CELLRATE * CYBORG_POWER_USAGE_MULTIPLIER))
|
var/power_use = amount * CYBORG_POWER_USAGE_MULTIPLIER
|
||||||
used_power_this_tick += amount * CYBORG_POWER_USAGE_MULTIPLIER
|
if(cell.checked_use(CELLRATE * power_use))
|
||||||
|
used_power_this_tick += power_use
|
||||||
return 1
|
return 1
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
..()
|
..()
|
||||||
updateicon()
|
updateicon()
|
||||||
|
|
||||||
/obj/item/weapon/cell/drain_power(var/drain_check, var/surge, var/amount = 0)
|
/obj/item/weapon/cell/drain_power(var/drain_check, var/surge, var/power = 0)
|
||||||
|
|
||||||
if(drain_check)
|
if(drain_check)
|
||||||
return 1
|
return 1
|
||||||
@@ -18,9 +18,9 @@
|
|||||||
if(charge <= 0)
|
if(charge <= 0)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
var/cell_amt = min((amount * CELLRATE), charge)
|
var/cell_amt = power * CELLRATE
|
||||||
use(cell_amt)
|
|
||||||
return cell_amt / CELLRATE
|
return use(cell_amt) / CELLRATE
|
||||||
|
|
||||||
/obj/item/weapon/cell/proc/updateicon()
|
/obj/item/weapon/cell/proc/updateicon()
|
||||||
overlays.Cut()
|
overlays.Cut()
|
||||||
@@ -38,13 +38,26 @@
|
|||||||
/obj/item/weapon/cell/proc/fully_charged()
|
/obj/item/weapon/cell/proc/fully_charged()
|
||||||
return (charge == maxcharge)
|
return (charge == maxcharge)
|
||||||
|
|
||||||
// use power from a cell
|
// checks if the power cell is able to provide the specified amount of charge
|
||||||
|
/obj/item/weapon/cell/proc/check_charge(var/amount)
|
||||||
|
return (charge >= amount)
|
||||||
|
|
||||||
|
// use power from a cell, returns the amount actually used
|
||||||
/obj/item/weapon/cell/proc/use(var/amount)
|
/obj/item/weapon/cell/proc/use(var/amount)
|
||||||
if(rigged && amount > 0)
|
if(rigged && amount > 0)
|
||||||
explode()
|
explode()
|
||||||
return 0
|
return 0
|
||||||
charge = max(0, charge - amount)
|
var/used = min(charge, amount)
|
||||||
return charge
|
charge -= used
|
||||||
|
return used
|
||||||
|
|
||||||
|
// Checks if the specified amount can be provided. If it can, it removes the amount
|
||||||
|
// from the cell and returns 1. Otherwise does nothing and returns 0.
|
||||||
|
/obj/item/weapon/cell/proc/checked_use(var/amount)
|
||||||
|
if(!check_charge(amount))
|
||||||
|
return 0
|
||||||
|
use(amount)
|
||||||
|
return 1
|
||||||
|
|
||||||
// recharge the cell
|
// recharge the cell
|
||||||
/obj/item/weapon/cell/proc/give(var/amount)
|
/obj/item/weapon/cell/proc/give(var/amount)
|
||||||
|
|||||||
@@ -374,7 +374,7 @@
|
|||||||
if (source_area)
|
if (source_area)
|
||||||
source_area.use_power(drained_energy/CELLRATE)
|
source_area.use_power(drained_energy/CELLRATE)
|
||||||
else if (istype(power_source,/datum/powernet))
|
else if (istype(power_source,/datum/powernet))
|
||||||
var/drained_power = drained_energy/CELLRATE //convert from "joules" to "watts"
|
var/drained_power = drained_energy/CELLRATE
|
||||||
drained_power = PN.draw_power(drained_power)
|
drained_power = PN.draw_power(drained_power)
|
||||||
else if (istype(power_source, /obj/item/weapon/cell))
|
else if (istype(power_source, /obj/item/weapon/cell))
|
||||||
cell.use(drained_energy)
|
cell.use(drained_energy)
|
||||||
|
|||||||
@@ -78,7 +78,7 @@
|
|||||||
/obj/item/weapon/gun/energy/consume_next_projectile()
|
/obj/item/weapon/gun/energy/consume_next_projectile()
|
||||||
if(!power_supply) return null
|
if(!power_supply) return null
|
||||||
if(!ispath(projectile_type)) return null
|
if(!ispath(projectile_type)) return null
|
||||||
if(!power_supply.use(charge_cost)) return null
|
if(!power_supply.checked_use(charge_cost)) return null
|
||||||
return new projectile_type(src)
|
return new projectile_type(src)
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/proc/get_external_power_supply()
|
/obj/item/weapon/gun/energy/proc/get_external_power_supply()
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 310 KiB After Width: | Height: | Size: 297 KiB |
Reference in New Issue
Block a user