Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Movie APC #61

Merged
merged 3 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions code/datums/vehicles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
name = "APC - No FPW"
interior_id = "apc_no_fpw"

/datum/map_template/interior/apc_movie
name = "Movie APC"
interior_id = "apc_movie"

/datum/map_template/interior/fancy_locker
name = "Fancy Locker"
interior_id = "fancylocker"
Expand Down
168 changes: 168 additions & 0 deletions code/modules/vehicles/apc/apc_movie.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@

/obj/vehicle/multitile/apc/movie
name = "M577A3 Armored Personnel Carrier"
desc = "An M577A3 Armored Personnel Carrier complete with a tactical operations center. Entrance on the right."

icon = 'icons/obj/vehicles/movieapc.dmi'
icon_state = "apc_base_movie"
pixel_x = -64
pixel_y = -64

bound_width = 96
bound_height = 96

interior_map = /datum/map_template/interior/apc_movie


passengers_slots = 20

entrances = list(
"right rear" = list(-2, 1),
"right front" = list(-2, 0)
)

seats = list(
VEHICLE_DRIVER = null,
VEHICLE_GUNNER = null,
)

active_hp = list(
VEHICLE_DRIVER = null,
VEHICLE_GUNNER = null,
)

/obj/vehicle/multitile/apc/movie/add_seated_verbs(mob/living/M, seat)
if(!M.client)
return
add_verb(M.client, list(
/obj/vehicle/multitile/proc/get_status_info,
/obj/vehicle/multitile/proc/open_controls_guide,
/obj/vehicle/multitile/proc/name_vehicle,
))
if(seat == VEHICLE_DRIVER)
add_verb(M.client, list(
/obj/vehicle/multitile/proc/toggle_door_lock,
/obj/vehicle/multitile/proc/switch_hardpoint,
/obj/vehicle/multitile/proc/cycle_hardpoint,
/obj/vehicle/multitile/proc/toggle_shift_click,
/obj/vehicle/multitile/proc/activate_horn,
))
else if(seat == VEHICLE_GUNNER)
add_verb(M.client, list(
/obj/vehicle/multitile/proc/switch_hardpoint,
/obj/vehicle/multitile/proc/cycle_hardpoint,
/obj/vehicle/multitile/proc/toggle_shift_click,
))

/obj/vehicle/multitile/apc/movie/remove_seated_verbs(mob/living/M, seat)
if(!M.client)
return
remove_verb(M.client, list(
/obj/vehicle/multitile/proc/get_status_info,
/obj/vehicle/multitile/proc/open_controls_guide,
/obj/vehicle/multitile/proc/name_vehicle,
))
SStgui.close_user_uis(M, src)
if(seat == VEHICLE_DRIVER)
remove_verb(M.client, list(
/obj/vehicle/multitile/proc/toggle_door_lock,
/obj/vehicle/multitile/proc/switch_hardpoint,
/obj/vehicle/multitile/proc/cycle_hardpoint,
/obj/vehicle/multitile/proc/toggle_shift_click,
/obj/vehicle/multitile/proc/activate_horn,
))
else if(seat == VEHICLE_GUNNER)
remove_verb(M.client, list(
/obj/vehicle/multitile/proc/switch_hardpoint,
/obj/vehicle/multitile/proc/cycle_hardpoint,
/obj/vehicle/multitile/proc/toggle_shift_click,
))

/obj/vehicle/multitile/apc/movie/initialize_cameras(change_tag = FALSE)
if(!camera)
camera = new /obj/structure/machinery/camera/vehicle(src)
if(change_tag)
camera.c_tag = "#[rand(1,100)] M577A3 \"[nickname]\" APC"
if(camera_int)
camera_int.c_tag = camera.c_tag + " interior"
else
camera.c_tag = "#[rand(1,100)] M577A3 APC"
if(camera_int)
camera_int.c_tag = camera.c_tag + " interior"

Doubleumc marked this conversation as resolved.
Show resolved Hide resolved
/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
*/
/obj/effect/vehicle_spawner/apc_movie
name = "Movie APC Spawner"
icon = 'icons/obj/vehicles/movieapc.dmi'
icon_state = "apc_base_movie"
pixel_x = -64
pixel_y = -64

/obj/effect/vehicle_spawner/apc_movie/Initialize()
. = ..()
spawn_vehicle()
qdel(src)

//PRESET: no hardpoints
/obj/effect/vehicle_spawner/apc_movie/spawn_vehicle()
var/obj/vehicle/multitile/apc/movie/APC = new (loc)

load_misc(APC)
load_hardpoints(APC)
handle_direction(APC)
APC.update_icon()

//PRESET: only wheels installed
/obj/effect/vehicle_spawner/apc_movie/plain/load_hardpoints(obj/vehicle/multitile/apc/movie/V)
V.add_hardpoint(new /obj/item/hardpoint/locomotion/apc_wheels)

//PRESET: default hardpoints, destroyed
/obj/effect/vehicle_spawner/apc_movie/decrepit/spawn_vehicle()
var/obj/vehicle/multitile/apc/movie/APC = new (loc)

load_misc(APC)
load_hardpoints(APC)
handle_direction(APC)
load_damage(APC)
APC.update_icon()

/obj/effect/vehicle_spawner/apc_movie/decrepit/load_hardpoints(obj/vehicle/multitile/apc/movie/V)
V.add_hardpoint(new /obj/item/hardpoint/primary/dualcannon)
V.add_hardpoint(new /obj/item/hardpoint/secondary/frontalcannon)
V.add_hardpoint(new /obj/item/hardpoint/support/flare_launcher)
V.add_hardpoint(new /obj/item/hardpoint/locomotion/apc_wheels)

//PRESET: default hardpoints
/obj/effect/vehicle_spawner/apc_movie/fixed/load_hardpoints(obj/vehicle/multitile/apc/movie/V)
V.add_hardpoint(new /obj/item/hardpoint/primary/dualcannon)
V.add_hardpoint(new /obj/item/hardpoint/secondary/frontalcannon)
V.add_hardpoint(new /obj/item/hardpoint/support/flare_launcher)
V.add_hardpoint(new /obj/item/hardpoint/locomotion/apc_wheels)
4 changes: 4 additions & 0 deletions code/modules/vehicles/interior/areas.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
name = "\improper CMD APC interior"
icon_state = "apc_cmd"

/area/vehicle/apc/movie
name = "\improper M557A3 APC interior"
icon_state = "apc_movie"

/area/vehicle/van
name = "van interior"
icon_state = "van"
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
1 change: 1 addition & 0 deletions colonialmarines.dme
Original file line number Diff line number Diff line change
Expand Up @@ -2363,6 +2363,7 @@
#include "code\modules\vehicles\apc\apc.dm"
#include "code\modules\vehicles\apc\apc_command.dm"
#include "code\modules\vehicles\apc\apc_medical.dm"
#include "code\modules\vehicles\apc\apc_movie.dm"
#include "code\modules\vehicles\apc\interior.dm"
#include "code\modules\vehicles\hardpoints\hardpoint.dm"
#include "code\modules\vehicles\hardpoints\armor\armor.dm"
Expand Down
Binary file modified icons/obj/vehicles/interiors/apc.dmi
Binary file not shown.
Binary file added icons/obj/vehicles/movieapc.dmi
Binary file not shown.
Binary file modified icons/turf/areas_interiors.dmi
Binary file not shown.
Loading