mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 03:27:05 +01:00
-tg- SpaceMove update
This commit updates the spacemove system to -tg-'s; All objects now drift in space, not just mobs. A few hardcoded space checks have been replaced with has_gravity(); So it applies to zero-G as well as space. Spacepods no longer drift, because their snowflakey shitcode just doesn't work. So they just move.
This commit is contained in:
@@ -179,9 +179,6 @@
|
||||
/mob/living/carbon/alien/IsAdvancedToolUser()
|
||||
return has_fine_manipulation
|
||||
|
||||
/mob/living/carbon/alien/Process_Spaceslipping()
|
||||
return 0 // Don't slip in space.
|
||||
|
||||
/mob/living/carbon/alien/Stat()
|
||||
|
||||
statpanel("Status")
|
||||
|
||||
@@ -481,19 +481,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
|
||||
item.layer = initial(item.layer)
|
||||
src.visible_message("\red [src] has thrown [item].")
|
||||
|
||||
if(!src.lastarea)
|
||||
src.lastarea = get_area(src.loc)
|
||||
if((istype(src.loc, /turf/space)) || (src.lastarea.has_gravity == 0))
|
||||
src.inertia_dir = get_dir(target, src)
|
||||
step(src, inertia_dir)
|
||||
|
||||
|
||||
/*
|
||||
if(istype(src.loc, /turf/space) || (src.flags & NOGRAV)) //they're in space, move em one space in the opposite direction
|
||||
src.inertia_dir = get_dir(target, src)
|
||||
step(src, inertia_dir)
|
||||
*/
|
||||
|
||||
newtonian_move(get_dir(target, src))
|
||||
|
||||
item.throw_at(target, item.throw_range, item.throw_speed, src)
|
||||
/*
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
..(new_loc, "Stok")
|
||||
|
||||
/mob/living/carbon/human/Bump(atom/movable/AM as mob|obj, yes)
|
||||
if ((!( yes ) || now_pushing))
|
||||
if ((!( yes ) || now_pushing || buckled))
|
||||
return
|
||||
now_pushing = 1
|
||||
if (ismob(AM))
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
if(species.slowdown)
|
||||
tally = species.slowdown
|
||||
|
||||
if (istype(loc, /turf/space)) return -1 // It's hard to be slowed down in space by... anything
|
||||
if(!has_gravity(src))
|
||||
return -1 // It's hard to be slowed down in space by... anything
|
||||
|
||||
if(flying) return -1
|
||||
|
||||
@@ -62,44 +63,18 @@
|
||||
|
||||
return (tally+config.human_delay)
|
||||
|
||||
/mob/living/carbon/human/Process_Spacemove(var/check_drift = 0)
|
||||
//Can we act
|
||||
if(restrained()) return 0
|
||||
/mob/living/carbon/human/Process_Spacemove(movement_dir = 0)
|
||||
|
||||
//Are we flying?
|
||||
if(flying)
|
||||
inertia_dir = 0
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
//Do we have a working jetpack
|
||||
if(istype(back, /obj/item/weapon/tank/jetpack))
|
||||
if(istype(back, /obj/item/weapon/tank/jetpack) && isturf(loc)) //Second check is so you can't use a jetpack in a mech
|
||||
var/obj/item/weapon/tank/jetpack/J = back
|
||||
if(((!check_drift) || (check_drift && J.stabilization_on)) && (!lying) && (J.allow_thrust(0.01, src)))
|
||||
inertia_dir = 0
|
||||
if((movement_dir || J.stabilization_on) && J.allow_thrust(0.01, src))
|
||||
return 1
|
||||
//If no working jetpack or magboots then use the other checks
|
||||
if(..()) 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.
|
||||
if(stat)
|
||||
prob_slip = 0 // Changing this to zero to make it line up with the comment, and also, make more sense.
|
||||
|
||||
//Do we have magboots or such on if so no slip
|
||||
if(istype(shoes, /obj/item/clothing/shoes/magboots) && (shoes.flags & NOSLIP))
|
||||
prob_slip = 0
|
||||
|
||||
//Check hands and mod slip
|
||||
if(!l_hand) prob_slip -= 2
|
||||
else if(l_hand.w_class <= 2) prob_slip -= 1
|
||||
if (!r_hand) prob_slip -= 2
|
||||
else if(r_hand.w_class <= 2) prob_slip -= 1
|
||||
|
||||
prob_slip = round(prob_slip)
|
||||
return(prob_slip)
|
||||
|
||||
/mob/living/carbon/human/mob_has_gravity()
|
||||
. = ..()
|
||||
if(!.)
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
step(AM, t)
|
||||
now_pushing = null
|
||||
|
||||
/mob/living/carbon/slime/Process_Spacemove()
|
||||
/mob/living/carbon/slime/Process_Spacemove(var/movement_dir = 0)
|
||||
return 2
|
||||
|
||||
/mob/living/carbon/slime/Stat()
|
||||
|
||||
@@ -399,10 +399,10 @@
|
||||
|
||||
return
|
||||
|
||||
/mob/living/Move(a, b, flag)
|
||||
if (buckled && buckled.loc != a)
|
||||
/mob/living/Move(atom/newloc, direct)
|
||||
if (buckled && buckled.loc != newloc)
|
||||
if (!buckled.anchored)
|
||||
return buckled.Move(a, b)
|
||||
return buckled.Move(newloc, direct)
|
||||
else
|
||||
return 0
|
||||
|
||||
@@ -415,7 +415,7 @@
|
||||
for(var/mob/living/M in range(src, 1))
|
||||
if ((M.pulling == src && M.stat == 0 && !( M.restrained() )))
|
||||
t7 = null
|
||||
if ((t7 && (pulling && ((get_dist(src, pulling) <= 1 || pulling.loc == loc) && (client && client.moving)))))
|
||||
if(t7 && pulling && (get_dist(src, pulling) <= 1 || pulling.loc == loc))
|
||||
var/turf/T = loc
|
||||
. = ..()
|
||||
|
||||
@@ -463,17 +463,12 @@
|
||||
var/turf/location = M.loc
|
||||
if (istype(location, /turf/simulated))
|
||||
location.add_blood()
|
||||
|
||||
|
||||
step(pulling, get_dir(pulling.loc, T))
|
||||
M.start_pulling(t)
|
||||
pulling.Move(T, get_dir(pulling, T))
|
||||
if(M)
|
||||
M.start_pulling(t)
|
||||
else
|
||||
if (pulling)
|
||||
if (istype(pulling, /obj/structure/window/full))
|
||||
for(var/obj/structure/window/win in get_step(pulling,get_dir(pulling.loc, T)))
|
||||
stop_pulling()
|
||||
if (pulling)
|
||||
step(pulling, get_dir(pulling.loc, T))
|
||||
pulling.Move(T, get_dir(pulling, T))
|
||||
else
|
||||
stop_pulling()
|
||||
. = ..()
|
||||
|
||||
@@ -76,15 +76,15 @@
|
||||
|
||||
aiCamera = new/obj/item/device/camera/siliconcam/drone_camera(src)
|
||||
additional_law_channels["Drone"] = ":d"
|
||||
|
||||
|
||||
playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 0)
|
||||
|
||||
//Redefining some robot procs...
|
||||
/mob/living/silicon/robot/drone/SetName(pickedName as text)
|
||||
// Would prefer to call the grandparent proc but this isn't possible, so..
|
||||
real_name = pickedName
|
||||
name = real_name
|
||||
|
||||
name = real_name
|
||||
|
||||
//Redefining some robot procs...
|
||||
/mob/living/silicon/robot/drone/updatename()
|
||||
real_name = "maintenance drone ([rand(100,999)])"
|
||||
@@ -127,13 +127,13 @@
|
||||
if(!allowed(usr))
|
||||
user << "\red Access denied."
|
||||
return
|
||||
|
||||
|
||||
var/delta = (world.time / 10) - last_reboot
|
||||
if(reboot_cooldown > delta)
|
||||
var/cooldown_time = round(reboot_cooldown - ((world.time / 10) - last_reboot), 1)
|
||||
usr << "\red The reboot system is currently offline. Please wait another [cooldown_time] seconds."
|
||||
return
|
||||
|
||||
|
||||
user.visible_message("\red \the [user] swipes \his ID card through \the [src], attempting to reboot it.", "\red You swipe your ID card through \the [src], attempting to reboot it.")
|
||||
last_reboot = world.time / 10
|
||||
var/drones = 0
|
||||
@@ -225,10 +225,6 @@
|
||||
|
||||
..(gibbed)
|
||||
|
||||
//DRONE MOVEMENT.
|
||||
/mob/living/silicon/robot/drone/Process_Spaceslipping(var/prob_slip)
|
||||
//TODO: Consider making a magboot item for drones to equip. ~Z
|
||||
return 0
|
||||
|
||||
//CONSOLE PROCS
|
||||
/mob/living/silicon/robot/drone/proc/law_resync()
|
||||
@@ -338,4 +334,4 @@
|
||||
src.verbs |= silicon_subsystems
|
||||
|
||||
/mob/living/silicon/robot/drone/remove_robot_verbs()
|
||||
src.verbs -= silicon_subsystems
|
||||
src.verbs -= silicon_subsystems
|
||||
@@ -1,9 +1,4 @@
|
||||
/mob/living/silicon/robot/Process_Spaceslipping(var/prob_slip)
|
||||
if(module && (istype(module,/obj/item/weapon/robot_module/drone)))
|
||||
return 0
|
||||
..(prob_slip)
|
||||
|
||||
/mob/living/silicon/robot/Process_Spacemove()
|
||||
/mob/living/silicon/robot/Process_Spacemove(var/movement_dir = 0)
|
||||
if(module)
|
||||
for(var/obj/item/weapon/tank/jetpack/J in module.modules)
|
||||
if(J && istype(J, /obj/item/weapon/tank/jetpack))
|
||||
@@ -24,7 +19,7 @@
|
||||
|
||||
/mob/living/silicon/robot/Move()
|
||||
..()
|
||||
|
||||
|
||||
/mob/living/silicon/robot/mob_negates_gravity()
|
||||
return magpulse
|
||||
|
||||
|
||||
@@ -290,7 +290,7 @@
|
||||
attack_sound = 'sound/weapons/tap.ogg'
|
||||
construct_spells = list(/obj/effect/proc_holder/spell/targeted/smoke/disable)
|
||||
|
||||
/mob/living/simple_animal/construct/harvester/Process_Spacemove(var/check_drift = 0)
|
||||
/mob/living/simple_animal/construct/harvester/Process_Spacemove(var/movement_dir = 0)
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
@@ -30,8 +30,10 @@
|
||||
if(isturf(src.loc) && !resting && !buckled) //This is so it only moves if it's not inside a closet, gentics machine, etc.
|
||||
turns_since_move++
|
||||
if(turns_since_move >= turns_per_move)
|
||||
Move(get_step(src,pick(4,8)))
|
||||
turns_since_move = 0
|
||||
var/east_vs_west = pick(4, 8)
|
||||
if(Process_Spacemove(east_vs_west))
|
||||
Move(get_step(src, east_vs_west), east_vs_west)
|
||||
turns_since_move = 0
|
||||
regenerate_icons()
|
||||
|
||||
//COFFEE! SQUEEEEEEEEE!
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
target = M
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/hostile/bear/Process_Spacemove(var/check_drift = 0)
|
||||
/mob/living/simple_animal/hostile/bear/Process_Spacemove(var/movement_dir = 0)
|
||||
return 1 //No drifting in space for space bears!
|
||||
|
||||
/mob/living/simple_animal/hostile/bear/FindTarget()
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
faction = list("carp")
|
||||
flying = 1
|
||||
|
||||
/mob/living/simple_animal/hostile/carp/Process_Spacemove(var/check_drift = 0)
|
||||
/mob/living/simple_animal/hostile/carp/Process_Spacemove(var/movement_dir = 0)
|
||||
return 1 //No drifting in space for space carp! //original comments do not steal
|
||||
|
||||
/mob/living/simple_animal/hostile/carp/FindTarget()
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
faction = list("faithless")
|
||||
|
||||
/mob/living/simple_animal/hostile/faithless/Process_Spacemove(var/check_drift = 0)
|
||||
/mob/living/simple_animal/hostile/faithless/Process_Spacemove(var/movement_dir = 0)
|
||||
return 1
|
||||
|
||||
/mob/living/simple_animal/hostile/faithless/FindTarget()
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
corpse = /obj/effect/landmark/mobcorpse/syndicatecommando
|
||||
speed = 1
|
||||
|
||||
/mob/living/simple_animal/hostile/syndicate/melee/space/Process_Spacemove(var/check_drift = 0)
|
||||
/mob/living/simple_animal/hostile/syndicate/melee/space/Process_Spacemove(var/movement_dir = 0)
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/hostile/syndicate/ranged
|
||||
@@ -132,7 +132,7 @@
|
||||
corpse = /obj/effect/landmark/mobcorpse/syndicatecommando
|
||||
speed = 1
|
||||
|
||||
/mob/living/simple_animal/hostile/syndicate/ranged/space/Process_Spacemove(var/check_drift = 0)
|
||||
/mob/living/simple_animal/hostile/syndicate/ranged/space/Process_Spacemove(var/movement_dir = 0)
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -130,8 +130,10 @@
|
||||
turns_since_move++
|
||||
if(turns_since_move >= turns_per_move)
|
||||
if(!(stop_automated_movement_when_pulled && pulledby)) //Soma animals don't move when pulled
|
||||
Move(get_step(src,pick(cardinal)))
|
||||
turns_since_move = 0
|
||||
var/anydir = pick(cardinal)
|
||||
if(Process_Spacemove(anydir))
|
||||
Move(get_step(src,anydir), anydir)
|
||||
turns_since_move = 0
|
||||
|
||||
//Speaking
|
||||
if(!client && speak_chance && (ckey == null))
|
||||
|
||||
@@ -142,8 +142,6 @@
|
||||
|
||||
var/emote_cd = 0 // Used to supress emote spamming. 1 if on CD, 2 if disabled by admin (manually set), else 0
|
||||
|
||||
var/inertia_dir = 0
|
||||
|
||||
var/music_lastplayed = "null"
|
||||
|
||||
var/job = null//Living
|
||||
|
||||
@@ -127,41 +127,6 @@
|
||||
return
|
||||
|
||||
|
||||
/atom/movable/Move(NewLoc, direct)
|
||||
if (direct & (direct - 1))
|
||||
if (direct & 1)
|
||||
if (direct & 4)
|
||||
if (step(src, NORTH))
|
||||
step(src, EAST)
|
||||
else
|
||||
if (step(src, EAST))
|
||||
step(src, NORTH)
|
||||
else
|
||||
if (direct & 8)
|
||||
if (step(src, NORTH))
|
||||
step(src, WEST)
|
||||
else
|
||||
if (step(src, WEST))
|
||||
step(src, NORTH)
|
||||
else
|
||||
if (direct & 2)
|
||||
if (direct & 4)
|
||||
if (step(src, SOUTH))
|
||||
step(src, EAST)
|
||||
else
|
||||
if (step(src, EAST))
|
||||
step(src, SOUTH)
|
||||
else
|
||||
if (direct & 8)
|
||||
if (step(src, SOUTH))
|
||||
step(src, WEST)
|
||||
else
|
||||
if (step(src, WEST))
|
||||
step(src, SOUTH)
|
||||
else
|
||||
. = ..()
|
||||
return
|
||||
|
||||
|
||||
/client/proc/Move_object(direct)
|
||||
if(mob && mob.control_object)
|
||||
@@ -243,14 +208,13 @@
|
||||
if(!mob.lastarea)
|
||||
mob.lastarea = get_area(mob.loc)
|
||||
|
||||
if((istype(mob.loc, /turf/space)) || ((mob.lastarea.has_gravity == 0) && (!istype(mob.loc, /obj/spacepod)))) // spacepods shouldn't get affected by changes in gravity
|
||||
if(!mob.Process_Spacemove(0)) return 0
|
||||
|
||||
|
||||
if(isobj(mob.loc) || ismob(mob.loc))//Inside an object, tell it we moved
|
||||
var/atom/O = mob.loc
|
||||
return O.relaymove(mob, direct)
|
||||
|
||||
if(!mob.Process_Spacemove(direct))
|
||||
return 0
|
||||
|
||||
if(isturf(mob.loc))
|
||||
|
||||
if(mob.restrained())//Why being pulled while cuffed prevents you from moving
|
||||
@@ -319,7 +283,7 @@
|
||||
|
||||
else if(mob.confused)
|
||||
step(mob, pick(cardinal))
|
||||
mob.last_movement=world.time
|
||||
mob.last_movement = world.time
|
||||
else
|
||||
. = ..()
|
||||
mob.last_movement=world.time
|
||||
@@ -332,6 +296,8 @@
|
||||
G.adjust_position()
|
||||
|
||||
moving = 0
|
||||
if(mob && .)
|
||||
mob.throwing = 0
|
||||
|
||||
return .
|
||||
|
||||
@@ -434,62 +400,44 @@
|
||||
///Called by /client/Move()
|
||||
///For moving in space
|
||||
///Return 1 for movement 0 for none
|
||||
/mob/proc/Process_Spacemove(var/check_drift = 0)
|
||||
//First check to see if we can do things
|
||||
if(restrained())
|
||||
return 0
|
||||
/mob/Process_Spacemove(var/movement_dir = 0)
|
||||
|
||||
/*
|
||||
if(istype(src,/mob/living/carbon))
|
||||
if(src.l_hand && src.r_hand)
|
||||
return 0
|
||||
*/
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
var/dense_object = 0
|
||||
for(var/turf/turf in oview(1,src))
|
||||
if(istype(turf,/turf/space))
|
||||
var/atom/movable/dense_object_backup
|
||||
for(var/atom/A in orange(1, get_turf(src)))
|
||||
if(isarea(A))
|
||||
continue
|
||||
|
||||
if(!turf.density && !mob_negates_gravity())
|
||||
continue
|
||||
else if(isturf(A))
|
||||
var/turf/turf = A
|
||||
if(istype(turf,/turf/space))
|
||||
continue
|
||||
|
||||
if(!turf.density && !mob_negates_gravity())
|
||||
continue
|
||||
|
||||
return 1
|
||||
|
||||
else
|
||||
var/atom/movable/AM = A
|
||||
if(AM == buckled) //Kind of unnecessary but let's just be sure
|
||||
continue
|
||||
if(AM.density)
|
||||
if(AM.anchored)
|
||||
return 1
|
||||
if(pulling == AM)
|
||||
continue
|
||||
dense_object_backup = AM
|
||||
|
||||
if(movement_dir && dense_object_backup)
|
||||
if(dense_object_backup.newtonian_move(turn(movement_dir, 180))) //You're pushing off something movable, so it moves
|
||||
src << "<span class='info'>You push off of [dense_object_backup] to propel yourself.</span>"
|
||||
|
||||
|
||||
|
||||
/*
|
||||
if(istype(turf,/turf/simulated/floor) && (src.flags & NOGRAV))
|
||||
continue
|
||||
*/
|
||||
|
||||
|
||||
dense_object++
|
||||
break
|
||||
|
||||
if(!dense_object && (locate(/obj/structure/lattice) in oview(1, src)))
|
||||
dense_object++
|
||||
|
||||
//Lastly attempt to locate any dense objects we could push off of
|
||||
//TODO: If we implement objects drifing in space this needs to really push them
|
||||
//Due to a few issues only anchored and dense objects will now work.
|
||||
if(!dense_object)
|
||||
for(var/obj/O in oview(1, src))
|
||||
if((O) && (O.density) && (O.anchored))
|
||||
dense_object++
|
||||
break
|
||||
|
||||
//Nothing to push off of so end here
|
||||
if(!dense_object)
|
||||
return 0
|
||||
|
||||
//Check to see if we slipped
|
||||
if(prob(Process_Spaceslipping(5)))
|
||||
src << "\blue <B>You slipped!</B>"
|
||||
src.inertia_dir = src.last_move
|
||||
step(src, src.inertia_dir)
|
||||
return 0
|
||||
|
||||
//If not then we can reset inertia and move
|
||||
inertia_dir = 0
|
||||
return 1
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/proc/mob_has_gravity(turf/T)
|
||||
return has_gravity(src, T)
|
||||
@@ -497,14 +445,5 @@
|
||||
/mob/proc/mob_negates_gravity()
|
||||
return 0
|
||||
|
||||
/mob/proc/Process_Spaceslipping(var/prob_slip = 5)
|
||||
//Setup slipage
|
||||
//If knocked out we might just hit it and stop. This makes it possible to get dead bodies and such.
|
||||
if(stat)
|
||||
prob_slip = 0 // Changing this to zero to make it line up with the comment.
|
||||
|
||||
prob_slip = round(prob_slip)
|
||||
return(prob_slip)
|
||||
|
||||
/mob/proc/update_gravity()
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user