diff --git a/code/game/jobs/jobs.dm b/code/game/jobs/jobs.dm index 57a8dd5528e..fac6eeac191 100644 --- a/code/game/jobs/jobs.dm +++ b/code/game/jobs/jobs.dm @@ -1,4 +1,5 @@ var/list/occupations = list( + "Assistant" = -1, "Captain" = 1, //civilian @@ -50,9 +51,7 @@ var/list/occupations = list( //silicon "AI" = 1, - "Cyborg" = 1, - - "Assistant" = -1 + "Cyborg" = 1 ) diff --git a/code/game/turf.dm b/code/game/turf.dm index 83af99735ab..9c025a9dc33 100644 --- a/code/game/turf.dm +++ b/code/game/turf.dm @@ -74,12 +74,12 @@ /turf/Entered(atom/movable/M as mob|obj) - if((ismob(M)) && (M.flags & NOGRAV)) - AntiGrav(M) - return - if(ismob(M) && !istype(src, /turf/space)) - var/mob/tmob = M - tmob.inertia_dir = 0 + if(ismob(M)) + if(M.flags & NOGRAV) + inertial_drift(M) + return + if(!istype(src, /turf/space)) + M:inertia_dir = 0 ..() for(var/atom/A as mob|obj|turf|area in src) spawn( 0 ) @@ -93,39 +93,18 @@ return return -/turf/proc/AntiGrav(atom/movable/A as mob|obj)//Could be better right now I just want to get it done +/turf/proc/inertial_drift(atom/movable/A as mob|obj) if (!(A.last_move)) return if ((istype(A, /mob/) && src.x > 2 && src.x < (world.maxx - 1) && src.y > 2 && src.y < (world.maxy-1))) var/mob/M = A - var/spacemove = M.Process_Spacemove(0) - if(spacemove) - var/prob_slip = 5 - if(M.stat) prob_slip = 50 - if(istype(M, /mob/living/carbon/human)) - var/mob/living/carbon/human/H = M - if((istype(H.shoes, /obj/item/clothing/shoes/magboots) && H.shoes.flags&NOSLIP) || (spacemove == 2)) - prob_slip = 0 - if(!M.l_hand) prob_slip -= 2 - else if(M.l_hand.w_class <= 2) prob_slip -= 1 - if (!M.r_hand) prob_slip -= 2 - else if(M.r_hand.w_class <= 2) prob_slip -= 1 - prob_slip = round(prob_slip) - - if(prob(prob_slip)) - M << "\blue You slipped!" - M.inertia_dir = M.last_move - step(M, M.inertia_dir) - return - else - M.inertia_dir = 0 //no inertia - else - spawn(5) - if((A && !( A.anchored ) && A.loc == src)) - if(M.inertia_dir) //they keep moving the same direction - step(M, M.inertia_dir) - else - M.inertia_dir = M.last_move - step(M, M.inertia_dir) //TODO: DEFERRED + if(M.Process_Spacemove()) return + spawn(5) + if((M && !(M.anchored) && (M.loc == src))) + if(M.inertia_dir) + step(M, M.inertia_dir) + else + M.inertia_dir = M.last_move + step(M, M.inertia_dir) return /turf/proc/levelupdate() @@ -1199,39 +1178,7 @@ turf/simulated/floor/return_siding_icon_state() ..() if ((!(A) || src != A.loc || istype(null, /obj/beam))) return - if (!(A.last_move)) return - - if ((istype(A, /mob/) && src.x > 2 && src.x < (world.maxx - 1) && src.y > 2 && src.y < (world.maxy-1))) - var/mob/M = A - var/spacemove = M.Process_Spacemove(0) - if(spacemove) - var/prob_slip = 5 - if(M.stat) prob_slip = 50 - if(istype(M, /mob/living/carbon/human)) - var/mob/living/carbon/human/H = M - if((istype(H.shoes, /obj/item/clothing/shoes/magboots) && H.shoes.flags&NOSLIP) || (spacemove == 2)) - prob_slip = 0 - if(!M.l_hand) prob_slip -= 2 - else if(M.l_hand.w_class <= 2) prob_slip -= 1 - if (!M.r_hand) prob_slip -= 2 - else if(M.r_hand.w_class <= 2) prob_slip -= 1 - prob_slip = round(prob_slip) - - if(prob(prob_slip)) - M << "\blue You slipped!" - M.inertia_dir = M.last_move - step(M, M.inertia_dir) - return - else - M.inertia_dir = 0 //no inertia - else - spawn(5) - if((A && !( A.anchored ) && A.loc == src)) - if(M.inertia_dir) //they keep moving the same direction - step(M, M.inertia_dir) - else - M.inertia_dir = M.last_move - step(M, M.inertia_dir) //TODO: DEFERRED + inertial_drift(A) if(ticker && ticker.mode) if(ticker.mode.name == "nuclear emergency") return diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 9eeb5acde76..7d2f30d4ebd 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -17,6 +17,8 @@ corpse = body verbs += /mob/dead/observer/proc/reenter_corpse +/mob/dead/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) + return 1 /* Transfer_mind is there to check if mob is being deleted/not going to have a body. Works together with spawning an observer, noted above. diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 02d7819a1ec..467ec7e82c2 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -2710,14 +2710,3 @@ It can still be worn/put on as normal. /mob/living/carbon/human/IsAdvancedToolUser() return 1//Humans can use guns and such - -/mob/living/carbon/human/Process_Spacemove() - if(..()) return 1 - if(restrained()) return 0 - if(istype(back, /obj/item/weapon/tank/jetpack)) - var/obj/item/weapon/tank/jetpack/J = back - if(J.allow_thrust(0.01, src)) - inertia_dir = 0 - return 2 - return 0 - diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm new file mode 100644 index 00000000000..0e90cdb7130 --- /dev/null +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -0,0 +1,32 @@ + +/mob/living/carbon/human/Process_Spacemove() + //Can we act + if(restrained()) return 0 + + //Do we have a working jetpack + if(istype(back, /obj/item/weapon/tank/jetpack)) + var/obj/item/weapon/tank/jetpack/J = back + if(J.allow_thrust(0.01, src)) + inertia_dir = 0 + return 1 + + //If no working jetpack 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 += 50 + + //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) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 1cd0b8f57ba..494218604b6 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -943,16 +943,3 @@ Frequency: /mob/living/silicon/robot/proc/self_destruct() gib(1) - -/mob/living/silicon/robot/Process_Spacemove() - if(..()) return 1 - if(!module) return 0 - for(var/obj/item/weapon/tank/jetpack/J in module.modules) - if(J && istype(J, /obj/item/weapon/tank/jetpack)) - if(J.allow_thrust(0.01)) - inertia_dir = 0 - return 1 - return 0 - -///mob/living/silicon/robot/proc/eyecheck() -// return \ No newline at end of file diff --git a/code/modules/mob/living/silicon/robot/robot_movement.dm b/code/modules/mob/living/silicon/robot/robot_movement.dm new file mode 100644 index 00000000000..f0a907d05da --- /dev/null +++ b/code/modules/mob/living/silicon/robot/robot_movement.dm @@ -0,0 +1,7 @@ +/mob/living/silicon/robot/Process_Spacemove() + if(module) + for(var/obj/item/weapon/tank/jetpack/J in module.modules) + if(J && istype(J, /obj/item/weapon/tank/jetpack)) + if(J.allow_thrust(0.01)) return 1 + if(..()) return 1 + return 0 diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 1c02722d867..ab5841c1114 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1594,20 +1594,6 @@ It's fairly easy to fix if dealing with single letters but not so much with comp if(src:cameraFollow) src:cameraFollow = null -/mob/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) - if(air_group || (height==0)) return 1 - - if(ismob(mover)) - var/mob/moving_mob = mover - if ((other_mobs && moving_mob.other_mobs)) - return 1 - return (!mover.density || !density || lying) - else - return (!mover.density || !density || lying) - return - -/mob/dead/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) - return 1 /mob/Topic(href, href_list) if(href_list["mach_close"]) @@ -1651,14 +1637,12 @@ It's fairly easy to fix if dealing with single letters but not so much with comp /mob/proc/get_damage() return health - /mob/proc/UpdateLuminosity() if(src.total_luminosity == src.last_luminosity) return 0//nothing to do here src.last_luminosity = src.total_luminosity sd_SetLuminosity(min(src.total_luminosity,7))//Current hardcode max at 7, should likely be a const somewhere else return 1 - /mob/MouseDrop(mob/M as mob) ..() if(M != usr) return @@ -1668,43 +1652,6 @@ It's fairly easy to fix if dealing with single letters but not so much with comp if(LinkBlocked(usr.loc,loc)) return show_inv(usr) - - -/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 - /atom/movable/verb/pull() set name = "Pull" set category = "IC" @@ -1735,254 +1682,6 @@ It's fairly easy to fix if dealing with single letters but not so much with comp //usr << "[name]: Dn:[density] dir:[dir] cont:[contents] icon:[icon] is:[icon_state] loc:[loc]" return -/client/North() - ..() - -/client/South() - ..() - -/client/West() - ..() - -/client/East() - ..() - -/client/Northeast() - if(istype(mob, /mob/living/carbon)) - mob:swap_hand() - return - -/client/Southeast() - var/obj/item/weapon/W = mob.equipped() - if (W) - W.attack_self(mob) - return - -/client/Southwest() - if(!istype(mob, /mob/living/carbon)) return - if((mob.stat || mob.restrained()) || !(isturf(mob.loc))) return - mob:toggle_throw_mode() - return - -/client/Northwest() - if(!isrobot(mob)) - mob.drop_item_v() - return - -/client/Center() - if (isobj(mob.loc)) - var/obj/O = mob.loc - if (mob.canmove) - return O.relaymove(mob, 16) - return - - -/client/proc/Move_object(direct) - if(mob.control_object.density) - step(mob.control_object,direct) - mob.control_object.dir = direct - else - mob.control_object.loc = get_step(mob.control_object,direct) - return - -/client/Move(n, direct) - if(mob.control_object) Move_object(direct) - - if(isobserver(mob)) return mob.Move(n,direct) - - if(moving) return 0 - - if(world.time < move_delay) return - - if(!mob) return - - if(mob.stat==2) return - - if(isAI(mob)) return AIMove(n,direct,mob) - - if(mob.monkeyizing) return//This is sota the goto stop mobs from moving var - - if(mob.incorporeal_move)//Move though walls - Process_Incorpmove(direct) - return - - if(Process_Grab()) return - if(!mob.canmove) return - - - if(istype(mob.loc, /turf/space)) - if(!mob.Process_Spacemove(1)) return 0 - else if(mob.flags & NOGRAV) - 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(isturf(mob.loc)) - - if(mob.restrained())//Why being pulled while cuffed prevents you from moving - for(var/mob/M in range(mob, 1)) - if(((M.pulling == mob && (!( M.restrained() ) && M.stat == 0)) || locate(/obj/item/weapon/grab, mob.grabbed_by.len))) - src << "\blue You're restrained! You can't move!" - return 0 - - move_delay = world.time//set move delay - switch(mob.m_intent) - if("run") - if(mob.drowsyness > 0) - move_delay += 6 - if(mob.organStructure && mob.organStructure.legs) - move_delay += mob.organStructure.legs.moveRunDelay - else - move_delay += 1 - if("walk") - if(mob.organStructure && mob.organStructure.legs) - move_delay += mob.organStructure.legs.moveWalkDelay - else - move_delay += 7 - move_delay += mob.movement_delay() - - //We are now going to move - moving = 1 - //Something with pulling things - if(locate(/obj/item/weapon/grab, mob)) - move_delay = max(move_delay, world.time + 7) - var/list/L = mob.ret_grab() - if(istype(L, /list)) - if(L.len == 2) - L -= mob - var/mob/M = L[1] - if ((get_dist(mob, M) <= 1 || M.loc == mob.loc)) - var/turf/T = mob.loc - . = ..() - if (isturf(M.loc)) - var/diag = get_dir(mob, M) - if ((diag - 1) & diag) - else - diag = null - if ((get_dist(mob, M) > 1 || diag)) - step(M, get_dir(M.loc, T)) - else - for(var/mob/M in L) - M.other_mobs = 1 - if(mob != M) - M.animate_movement = 3 - for(var/mob/M in L) - spawn( 0 ) - step(M, direct) - return - spawn( 1 ) - M.other_mobs = null - M.animate_movement = 2 - return - - else - if(mob.confused) - step(mob, pick(cardinal)) - else - . = ..() - for(var/obj/speech_bubble/S in range(1, mob)) - if(S.parent == mob) - S.loc = mob.loc - moving = 0 - return . - - return - -//Called by Move() -/client/proc/Process_Grab() - if(locate(/obj/item/weapon/grab, locate(/obj/item/weapon/grab, mob.grabbed_by.len))) - var/list/grabbing = list() - if(istype(mob.l_hand, /obj/item/weapon/grab)) - var/obj/item/weapon/grab/G = mob.l_hand - grabbing += G.affecting - if(istype(mob.r_hand, /obj/item/weapon/grab)) - var/obj/item/weapon/grab/G = mob.r_hand - grabbing += G.affecting - for(var/obj/item/weapon/grab/G in mob.grabbed_by) - if((G.state == 1)&&(!grabbing.Find(G.assailant))) del(G) - if(G.state == 2) - move_delay = world.time + 10 - if(!prob(25)) return 1 - mob.visible_message("\red [mob] has broken free of [G.assailant]'s grip!") - del(G) - if(G.state == 3) - move_delay = world.time + 10 - if(!prob(5)) return 1 - mob.visible_message("\red [mob] has broken free of [G.assailant]'s headlock!") - del(G) - return 0 - -/client/proc/Process_Incorpmove(direct) - var/turf/mobloc = get_turf(mob) - switch(mob.incorporeal_move) - if(1) - mob.loc = get_step(mob, direct) - mob.dir = direct - if(2) - if(prob(50)) - var/locx - var/locy - switch(direct) - if(NORTH) - locx = mobloc.x - locy = (mobloc.y+2) - if(locy>world.maxy) - return - if(SOUTH) - locx = mobloc.x - locy = (mobloc.y-2) - if(locy<1) - return - if(EAST) - locy = mobloc.y - locx = (mobloc.x+2) - if(locx>world.maxx) - return - if(WEST) - locy = mobloc.y - locx = (mobloc.x-2) - if(locx<1) - return - else - return - mob.loc = locate(locx,locy,mobloc.z) - spawn(0) - var/limit = 2//For only two trailing shadows. - for(var/turf/T in getline(mobloc, mob.loc)) - spawn(0) - anim(T,mob,'mob.dmi',,"shadow",,mob.dir) - limit-- - if(limit<=0) break - else - spawn(0) - anim(mobloc,mob,'mob.dmi',,"shadow",,mob.dir) - mob.loc = get_step(mob, direct) - mob.dir = direct - return 1 - -//For moving in space -//Called by /client/Move -//Return 1 for movement 0 for none -/mob/proc/Process_Spacemove(var/gravity = 1) - if(restrained()) return 0 - -// if(locate(/obj/grille) in oview(1, mob)) - if(((locate(/turf/simulated) in oview(1, src)) && gravity) || (locate(/turf/simulated/wall) in oview(1, src))) - inertia_dir = 0 - return 1 - - if(locate(/obj/lattice) in oview(1, src)) - inertia_dir = 0 - return 1 - for(var/obj/O in oview(1, src)) - if((O) && (O.density)) - inertia_dir = 0 - return 1 - return 0 - - /client/New() if(findtextEx(key, "Telnet @")) src << "Sorry, this game does not support Telnet." diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm new file mode 100644 index 00000000000..43526d41a29 --- /dev/null +++ b/code/modules/mob/mob_movement.dm @@ -0,0 +1,331 @@ +/mob/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) + if(air_group || (height==0)) return 1 + + if(ismob(mover)) + var/mob/moving_mob = mover + if ((other_mobs && moving_mob.other_mobs)) + return 1 + return (!mover.density || !density || lying) + else + return (!mover.density || !density || lying) + return + + +/client/North() + ..() + +/client/South() + ..() + +/client/West() + ..() + +/client/East() + ..() + +/client/Northeast() + if(istype(mob, /mob/living/carbon)) + mob:swap_hand() + return + +/client/Southeast() + var/obj/item/weapon/W = mob.equipped() + if (W) + W.attack_self(mob) + return + +/client/Southwest() + if(!istype(mob, /mob/living/carbon)) return + if((mob.stat || mob.restrained()) || !(isturf(mob.loc))) return + mob:toggle_throw_mode() + return + +/client/Northwest() + if(!isrobot(mob)) + mob.drop_item_v() + return + +/client/Center() + if (isobj(mob.loc)) + var/obj/O = mob.loc + if (mob.canmove) + return O.relaymove(mob, 16) + 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.control_object.density) + step(mob.control_object,direct) + mob.control_object.dir = direct + else + mob.control_object.loc = get_step(mob.control_object,direct) + return + +/client/Move(n, direct) + if(mob.control_object) Move_object(direct) + + if(isobserver(mob)) return mob.Move(n,direct) + + if(moving) return 0 + + if(world.time < move_delay) return + + if(!mob) return + + if(mob.stat==2) return + + if(isAI(mob)) return AIMove(n,direct,mob) + + if(mob.monkeyizing) return//This is sota the goto stop mobs from moving var + + if(mob.incorporeal_move)//Move though walls + Process_Incorpmove(direct) + return + + if(Process_Grab()) return + if(!mob.canmove) return + + + if(istype(mob.loc, /turf/space) || (mob.flags & NOGRAV)) + if(!mob.Process_Spacemove()) 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(isturf(mob.loc)) + + if(mob.restrained())//Why being pulled while cuffed prevents you from moving + for(var/mob/M in range(mob, 1)) + if(((M.pulling == mob && (!( M.restrained() ) && M.stat == 0)) || locate(/obj/item/weapon/grab, mob.grabbed_by.len))) + src << "\blue You're restrained! You can't move!" + return 0 + + move_delay = world.time//set move delay + switch(mob.m_intent) + if("run") + if(mob.drowsyness > 0) + move_delay += 6 + if(mob.organStructure && mob.organStructure.legs) + move_delay += mob.organStructure.legs.moveRunDelay + else + move_delay += 1 + if("walk") + if(mob.organStructure && mob.organStructure.legs) + move_delay += mob.organStructure.legs.moveWalkDelay + else + move_delay += 7 + move_delay += mob.movement_delay() + + //We are now going to move + moving = 1 + //Something with pulling things + if(locate(/obj/item/weapon/grab, mob)) + move_delay = max(move_delay, world.time + 7) + var/list/L = mob.ret_grab() + if(istype(L, /list)) + if(L.len == 2) + L -= mob + var/mob/M = L[1] + if ((get_dist(mob, M) <= 1 || M.loc == mob.loc)) + var/turf/T = mob.loc + . = ..() + if (isturf(M.loc)) + var/diag = get_dir(mob, M) + if ((diag - 1) & diag) + else + diag = null + if ((get_dist(mob, M) > 1 || diag)) + step(M, get_dir(M.loc, T)) + else + for(var/mob/M in L) + M.other_mobs = 1 + if(mob != M) + M.animate_movement = 3 + for(var/mob/M in L) + spawn( 0 ) + step(M, direct) + return + spawn( 1 ) + M.other_mobs = null + M.animate_movement = 2 + return + + else + if(mob.confused) + step(mob, pick(cardinal)) + else + . = ..() + for(var/obj/speech_bubble/S in range(1, mob)) + if(S.parent == mob) + S.loc = mob.loc + moving = 0 + return . + + return + + +///Process_Grab() +///Called by client/Move() +///Checks to see if you are being grabbed and if so attemps to break it +/client/proc/Process_Grab() + if(locate(/obj/item/weapon/grab, locate(/obj/item/weapon/grab, mob.grabbed_by.len))) + var/list/grabbing = list() + if(istype(mob.l_hand, /obj/item/weapon/grab)) + var/obj/item/weapon/grab/G = mob.l_hand + grabbing += G.affecting + if(istype(mob.r_hand, /obj/item/weapon/grab)) + var/obj/item/weapon/grab/G = mob.r_hand + grabbing += G.affecting + for(var/obj/item/weapon/grab/G in mob.grabbed_by) + if((G.state == 1)&&(!grabbing.Find(G.assailant))) del(G) + if(G.state == 2) + move_delay = world.time + 10 + if(!prob(25)) return 1 + mob.visible_message("\red [mob] has broken free of [G.assailant]'s grip!") + del(G) + if(G.state == 3) + move_delay = world.time + 10 + if(!prob(5)) return 1 + mob.visible_message("\red [mob] has broken free of [G.assailant]'s headlock!") + del(G) + return 0 + + +///Process_Incorpmove +///Called by client/Move() +///Allows mobs to run though walls +/client/proc/Process_Incorpmove(direct) + var/turf/mobloc = get_turf(mob) + switch(mob.incorporeal_move) + if(1) + mob.loc = get_step(mob, direct) + mob.dir = direct + if(2) + if(prob(50)) + var/locx + var/locy + switch(direct) + if(NORTH) + locx = mobloc.x + locy = (mobloc.y+2) + if(locy>world.maxy) + return + if(SOUTH) + locx = mobloc.x + locy = (mobloc.y-2) + if(locy<1) + return + if(EAST) + locy = mobloc.y + locx = (mobloc.x+2) + if(locx>world.maxx) + return + if(WEST) + locy = mobloc.y + locx = (mobloc.x-2) + if(locx<1) + return + else + return + mob.loc = locate(locx,locy,mobloc.z) + spawn(0) + var/limit = 2//For only two trailing shadows. + for(var/turf/T in getline(mobloc, mob.loc)) + spawn(0) + anim(T,mob,'mob.dmi',,"shadow",,mob.dir) + limit-- + if(limit<=0) break + else + spawn(0) + anim(mobloc,mob,'mob.dmi',,"shadow",,mob.dir) + mob.loc = get_step(mob, direct) + mob.dir = direct + return 1 + + +///Process_Spacemove +///Called by /client/Move() +///For moving in space +///Return 1 for movement 0 for none +/mob/proc/Process_Spacemove() + //First check to see if we can do things + if(restrained()) return 0 + + var/dense_object = 0 + for(var/turf/simulated/turf in oview(1,src)) + if(istype(turf,/turf/simulated/floor) && !(src.flags & NOGRAV)) + dense_object++ + break + if((istype(turf,/turf/simulated)) && !(istype(turf,/turf/simulated/floor))) + dense_object++ + break + + if(!dense_object && (locate(/obj/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 + if(!dense_object) + for(var/obj/O in oview(1, src)) + if((O) && (O.density)) + 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 You slipped!" + 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 + + +/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 += 50 + + prob_slip = round(prob_slip) + return(prob_slip) diff --git a/icons/mob/blob.dmi b/icons/mob/blob.dmi index 1de6878ce73..0309b04e790 100644 Binary files a/icons/mob/blob.dmi and b/icons/mob/blob.dmi differ diff --git a/icons/mob/critter.dmi b/icons/mob/critter.dmi index 0600ff1624a..3ec19ac3cd2 100644 Binary files a/icons/mob/critter.dmi and b/icons/mob/critter.dmi differ diff --git a/tgstation.dme b/tgstation.dme index df0b104f494..f20434cf118 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -723,6 +723,7 @@ #include "code\modules\mob\login.dm" #include "code\modules\mob\logout.dm" #include "code\modules\mob\mob.dm" +#include "code\modules\mob\mob_movement.dm" #include "code\modules\mob\organs.dm" #include "code\modules\mob\say.dm" #include "code\modules\mob\transform_procs.dm" @@ -772,6 +773,7 @@ #include "code\modules\mob\living\carbon\human\hud.dm" #include "code\modules\mob\living\carbon\human\human.dm" #include "code\modules\mob\living\carbon\human\human_defense.dm" +#include "code\modules\mob\living\carbon\human\human_movement.dm" #include "code\modules\mob\living\carbon\human\life.dm" #include "code\modules\mob\living\carbon\human\login.dm" #include "code\modules\mob\living\carbon\human\say.dm" @@ -827,6 +829,7 @@ #include "code\modules\mob\living\silicon\robot\login.dm" #include "code\modules\mob\living\silicon\robot\robot.dm" #include "code\modules\mob\living\silicon\robot\robot_modules.dm" +#include "code\modules\mob\living\silicon\robot\robot_movement.dm" #include "code\modules\mob\living\silicon\robot\say.dm" #include "code\modules\mob\living\silicon\robot\wires.dm" #include "code\modules\mob\new_player\hud.dm"