From a7524f536987485d5636cd9131c8058b3807b56a Mon Sep 17 00:00:00 2001 From: Doubleumc Date: Sun, 3 Dec 2023 20:02:37 -0500 Subject: [PATCH] muzzle offsets --- code/modules/vehicles/apc/apc_movie.dm | 26 +++++++++++++++++++ .../multitile/multitile_hardpoints.dm | 4 +++ 2 files changed, 30 insertions(+) diff --git a/code/modules/vehicles/apc/apc_movie.dm b/code/modules/vehicles/apc/apc_movie.dm index e0c11e945c..aef7ad45b2 100644 --- a/code/modules/vehicles/apc/apc_movie.dm +++ b/code/modules/vehicles/apc/apc_movie.dm @@ -90,6 +90,32 @@ if(camera_int) camera_int.c_tag = camera.c_tag + " interior" +/obj/vehicle/multitile/apc/movie/set_muzzle_offsets(obj/item/hardpoint/HP) + //sets muzzle flash offsets for APC weapons as appropriate for the movie APC + switch(HP.slot) + if(HDPT_PRIMARY) //dualcannon + HP.muzzle_flash_pos = list( + "1" = list(8, -20), + "2" = list(25, 31), + "4" = list(-7, 27), + "8" = list(37, 9) + ) + if(HDPT_SECONDARY) //frontalcannon + HP.muzzle_flash_pos = list( + "1" = list(34, 70), + "2" = list(-1, -70), + "4" = list(88, -7), + "8" = list(-56, 12) + ) + if(HDPT_SUPPORT) //flare + HP.muzzle_flash_pos = list( + "1" = list(22, -20), + "2" = list(11, 32), + "4" = list(-5, 10), + "8" = list(37, 24) + ) + return ..() + /* ** PRESETS SPAWNERS */ diff --git a/code/modules/vehicles/multitile/multitile_hardpoints.dm b/code/modules/vehicles/multitile/multitile_hardpoints.dm index 2c5a343b80..b8edba78da 100644 --- a/code/modules/vehicles/multitile/multitile_hardpoints.dm +++ b/code/modules/vehicles/multitile/multitile_hardpoints.dm @@ -201,6 +201,7 @@ //ALWAYS CALL THIS WHEN ATTACHING HARDPOINTS /obj/vehicle/multitile/proc/add_hardpoint(obj/item/hardpoint/HP, mob/user) HP.owner = src + set_muzzle_offsets(HP) HP.forceMove(src) hardpoints += HP @@ -209,6 +210,9 @@ update_icon() +/obj/vehicle/multitile/proc/set_muzzle_offsets(obj/item/hardpoint/HP) + return + //General proc for taking off hardpoints //ALWAYS CALL THIS WHEN REMOVING HARDPOINTS /obj/vehicle/multitile/proc/remove_hardpoint(obj/item/hardpoint/old, mob/user)