diff --git a/code/__DEFINES/vehicle.dm b/code/__DEFINES/vehicle.dm index 9c6685085788..8a1617229926 100644 --- a/code/__DEFINES/vehicle.dm +++ b/code/__DEFINES/vehicle.dm @@ -53,5 +53,6 @@ #define VEHICLE_CLASS_LIGHT (1<<2) //light class armor (APC, tank) #define VEHICLE_CLASS_MEDIUM (1<<3) //medium class armor (tank) #define VEHICLE_CLASS_HEAVY (1<<4) //heavy class armor (tank) - -#define TANK_POPLOCK 90 +// Other vehicle flags +/// Vehicle can bypass vehicle blockers, typically going further into maps than intended +#define VEHICLE_BYPASS_BLOCKERS (1<<5) diff --git a/code/_globalvars/bitfields.dm b/code/_globalvars/bitfields.dm index 53dd40ff6035..7a1cba4719d8 100644 --- a/code/_globalvars/bitfields.dm +++ b/code/_globalvars/bitfields.dm @@ -462,3 +462,11 @@ DEFINE_BITFIELD(vend_flags, list( "VEND_FACTION_THEMES" = VEND_FACTION_THEMES, "VEND_USE_VENDOR_FLAGS" = VEND_USE_VENDOR_FLAGS, )) + +DEFINE_BITFIELD(vehicle_flags, list( + "VEHICLE_CLASS_WEAK" = VEHICLE_CLASS_WEAK, + "VEHICLE_CLASS_LIGHT" = VEHICLE_CLASS_LIGHT, + "VEHICLE_CLASS_MEDIUM" = VEHICLE_CLASS_MEDIUM, + "VEHICLE_CLASS_HEAVY" = VEHICLE_CLASS_HEAVY, + "VEHICLE_BYPASS_BLOCKERS" = VEHICLE_BYPASS_BLOCKERS, +)) diff --git a/code/game/machinery/vending/vendor_types/crew/vehicle_crew.dm b/code/game/machinery/vending/vendor_types/crew/vehicle_crew.dm index 891a2a907b39..d352936b5434 100644 --- a/code/game/machinery/vending/vendor_types/crew/vehicle_crew.dm +++ b/code/game/machinery/vending/vendor_types/crew/vehicle_crew.dm @@ -55,8 +55,10 @@ SIGNAL_HANDLER UnregisterSignal(SSdcs, COMSIG_GLOB_VEHICLE_ORDERED) - selected_vehicle = "APC" - available_categories &= ~(VEHICLE_ARMOR_AVAILABLE|VEHICLE_INTEGRAL_AVAILABLE) //APC lacks these, so we need to remove these flags to be able to access spare parts section + if(!selected_vehicle) + selected_vehicle = "APC" // The whole thing seems to be based upon the assumption you unlock tank as an override, defaulting to APC + if(selected_vehicle == "APC") + available_categories &= ~(VEHICLE_ARMOR_AVAILABLE|VEHICLE_INTEGRAL_AVAILABLE) //APC lacks these, so we need to remove these flags to be able to access spare parts section /obj/structure/machinery/cm_vending/gear/vehicle_crew/get_listed_products(mob/user) var/list/display_list = list() diff --git a/code/game/objects/structures/blocker.dm b/code/game/objects/structures/blocker.dm index 284daf0028aa..f85b1e65fff5 100644 --- a/code/game/objects/structures/blocker.dm +++ b/code/game/objects/structures/blocker.dm @@ -105,9 +105,21 @@ /obj/structure/blocker/forcefield/vehicles types = list(/obj/vehicle/) + +/obj/structure/blocker/forcefield/vehicles/handle_vehicle_bump(obj/vehicle/multitile/multitile_vehicle) + if(multitile_vehicle.vehicle_flags & VEHICLE_BYPASS_BLOCKERS) + return TRUE + return FALSE + /obj/structure/blocker/forcefield/multitile_vehicles types = list(/obj/vehicle/multitile/) + +/obj/structure/blocker/forcefield/multitile_vehicles/handle_vehicle_bump(obj/vehicle/multitile/multitile_vehicle) + if(multitile_vehicle.vehicle_flags & VEHICLE_BYPASS_BLOCKERS) + return TRUE + return FALSE + /obj/structure/blocker/forcefield/human types = list(/mob/living/carbon/human) icon_state = "purple_line" diff --git a/code/game/supplyshuttle.dm b/code/game/supplyshuttle.dm index e8f40c1d52b3..5e3911b726c3 100644 --- a/code/game/supplyshuttle.dm +++ b/code/game/supplyshuttle.dm @@ -1315,6 +1315,14 @@ var/datum/controller/supply/supply_controller = new() /datum/vehicle_order/tank/has_vehicle_lock() return +/datum/vehicle_order/tank/broken + name = "Smashed M34A2 Longstreet Light Tank" + ordered_vehicle = /obj/effect/vehicle_spawner/tank/hull/broken + +/datum/vehicle_order/tank/plain + name = "M34A2 Longstreet Light Tank" + ordered_vehicle = /obj/effect/vehicle_spawner/tank + /datum/vehicle_order/apc name = "M577 Armored Personnel Carrier" ordered_vehicle = /obj/effect/vehicle_spawner/apc/decrepit @@ -1327,18 +1335,19 @@ var/datum/controller/supply/supply_controller = new() name = "M577-CMD Armored Personnel Carrier" ordered_vehicle = /obj/effect/vehicle_spawner/apc_cmd/decrepit +/datum/vehicle_order/apc/empty + name = "Barebones M577 Armored Personal Carrier" + ordered_vehicle = /obj/effect/vehicle_spawner/apc/unarmed/broken + /obj/structure/machinery/computer/supplycomp/vehicle/Initialize() . = ..() vehicles = list( - /datum/vehicle_order/apc, - /datum/vehicle_order/apc/med, - /datum/vehicle_order/apc/cmd, + new /datum/vehicle_order/apc(), + new /datum/vehicle_order/apc/med(), + new /datum/vehicle_order/apc/cmd(), ) - for(var/order as anything in vehicles) - new order - if(!VehicleElevatorConsole) VehicleElevatorConsole = src @@ -1408,6 +1417,7 @@ var/datum/controller/supply/supply_controller = new() return if(!is_admin_level(SSshuttle.vehicle_elevator.z)) + to_chat(usr, SPAN_WARNING("The elevator needs to be in the cargo bay dock to call a vehicle up. Ask someone to send it away.")) return if(ismaintdrone(usr)) diff --git a/code/modules/cm_tech/implements/tank.dm b/code/modules/cm_tech/implements/tank.dm index 1ce83c37eae3..ae7dfc580e38 100644 --- a/code/modules/cm_tech/implements/tank.dm +++ b/code/modules/cm_tech/implements/tank.dm @@ -1,16 +1,3 @@ -/datum/supply_packs/vc_kit - name = "Vehicle Crewman Kits" - contains = list( - /obj/item/pamphlet/skill/vc, - /obj/item/pamphlet/skill/vc, - ) - cost = 0 - containertype = /obj/structure/closet/crate/supply - containername = "vehicle crewman kits crate" - buyable = 0 - group = "Operations" - iteration_needed = null - /obj/item/pamphlet/skill/vc name = "vehicle training manual" desc = "A manual used to quickly impart vital knowledge on driving vehicles." @@ -18,22 +5,30 @@ trait = /datum/character_trait/skills/vc bypass_pamphlet_limit = TRUE -/obj/item/tank_coupon - name = "tank coupon" - desc = "A coupon to be used for ASRS Vehicle Consoles to grant the wearer a TANK! One use only." +/obj/item/vehicle_coupon + name = "vehicle coupon" + desc = "A coupon to be used for ASRS Vehicle Consoles to grant the wearer an actual APC! Yeah baby, we're done walking! One use only. The ASRS elevator must be manually sent to lower level. Special restrictions may apply. No warranty." icon = 'icons/obj/items/pamphlets.dmi' icon_state = "pamphlet_written" item_state = "pamphlet_written" + var/vehicle_type = /datum/vehicle_order/apc/empty + var/vehicle_category = "APC" -/obj/item/tank_coupon/attack_self(mob/user) +/obj/item/vehicle_coupon/tank + name = "tank coupon" + desc = "We're done playing! This coupon allows the ship crew to retrieve a complete Longstreet tank from Vehicle ASRS. Make sure to send the ASRS lift down so it can be retrieved. One use only. LTB not included. Comes with free friendly fire." + vehicle_type = /datum/vehicle_order/tank/broken + vehicle_category = "TANK" + +/obj/item/vehicle_coupon/attack_self(mob/user) if(QDELETED(src)) return - if(redeem_tank()) - to_chat(user, SPAN_WARNING("\The [src] catches fire as it is read, resetting the ASRS Vehicle system!")) + if(redeem_vehicle()) + to_chat(user, SPAN_WARNING("\The [src] catches fire as it is read and resets the ASRS Vehicle system! Send the lift down and haul your prize up.")) qdel(src) return ..() -/obj/item/tank_coupon/proc/redeem_tank(mob/user) +/obj/item/vehicle_coupon/proc/redeem_vehicle(mob/user) SHOULD_NOT_SLEEP(TRUE) . = FALSE var/obj/structure/machinery/computer/supplycomp/vehicle/comp = VehicleElevatorConsole @@ -46,7 +41,7 @@ comp.spent = FALSE QDEL_NULL_LIST(comp.vehicles) comp.vehicles = list( - new /datum/vehicle_order/tank() + new vehicle_type(), ) comp.allowed_roles = null comp.req_access = list() @@ -56,17 +51,7 @@ gearcomp.req_access = list() gearcomp.req_one_access = list() gearcomp.vendor_role = list() - gearcomp.selected_vehicle = "TANK" + gearcomp.selected_vehicle = vehicle_category gearcomp.available_categories = VEHICLE_ALL_AVAILABLE - var/datum/supply_packs/VK = /datum/supply_packs/vc_kit - var/pack = initial(VK.name) - var/datum/supply_order/O = new /datum/supply_order() - O.ordernum = supply_controller.ordernum - supply_controller.ordernum++ - O.object = supply_controller.supply_packs[pack] - O.orderedby = MAIN_AI_SYSTEM - O.approvedby = MAIN_AI_SYSTEM - supply_controller.shoppinglist += O - return TRUE diff --git a/code/modules/vehicles/apc/apc.dm b/code/modules/vehicles/apc/apc.dm index d71db37074f1..24b137a6804a 100644 --- a/code/modules/vehicles/apc/apc.dm +++ b/code/modules/vehicles/apc/apc.dm @@ -256,9 +256,16 @@ GLOBAL_LIST_EMPTY(command_apc_list) handle_direction(APC) APC.update_icon() + return APC + /obj/effect/vehicle_spawner/apc/unarmed/load_hardpoints(obj/vehicle/multitile/apc/V) return +/obj/effect/vehicle_spawner/apc/unarmed/broken/spawn_vehicle() + var/obj/vehicle/multitile/apc/apc = ..() + load_damage(apc) + apc.update_icon() + //PRESET: default hardpoints, destroyed /obj/effect/vehicle_spawner/apc/unarmed/decrepit/spawn_vehicle() var/obj/vehicle/multitile/apc/unarmed/APC = new (loc) diff --git a/code/modules/vehicles/multitile/multitile.dm b/code/modules/vehicles/multitile/multitile.dm index 9e4d2c9d297b..c8138c5b8f86 100644 --- a/code/modules/vehicles/multitile/multitile.dm +++ b/code/modules/vehicles/multitile/multitile.dm @@ -240,26 +240,15 @@ var/amt_hardpoints = LAZYLEN(hardpoints) if(amt_hardpoints) - var/list/hardpoint_images[amt_hardpoints] - var/list/C[HDPT_LAYER_MAX] - - // Counting sort the images into a list so we get the hardpoint images sorted by layer - for(var/obj/item/hardpoint/H in hardpoints) - C[H.hdpt_layer] += 1 - - for(var/i = 2 to HDPT_LAYER_MAX) - C[i] += C[i-1] - - for(var/obj/item/hardpoint/H in hardpoints) - hardpoint_images[C[H.hdpt_layer]] = H.get_hardpoint_image() - C[H.hdpt_layer] -= 1 - - for(var/i = 1 to amt_hardpoints) - var/image/I = hardpoint_images[i] - // get_hardpoint_image() can return a list of images - if(istype(I)) - I.layer = layer + (i*0.1) - overlays += I + for(var/obj/item/hardpoint/hardpoint in hardpoints) + var/image/hardpoint_image = hardpoint.get_hardpoint_image() + if(istype(hardpoint_image)) + hardpoint_image.layer = layer + hardpoint.hdpt_layer * 0.1 + else if(islist(hardpoint_image)) + var/list/image/hardpoint_image_list = hardpoint_image // Linter will complain about iterating on "an image" otherwise + for(var/image/subimage in hardpoint_image_list) + subimage.layer = layer + hardpoint.hdpt_layer * 0.1 + overlays += hardpoint_image if(clamped) var/image/J = image(icon, icon_state = "vehicle_clamp", layer = layer+0.1) diff --git a/code/modules/vehicles/tank/tank.dm b/code/modules/vehicles/tank/tank.dm index ad69f80cdfb6..fd953b04100a 100644 --- a/code/modules/vehicles/tank/tank.dm +++ b/code/modules/vehicles/tank/tank.dm @@ -189,6 +189,8 @@ handle_direction(TANK) TANK.update_icon() + return TANK + /obj/effect/vehicle_spawner/tank/load_hardpoints(obj/vehicle/multitile/tank/V) V.add_hardpoint(new /obj/item/hardpoint/holder/tank_turret) @@ -201,6 +203,12 @@ /obj/effect/vehicle_spawner/tank/hull/load_hardpoints(obj/vehicle/multitile/tank/V) return +//Just the hull and it's broken TOO, you get the full experience +/obj/effect/vehicle_spawner/tank/hull/broken/spawn_vehicle() + var/obj/vehicle/multitile/tank/tonk = ..() + load_damage(tonk) + tonk.update_icon() + //PRESET: default hardpoints, destroyed /obj/effect/vehicle_spawner/tank/decrepit/spawn_vehicle() var/obj/vehicle/multitile/tank/TANK = new (loc)