From 198cd2423be6efddfab7e8a11b521d66e54334dd Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sat, 14 Oct 2023 03:35:36 +0200 Subject: [PATCH] [MIRROR] Improves code for power usage of energy weapons [MDB IGNORE] (#24323) * Improves code for power usage of energy weapons * Modular update * This comment was wrong, it was 10 before * One last modular --------- Co-authored-by: GPeckman <21979502+GPeckman@users.noreply.github.com> Co-authored-by: Giz <13398309+vinylspiders@users.noreply.github.com> --- code/__DEFINES/projectiles.dm | 6 ++ .../modules/capture_the_flag/ctf_equipment.dm | 2 +- code/modules/power/cell.dm | 68 +++++++++---------- .../projectiles/ammunition/energy/_energy.dm | 2 +- .../projectiles/ammunition/energy/ebow.dm | 2 +- .../projectiles/ammunition/energy/gravity.dm | 2 +- .../projectiles/ammunition/energy/laser.dm | 25 +++---- .../projectiles/ammunition/energy/lmg.dm | 2 +- .../projectiles/ammunition/energy/plasma.dm | 4 +- .../projectiles/ammunition/energy/portal.dm | 2 +- .../projectiles/ammunition/energy/special.dm | 14 ++-- .../projectiles/ammunition/energy/stun.dm | 21 +++--- .../projectiles/guns/energy/beam_rifle.dm | 2 +- .../projectiles/guns/energy/dueling.dm | 2 +- .../guns/energy/kinetic_accelerator.dm | 2 +- code/modules/projectiles/guns/energy/laser.dm | 2 +- .../projectiles/ammunition/energy/stun.dm | 2 + .../modules/cellguns/code/medigun_cells.dm | 2 +- .../modules/icspawning/code/standard.dm | 2 +- .../modules/microfusion/code/projectiles.dm | 2 +- .../novaya_ert/code/surplus_weapons.dm | 2 +- tgstation.dme | 1 + 22 files changed, 85 insertions(+), 84 deletions(-) create mode 100644 modular_skyrat/master_files/code/modules/projectiles/ammunition/energy/stun.dm diff --git a/code/__DEFINES/projectiles.dm b/code/__DEFINES/projectiles.dm index 3bc745756aa..a82ac8422c5 100644 --- a/code/__DEFINES/projectiles.dm +++ b/code/__DEFINES/projectiles.dm @@ -73,3 +73,9 @@ #define RETURN_POINT_VECTOR(ATOM, ANGLE, SPEED) (new /datum/point/vector(ATOM, null, null, null, null, ANGLE, SPEED)) #define RETURN_POINT_VECTOR_INCREMENT(ATOM, ANGLE, SPEED, AMT) (new /datum/point/vector(ATOM, null, null, null, null, ANGLE, SPEED, AMT)) + +/// The amount of energy that a standard energy weapon cell can hold +#define STANDARD_CELL_CHARGE 1000 +/// Macro to turn a number of laser shots into an energy cost, based on the above define +/// e.g. LASER_SHOTS(12, STANDARD_CELL_CHARGE) means 12 shots +#define LASER_SHOTS(X, MAX_CHARGE) (((100 * MAX_CHARGE) - ((100 * MAX_CHARGE) % X)) / (100 * X)) // I wish I could just use round, but it can't be used in datum members diff --git a/code/modules/capture_the_flag/ctf_equipment.dm b/code/modules/capture_the_flag/ctf_equipment.dm index 5ec412f9017..e822ae2dbb1 100644 --- a/code/modules/capture_the_flag/ctf_equipment.dm +++ b/code/modules/capture_the_flag/ctf_equipment.dm @@ -165,7 +165,7 @@ /obj/item/ammo_casing/energy/instakill projectile_type = /obj/projectile/beam/instakill - e_cost = 0 + e_cost = 0 // Not possible to use the macro select_name = "DESTROY" /obj/projectile/beam/instakill diff --git a/code/modules/power/cell.dm b/code/modules/power/cell.dm index dcc3369766f..eb2a5b4d1a2 100644 --- a/code/modules/power/cell.dm +++ b/code/modules/power/cell.dm @@ -23,7 +23,7 @@ ///Current charge in cell units var/charge = 0 ///Maximum charge in cell units - var/maxcharge = 1000 + var/maxcharge = STANDARD_CELL_CHARGE custom_materials = list(/datum/material/iron=SMALL_MATERIAL_AMOUNT*7, /datum/material/glass=SMALL_MATERIAL_AMOUNT*0.5) grind_results = list(/datum/reagent/lithium = 15, /datum/reagent/iron = 5, /datum/reagent/silicon = 5) ///If the cell has been booby-trapped by injecting it with plasma. Chance on use() to explode. @@ -31,7 +31,7 @@ ///If the power cell was damaged by an explosion, chance for it to become corrupted and function the same as rigged. var/corrupted = FALSE ///how much power is given every tick in a recharger - var/chargerate = 100 + var/chargerate = STANDARD_CELL_CHARGE * 0.1 ///If true, the cell will state it's maximum charge in it's description var/ratingdesc = TRUE ///If it's a grown that acts as a battery, add a wire overlay to it. @@ -51,7 +51,7 @@ create_reagents(5, INJECTABLE | DRAINABLE) if (override_maxcharge) maxcharge = override_maxcharge - rating = max(round(maxcharge / 10000, 1), 1) + rating = max(round(maxcharge / (STANDARD_CELL_CHARGE * 10), 1), 1) if(!charge) charge = maxcharge if(empty) @@ -82,7 +82,7 @@ . = COMPONENT_ITEM_CHARGED if(prob(80)) - maxcharge -= 200 + maxcharge -= STANDARD_CELL_CHARGE * 0.2 if(maxcharge <= 1) // Div by 0 protection maxcharge = 1 @@ -289,7 +289,7 @@ /obj/item/stock_parts/cell/crap name = "\improper Nanotrasen brand rechargeable AA battery" desc = "You can't top the plasma top." //TOTALLY TRADEMARK INFRINGEMENT - maxcharge = 500 + maxcharge = STANDARD_CELL_CHARGE * 0.5 custom_materials = list(/datum/material/glass=SMALL_MATERIAL_AMOUNT*0.4) /obj/item/stock_parts/cell/crap/empty @@ -298,18 +298,18 @@ /obj/item/stock_parts/cell/upgraded name = "upgraded power cell" desc = "A power cell with a slightly higher capacity than normal!" - maxcharge = 2500 + maxcharge = STANDARD_CELL_CHARGE * 2.5 custom_materials = list(/datum/material/glass=SMALL_MATERIAL_AMOUNT*0.5) - chargerate = 1000 + chargerate = STANDARD_CELL_CHARGE /obj/item/stock_parts/cell/upgraded/plus name = "upgraded power cell+" desc = "A power cell with an even higher capacity than the base model!" - maxcharge = 5000 + maxcharge = STANDARD_CELL_CHARGE * 5 /obj/item/stock_parts/cell/secborg name = "security borg rechargeable D battery" - maxcharge = 600 //600 max charge / 100 charge per shot = six shots + maxcharge = STANDARD_CELL_CHARGE * 0.6 custom_materials = list(/datum/material/glass=SMALL_MATERIAL_AMOUNT*0.4) /obj/item/stock_parts/cell/secborg/empty @@ -317,38 +317,38 @@ /obj/item/stock_parts/cell/mini_egun name = "miniature energy gun power cell" - maxcharge = 600 + maxcharge = STANDARD_CELL_CHARGE * 0.6 /obj/item/stock_parts/cell/hos_gun name = "X-01 multiphase energy gun power cell" - maxcharge = 1200 + maxcharge = STANDARD_CELL_CHARGE * 1.2 /obj/item/stock_parts/cell/pulse //200 pulse shots name = "pulse rifle power cell" - maxcharge = 40000 - chargerate = 1500 + maxcharge = STANDARD_CELL_CHARGE * 40 + chargerate = STANDARD_CELL_CHARGE * 1.5 /obj/item/stock_parts/cell/pulse/carbine //25 pulse shots name = "pulse carbine power cell" - maxcharge = 5000 + maxcharge = STANDARD_CELL_CHARGE * 5 /obj/item/stock_parts/cell/pulse/pistol //10 pulse shots name = "pulse pistol power cell" - maxcharge = 2000 + maxcharge = STANDARD_CELL_CHARGE * 2 /obj/item/stock_parts/cell/ninja name = "black power cell" icon_state = "bscell" - maxcharge = 10000 + maxcharge = STANDARD_CELL_CHARGE * 10 custom_materials = list(/datum/material/glass=SMALL_MATERIAL_AMOUNT*0.6) - chargerate = 2000 + chargerate = STANDARD_CELL_CHARGE * 2 /obj/item/stock_parts/cell/high name = "high-capacity power cell" icon_state = "hcell" - maxcharge = 10000 + maxcharge = STANDARD_CELL_CHARGE * 10 custom_materials = list(/datum/material/glass=SMALL_MATERIAL_AMOUNT*0.6) - chargerate = 1500 + chargerate = STANDARD_CELL_CHARGE * 1.5 /obj/item/stock_parts/cell/high/empty empty = TRUE @@ -356,9 +356,9 @@ /obj/item/stock_parts/cell/super name = "super-capacity power cell" icon_state = "scell" - maxcharge = 20000 + maxcharge = STANDARD_CELL_CHARGE * 20 custom_materials = list(/datum/material/glass=SMALL_MATERIAL_AMOUNT * 3) - chargerate = 2000 + chargerate = STANDARD_CELL_CHARGE * 2 /obj/item/stock_parts/cell/super/empty empty = TRUE @@ -366,9 +366,9 @@ /obj/item/stock_parts/cell/hyper name = "hyper-capacity power cell" icon_state = "hpcell" - maxcharge = 30000 + maxcharge = STANDARD_CELL_CHARGE * 30 custom_materials = list(/datum/material/glass=SMALL_MATERIAL_AMOUNT * 4) - chargerate = 3000 + chargerate = STANDARD_CELL_CHARGE * 3 /obj/item/stock_parts/cell/hyper/empty empty = TRUE @@ -377,9 +377,9 @@ name = "bluespace power cell" desc = "A rechargeable transdimensional power cell." icon_state = "bscell" - maxcharge = 40000 + maxcharge = STANDARD_CELL_CHARGE * 40 custom_materials = list(/datum/material/glass=SMALL_MATERIAL_AMOUNT*6) - chargerate = 4000 + chargerate = STANDARD_CELL_CHARGE * 4 /obj/item/stock_parts/cell/bluespace/empty empty = TRUE @@ -400,7 +400,7 @@ desc = "An alien power cell that produces energy seemingly out of nowhere." icon = 'icons/obj/antags/abductor.dmi' icon_state = "cell" - maxcharge = 50000 + maxcharge = STANDARD_CELL_CHARGE * 50 ratingdesc = FALSE /obj/item/stock_parts/cell/infinite/abductor/Initialize(mapload) @@ -413,7 +413,7 @@ icon = 'icons/obj/service/hydroponics/harvest.dmi' icon_state = "potato" charge = 100 - maxcharge = 300 + maxcharge = STANDARD_CELL_CHARGE * 0.3 charge_light_type = null connector_type = null custom_materials = null @@ -423,7 +423,7 @@ /obj/item/stock_parts/cell/emproof name = "\improper EMP-proof cell" desc = "An EMP-proof cell." - maxcharge = 500 + maxcharge = STANDARD_CELL_CHARGE * 0.5 /obj/item/stock_parts/cell/emproof/Initialize(mapload) AddElement(/datum/element/empprotection, EMP_PROTECT_SELF) @@ -441,15 +441,15 @@ icon = 'icons/mob/simple/slimes.dmi' icon_state = "yellow slime extract" custom_materials = null - maxcharge = 5000 + maxcharge = STANDARD_CELL_CHARGE * 5 charge_light_type = null connector_type = "slimecore" /obj/item/stock_parts/cell/beam_rifle name = "beam rifle capacitor" desc = "A high powered capacitor that can provide huge amounts of energy in an instant." - maxcharge = 50000 - chargerate = 5000 //Extremely energy intensive + maxcharge = STANDARD_CELL_CHARGE * 50 + chargerate = STANDARD_CELL_CHARGE * 5 //Extremely energy intensive /obj/item/stock_parts/cell/beam_rifle/corrupt() return @@ -463,7 +463,7 @@ /obj/item/stock_parts/cell/emergency_light name = "miniature power cell" desc = "A tiny power cell with a very low power capacity. Used in light fixtures to power them in the event of an outage." - maxcharge = 120 //Emergency lights use 0.2 W per tick, meaning ~10 minutes of emergency power from a cell + maxcharge = STANDARD_CELL_CHARGE * 0.12 //Emergency lights use 0.2 W per tick, meaning ~10 minutes of emergency power from a cell custom_materials = list(/datum/material/glass = SMALL_MATERIAL_AMOUNT*0.2) w_class = WEIGHT_CLASS_TINY @@ -478,7 +478,7 @@ name = "crystal power cell" desc = "A very high power cell made from crystallized plasma" icon_state = "crystal_cell" - maxcharge = 50000 + maxcharge = STANDARD_CELL_CHARGE * 50 chargerate = 0 charge_light_type = null connector_type = "crystal" @@ -486,7 +486,7 @@ grind_results = null /obj/item/stock_parts/cell/inducer_supply - maxcharge = 5000 + maxcharge = STANDARD_CELL_CHARGE * 5 #undef CELL_DRAIN_TIME #undef CELL_POWER_GAIN diff --git a/code/modules/projectiles/ammunition/energy/_energy.dm b/code/modules/projectiles/ammunition/energy/_energy.dm index 808cbdfbfe7..11c8707a5e7 100644 --- a/code/modules/projectiles/ammunition/energy/_energy.dm +++ b/code/modules/projectiles/ammunition/energy/_energy.dm @@ -4,7 +4,7 @@ caliber = ENERGY projectile_type = /obj/projectile/energy slot_flags = null - var/e_cost = 100 //The amount of energy a cell needs to expend to create this shot. + var/e_cost = LASER_SHOTS(10, STANDARD_CELL_CHARGE) //The amount of energy a cell needs to expend to create this shot. var/select_name = CALIBER_ENERGY fire_sound = 'sound/weapons/laser.ogg' firing_effect_type = /obj/effect/temp_visual/dir_setting/firing_effect/energy diff --git a/code/modules/projectiles/ammunition/energy/ebow.dm b/code/modules/projectiles/ammunition/energy/ebow.dm index 0eee10a58e5..535ea126576 100644 --- a/code/modules/projectiles/ammunition/energy/ebow.dm +++ b/code/modules/projectiles/ammunition/energy/ebow.dm @@ -1,7 +1,7 @@ /obj/item/ammo_casing/energy/bolt projectile_type = /obj/projectile/energy/bolt select_name = "bolt" - e_cost = 500 + e_cost = LASER_SHOTS(1, STANDARD_CELL_CHARGE * 0.5) fire_sound = 'sound/weapons/gun/general/heavy_shot_suppressed.ogg' // Even for non-suppressed crossbows, this is the most appropriate sound /obj/item/ammo_casing/energy/bolt/halloween diff --git a/code/modules/projectiles/ammunition/energy/gravity.dm b/code/modules/projectiles/ammunition/energy/gravity.dm index 5b781189c52..fe73ad26883 100644 --- a/code/modules/projectiles/ammunition/energy/gravity.dm +++ b/code/modules/projectiles/ammunition/energy/gravity.dm @@ -1,5 +1,5 @@ /obj/item/ammo_casing/energy/gravity - e_cost = 0 + e_cost = 0 // Not possible to use the macro fire_sound = 'sound/weapons/wave.ogg' select_name = "gravity" delay = 50 diff --git a/code/modules/projectiles/ammunition/energy/laser.dm b/code/modules/projectiles/ammunition/energy/laser.dm index 4f62af047d4..73631335958 100644 --- a/code/modules/projectiles/ammunition/energy/laser.dm +++ b/code/modules/projectiles/ammunition/energy/laser.dm @@ -1,37 +1,34 @@ /obj/item/ammo_casing/energy/laser projectile_type = /obj/projectile/beam/laser - e_cost = 83 + e_cost = LASER_SHOTS(12, STANDARD_CELL_CHARGE) select_name = "kill" /obj/item/ammo_casing/energy/laser/hellfire projectile_type = /obj/projectile/beam/laser/hellfire - e_cost = 100 + e_cost = LASER_SHOTS(10, STANDARD_CELL_CHARGE) select_name = "maim" -/obj/item/ammo_casing/energy/laser/hellfire/antique - e_cost = 100 - /obj/item/ammo_casing/energy/lasergun projectile_type = /obj/projectile/beam/laser - e_cost = 62.5 + e_cost = LASER_SHOTS(16, STANDARD_CELL_CHARGE) select_name = "kill" /obj/item/ammo_casing/energy/lasergun/carbine projectile_type = /obj/projectile/beam/laser/carbine - e_cost = 25 // 40 shots + e_cost = LASER_SHOTS(40, STANDARD_CELL_CHARGE) select_name = "kill" /obj/item/ammo_casing/energy/lasergun/old projectile_type = /obj/projectile/beam/laser - e_cost = 200 + e_cost = LASER_SHOTS(5, STANDARD_CELL_CHARGE) select_name = "kill" /obj/item/ammo_casing/energy/laser/hos - e_cost = 120 + e_cost = LASER_SHOTS(10, STANDARD_CELL_CHARGE * 1.2) /obj/item/ammo_casing/energy/laser/musket projectile_type = /obj/projectile/beam/laser/musket - e_cost = 1000 + e_cost = LASER_SHOTS(1, STANDARD_CELL_CHARGE) /obj/item/ammo_casing/energy/laser/musket/prime projectile_type = /obj/projectile/beam/laser/musket/prime @@ -43,7 +40,7 @@ /obj/item/ammo_casing/energy/chameleon projectile_type = /obj/projectile/energy/chameleon - e_cost = 0 + e_cost = 0 // Can't really use the macro here, unfortunately var/projectile_vars = list() /obj/item/ammo_casing/energy/chameleon/ready_proj() @@ -83,7 +80,7 @@ /obj/item/ammo_casing/energy/laser/pulse projectile_type = /obj/projectile/beam/pulse - e_cost = 200 + e_cost = LASER_SHOTS(200, STANDARD_CELL_CHARGE * 40) select_name = "DESTROY" fire_sound = 'sound/weapons/pulse.ogg' @@ -105,7 +102,7 @@ /obj/item/ammo_casing/energy/xray projectile_type = /obj/projectile/beam/xray - e_cost = 50 + e_cost = LASER_SHOTS(20, STANDARD_CELL_CHARGE) fire_sound = 'sound/weapons/laser3.ogg' /obj/item/ammo_casing/energy/mindflayer @@ -121,7 +118,7 @@ /obj/item/ammo_casing/energy/nanite projectile_type = /obj/projectile/bullet/c10mm //henk select_name = "bullet" - e_cost = 120 + e_cost = LASER_SHOTS(8, STANDARD_CELL_CHARGE) fire_sound = 'sound/weapons/thermalpistol.ogg' /obj/item/ammo_casing/energy/nanite/inferno diff --git a/code/modules/projectiles/ammunition/energy/lmg.dm b/code/modules/projectiles/ammunition/energy/lmg.dm index fbd5916613e..632044f0652 100644 --- a/code/modules/projectiles/ammunition/energy/lmg.dm +++ b/code/modules/projectiles/ammunition/energy/lmg.dm @@ -2,5 +2,5 @@ projectile_type = /obj/projectile/bullet/c3d select_name = "spraydown" fire_sound = 'sound/weapons/gun/smg/shot.ogg' - e_cost = 20 + e_cost = LASER_SHOTS(30, STANDARD_CELL_CHARGE * 0.6) firing_effect_type = /obj/effect/temp_visual/dir_setting/firing_effect diff --git a/code/modules/projectiles/ammunition/energy/plasma.dm b/code/modules/projectiles/ammunition/energy/plasma.dm index 00de4a90ffe..e660903bdc9 100644 --- a/code/modules/projectiles/ammunition/energy/plasma.dm +++ b/code/modules/projectiles/ammunition/energy/plasma.dm @@ -3,9 +3,9 @@ select_name = "plasma burst" fire_sound = 'sound/weapons/plasma_cutter.ogg' delay = 15 - e_cost = 25 + e_cost = LASER_SHOTS(40, STANDARD_CELL_CHARGE) /obj/item/ammo_casing/energy/plasma/adv projectile_type = /obj/projectile/plasma/adv delay = 10 - e_cost = 10 + e_cost = LASER_SHOTS(100, STANDARD_CELL_CHARGE) diff --git a/code/modules/projectiles/ammunition/energy/portal.dm b/code/modules/projectiles/ammunition/energy/portal.dm index 8bdd697f1bf..0ef63491f11 100644 --- a/code/modules/projectiles/ammunition/energy/portal.dm +++ b/code/modules/projectiles/ammunition/energy/portal.dm @@ -1,6 +1,6 @@ /obj/item/ammo_casing/energy/wormhole projectile_type = /obj/projectile/beam/wormhole - e_cost = 0 + e_cost = 0 // Can't use the macro harmful = FALSE fire_sound = 'sound/weapons/pulse3.ogg' select_name = "blue" diff --git a/code/modules/projectiles/ammunition/energy/special.dm b/code/modules/projectiles/ammunition/energy/special.dm index 24fba4b9ba4..f2fc274ee8a 100644 --- a/code/modules/projectiles/ammunition/energy/special.dm +++ b/code/modules/projectiles/ammunition/energy/special.dm @@ -5,7 +5,7 @@ /obj/item/ammo_casing/energy/ion/hos projectile_type = /obj/projectile/ion/weak - e_cost = 300 + e_cost = LASER_SHOTS(4, STANDARD_CELL_CHARGE * 1.2) /obj/item/ammo_casing/energy/declone projectile_type = /obj/projectile/energy/declone @@ -30,12 +30,12 @@ /obj/item/ammo_casing/energy/flora/revolution projectile_type = /obj/projectile/energy/florarevolution select_name = "revolution" - e_cost = 250 + e_cost = LASER_SHOTS(4, STANDARD_CELL_CHARGE) /obj/item/ammo_casing/energy/temp projectile_type = /obj/projectile/temp select_name = "freeze" - e_cost = 250 + e_cost = LASER_SHOTS(40, STANDARD_CELL_CHARGE * 10) fire_sound = 'sound/weapons/pulse3.ogg' /obj/item/ammo_casing/energy/temp/hot @@ -60,23 +60,23 @@ /obj/item/ammo_casing/energy/tesla_cannon fire_sound = 'sound/magic/lightningshock.ogg' - e_cost = 30 + e_cost = LASER_SHOTS(33, STANDARD_CELL_CHARGE) select_name = "shock" projectile_type = /obj/projectile/energy/tesla_cannon /obj/item/ammo_casing/energy/shrink projectile_type = /obj/projectile/beam/shrink select_name = "shrink ray" - e_cost = 200 + e_cost = LASER_SHOTS(5, STANDARD_CELL_CHARGE) /obj/item/ammo_casing/energy/marksman projectile_type = /obj/projectile/bullet/marksman select_name = "marksman nanoshot" - e_cost = 0 + e_cost = 0 // Can't use the macro fire_sound = 'sound/weapons/gun/revolver/shot_alt.ogg' /obj/item/ammo_casing/energy/fisher projectile_type = /obj/projectile/energy/fisher select_name = "light-buster" - e_cost = 250 + e_cost = LASER_SHOTS(2, STANDARD_CELL_CHARGE * 0.5) fire_sound = 'sound/weapons/gun/general/heavy_shot_suppressed.ogg' // fwip fwip fwip fwip diff --git a/code/modules/projectiles/ammunition/energy/stun.dm b/code/modules/projectiles/ammunition/energy/stun.dm index 630233e5d73..ee2f9fa17ee 100644 --- a/code/modules/projectiles/ammunition/energy/stun.dm +++ b/code/modules/projectiles/ammunition/energy/stun.dm @@ -2,38 +2,33 @@ projectile_type = /obj/projectile/energy/electrode select_name = "stun" fire_sound = 'sound/weapons/taser.ogg' - e_cost = 200 + e_cost = LASER_SHOTS(5, STANDARD_CELL_CHARGE) harmful = FALSE /obj/item/ammo_casing/energy/electrode/spec - e_cost = 100 + e_cost = LASER_SHOTS(10, STANDARD_CELL_CHARGE) /obj/item/ammo_casing/energy/electrode/gun fire_sound = 'sound/weapons/gun/pistol/shot.ogg' - e_cost = 100 + e_cost = LASER_SHOTS(10, STANDARD_CELL_CHARGE) /obj/item/ammo_casing/energy/electrode/old - e_cost = 1000 + e_cost = LASER_SHOTS(1, STANDARD_CELL_CHARGE) /obj/item/ammo_casing/energy/disabler projectile_type = /obj/projectile/beam/disabler select_name = "disable" - e_cost = 50 + e_cost = LASER_SHOTS(20, STANDARD_CELL_CHARGE) fire_sound = 'sound/weapons/taser2.ogg' harmful = FALSE /obj/item/ammo_casing/energy/disabler/hos - e_cost = 60 + e_cost = LASER_SHOTS(20, STANDARD_CELL_CHARGE * 1.2) /obj/item/ammo_casing/energy/disabler/smoothbore projectile_type = /obj/projectile/beam/disabler/smoothbore - e_cost = 1000 + e_cost = LASER_SHOTS(1, STANDARD_CELL_CHARGE) /obj/item/ammo_casing/energy/disabler/smoothbore/prime projectile_type = /obj/projectile/beam/disabler/smoothbore/prime - e_cost = 500 - -// SKYRAT ADDITION START -/obj/item/ammo_casing/energy/disabler/skyrat - e_cost = 1000 -// SKYRAT ADDITION END + e_cost = LASER_SHOTS(2, STANDARD_CELL_CHARGE) diff --git a/code/modules/projectiles/guns/energy/beam_rifle.dm b/code/modules/projectiles/guns/energy/beam_rifle.dm index 8869da14a59..a451b14de9a 100644 --- a/code/modules/projectiles/guns/energy/beam_rifle.dm +++ b/code/modules/projectiles/guns/energy/beam_rifle.dm @@ -433,7 +433,7 @@ /obj/item/ammo_casing/energy/beam_rifle/hitscan projectile_type = /obj/projectile/beam/beam_rifle/hitscan select_name = "beam" - e_cost = 10000 + e_cost = LASER_SHOTS(5, 50000) // Beam rifle has a custom cell fire_sound = 'sound/weapons/beam_sniper.ogg' /obj/projectile/beam/beam_rifle diff --git a/code/modules/projectiles/guns/energy/dueling.dm b/code/modules/projectiles/guns/energy/dueling.dm index a766ba5667f..7b3929d7574 100644 --- a/code/modules/projectiles/guns/energy/dueling.dm +++ b/code/modules/projectiles/guns/energy/dueling.dm @@ -292,7 +292,7 @@ //Casing /obj/item/ammo_casing/energy/duel - e_cost = 0 + e_cost = 0 // Can't use the macro projectile_type = /obj/projectile/energy/duel var/setting diff --git a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm index 06e82a37aae..444b18ad274 100644 --- a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm +++ b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm @@ -165,7 +165,7 @@ /obj/item/ammo_casing/energy/kinetic projectile_type = /obj/projectile/kinetic select_name = "kinetic" - e_cost = 500 + e_cost = LASER_SHOTS(1, STANDARD_CELL_CHARGE * 0.5) 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 = "") diff --git a/code/modules/projectiles/guns/energy/laser.dm b/code/modules/projectiles/guns/energy/laser.dm index 9ad095f67e0..12b184ed913 100644 --- a/code/modules/projectiles/guns/energy/laser.dm +++ b/code/modules/projectiles/guns/energy/laser.dm @@ -72,7 +72,7 @@ selfcharge = 1 resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF flags_1 = PREVENT_CONTENTS_EXPLOSION_1 - ammo_type = list(/obj/item/ammo_casing/energy/laser/hellfire/antique) + ammo_type = list(/obj/item/ammo_casing/energy/laser/hellfire) /obj/item/gun/energy/laser/captain/scattershot name = "scatter shot laser rifle" diff --git a/modular_skyrat/master_files/code/modules/projectiles/ammunition/energy/stun.dm b/modular_skyrat/master_files/code/modules/projectiles/ammunition/energy/stun.dm new file mode 100644 index 00000000000..8d05d57e551 --- /dev/null +++ b/modular_skyrat/master_files/code/modules/projectiles/ammunition/energy/stun.dm @@ -0,0 +1,2 @@ +/obj/item/ammo_casing/energy/disabler/skyrat + e_cost = LASER_SHOTS(1, STANDARD_CELL_CHARGE) diff --git a/modular_skyrat/modules/cellguns/code/medigun_cells.dm b/modular_skyrat/modules/cellguns/code/medigun_cells.dm index e846c2ec685..c02118d226e 100644 --- a/modular_skyrat/modules/cellguns/code/medigun_cells.dm +++ b/modular_skyrat/modules/cellguns/code/medigun_cells.dm @@ -6,7 +6,7 @@ projectile_type = /obj/projectile/energy/medical/oxygen select_name = "oxygen" fire_sound = 'sound/effects/stealthoff.ogg' - e_cost = 120 + e_cost = LASER_SHOTS(8, STANDARD_CELL_CHARGE) delay = 8 harmful = FALSE select_color = "#00d9ffff" diff --git a/modular_skyrat/modules/icspawning/code/standard.dm b/modular_skyrat/modules/icspawning/code/standard.dm index 5de008c8901..bd30194d2bf 100644 --- a/modular_skyrat/modules/icspawning/code/standard.dm +++ b/modular_skyrat/modules/icspawning/code/standard.dm @@ -4,7 +4,7 @@ w_class = WEIGHT_CLASS_TINY /obj/item/ammo_casing/energy/electrode/debug - e_cost = 1 + e_cost = LASER_SHOTS(1000, STANDARD_CELL_CHARGE) /obj/item/clothing/suit/armor/vest/debug name = "Bluespace Tech vest" diff --git a/modular_skyrat/modules/microfusion/code/projectiles.dm b/modular_skyrat/modules/microfusion/code/projectiles.dm index 6e90ebfda46..f14bb7c3888 100644 --- a/modular_skyrat/modules/microfusion/code/projectiles.dm +++ b/modular_skyrat/modules/microfusion/code/projectiles.dm @@ -5,7 +5,7 @@ /obj/item/ammo_casing/energy/laser/microfusion name = "microfusion energy lens" projectile_type = /obj/projectile/beam/laser/microfusion - e_cost = 100 // 12 shots with a normal cell. + e_cost = LASER_SHOTS(10, STANDARD_CELL_CHARGE) // 10 shots with a normal cell. select_name = "laser" fire_sound = 'modular_skyrat/modules/microfusion/sound/laser_1.ogg' fire_sound_volume = 100 diff --git a/modular_skyrat/modules/novaya_ert/code/surplus_weapons.dm b/modular_skyrat/modules/novaya_ert/code/surplus_weapons.dm index bcc8b49c26d..aa9fda10f89 100644 --- a/modular_skyrat/modules/novaya_ert/code/surplus_weapons.dm +++ b/modular_skyrat/modules/novaya_ert/code/surplus_weapons.dm @@ -45,7 +45,7 @@ /obj/item/ammo_casing/energy/laser/plasma_glob projectile_type = /obj/projectile/beam/laser/plasma_glob fire_sound = 'modular_skyrat/modules/microfusion/sound/incinerate.ogg' - e_cost = 50 + e_cost = LASER_SHOTS(20, STANDARD_CELL_CHARGE) /obj/projectile/beam/laser/plasma_glob name = "plasma globule" diff --git a/tgstation.dme b/tgstation.dme index 006c2049ec3..0bed5acf98a 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -6197,6 +6197,7 @@ #include "modular_skyrat\master_files\code\modules\power\powernet.dm" #include "modular_skyrat\master_files\code\modules\power\lighting\light_mapping_helpers.dm" #include "modular_skyrat\master_files\code\modules\power\singularity\containment_field.dm" +#include "modular_skyrat\master_files\code\modules\projectiles\ammunition\energy\stun.dm" #include "modular_skyrat\master_files\code\modules\projectiles\boxes_magazines\external\shotgun.dm" #include "modular_skyrat\master_files\code\modules\projectiles\boxes_magazines\external\smg.dm" #include "modular_skyrat\master_files\code\modules\projectiles\guns\ballistic.dm"