From d031d38f03b39d6b795e2ed236f04d0991d7cf3d Mon Sep 17 00:00:00 2001 From: PKPenguin321 Date: Tue, 7 Jun 2016 20:06:03 -0700 Subject: [PATCH 1/5] makes scooterborgs a feature --- code/modules/vehicles/scooter.dm | 53 ++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 13 deletions(-) diff --git a/code/modules/vehicles/scooter.dm b/code/modules/vehicles/scooter.dm index e894e3c1c4a..79e80282808 100644 --- a/code/modules/vehicles/scooter.dm +++ b/code/modules/vehicles/scooter.dm @@ -24,19 +24,45 @@ if(buckled_mobs.len) for(var/m in buckled_mobs) var/mob/living/buckled_mob = m - switch(buckled_mob.dir) - if(NORTH) - buckled_mob.pixel_x = 0 - buckled_mob.pixel_y = 4 - if(EAST) - buckled_mob.pixel_x = -2 - buckled_mob.pixel_y = 4 - if(SOUTH) - buckled_mob.pixel_x = 0 - buckled_mob.pixel_y = 4 - if(WEST) - buckled_mob.pixel_x = 2 - buckled_mob.pixel_y = 4 + if(iscarbon(buckled_mob)) + var/mob/living/carbon/buckled_carbon = buckled_mob + if(buckled_carbon.get_num_legs() < 2) + switch(buckled_carbon.dir) + if(NORTH) + buckled_carbon.pixel_x = 0 + buckled_carbon.pixel_y = -4 + if(EAST) + buckled_carbon.pixel_x = -2 + buckled_carbon.pixel_y = -4 + if(SOUTH) + buckled_carbon.pixel_x = 0 + buckled_carbon.pixel_y = -4 + if(WEST) + buckled_carbon.pixel_x = 2 + buckled_carbon.pixel_y = -4 + else + switch(buckled_mob.dir) + if(NORTH) + buckled_mob.pixel_x = 0 + buckled_mob.pixel_y = 4 + if(EAST) + buckled_mob.pixel_x = -2 + buckled_mob.pixel_y = 4 + if(SOUTH) + buckled_mob.pixel_x = 0 + buckled_mob.pixel_y = 4 + if(WEST) + buckled_mob.pixel_x = 2 + buckled_mob.pixel_y = 4 + +/obj/vehicle/scooter/post_buckle_mob(mob/living/M) + vehicle_move_delay = initial(vehicle_move_delay) + ..() + if(!iscarbon(M)) + return + var/mob/living/carbon/C = M + if(C.get_num_legs() < 2) + vehicle_move_delay = initial(vehicle_move_delay) + 1 /obj/vehicle/scooter/skateboard name = "skateboard" @@ -50,6 +76,7 @@ density = 1 else density = 0 + ..() /obj/vehicle/scooter/skateboard/Bump(atom/A) ..() From 7de7f6bbdb68dfcb7034d754345c325c81ac829b Mon Sep 17 00:00:00 2001 From: PKPenguin321 Date: Tue, 7 Jun 2016 21:30:28 -0700 Subject: [PATCH 2/5] tweaks --- code/modules/vehicles/scooter.dm | 40 +++++++++++++++----------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/code/modules/vehicles/scooter.dm b/code/modules/vehicles/scooter.dm index 79e80282808..9fce1acd3dd 100644 --- a/code/modules/vehicles/scooter.dm +++ b/code/modules/vehicles/scooter.dm @@ -24,22 +24,20 @@ if(buckled_mobs.len) for(var/m in buckled_mobs) var/mob/living/buckled_mob = m - if(iscarbon(buckled_mob)) - var/mob/living/carbon/buckled_carbon = buckled_mob - if(buckled_carbon.get_num_legs() < 2) - switch(buckled_carbon.dir) - if(NORTH) - buckled_carbon.pixel_x = 0 - buckled_carbon.pixel_y = -4 - if(EAST) - buckled_carbon.pixel_x = -2 - buckled_carbon.pixel_y = -4 - if(SOUTH) - buckled_carbon.pixel_x = 0 - buckled_carbon.pixel_y = -4 - if(WEST) - buckled_carbon.pixel_x = 2 - buckled_carbon.pixel_y = -4 + if(buckled_mobs.get_num_legs() <= 0) + switch(buckled_mobs.dir) + if(NORTH) + buckled_mobs.pixel_x = 0 + buckled_mobs.pixel_y = -4 + if(EAST) + buckled_mobs.pixel_x = -2 + buckled_mobs.pixel_y = -4 + if(SOUTH) + buckled_mobs.pixel_x = 0 + buckled_mobs.pixel_y = -4 + if(WEST) + buckled_mobs.pixel_x = 2 + buckled_mobs.pixel_y = -4 else switch(buckled_mob.dir) if(NORTH) @@ -58,11 +56,11 @@ /obj/vehicle/scooter/post_buckle_mob(mob/living/M) vehicle_move_delay = initial(vehicle_move_delay) ..() - if(!iscarbon(M)) - return - var/mob/living/carbon/C = M - if(C.get_num_legs() < 2) - vehicle_move_delay = initial(vehicle_move_delay) + 1 + if(M.get_num_legs() < 2) + vehicle_move_delay ++ + if(M.get_num_arms() <= 0) + unbuckle_mob(M) + M << "Your limbless body flops off \the [src]." /obj/vehicle/scooter/skateboard name = "skateboard" From 3c08c52cff4afc826f26615a9a6eace03097d5d8 Mon Sep 17 00:00:00 2001 From: PKPenguin321 Date: Tue, 7 Jun 2016 22:59:20 -0700 Subject: [PATCH 3/5] fixes broken var Buckled mobs -> buckled mob --- code/modules/vehicles/scooter.dm | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/code/modules/vehicles/scooter.dm b/code/modules/vehicles/scooter.dm index 9fce1acd3dd..7236ad3044d 100644 --- a/code/modules/vehicles/scooter.dm +++ b/code/modules/vehicles/scooter.dm @@ -24,20 +24,20 @@ if(buckled_mobs.len) for(var/m in buckled_mobs) var/mob/living/buckled_mob = m - if(buckled_mobs.get_num_legs() <= 0) - switch(buckled_mobs.dir) + if(buckled_mob.get_num_legs() <= 0) + switch(buckled_mob.dir) if(NORTH) - buckled_mobs.pixel_x = 0 - buckled_mobs.pixel_y = -4 + buckled_mob.pixel_x = 0 + buckled_mob.pixel_y = -4 if(EAST) - buckled_mobs.pixel_x = -2 - buckled_mobs.pixel_y = -4 + buckled_mob.pixel_x = -2 + buckled_mob.pixel_y = -4 if(SOUTH) - buckled_mobs.pixel_x = 0 - buckled_mobs.pixel_y = -4 + buckled_mob.pixel_x = 0 + buckled_mob.pixel_y = -4 if(WEST) - buckled_mobs.pixel_x = 2 - buckled_mobs.pixel_y = -4 + buckled_mob.pixel_x = 2 + buckled_mob.pixel_y = -4 else switch(buckled_mob.dir) if(NORTH) @@ -136,4 +136,4 @@ user << "You add the rods to [src], creating handlebars." C.use(2) new/obj/vehicle/scooter(get_turf(src)) - qdel(src) \ No newline at end of file + qdel(src) From ceb1780c2f95bc577ca17a2b360227860fc299e6 Mon Sep 17 00:00:00 2001 From: PKPenguin321 Date: Wed, 8 Jun 2016 15:25:43 -0700 Subject: [PATCH 4/5] fixes duplicate message, more tweaks --- code/modules/vehicles/scooter.dm | 33 ++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/code/modules/vehicles/scooter.dm b/code/modules/vehicles/scooter.dm index 9fce1acd3dd..8c8b15b3267 100644 --- a/code/modules/vehicles/scooter.dm +++ b/code/modules/vehicles/scooter.dm @@ -24,22 +24,8 @@ if(buckled_mobs.len) for(var/m in buckled_mobs) var/mob/living/buckled_mob = m - if(buckled_mobs.get_num_legs() <= 0) + if(buckled_mobs.get_num_legs() > 0) switch(buckled_mobs.dir) - if(NORTH) - buckled_mobs.pixel_x = 0 - buckled_mobs.pixel_y = -4 - if(EAST) - buckled_mobs.pixel_x = -2 - buckled_mobs.pixel_y = -4 - if(SOUTH) - buckled_mobs.pixel_x = 0 - buckled_mobs.pixel_y = -4 - if(WEST) - buckled_mobs.pixel_x = 2 - buckled_mobs.pixel_y = -4 - else - switch(buckled_mob.dir) if(NORTH) buckled_mob.pixel_x = 0 buckled_mob.pixel_y = 4 @@ -52,6 +38,20 @@ if(WEST) buckled_mob.pixel_x = 2 buckled_mob.pixel_y = 4 + else + switch(buckled_mob.dir) + if(NORTH) + buckled_mobs.pixel_x = 0 + buckled_mobs.pixel_y = -4 + if(EAST) + buckled_mobs.pixel_x = -2 + buckled_mobs.pixel_y = -4 + if(SOUTH) + buckled_mobs.pixel_x = 0 + buckled_mobs.pixel_y = -4 + if(WEST) + buckled_mobs.pixel_x = 2 + buckled_mobs.pixel_y = -4 /obj/vehicle/scooter/post_buckle_mob(mob/living/M) vehicle_move_delay = initial(vehicle_move_delay) @@ -59,8 +59,9 @@ if(M.get_num_legs() < 2) vehicle_move_delay ++ if(M.get_num_arms() <= 0) + if(buckled_mobs.len)//to prevent the message displaying twice due to unbuckling + M << "Your limbless body flops off \the [src]." unbuckle_mob(M) - M << "Your limbless body flops off \the [src]." /obj/vehicle/scooter/skateboard name = "skateboard" From beccfc08a6948a473173f6a123e1334b10abc868 Mon Sep 17 00:00:00 2001 From: PKPenguin321 Date: Wed, 8 Jun 2016 19:21:47 -0700 Subject: [PATCH 5/5] makes it work --- code/modules/vehicles/scooter.dm | 39 ++++++++++---------------------- 1 file changed, 12 insertions(+), 27 deletions(-) diff --git a/code/modules/vehicles/scooter.dm b/code/modules/vehicles/scooter.dm index 3a39fcaf561..e5905ef5e14 100644 --- a/code/modules/vehicles/scooter.dm +++ b/code/modules/vehicles/scooter.dm @@ -24,34 +24,19 @@ if(buckled_mobs.len) for(var/m in buckled_mobs) var/mob/living/buckled_mob = m - if(buckled_mobs.get_num_legs() > 0) - switch(buckled_mob.dir) - if(NORTH) - buckled_mob.pixel_x = 0 - buckled_mob.pixel_y = 4 - if(EAST) - buckled_mob.pixel_x = -2 - buckled_mob.pixel_y = 4 - if(SOUTH) - buckled_mob.pixel_x = 0 - buckled_mob.pixel_y = 4 - if(WEST) - buckled_mob.pixel_x = 2 - buckled_mob.pixel_y = 4 + switch(buckled_mob.dir) + if(NORTH) + buckled_mob.pixel_x = 0 + if(EAST) + buckled_mob.pixel_x = -2 + if(SOUTH) + buckled_mob.pixel_x = 0 + if(WEST) + buckled_mob.pixel_x = 2 + if(buckled_mob.get_num_legs() > 0) + buckled_mob.pixel_y = 4 else - switch(buckled_mob.dir) - if(NORTH) - buckled_mobs.pixel_x = 0 - buckled_mobs.pixel_y = -4 - if(EAST) - buckled_mobs.pixel_x = -2 - buckled_mobs.pixel_y = -4 - if(SOUTH) - buckled_mobs.pixel_x = 0 - buckled_mobs.pixel_y = -4 - if(WEST) - buckled_mobs.pixel_x = 2 - buckled_mobs.pixel_y = -4 + buckled_mob.pixel_y = -4 /obj/vehicle/scooter/post_buckle_mob(mob/living/M) vehicle_move_delay = initial(vehicle_move_delay)