Skip to content

Commit

Permalink
Semiport of Allow_SpaceMove from Bay/Neb.
Browse files Browse the repository at this point in the history
  • Loading branch information
MistakeNot4892 committed Jul 19, 2023
1 parent 9a8d1bd commit 9283169
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 51 deletions.
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
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, check_drift = 0)
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, check_drift = 0)
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")
34 changes: 26 additions & 8 deletions code/modules/mob/mob_movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,21 @@
/mob/proc/get_jetpack()
return

// Checks whether this mob is allowed to move in space
// Return 1 for movement, 0 for none,
// check_drift indicates this is an inertial move and can ignore other requirements.
/mob/proc/Allow_Spacemove(var/dense_object, check_drift = 0)
if(check_drift)
return TRUE
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
Expand All @@ -404,24 +419,27 @@
if(is_incorporeal())
return

if(!Check_Dense_Object()) //Nothing to push off of so end here
update_floating(0)
return 0
var/dense_object = Check_Dense_Object()
if(!Allow_Spacemove(dense_object, check_drift))
update_floating(dense_object)
return FALSE

update_floating(1)
update_floating(TRUE)

if(restrained()) //Check to see if we can do things
return 0
var/obj/item/tank/jetpack/thrust = get_jetpack()
if((!check_drift || (thrust && (check_drift && thrust.stabilization_on)) && !lying && thrust.do_thrust(0.01, src)))
inertia_dir = 0
return TRUE

//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

0 comments on commit 9283169

Please sign in to comment.