Merge pull request #7061 from Fox-McCloud/damn-cells

Damn cells
This commit is contained in:
Crazy Lemon
2017-04-09 13:55:30 -07:00
committed by GitHub
28 changed files with 212 additions and 216 deletions

View File

@@ -1,7 +1,7 @@
var/global/datum/datacore/data_core = null
var/CELLRATE = 0.002 // multiplier for watts per tick <> cell storage (eg: .002 means if there is a load of 1000 watts, 20 units will be taken from a cell per second)
var/CHARGELEVEL = 0.0005 // Cap for how fast cells charge, as a percentage-per-tick (.001 means cellcharge is capped to 1% per second)
var/CHARGELEVEL = 0.001 // Cap for how fast cells charge, as a percentage-per-tick (.001 means cellcharge is capped to 1% per second)
var/list/powernets = list()
var/list/deferred_powernet_rebuilds = list()

View File

@@ -62,11 +62,12 @@
break
else if(istype(item, /obj/item/weapon/stock_parts/cell/))
var/obj/item/weapon/stock_parts/cell/C = item
if(prob(80))
C.maxcharge -= 200
if(C.maxcharge <= 1) //Div by 0 protection
C.maxcharge = 1
burnt_out = 1
if(!C.self_recharge)
if(prob(80))
C.maxcharge -= 200
if(C.maxcharge <= 1) //Div by 0 protection
C.maxcharge = 1
burnt_out = 1
C.charge = C.maxcharge
charged_item = C
break
@@ -75,11 +76,12 @@
for(I in item.contents)
if(istype(I, /obj/item/weapon/stock_parts/cell/))
var/obj/item/weapon/stock_parts/cell/C = I
if(prob(80))
C.maxcharge -= 200
if(C.maxcharge <= 1) //Div by 0 protection
C.maxcharge = 1
burnt_out = 1
if(!C.self_recharge)
if(prob(80))
C.maxcharge -= 200
if(C.maxcharge <= 1) //Div by 0 protection
C.maxcharge = 1
burnt_out = 1
C.charge = C.maxcharge
item.update_icon()
charged_item = item

View File

@@ -16,7 +16,7 @@
if(charging && !(stat & (BROKEN|NOPOWER)) )
var/newlevel = round(charging.percent() * 4.0 / 99)
var/newlevel = round(charging.percent() * 4 / 100)
// to_chat(world, "nl: [newlevel]")
if(chargelevel != newlevel)
@@ -91,7 +91,7 @@
if(!charging || (stat & (BROKEN|NOPOWER)) || !anchored)
return
use_power(2000) //this used to use CELLRATE, but CELLRATE is fucking awful. feel free to fix this properly!
charging.give(1750) //inefficiency.
use_power(200) //this used to use CELLRATE, but CELLRATE is fucking awful. feel free to fix this properly!
charging.give(175) //inefficiency.
updateicon()

View File

@@ -1,70 +1,78 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
/obj/machinery/recharger
name = "recharger"
icon = 'icons/obj/stationobjs.dmi'
icon_state = "recharger0"
desc = "A charging dock for energy based weaponry."
anchored = 1
use_power = 1
idle_power_usage = 40
active_power_usage = 2500
idle_power_usage = 4
active_power_usage = 250
var/obj/item/charging = null
var/list/allowed_devices = list(/obj/item/weapon/gun/energy, /obj/item/weapon/melee/baton, /obj/item/device/modular_computer, /obj/item/weapon/rcs)
var/icon_state_off = "rechargeroff"
var/icon_state_charged = "recharger2"
var/icon_state_charging = "recharger1"
var/icon_state_idle = "recharger0"
/obj/machinery/recharger/attackby(obj/item/weapon/G as obj, mob/user as mob, params)
if(istype(user,/mob/living/silicon))
return
if(!user.canUnEquip(G, 0))
to_chat(user, "<span class='warning'>[G] is stuck to your hand, you can't put it in [src]!</span>")
return
if(istype(G, /obj/item/weapon/gun/energy) || istype(G, /obj/item/weapon/melee/baton) || istype(G,/obj/item/device/laptop) || istype(G, /obj/item/weapon/rcs))
/obj/machinery/recharger/attackby(obj/item/weapon/G, mob/user, params)
if(iswrench(G))
if(charging)
return
// Checks to make sure he's not in space doing it, and that the area got proper power.
var/area/a = get_area(src)
if(!isarea(a))
to_chat(user, "\red The [name] blinks red as you try to insert the item!")
return
if(a.power_equip == 0 && a.requires_power)
to_chat(user, "\red The [name] blinks red as you try to insert the item!")
return
if(istype(G, /obj/item/weapon/gun/energy))
var/obj/item/weapon/gun/energy/E = G
if(!E.can_charge)
to_chat(user, "<span class='notice'>Your gun has no external power connector.</span>")
return
if(istype(G, /obj/item/device/laptop))
var/obj/item/device/laptop/L = G
if(!L.stored_computer.battery)
to_chat(user, "There's no battery in it!")
return
user.drop_item()
G.loc = src
charging = G
use_power = 2
update_icon()
else if(istype(G, /obj/item/weapon/wrench))
if(charging)
to_chat(user, "\red Remove the weapon first!")
to_chat(user, "<span class='notice'>Remove the charging item first!</span>")
return
anchored = !anchored
to_chat(user, "You [anchored ? "attached" : "detached"] the recharger.")
power_change()
to_chat(user, "<span class='notice'>You [anchored ? "attached" : "detached"] [src].</span>")
playsound(loc, G.usesound, 75, 1)
return
var/allowed = is_type_in_list(G, allowed_devices)
if(allowed)
if(anchored)
if(charging)
return 1
//Checks to make sure he's not in space doing it, and that the area got proper power.
var/area/a = get_area(src)
if(!isarea(a) || a.power_equip == 0)
to_chat(user, "<span class='notice'>[src] blinks red as you try to insert [G].</span>")
return 1
if(istype(G, /obj/item/weapon/gun/energy))
var/obj/item/weapon/gun/energy/E = G
if(!E.can_charge)
to_chat(user, "<span class='notice'>Your gun has no external power connector.</span>")
return 1
if(!user.drop_item())
return 1
G.forceMove(src)
charging = G
use_power = 2
update_icon()
else
to_chat(user, "<span class='notice'>[src] isn't connected to anything!</span>")
return 1
else
..()
/obj/machinery/recharger/attack_hand(mob/user)
if(issilicon(user))
return
/obj/machinery/recharger/attack_hand(mob/user as mob)
add_fingerprint(user)
if(charging)
charging.update_icon()
charging.loc = loc
charging.forceMove(loc)
user.put_in_hands(charging)
charging = null
use_power = 1
update_icon()
/obj/machinery/recharger/attack_tk(mob/user)
if(charging)
charging.update_icon()
charging.forceMove(loc)
charging = null
use_power = 1
update_icon()
@@ -73,43 +81,42 @@
if(stat & (NOPOWER|BROKEN) || !anchored)
return
var/using_power = 0
if(charging)
if(istype(charging, /obj/item/weapon/gun/energy))
var/obj/item/weapon/gun/energy/E = charging
if(E.power_supply.charge < E.power_supply.maxcharge)
E.power_supply.give(1000)
icon_state = icon_state_charging
use_power(2500)
else
icon_state = icon_state_charged
return
E.power_supply.give(E.power_supply.chargerate)
use_power(250)
using_power = 1
if(istype(charging, /obj/item/weapon/melee/baton))
var/obj/item/weapon/melee/baton/B = charging
if(B.bcell && B.bcell.charge < B.bcell.maxcharge)
B.bcell.charge += 1750
icon_state = icon_state_charging
use_power(2000)
else
icon_state = icon_state_charged
return
if(istype(charging, /obj/item/device/laptop))
var/obj/item/device/laptop/L = charging
if(L.stored_computer.battery.charge < L.stored_computer.battery.maxcharge)
L.stored_computer.battery.give(1000)
icon_state = icon_state_charging
use_power(2500)
else
icon_state = icon_state_charged
if(B.bcell)
if(B.bcell.give(B.bcell.chargerate))
use_power(200)
using_power = 1
if(istype(charging, /obj/item/device/modular_computer))
var/obj/item/device/modular_computer/C = charging
var/obj/item/weapon/computer_hardware/battery/battery_module = C.all_components[MC_CELL]
if(battery_module)
var/obj/item/weapon/computer_hardware/battery/B = battery_module
if(B.battery)
if(B.battery.charge < B.battery.maxcharge)
B.battery.give(B.battery.chargerate)
use_power(200)
using_power = 1
if(istype(charging, /obj/item/weapon/rcs))
var/obj/item/weapon/rcs/R = charging
if(R.rcell && R.rcell.charge < R.rcell.maxcharge)
R.rcell.charge += 1750
icon_state = icon_state_charging
use_power(2000)
else
icon_state = icon_state_charged
return
if(R.rcell)
if(R.rcell.give(R.rcell.chargerate))
use_power(200)
using_power = 1
update_icon(using_power)
/obj/machinery/recharger/emp_act(severity)
if(stat & (NOPOWER|BROKEN) || !anchored)
@@ -127,17 +134,23 @@
B.bcell.charge = 0
..(severity)
/obj/machinery/recharger/update_icon() //we have an update_icon() in addition to the stuff in process to make it feel a tiny bit snappier.
/obj/machinery/recharger/update_icon(using_power = 0) //we have an update_icon() in addition to the stuff in process to make it feel a tiny bit snappier.
if(stat & (NOPOWER|BROKEN) || !anchored)
icon_state = icon_state_off
return
if(charging)
icon_state = icon_state_charging
else
icon_state = icon_state_idle
if(using_power)
icon_state = icon_state_charging
else
icon_state = icon_state_charged
return
icon_state = icon_state_idle
// Atlantis: No need for that copy-pasta code, just use var to store icon_states instead.
obj/machinery/recharger/wallcharger
name = "wall recharger"
icon = 'icons/obj/stationobjs.dmi'
icon_state = "wrecharger0"
icon_state_off = "wrechargeroff"
icon_state_idle = "wrecharger0"
icon_state_charging = "wrecharger1"
icon_state_charged = "wrecharger2"

View File

@@ -159,10 +159,7 @@
R.adjustFireLoss(-(repairs))
R.updatehealth()
if(R.cell)
if(R.cell.charge >= R.cell.maxcharge)
R.cell.charge = R.cell.maxcharge
else
R.cell.charge = min(R.cell.charge + recharge_speed, R.cell.maxcharge)
R.cell.charge = min(R.cell.charge + recharge_speed, R.cell.maxcharge)
else if(istype(occupant, /mob/living/carbon/human))
var/mob/living/carbon/human/H = occupant
if(H.get_int_organ(/obj/item/organ/internal/cell) && H.nutrition < 450)

View File

@@ -185,7 +185,7 @@
icon_state = "repair_droid"
origin_tech = "magnets=3;programming=3"
equip_cooldown = 20
energy_drain = 100
energy_drain = 50
range = 0
var/health_boost = 1
var/icon/droid_overlay

View File

@@ -78,7 +78,7 @@
equip_cooldown = 10
name = "CH-LC \"Solaris\" Laser Cannon"
icon_state = "mecha_laser"
energy_drain = 40
energy_drain = 60
projectile = /obj/item/projectile/beam/laser/heavylaser
fire_sound = 'sound/weapons/lasercannonfire.ogg'
@@ -448,7 +448,7 @@
desc = "A device that shoots resonant plasma bursts at extreme velocity. The blasts are capable of crushing rock and demloishing solid obstacles."
icon_state = "mecha_plasmacutter"
item_state = "plasmacutter"
energy_drain = 60
energy_drain = 30
origin_tech = "materials=3;combat=2;powerstorage=3;plasmatech=3"
projectile = /obj/item/projectile/plasma/adv/mech
fire_sound = 'sound/weapons/laser.ogg'

View File

@@ -662,7 +662,7 @@
/obj/mecha/emp_act(severity)
if(get_charge())
use_power((cell.charge / 2) / severity)
use_power((cell.charge/3)/(severity*2))
take_damage(50 / severity, "energy")
log_message("EMP detected", 1)
check_for_internal_damage(list(MECHA_INT_FIRE, MECHA_INT_TEMP_CONTROL, MECHA_INT_CONTROL_LOST, MECHA_INT_SHORT_CIRCUIT), 1)

View File

@@ -13,7 +13,7 @@
materials = list(MAT_METAL=750)
origin_tech = "powerstorage=3;syndicate=5"
var/drain_rate = 1600000 // amount of power to drain per tick
var/apc_drain_rate = 5000 // Max. amount drained from single APC. In Watts.
var/apc_drain_rate = 50 // Max. amount drained from single APC. In Watts.
var/dissipation_rate = 20000 // Passive dissipation of drained power. In Watts.
var/power_drained = 0 // Amount of power drained.
var/max_power = 1e10 // Detonation point.
@@ -112,10 +112,10 @@
if(istype(T.master, /obj/machinery/power/apc))
var/obj/machinery/power/apc/A = T.master
if(A.operating && A.cell)
var/cur_charge = A.cell.charge / CELLRATE
var/drain_val = min(apc_drain_rate, cur_charge)
A.cell.use(drain_val * CELLRATE)
drained += drain_val
A.cell.charge = max(0, A.cell.charge - apc_drain_rate)
drained += apc_drain_rate
if(A.charging == 2) // If the cell was full
A.charging = 1 // It's no longer full
power_drained += drained
return 1

View File

@@ -109,7 +109,7 @@
if(R.cell)
var/obj/item/weapon/stock_parts/cell/C = R.cell
if(active && !(C.use(hitcost)))
attack_self()
attack_self(R)
to_chat(R, "<span class='notice'>It's out of charge!</span>")
return
..()

View File

@@ -5,18 +5,17 @@
icon_state = "cell"
item_state = "cell"
origin_tech = "powerstorage=1"
force = 5.0
throwforce = 5.0
throw_speed = 3
force = 5
throwforce = 5
throw_speed = 2
throw_range = 5
w_class = 2
w_class = WEIGHT_CLASS_SMALL
var/charge = 0 // note %age conveted to actual charge in New
var/maxcharge = 10000
rating = 1
var/maxcharge = 1000
materials = list(MAT_METAL=700, MAT_GLASS=50)
var/rigged = 0 // true if rigged to explode
var/chargerate = 100 //how much power is given every tick in a recharger
var/minor_fault = 0 //If not 100% reliable, it will build up faults.
var/chargerate = 1000 //how much power is given every tick in a recharger
var/self_recharge = 0 //does it self recharge, over time, or not?
var/grown_battery = FALSE // If it's a grown that acts as a battery, add a wire overlay to it.
@@ -62,10 +61,9 @@
/obj/item/weapon/stock_parts/cell/crap
name = "\improper Nanotrasen brand rechargable AA battery"
desc = "You can't top the plasma top." //TOTALLY TRADEMARK INFRINGEMENT
origin_tech = null
maxcharge = 5000
rating = 2
maxcharge = 500
materials = list(MAT_GLASS=40)
rating = 2
/obj/item/weapon/stock_parts/cell/crap/empty/New()
..()
@@ -74,9 +72,9 @@
/obj/item/weapon/stock_parts/cell/secborg
name = "\improper Security borg rechargable D battery"
origin_tech = null
maxcharge = 6000 //6000 max charge / 1000 charge per shot = six shots
rating = 2.5
maxcharge = 600 //600 max charge / 100 charge per shot = six shots
materials = list(MAT_GLASS=40)
rating = 2.5
/obj/item/weapon/stock_parts/cell/secborg/empty/New()
..()
@@ -86,11 +84,18 @@
name = "high-capacity power cell"
origin_tech = "powerstorage=2"
icon_state = "hcell"
maxcharge = 15000
rating = 3
maxcharge = 10000
materials = list(MAT_GLASS=60)
rating = 3
chargerate = 1500
/obj/item/weapon/stock_parts/cell/high/plus
name = "high-capacity power cell+"
desc = "Where did these come from?"
icon_state = "h+cell"
maxcharge = 15000
chargerate = 2250
/obj/item/weapon/stock_parts/cell/high/empty/New()
..()
charge = 0
@@ -100,7 +105,7 @@
origin_tech = "powerstorage=5"
icon_state = "scell"
maxcharge = 20000
materials = list(MAT_GLASS=70)
materials = list(MAT_GLASS=300)
rating = 4
chargerate = 2000
@@ -113,8 +118,8 @@
origin_tech = "powerstorage=6"
icon_state = "hpcell"
maxcharge = 30000
materials = list(MAT_GLASS=400)
rating = 5
materials = list(MAT_GLASS=80)
chargerate = 3000
/obj/item/weapon/stock_parts/cell/hyper/empty/New()
@@ -126,7 +131,7 @@
origin_tech = "powerstorage=7"
icon_state = "bscell"
maxcharge = 40000
materials = list(MAT_GLASS=80)
materials = list(MAT_GLASS=600)
rating = 6
chargerate = 4000
@@ -139,8 +144,8 @@
icon_state = "icell"
origin_tech = null
maxcharge = 30000
materials = list(MAT_GLASS=1000)
rating = 6
materials = list(MAT_GLASS=80)
chargerate = 30000
/obj/item/weapon/stock_parts/cell/infinite/use()
@@ -153,7 +158,7 @@
icon_state = "potato"
origin_tech = "powerstorage=1;biotech=1"
charge = 100
maxcharge = 3000
maxcharge = 300
materials = list()
rating = 1
minor_fault = 1
@@ -170,17 +175,17 @@
/obj/item/weapon/stock_parts/cell/pulse //200 pulse shots
name = "pulse rifle power cell"
maxcharge = 400000
maxcharge = 40000
rating = 3
chargerate = 1500
/obj/item/weapon/stock_parts/cell/pulse/carbine
/obj/item/weapon/stock_parts/cell/pulse/carbine //25 pulse shots
name = "pulse carbine power cell"
maxcharge = 40000
maxcharge = 5000
/obj/item/weapon/stock_parts/cell/pulse/pistol
/obj/item/weapon/stock_parts/cell/pulse/pistol //10 pulse shots
name = "pulse pistol power cell"
maxcharge = 16000
maxcharge = 2000
/obj/item/weapon/stock_parts/cell/ninja
name = "spider-clan power cell"
@@ -192,7 +197,7 @@
/obj/item/weapon/stock_parts/cell/emproof
name = "\improper EMP-proof cell"
desc = "An EMP-proof cell."
maxcharge = 5000
maxcharge = 500
rating = 2
/obj/item/weapon/stock_parts/cell/emproof/empty/New()

View File

@@ -12,7 +12,7 @@
var/stunforce = 7
var/status = 0
var/obj/item/weapon/stock_parts/cell/high/bcell = null
var/hitcost = 1500
var/hitcost = 1000
/obj/item/weapon/melee/baton/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is putting the live [name] in \his mouth! It looks like \he's trying to commit suicide.</span>")
@@ -182,11 +182,6 @@
return 1
..()
//secborg stun baton module
/obj/item/weapon/melee/baton/loaded/robot
hitcost = 1000
//Makeshift stun baton. Replacement for stun gloves.
/obj/item/weapon/melee/baton/cattleprod
name = "stunprod"
@@ -197,7 +192,7 @@
force = 3
throwforce = 5
stunforce = 5
hitcost = 3750
hitcost = 2000
slot_flags = SLOT_BACK
var/obj/item/device/assembly/igniter/sparkler = null

View File

@@ -63,7 +63,7 @@
desc = "Horrendous and awful. It smells like cancer. The fact it has wires attached to it is incidental."
var/obj/item/weapon/stock_parts/cell/cell = null
var/stun_strength = 5
var/stun_cost = 3750
var/stun_cost = 2000
/obj/item/clothing/gloves/color/yellow/stun/New()
..()

View File

@@ -221,7 +221,7 @@
/obj/item/weapon/robot_module/security/New()
..()
modules += new /obj/item/weapon/restraints/handcuffs/cable/zipties/cyborg(src)
modules += new /obj/item/weapon/melee/baton/loaded/robot(src)
modules += new /obj/item/weapon/melee/baton/loaded(src)
modules += new /obj/item/weapon/gun/energy/disabler/cyborg(src)
modules += new /obj/item/taperoll/police(src)
modules += new /obj/item/clothing/mask/gas/sechailer/cyborg(src)

View File

@@ -90,7 +90,6 @@
var/update_overlay = -1
var/global/status_overlays = 0
var/updating_icon = 0
var/standard_max_charge
var/datum/wires/apc/wires = null
//var/debug = 0
var/global/list/status_overlays_lock
@@ -142,9 +141,6 @@
apcs += src
apcs = sortAtom(apcs)
wires = new(src)
var/tmp/obj/item/weapon/stock_parts/cell/tmp_cell = new
standard_max_charge = tmp_cell.maxcharge
qdel(tmp_cell)
// offset 24 pixels in direction of dir
// this allows the APC to be embedded in a wall, yet still inside an area
@@ -198,7 +194,7 @@
if(cell_type)
src.cell = new/obj/item/weapon/stock_parts/cell(src)
cell.maxcharge = cell_type // cell_type is maximum charge (old default was 1000 or 2500 (values one and two respectively)
cell.charge = start_charge * cell.maxcharge / 100.0 // (convert percentage to actual value)
cell.charge = start_charge * cell.maxcharge / 100 // (convert percentage to actual value)
var/area/A = get_area(src)

View File

@@ -5,24 +5,25 @@
return 100.0*charge/maxcharge
// use power from a cell
/obj/item/weapon/stock_parts/cell/proc/use(var/amount)
/obj/item/weapon/stock_parts/cell/proc/use(amount)
if(rigged && amount > 0)
explode()
return 0
if(charge < amount) return 0
if(charge < amount)
return 0
charge = (charge - amount)
return 1
// recharge the cell
/obj/item/weapon/stock_parts/cell/proc/give(var/amount)
/obj/item/weapon/stock_parts/cell/proc/give(amount)
if(rigged && amount > 0)
explode()
return 0
if(maxcharge < amount) return 0
if(maxcharge < amount)
return 0
var/power_used = min(maxcharge-charge,amount)
if(crit_fail) return 0
if(crit_fail)
return 0
if(!prob(reliability))
minor_fault++
if(prob(minor_fault))
@@ -31,7 +32,6 @@
charge += power_used
return power_used
/obj/item/weapon/stock_parts/cell/examine(mob/user)
if(..(user, 1))
if(maxcharge <= 2500)

View File

@@ -3,7 +3,7 @@
desc = "The part of the gun that makes the laser go pew"
caliber = "energy"
projectile_type = /obj/item/projectile/energy
var/e_cost = 1000 //The amount of energy a cell needs to expend to create this shot.
var/e_cost = 100 //The amount of energy a cell needs to expend to create this shot.
var/select_name = "energy"
fire_sound = 'sound/weapons/Laser.ogg'
@@ -13,10 +13,11 @@
/obj/item/ammo_casing/energy/lasergun
projectile_type = /obj/item/projectile/beam/laser
e_cost = 830
e_cost = 83
select_name = "kill"
/obj/item/ammo_casing/energy/laser/hos //allows balancing of HoS and blueshit guns seperately from other energy weapons
e_cost = 100
/obj/item/ammo_casing/energy/laser/practice
projectile_type = /obj/item/projectile/beam/practice
@@ -35,13 +36,13 @@
/obj/item/ammo_casing/energy/laser/pulse
projectile_type = /obj/item/projectile/beam/pulse
e_cost = 2000
e_cost = 200
select_name = "DESTROY"
fire_sound = 'sound/weapons/pulse.ogg'
/obj/item/ammo_casing/energy/laser/scatter/pulse
projectile_type = /obj/item/projectile/beam/pulse
e_cost = 2000
e_cost = 200
select_name = "ANNIHILATE"
fire_sound = 'sound/weapons/pulse.ogg'
@@ -55,26 +56,27 @@
/obj/item/ammo_casing/energy/xray
projectile_type = /obj/item/projectile/beam/xray
e_cost = 500
e_cost = 50
fire_sound = 'sound/weapons/laser3.ogg'
/obj/item/ammo_casing/energy/immolator
projectile_type = /obj/item/projectile/beam/immolator
fire_sound = 'sound/weapons/laser3.ogg'
e_cost = 1250
e_cost = 125
/obj/item/ammo_casing/energy/electrode
projectile_type = /obj/item/projectile/energy/electrode
select_name = "stun"
fire_sound = 'sound/weapons/taser.ogg'
e_cost = 2000
e_cost = 200
delay = 15
/obj/item/ammo_casing/energy/electrode/gun
fire_sound = 'sound/weapons/gunshot.ogg'
e_cost = 1000
e_cost = 100
/obj/item/ammo_casing/energy/electrode/hos //allows balancing of HoS and blueshit guns seperately from other energy weapons
e_cost = 200
/obj/item/ammo_casing/energy/ion
projectile_type = /obj/item/projectile/ion
@@ -121,7 +123,7 @@
/obj/item/ammo_casing/energy/disabler
projectile_type = /obj/item/projectile/beam/disabler
select_name = "disable"
e_cost = 500
e_cost = 50
fire_sound = 'sound/weapons/taser2.ogg'
/obj/item/ammo_casing/energy/plasma
@@ -129,12 +131,12 @@
select_name = "plasma burst"
fire_sound = 'sound/weapons/plasma_cutter.ogg'
delay = 15
e_cost = 250
e_cost = 25
/obj/item/ammo_casing/energy/plasma/adv
projectile_type = /obj/item/projectile/plasma/adv
delay = 10
e_cost = 100
e_cost = 10
/obj/item/ammo_casing/energy/wormhole
projectile_type = /obj/item/projectile/beam/wormhole
@@ -153,7 +155,7 @@
/obj/item/ammo_casing/energy/bolt
projectile_type = /obj/item/projectile/energy/bolt
select_name = "bolt"
e_cost = 5000
e_cost = 500
fire_sound = 'sound/weapons/Genhit.ogg'
/obj/item/ammo_casing/energy/bolt/large
@@ -163,7 +165,7 @@
/obj/item/ammo_casing/energy/dart
projectile_type = /obj/item/projectile/energy/dart
fire_sound = 'sound/weapons/Genhit.ogg'
e_cost = 5000
e_cost = 500
select_name = "toxic dart"
/obj/item/ammo_casing/energy/instakill
@@ -187,7 +189,7 @@
/obj/item/ammo_casing/energy/shock_revolver
fire_sound = 'sound/magic/lightningbolt.ogg'
e_cost = 2000
e_cost = 200
select_name = "lightning beam"
projectile_type = /obj/item/projectile/energy/shock_revolver
@@ -210,7 +212,7 @@
/obj/item/ammo_casing/energy/teleport
projectile_type = /obj/item/projectile/energy/teleport
fire_sound = 'sound/weapons/wave.ogg'
e_cost = 1250
e_cost = 250
select_name = "teleport beam"
var/teleport_target

View File

@@ -26,7 +26,7 @@
/obj/item/ammo_casing/magic/chaos
projectile_type = /obj/item/projectile/magic
/obj/item/ammo_casing/magic/spellblade
projectile_type = /obj/item/projectile/magic/spellblade
@@ -49,4 +49,4 @@
projectile_type = /obj/item/projectile/bullet/midbullet3
select_name = "spraydown"
fire_sound = 'sound/weapons/gunshot_smg.ogg'
e_cost = 200
e_cost = 20

View File

@@ -34,7 +34,7 @@
if(selfcharge)
processing_objects.Add(src)
update_icon()
/obj/item/weapon/gun/energy/proc/update_ammo_types()
var/obj/item/ammo_casing/energy/shot
for(var/i = 1, i <= ammo_type.len, i++)
@@ -61,9 +61,9 @@
var/obj/item/ammo_casing/energy/E = ammo_type[select]
if(use_external_power)
var/obj/item/weapon/stock_parts/cell/external = get_external_power_supply()
if(!external || !external.use((E.e_cost)/10)) //Take power from the borg...
if(!external || !external.use(E.e_cost)) //Take power from the borg...
return //Note, uses /10 because of shitty mods to the cell system
power_supply.give(1000) //... to recharge the shot
power_supply.give(100) //... to recharge the shot
update_icon()
/obj/item/weapon/gun/energy/attack_self(mob/living/user as mob)
@@ -176,7 +176,7 @@
var/mob/living/silicon/robot/R = loc
if(R && R.cell)
var/obj/item/ammo_casing/energy/shot = ammo_type[select] //Necessary to find cost of shot
if(R.cell.use(shot.e_cost/10)) //Take power from the borg... //Divided by 10 because cells and charge costs are fucked.
if(R.cell.use(shot.e_cost)) //Take power from the borg...
power_supply.give(shot.e_cost) //... to recharge the shot
/obj/item/weapon/gun/energy/proc/get_external_power_supply()

View File

@@ -94,7 +94,7 @@
empty()
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/empty()
power_supply.use(5000)
power_supply.use(500)
update_icon()
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/attempt_reload()
@@ -120,7 +120,7 @@
return
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/reload()
power_supply.give(5000)
power_supply.give(500)
if(!suppressed)
playsound(loc, 'sound/weapons/kenetic_reload.ogg', 60, 1)
else if(isliving(loc))
@@ -144,7 +144,7 @@
/obj/item/ammo_casing/energy/kinetic
projectile_type = /obj/item/projectile/kinetic
select_name = "kinetic"
e_cost = 5000
e_cost = 500
fire_sound = 'sound/weapons/Kenetic_accel.ogg' // fine spelling there chap
/obj/item/ammo_casing/energy/kinetic/ready_proj(atom/target, mob/living/user, quiet, zone_override = "")
@@ -181,7 +181,7 @@
/obj/item/projectile/kinetic/pod
range = 4
/obj/item/projectile/kinetic/pod/regular
damage = 50
pressure_decrease = 0.5

View File

@@ -39,8 +39,8 @@
/obj/item/weapon/gun/energy/gun/mini/New()
gun_light = new /obj/item/device/flashlight/seclite(src)
..()
power_supply.maxcharge = 6000
power_supply.charge = 6000
power_supply.maxcharge = 600
power_supply.charge = 600
/obj/item/weapon/gun/energy/gun/mini/update_icon()
..()

View File

@@ -157,11 +157,11 @@
if(istype(A, /obj/item/stack/sheet/mineral/plasma))
var/obj/item/stack/sheet/S = A
S.use(1)
power_supply.give(10000)
power_supply.give(1000)
to_chat(user, "<span class='notice'>You insert [A] in [src], recharging it.</span>")
else if(istype(A, /obj/item/weapon/ore/plasma))
qdel(A)
power_supply.give(5000)
power_supply.give(500)
to_chat(user, "<span class='notice'>You insert [A] in [src], recharging it.</span>")
else
..()
@@ -308,12 +308,10 @@
desc = "A gun that changes the body temperature of its targets."
var/temperature = 300
var/target_temperature = 300
var/e_cost = 1000
origin_tech = "combat=3;materials=4;powerstorage=3;magnets=2"
ammo_type = list(/obj/item/ammo_casing/energy/temp)
selfcharge = 1
cell_type = /obj/item/weapon/stock_parts/cell
var/powercost = ""
var/powercostcolor = ""
@@ -369,19 +367,19 @@
T.temp = temperature
switch(temperature)
if(0 to 100)
T.e_cost = 3000
T.e_cost = 300
powercost = "High"
if(100 to 250)
T.e_cost = 2000
T.e_cost = 200
powercost = "Medium"
if(251 to 300)
T.e_cost = 1000
T.e_cost = 100
powercost = "Low"
if(301 to 400)
T.e_cost = 2000
T.e_cost = 200
powercost = "Medium"
if(401 to 1000)
T.e_cost = 3000
T.e_cost = 300
powercost = "High"
switch(powercost)
if("High")
@@ -471,16 +469,16 @@
/obj/item/weapon/gun/energy/temperature/proc/update_charge()
var/charge = power_supply.charge
switch(charge)
if(9000 to INFINITY) overlays += "900"
if(8000 to 9000) overlays += "800"
if(7000 to 8000) overlays += "700"
if(6000 to 7000) overlays += "600"
if(5000 to 6000) overlays += "500"
if(4000 to 5000) overlays += "400"
if(3000 to 4000) overlays += "300"
if(2000 to 3000) overlays += "200"
if(1000 to 2002) overlays += "100"
if(-INFINITY to 1000) overlays += "0"
if(900 to INFINITY) overlays += "900"
if(800 to 900) overlays += "800"
if(700 to 800) overlays += "700"
if(600 to 700) overlays += "600"
if(500 to 600) overlays += "500"
if(400 to 500) overlays += "400"
if(300 to 400) overlays += "300"
if(200 to 300) overlays += "200"
if(100 to 202) overlays += "100"
if(-INFINITY to 100) overlays += "0"
/obj/item/weapon/gun/energy/mimicgun
name = "mimic gun"

View File

@@ -5,23 +5,12 @@
item_state = null //so the human update icon uses the icon_state instead.
ammo_type = list(/obj/item/ammo_casing/energy/electrode)
ammo_x_offset = 3
cell_type = /obj/item/weapon/stock_parts/cell/crap
/obj/item/weapon/gun/energy/taser/mounted
name = "mounted taser gun"
selfcharge = 1
use_external_power = 1
/obj/item/weapon/gun/energy/taser/cyborg
name = "taser gun"
desc = "A small, low capacity gun used for non-lethal takedowns."
icon_state = "taser"
cell_type = /obj/item/weapon/stock_parts/cell/secborg
/obj/item/weapon/gun/energy/disabler/cyborg/newshot()
..()
robocharge()
/obj/item/weapon/gun/energy/shock_revolver
name = "tesla revolver"
desc = "A high-tech revolver that fires internal, reusable shock cartridges in a revolving cylinder. The cartridges can be recharged using conventional rechargers."

View File

@@ -6,7 +6,6 @@
icon_state = "telegun"
item_state = "ionrifle"
origin_tech = "combat=6;materials=7;powerstorage=5;bluespace=5;syndicate=4"
cell_type = /obj/item/weapon/stock_parts/cell/crap
ammo_type = list(/obj/item/ammo_casing/energy/teleport)
shaded_charge = 1
var/teleport_target = null

View File

@@ -267,7 +267,7 @@
cargo_hold.emp_act(severity)
if(battery && battery.charge > 0)
battery.use((battery.charge / 2) / severity)
battery.use((battery.charge/3)/(severity*2))
deal_damage(80 / severity)
if(empcounter < (40 / severity))
empcounter = 40 / severity

View File

@@ -128,7 +128,7 @@
var/rand_y = 0
var/emagged = 0
var/teleporting = 0
var/chargecost = 1500
var/chargecost = 1000
/obj/item/weapon/rcs/New()
..()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 76 KiB