From 901559a51d3bf77d09cf2ff1409c7b9d460f0d78 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Thu, 26 Sep 2024 14:04:15 -0500 Subject: [PATCH] fixed powered weapons (my hated) --- code/modules/projectiles/guns/ballistic/gauss.dm | 12 ++++++------ code/modules/projectiles/guns/powered.dm | 15 ++++++++++----- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/code/modules/projectiles/guns/ballistic/gauss.dm b/code/modules/projectiles/guns/ballistic/gauss.dm index 47fcb0a35450..b767db96cc90 100644 --- a/code/modules/projectiles/guns/ballistic/gauss.dm +++ b/code/modules/projectiles/guns/ballistic/gauss.dm @@ -48,8 +48,8 @@ item_state = "model-h" fire_sound = 'sound/weapons/gun/gauss/modelh.ogg' load_sound = 'sound/weapons/gun/gauss/pistol_reload.ogg' - default_ammo_type = /obj/item/stock_parts/cell/gun/solgov - allowed_ammo_types = list( + default_cell_type = /obj/item/stock_parts/cell/gun/solgov + allowed_cell_types = list( /obj/item/stock_parts/cell/gun/solgov, ) slot_flags = ITEM_SLOT_BELT @@ -91,8 +91,8 @@ item_state = "claris" fire_sound = 'sound/weapons/gun/gauss/claris.ogg' load_sound = 'sound/weapons/gun/gauss/sniper_reload.ogg' - default_ammo_type = /obj/item/stock_parts/cell/gun/solgov - allowed_ammo_types = list( + default_cell_type = /obj/item/stock_parts/cell/gun/solgov + allowed_cell_types = list( /obj/item/stock_parts/cell/gun/solgov, ) fire_delay = 0.4 SECONDS @@ -123,8 +123,8 @@ item_state = "gar" fire_sound = 'sound/weapons/gun/gauss/gar.ogg' load_sound = 'sound/weapons/gun/gauss/rifle_reload.ogg' - default_ammo_type = /obj/item/stock_parts/cell/gun/solgov - allowed_ammo_types = list( + default_cell_type = /obj/item/stock_parts/cell/gun/solgov + default_cell_types = list( /obj/item/stock_parts/cell/gun/solgov, ) burst_size = 1 diff --git a/code/modules/projectiles/guns/powered.dm b/code/modules/projectiles/guns/powered.dm index e7af02f66059..44419c099564 100644 --- a/code/modules/projectiles/guns/powered.dm +++ b/code/modules/projectiles/guns/powered.dm @@ -3,14 +3,19 @@ allowed_ammo_types = list( /obj/item/ammo_box/magazine/gauss, ) + var/default_cell_type = /obj/item/stock_parts/cell/gun + var/list/allowed_cell_types = list( + /obj/item/stock_parts/cell/gun, + /obj/item/stock_parts/cell/gun/upgraded, + /obj/item/stock_parts/cell/gun/empty, + /obj/item/stock_parts/cell/gun/upgraded/empty, + ) charge_sections = 3 /obj/item/gun/ballistic/automatic/powered/Initialize() . = ..() - if(default_ammo_type) - cell = new default_ammo_type(src) - else - cell = new(src) + if(default_cell_type) + cell = new default_cell_type(src) update_appearance() /obj/item/gun/ballistic/automatic/powered/examine(mob/user) @@ -42,7 +47,7 @@ //the things below were taken from energy gun code. blame whoever coded this, not me /obj/item/gun/ballistic/automatic/powered/attackby(obj/item/A, mob/user, params) - if (!internal_cell && A.type in allowed_ammo_types) + if (!internal_cell && (A.type in allowed_cell_types)) var/obj/item/stock_parts/cell/gun/C = A if (!cell) insert_cell(user, C)