From 82e4f5d2d9d886b11626b199fce8618dd619d530 Mon Sep 17 00:00:00 2001 From: Hatterhat Date: Thu, 13 Aug 2020 13:29:36 -0500 Subject: [PATCH 1/5] vehicle headshots (tm) --- code/modules/vehicles/_vehicle.dm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/code/modules/vehicles/_vehicle.dm b/code/modules/vehicles/_vehicle.dm index ac7fa879f4..133ebc9263 100644 --- a/code/modules/vehicles/_vehicle.dm +++ b/code/modules/vehicles/_vehicle.dm @@ -18,6 +18,7 @@ var/canmove = TRUE var/emulate_door_bumps = TRUE //when bumping a door try to make occupants bump them to open them. var/default_driver_move = TRUE //handle driver movement instead of letting something else do it like riding datums. + var/enclosed = FALSE // is the rider protected from bullets? assume no var/list/autogrant_actions_passenger //plain list of typepaths var/list/autogrant_actions_controller //assoc list "[bitflag]" = list(typepaths) var/list/mob/occupant_actions //assoc list mob = list(type = action datum assigned to mob) @@ -166,3 +167,9 @@ if(trailer && .) var/dir_to_move = get_dir(trailer.loc, newloc) step(trailer, dir_to_move) + +/obj/vehicle/bullet_act(obj/projectile/Proj) //wrapper + if (!enclosed && occupant && !Proj.force_hit && (Proj.def_zone == BODY_ZONE_HEAD || Proj.def_zone == BODY_ZONE_CHEST)) //allows bullets to hit drivers + occupant.bullet_act(Proj) //i'm sure that ATV will protect you against a dink, idiot + return BULLET_ACT_HIT + . = ..() From df7e82ab0ab2e6d9a3f2d6fa1683e34c6217ce04 Mon Sep 17 00:00:00 2001 From: Hatterhat Date: Thu, 13 Aug 2020 13:32:27 -0500 Subject: [PATCH 2/5] compile first tho --- code/modules/vehicles/_vehicle.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/vehicles/_vehicle.dm b/code/modules/vehicles/_vehicle.dm index 133ebc9263..47591bf5b8 100644 --- a/code/modules/vehicles/_vehicle.dm +++ b/code/modules/vehicles/_vehicle.dm @@ -168,8 +168,8 @@ var/dir_to_move = get_dir(trailer.loc, newloc) step(trailer, dir_to_move) -/obj/vehicle/bullet_act(obj/projectile/Proj) //wrapper - if (!enclosed && occupant && !Proj.force_hit && (Proj.def_zone == BODY_ZONE_HEAD || Proj.def_zone == BODY_ZONE_CHEST)) //allows bullets to hit drivers - occupant.bullet_act(Proj) //i'm sure that ATV will protect you against a dink, idiot +/obj/vehicle/bullet_act(obj/item/projectile/Proj) //wrapper + if (!enclosed && occupants && !Proj.force_hit && (Proj.def_zone == BODY_ZONE_HEAD || Proj.def_zone == BODY_ZONE_CHEST)) //allows bullets to hit drivers + occupants.bullet_act(Proj) //i'm sure that ATV will protect you against a dink, idiot return BULLET_ACT_HIT . = ..() From d572e7c05eec8544af7fd44409dcb0cd205e6564 Mon Sep 17 00:00:00 2001 From: Hatterhat Date: Thu, 13 Aug 2020 19:58:45 -0500 Subject: [PATCH 3/5] turns out there were sealed vehicles --- code/modules/vehicles/sealed.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/vehicles/sealed.dm b/code/modules/vehicles/sealed.dm index edaab8b982..28f6b1cca8 100644 --- a/code/modules/vehicles/sealed.dm +++ b/code/modules/vehicles/sealed.dm @@ -1,4 +1,5 @@ /obj/vehicle/sealed + enclosed = TRUE // you're in a sealed vehicle dont get dinked idiot var/enter_delay = 20 flags_1 = BLOCK_FACE_ATOM_1 From 89b71ddfc5fc5e9fc6549a3351e18e60fe131e4f Mon Sep 17 00:00:00 2001 From: Hatterhat Date: Sun, 16 Aug 2020 15:02:04 -0500 Subject: [PATCH 4/5] first and only occupant gets dinked --- code/modules/vehicles/_vehicle.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/vehicles/_vehicle.dm b/code/modules/vehicles/_vehicle.dm index 47591bf5b8..3a12e3c2bd 100644 --- a/code/modules/vehicles/_vehicle.dm +++ b/code/modules/vehicles/_vehicle.dm @@ -170,6 +170,6 @@ /obj/vehicle/bullet_act(obj/item/projectile/Proj) //wrapper if (!enclosed && occupants && !Proj.force_hit && (Proj.def_zone == BODY_ZONE_HEAD || Proj.def_zone == BODY_ZONE_CHEST)) //allows bullets to hit drivers - occupants.bullet_act(Proj) //i'm sure that ATV will protect you against a dink, idiot + occupants[1].bullet_act(Proj) // driver dinkage return BULLET_ACT_HIT . = ..() From b8686ab0f95233b6fd3b9617a0a3700a139cf240 Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Sun, 16 Aug 2020 18:49:49 -0700 Subject: [PATCH 5/5] Update _vehicle.dm --- code/modules/vehicles/_vehicle.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/vehicles/_vehicle.dm b/code/modules/vehicles/_vehicle.dm index 3a12e3c2bd..12e9f365d0 100644 --- a/code/modules/vehicles/_vehicle.dm +++ b/code/modules/vehicles/_vehicle.dm @@ -169,7 +169,7 @@ step(trailer, dir_to_move) /obj/vehicle/bullet_act(obj/item/projectile/Proj) //wrapper - if (!enclosed && occupants && !Proj.force_hit && (Proj.def_zone == BODY_ZONE_HEAD || Proj.def_zone == BODY_ZONE_CHEST)) //allows bullets to hit drivers + if (!enclosed && length(occupants) && !Proj.force_hit && (Proj.def_zone == BODY_ZONE_HEAD || Proj.def_zone == BODY_ZONE_CHEST)) //allows bullets to hit drivers occupants[1].bullet_act(Proj) // driver dinkage return BULLET_ACT_HIT . = ..()