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

refactor creating it's own file for souto mobile code instead of it being in vehicle.dm. #5498

Merged
merged 4 commits into from
Jan 24, 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
43 changes: 43 additions & 0 deletions code/modules/vehicles/souto_mobile.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/obj/vehicle/souto
name = "\improper Soutomobile"
icon_state = "soutomobile"
desc = "Almost, but not quite, the best ride in the universe."
move_delay = 3 //The speed of a fed but shoeless pajamarine, or a bit slower than a heavy-armor marine.
buckling_y = 4
layer = ABOVE_LYING_MOB_LAYER //Allows it to drive over people, but is below the driver.

/obj/vehicle/souto/Initialize()
. = ..()
var/image/I = new(icon = 'icons/obj/vehicles/vehicles.dmi', icon_state = "soutomobile_overlay", layer = ABOVE_MOB_LAYER) //over mobs
overlays += I

/obj/vehicle/souto/manual_unbuckle(mob/user)
if(buckled_mob && buckled_mob != user)
if(do_after(user, 20, INTERRUPT_ALL, BUSY_ICON_GENERIC))
..()
else ..()

/obj/vehicle/souto/relaymove(mob/user, direction)
if(user.is_mob_incapacitated()) return
if(world.time > l_move_time + move_delay)
. = step(src, direction)

/obj/vehicle/souto/super
desc = "The best ride in the universe, for the one-and-only Souto Man!"
health = 1000
locked = FALSE
unacidable = TRUE
indestructible = TRUE

/obj/vehicle/souto/super/explode()
for(var/mob/M as anything in viewers(7, src))
M.show_message("Somehow, [src] still looks as bright and shiny as a new can of Souto Classic.", SHOW_MESSAGE_VISIBLE)
health = initial(health) //Souto Man never dies, and neither does his bike.

/obj/vehicle/souto/super/buckle_mob(mob/M, mob/user)
if(!locked) //Vehicle is unlocked until first being mounted, since the Soutomobile is faction-locked and otherwise Souto Man cannot automatically buckle in on spawn as his equipment is spawned before his ID.
locked = TRUE
else if(M == user && M.faction != FACTION_SOUTO && locked == TRUE) //Are you a cool enough dude to drive this bike? Nah, nobody's THAT cool.
to_chat(user, SPAN_WARNING("Somehow, as you take hold of the handlebars, [src] manages to glare at you. You back off. We didn't sign up for haunted motorbikes, man."))
return
..()
57 changes: 8 additions & 49 deletions code/modules/vehicles/vehicle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,19 @@
var/maxhealth = 100
var/fire_dam_coeff = 1
var/brute_dam_coeff = 1
var/open = 0 //Maint panel
///Maint panel
var/open = 0
var/locked = TRUE
var/stat = 0
var/powered = 0 //set if vehicle is powered and should use fuel when moving
var/move_delay = 1 //set this to limit the speed of the vehicle
///set if vehicle is powered and should use fuel when moving
var/powered = 0
///set this to limit the speed of the vehicle
var/move_delay = 1
var/buckling_y = 0

var/obj/item/cell/cell
var/charge_use = 5 //set this to adjust the amount of power the vehicle uses per move
///set this to adjust the amount of power the vehicle uses per move
var/charge_use = 5
can_block_movement = TRUE

//-------------------------------------------
Expand Down Expand Up @@ -267,48 +271,3 @@
//-------------------------------------------------------
/obj/vehicle/proc/update_stats()
return

/obj/vehicle/souto
name = "\improper Soutomobile"
icon_state = "soutomobile"
desc = "Almost, but not quite, the best ride in the universe."
move_delay = 3 //The speed of a fed but shoeless pajamarine, or a bit slower than a heavy-armor marine.
buckling_y = 4
layer = ABOVE_LYING_MOB_LAYER //Allows it to drive over people, but is below the driver.

/obj/vehicle/souto/Initialize()
. = ..()
var/image/I = new(icon = 'icons/obj/vehicles/vehicles.dmi', icon_state = "soutomobile_overlay", layer = ABOVE_MOB_LAYER) //over mobs
overlays += I

/obj/vehicle/souto/manual_unbuckle(mob/user)
if(buckled_mob && buckled_mob != user)
if(do_after(user, 20, INTERRUPT_ALL, BUSY_ICON_GENERIC))
..()
else ..()

/obj/vehicle/souto/relaymove(mob/user, direction)
if(user.is_mob_incapacitated()) return
if(world.time > l_move_time + move_delay)
. = step(src, direction)


/obj/vehicle/souto/super
desc = "The best ride in the universe, for the one-and-only Souto Man!"
health = 1000
locked = FALSE
unacidable = TRUE
indestructible = TRUE

/obj/vehicle/souto/super/explode()
for(var/mob/M as anything in viewers(7, src))
M.show_message("Somehow, [src] still looks as bright and shiny as a new can of Souto Classic.", SHOW_MESSAGE_VISIBLE)
health = initial(health) //Souto Man never dies, and neither does his bike.

/obj/vehicle/souto/super/buckle_mob(mob/M, mob/user)
if(!locked) //Vehicle is unlocked until first being mounted, since the Soutomobile is faction-locked and otherwise Souto Man cannot automatically buckle in on spawn as his equipment is spawned before his ID.
locked = TRUE
else if(M == user && M.faction != FACTION_SOUTO && locked == TRUE) //Are you a cool enough dude to drive this bike? Nah, nobody's THAT cool.
to_chat(user, SPAN_WARNING("Somehow, as you take hold of the handlebars, [src] manages to glare at you. You back off. We didn't sign up for haunted motorbikes, man."))
return
..()
1 change: 1 addition & 0 deletions colonialmarines.dme
Original file line number Diff line number Diff line change
Expand Up @@ -2393,6 +2393,7 @@
#include "code\modules\unit_tests\_unit_tests.dm"
#include "code\modules\vehicles\cargo_train.dm"
#include "code\modules\vehicles\powerloader.dm"
#include "code\modules\vehicles\souto_mobile.dm"
#include "code\modules\vehicles\train.dm"
#include "code\modules\vehicles\vehicle.dm"
#include "code\modules\vehicles\vehicle_misc_objects.dm"
Expand Down