Skip to content

Commit

Permalink
muzzle offsets
Browse files Browse the repository at this point in the history
  • Loading branch information
Doubleumc committed Dec 4, 2023
1 parent 8be509d commit a7524f5
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
26 changes: 26 additions & 0 deletions code/modules/vehicles/apc/apc_movie.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
4 changes: 4 additions & 0 deletions code/modules/vehicles/multitile/multitile_hardpoints.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand Down

0 comments on commit a7524f5

Please sign in to comment.