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

Semiport of Allow_Spacemove from Bay. #9163

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion code/modules/clothing/spacesuits/rig/rig.dm
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@
return

if((istype(wearer.loc, /turf/space)) || (wearer.lastarea.has_gravity == 0))
if(!wearer.Process_Spacemove(0))
if(!wearer.Process_Spacemove(FALSE))
return 0

if(malfunctioning)
Expand Down
18 changes: 0 additions & 18 deletions code/modules/mob/living/carbon/human/human_movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -173,24 +173,6 @@
for(var/obj/item/rig_module/maneuvering_jets/module in rig.installed_modules)
return module.jets

/mob/living/carbon/human/Process_Spacemove(var/check_drift = 0)
//Can we act?
if(restrained()) return 0

if(..()) //Can move due to other reasons, don't use jetpack fuel
return 1

//Do we have a working jetpack?
var/obj/item/tank/jetpack/thrust = get_jetpack()

if(thrust)
if(((!check_drift) || (check_drift && thrust.stabilization_on)) && (!lying) && (thrust.do_thrust(0.01, src)))
inertia_dir = 0
return 1

return 0


/mob/living/carbon/human/Process_Spaceslipping(var/prob_slip = 5)
//If knocked out we might just hit it and stop. This makes it possible to get dead bodies and such.

Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/living_movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ default behaviour is:

/mob/living/proc/inertial_drift()
if(x > 1 && x < (world.maxx) && y > 1 && y < (world.maxy))
if(Process_Spacemove(1))
if(Process_Spacemove(TRUE))
inertia_dir = 0
return

Expand Down
18 changes: 1 addition & 17 deletions code/modules/mob/living/silicon/robot/robot_movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,7 @@
return module && module.no_slip

/mob/living/silicon/robot/Process_Spaceslipping(var/prob_slip)
var/obj/item/tank/jetpack/thrust = get_jetpack()
if(thrust?.can_thrust(0.01))
return 0
if(module && module.no_slip)
return 0
..(prob_slip)

/mob/living/silicon/robot/Process_Spacemove(var/check_drift = 0)
if(..())//Can move due to other reasons, don't use jetpack fuel
return 1

var/obj/item/tank/jetpack/thrust = get_jetpack()
if(thrust && (!check_drift || (check_drift && thrust.stabilization_on)) && thrust.do_thrust(0.01))
inertia_dir = 0
return 1

return 0
return ..(module?.no_slip ? 0 : prob_slip)

//No longer needed, but I'll leave it here incase we plan to re-use it.
/mob/living/silicon/robot/movement_delay()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,4 +430,4 @@
/obj/random/projectile/scrapped_grenadelauncher = 100,
/obj/item/grenade/spawnergrenade/manhacks/mercenary = 50,
/obj/item/grenade/spawnergrenade/manhacks/mercenary = 30
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@
..(null,"suddenly breaks apart.")
qdel(src)

/mob/living/simple_mob/mechanical/combat_drone/Allow_Spacemove(var/dense_object)
return TRUE

/mob/living/simple_mob/mechanical/combat_drone/Process_Spacemove(var/check_drift = 0)
return TRUE

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@
..(null,"suddenly breaks apart.")
qdel(src)

/mob/living/simple_mob/mechanical/mining_drone/Allow_Spacemove(var/dense_object, check_drift = 0)
return TRUE

/mob/living/simple_mob/mechanical/mining_drone/Process_Spacemove(var/check_drift = 0)
return TRUE

Expand Down Expand Up @@ -150,4 +153,4 @@


/decl/mob_organ_names/miningdrone
hit_zones = list("chassis", "comms array", "sensor suite", "left excavator module", "right excavator module", "maneuvering thruster")
hit_zones = list("chassis", "comms array", "sensor suite", "left excavator module", "right excavator module", "maneuvering thruster")
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@
ion_trail.start()
return ..()

/mob/living/simple_mob/mechanical/mecha/hoverpod/Allow_Spacemove(var/dense_object, check_drift = 0)
return TRUE

/mob/living/simple_mob/mechanical/mecha/hoverpod/Process_Spacemove(var/check_drift = 0)
return TRUE

/decl/mob_organ_names/hoverpod
hit_zones = list("central chassis", "control module", "hydraulics", "left manipulator", "right manipulator", "left landing strut", "right landing strut", "maneuvering thruster", "sensor suite", "radiator", "power supply")
hit_zones = list("central chassis", "control module", "hydraulics", "left manipulator", "right manipulator", "left landing strut", "right landing strut", "maneuvering thruster", "sensor suite", "radiator", "power supply")
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,11 @@
. += "<span class='warning'><B>It looks severely dented!</B></span>"

//Constructs levitate, can fall from a shuttle with no harm, and are piloted by either damned spirits or some otherworldly entity. Let 'em float in space.
/mob/living/simple_mob/construct/Process_Spacemove()
return 1
/mob/living/simple_mob/construct/Allow_Spacemove(var/dense_object)
return TRUE

/mob/living/simple_mob/construct/Process_Spacemove(var/check_drift = 0)
return TRUE

/*
// Glowing Procs
Expand All @@ -155,4 +158,4 @@

/mob/living/simple_mob/construct/proc/remove_glow()
overlays.Cut()
*/
*/
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@
max_n2 = 0
minbodytemp = 0

/mob/living/simple_mob/faithless/Allow_Spacemove(var/dense_object, check_drift = 0)
return TRUE

/mob/living/simple_mob/faithless/Process_Spacemove(var/check_drift = 0)
return 1
return TRUE

/mob/living/simple_mob/faithless/apply_melee_effects(var/atom/A)
if(isliving(A))
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/simple_mob/subtypes/slime/slime.dm
Original file line number Diff line number Diff line change
Expand Up @@ -238,4 +238,4 @@ var/global/list/_slime_default_emotes = list(
visible_message("<b>\The [src]</b> squishes!")

/decl/mob_organ_names/slime
hit_zones = list("cytoplasmic membrane")
hit_zones = list("cytoplasmic membrane")
39 changes: 28 additions & 11 deletions code/modules/mob/mob_movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@

// Can't control ourselves when drifting
if((isspace(loc) || my_mob.lastarea?.has_gravity == 0) && isturf(loc))
if(!my_mob.Process_Spacemove(0))
if(!my_mob.Process_Spacemove(FALSE))
return 0

// Inside an object, tell it we moved
Expand Down Expand Up @@ -395,33 +395,50 @@
/mob/proc/get_jetpack()
return

// Checks whether this mob is allowed to move in space
// Return 1 for movement, 0 for none,
/mob/proc/Allow_Spacemove(var/dense_object)
if(restrained())
return FALSE
var/obj/item/tank/jetpack/J = get_jetpack()
if(J?.can_thrust(0.01))
return TRUE
if(!dense_object) //Nothing to push off of so end here
return FALSE
return TRUE

///Process_Spacemove
///Called by /client/Move()
///For moving in space
///Return 1 for movement 0 for none
/mob/proc/Process_Spacemove(var/check_drift = 0)

if(is_incorporeal())
return

if(!Check_Dense_Object()) //Nothing to push off of so end here
update_floating(0)
return 0
return FALSE

update_floating(1)
var/dense_object = Check_Dense_Object()
if(!Allow_Spacemove())
update_floating(dense_object)
return FALSE

if(restrained()) //Check to see if we can do things
return 0
var/obj/item/tank/jetpack/thrust = get_jetpack()
if(dense_object || ((!check_drift || thrust?.stabilization_on) && !lying && thrust.do_thrust(0.01, src)))
inertia_dir = 0
return TRUE
else if(!dense_object) //Nothing to push off of so end here
update_floating(FALSE)
return FALSE

//Check to see if we slipped
if(prob(Process_Spaceslipping(5)) && !buckled)
to_chat(src, "<span class='notice'><B>You slipped!</B></span>")
inertia_dir = last_move
step(src, src.inertia_dir) // Not using Move for smooth glide here because this is a 'slip' so should be sudden.
return 0
return FALSE

//If not then we can reset inertia and move
inertia_dir = 0
return 1
return TRUE

/mob/proc/Check_Dense_Object() //checks for anything to push off in the vicinity. also handles magboots on gravity-less floors tiles

Expand Down