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

Adds the ARC to the epic APC roster #214

Merged
merged 8 commits into from
May 13, 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 @@ -30,6 +30,10 @@
name = "Movie APC"
interior_id = "apc_movie"

/datum/map_template/interior/arc
name = "ARC"
interior_id = "arc"

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

/obj/vehicle/multitile/apc/arc
name = "M540 Armored Recon Carrier"
desc = "An M540 Armored Recon Carrier, also known as an ARC. This is a much lighter and more nimble alternative to the M557A3 APC, often preferred by recon forces for that very reason. Entrance on the right."

icon = 'icons/obj/vehicles/arc.dmi'
icon_state = "arc_base"
pixel_x = -48
pixel_y = -48

bound_width = 96
bound_height = 96

interior_map = /datum/map_template/interior/arc


passengers_slots = 9

entrances = list(
"right" = list(-2, 0),
)

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

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

hardpoints_allowed = list(
/obj/item/hardpoint/primary/arc_frontalcannon,
/obj/item/hardpoint/support/flare_launcher,
/obj/item/hardpoint/locomotion/apc_wheels/arc,
)

/obj/vehicle/multitile/apc/arc/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/arc/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/arc/initialize_cameras(change_tag = FALSE)
if(!camera)
camera = new /obj/structure/machinery/camera/vehicle(src)
if(change_tag)
camera.c_tag = "#[rand(1,100)] M540 \"[nickname]\" ARC"
if(camera_int)
camera_int.c_tag = camera.c_tag + " interior"
else
camera.c_tag = "#[rand(1,100)] M540 ARC"
if(camera_int)
camera_int.c_tag = camera.c_tag + " interior"

/obj/vehicle/multitile/apc/arc/set_muzzle_offsets(obj/item/hardpoint/HP)
//sets muzzle flash offsets for APC weapons
switch(HP.slot)
if(HDPT_SUPPORT) //flare
HP.muzzle_flash_pos = list(
"1" = list(-4, -40),
"2" = list(5, 5),
"4" = list(-25, 6),
"8" = list(25, -4)
)
return ..()

/*
** PRESETS SPAWNERS
*/
/obj/effect/vehicle_spawner/arc
name = "ARC Spawner"
icon = 'icons/obj/vehicles/arc.dmi'
icon_state = "arc_base"
pixel_x = -48
pixel_y = -48

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

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

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

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

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

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

/obj/effect/vehicle_spawner/arc/decrepit/load_hardpoints(obj/vehicle/multitile/apc/arc/V)
V.add_hardpoint(new /obj/item/hardpoint/primary/arc_frontalcannon)
V.add_hardpoint(new /obj/item/hardpoint/support/flare_launcher)
V.add_hardpoint(new /obj/item/hardpoint/locomotion/apc_wheels/arc)

//PRESET: default hardpoints
/obj/effect/vehicle_spawner/arc/fixed/load_hardpoints(obj/vehicle/multitile/apc/arc/V)
V.add_hardpoint(new /obj/item/hardpoint/primary/arc_frontalcannon)
V.add_hardpoint(new /obj/item/hardpoint/support/flare_launcher)
V.add_hardpoint(new /obj/item/hardpoint/locomotion/apc_wheels/arc)
147 changes: 147 additions & 0 deletions code/modules/vehicles/apc/arc_weaponless.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@

/obj/vehicle/multitile/apc/arc/weaponless
name = "M540-S Armored Recon Carrier"
desc = "An M540-S Armored Recon Carrier, also known as an ARC. This is a much lighter and more nimble version to the M557A3 APC, often preferred by recon forces for that very reason. This variant has had it's weapons removed to lighten it's weight and improve it's stealth capabilities. Entrance on the right."

icon_state = "arc_weaponless"

interior_map = /datum/map_template/interior/arc

passengers_slots = 9

entrances = list(
"right" = list(-2, 0),
)

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

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

hardpoints_allowed = list(
/obj/item/hardpoint/support/flare_launcher,
/obj/item/hardpoint/locomotion/apc_wheels/arc,
)

/obj/vehicle/multitile/apc/arc/weaponless/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/arc/weaponless/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/arc/weaponless/initialize_cameras(change_tag = FALSE)
if(!camera)
camera = new /obj/structure/machinery/camera/vehicle(src)
if(change_tag)
camera.c_tag = "#[rand(1,100)] M540-S \"[nickname]\" ARC"
if(camera_int)
camera_int.c_tag = camera.c_tag + " interior"
else
camera.c_tag = "#[rand(1,100)] M540-S ARC"
if(camera_int)
camera_int.c_tag = camera.c_tag + " interior"

/obj/vehicle/multitile/apc/arc/weaponless/set_muzzle_offsets(obj/item/hardpoint/HP)
//sets muzzle flash offsets for APC weapons
switch(HP.slot)
if(HDPT_SUPPORT) //flare
HP.muzzle_flash_pos = list(
"1" = list(-4, -40),
"2" = list(5, 5),
"4" = list(-25, 6),
"8" = list(25, -4)
)
return ..()

/*
** PRESETS SPAWNERS
*/
/obj/effect/vehicle_spawner/arc/weaponless
name = "Weaponless ARC Spawner"
icon = 'icons/obj/vehicles/arc.dmi'
icon_state = "arc_weaponless"
pixel_x = -48
pixel_y = -48

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

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

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

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

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

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

/obj/effect/vehicle_spawner/arc/weaponless/decrepit/load_hardpoints(obj/vehicle/multitile/apc/arc/weaponless/V)
V.add_hardpoint(new /obj/item/hardpoint/support/flare_launcher)
V.add_hardpoint(new /obj/item/hardpoint/locomotion/apc_wheels/arc)

//PRESET: default hardpoints
/obj/effect/vehicle_spawner/arc/weaponless/fixed/load_hardpoints(obj/vehicle/multitile/apc/arc/weaponless/V)
V.add_hardpoint(new /obj/item/hardpoint/support/flare_launcher)
V.add_hardpoint(new /obj/item/hardpoint/locomotion/apc_wheels/arc)
12 changes: 12 additions & 0 deletions code/modules/vehicles/apc/interior.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
/obj/structure/interior_exit/vehicle/apc/rear/right
icon_state = "door_rear_right"

/obj/structure/interior_exit/vehicle/arc
name = "ARC side door"
icon = 'icons/obj/vehicles/interiors/arc.dmi'
icon_state = "exit_door"

/obj/structure/prop/vehicle
name = "Generic vehicle prop"
desc = "Adds more flavour to vehicle interior."
Expand All @@ -40,6 +45,13 @@
breakable = FALSE
indestructible = TRUE

/obj/structure/prop/vehicle/arc
name = "ARC chassis"

icon = 'icons/obj/vehicles/interiors/arc_chassis.dmi'
icon_state = "arc_chassis"


/obj/structure/prop/vehicle/firing_port_weapon
name = "M56 FPW handle"
desc = "A control handle for a modified M56B Smartgun installed on the sides of M577 Armored Personnel Carrier as a Firing Port Weapon. \
Expand Down
39 changes: 39 additions & 0 deletions code/modules/vehicles/hardpoints/primary/arc_frontal.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/obj/item/hardpoint/primary/arc_frontalcannon
name = "Bleihagel RE-RE850 Frontal Rotary Cannon"
desc = "A peculiar turret with two rotary cannons strapped to the front of it. Normally equipped with an autonomous mode, this one curiously lacks the feature."
icon = 'icons/obj/vehicles/hardpoints/arc.dmi'

icon_state = "frontalcannon"
disp_icon = "arc"
disp_icon_state = "frontalcannon"
activation_sounds = list('sound/weapons/gun_smartgun1.ogg', 'sound/weapons/gun_smartgun2.ogg', 'sound/weapons/gun_smartgun3.ogg')

damage_multiplier = 0.15

health = 2000
firing_arc = 120

origins = list(0, -2)

allowed_seat = VEHICLE_DRIVER

ammo = new /obj/item/ammo_magazine/hardpoint/m56_cupola/frontal_cannon
max_clips = 1

use_muzzle_flash = TRUE
angle_muzzleflash = FALSE
muzzleflash_icon_state = "muzzle_flash_double"

muzzle_flash_pos = list(
"1" = list(1, 5),
"2" = list(1, -30),
"4" = list(17, 3),
"8" = list(-17, 3)
)

scatter = 1
gun_firemode = GUN_FIREMODE_AUTOMATIC
gun_firemode_list = list(
GUN_FIREMODE_AUTOMATIC,
)
fire_delay = 0.05 SECONDS
9 changes: 9 additions & 0 deletions code/modules/vehicles/hardpoints/wheels/apc_wheels.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,12 @@
move_max_momentum = 2
move_momentum_build_factor = 1.5
move_turn_momentum_loss_factor = 0.5

/obj/item/hardpoint/locomotion/apc_wheels/arc
name = "ARC Wheels"
desc = "Not to be confused with the APC wheels, these are designed for the M540 ARC in mind."
icon = 'icons/obj/vehicles/hardpoints/arc.dmi'

icon_state = "tires"
disp_icon = "arc"
disp_icon_state = "wheels"
Loading
Loading