Skip to content

Commit

Permalink
refactor creating it's own file for souto mobile code instead of it b…
Browse files Browse the repository at this point in the history
…eing in vehicle.dm. (#5498)

# About the pull request
Also changed some comment to be to doc stuff standard while i was
modifying vehicle...
<!-- Remove this text and explain what the purpose of your PR is.

Mention if you have tested your changes. If you changed a map, make sure
you used the mapmerge tool.
If this is an Issue Correction, you can type "Fixes Issue #169420" to
link the PR to the corresponding Issue number #169420.

Remember: something that is self-evident to you might not be to others.
Explain your rationale fully, even if you feel it goes without saying.
-->

# Explain why it's good for the game
# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog
:cl:
refactor: creating it's own file for souto mobile code instead of it
being in vehicle.dm.
/:cl:

---------

Co-authored-by: Julien <[email protected]>
Co-authored-by: Birdtalon <[email protected]>
  • Loading branch information
3 people committed Jan 24, 2024
1 parent d2786b8 commit 698a9cd
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 49 deletions.
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 @@ -2355,6 +2355,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

0 comments on commit 698a9cd

Please sign in to comment.