+444
-444
@@ -1,452 +1,452 @@
|
||||
/mob/CanPass(atom/movable/mover, turf/target, height=0)
|
||||
if(height==0)
|
||||
return 1
|
||||
if(istype(mover, /obj/item/projectile) || mover.throwing)
|
||||
return (!density || lying)
|
||||
if(mover.checkpass(PASSMOB))
|
||||
return 1
|
||||
if(buckled == mover)
|
||||
return 1
|
||||
if(ismob(mover))
|
||||
if (mover in buckled_mobs)
|
||||
return 1
|
||||
return (!mover.density || !density || lying)
|
||||
|
||||
|
||||
//The byond version of these verbs wait for the next tick before acting.
|
||||
// instant verbs however can run mid tick or even during the time between ticks.
|
||||
/client/verb/moveup()
|
||||
set name = ".moveup"
|
||||
set instant = 1
|
||||
Move(get_step(mob, NORTH), NORTH)
|
||||
|
||||
/client/verb/movedown()
|
||||
set name = ".movedown"
|
||||
set instant = 1
|
||||
Move(get_step(mob, SOUTH), SOUTH)
|
||||
|
||||
/client/verb/moveright()
|
||||
set name = ".moveright"
|
||||
set instant = 1
|
||||
Move(get_step(mob, EAST), EAST)
|
||||
|
||||
/client/verb/moveleft()
|
||||
set name = ".moveleft"
|
||||
set instant = 1
|
||||
Move(get_step(mob, WEST), WEST)
|
||||
|
||||
/client/Northeast()
|
||||
swap_hand()
|
||||
return
|
||||
|
||||
|
||||
/client/Southeast()
|
||||
attack_self()
|
||||
return
|
||||
|
||||
|
||||
/client/Southwest()
|
||||
if(iscarbon(usr))
|
||||
var/mob/living/carbon/C = usr
|
||||
C.toggle_throw_mode()
|
||||
else
|
||||
to_chat(usr, "<span class='danger'>This mob type cannot throw items.</span>")
|
||||
return
|
||||
|
||||
|
||||
/client/Northwest()
|
||||
if(!usr.get_active_held_item())
|
||||
to_chat(usr, "<span class='warning'>You have nothing to drop in your hand!</span>")
|
||||
return
|
||||
usr.drop_item()
|
||||
|
||||
//This gets called when you press the delete button.
|
||||
/client/verb/delete_key_pressed()
|
||||
set hidden = 1
|
||||
|
||||
if(!usr.pulling)
|
||||
to_chat(usr, "<span class='notice'>You are not pulling anything.</span>")
|
||||
return
|
||||
usr.stop_pulling()
|
||||
|
||||
/client/verb/swap_hand()
|
||||
set category = "IC"
|
||||
set name = "Swap hands"
|
||||
|
||||
if(mob)
|
||||
mob.swap_hand()
|
||||
|
||||
/client/verb/attack_self()
|
||||
set hidden = 1
|
||||
if(mob)
|
||||
mob.mode()
|
||||
return
|
||||
|
||||
|
||||
/client/verb/drop_item()
|
||||
set hidden = 1
|
||||
if(!iscyborg(mob))
|
||||
mob.drop_item_v()
|
||||
return
|
||||
|
||||
|
||||
/client/Center()
|
||||
if(isobj(mob.loc))
|
||||
var/obj/O = mob.loc
|
||||
if(mob.canmove)
|
||||
return O.relaymove(mob, 0)
|
||||
return
|
||||
|
||||
|
||||
/client/proc/Move_object(direct)
|
||||
if(mob && mob.control_object)
|
||||
if(mob.control_object.density)
|
||||
step(mob.control_object,direct)
|
||||
if(!mob.control_object)
|
||||
return
|
||||
mob.control_object.setDir(direct)
|
||||
else
|
||||
mob.control_object.loc = get_step(mob.control_object,direct)
|
||||
return
|
||||
|
||||
/mob/CanPass(atom/movable/mover, turf/target, height=0)
|
||||
if(height==0)
|
||||
return 1
|
||||
if(istype(mover, /obj/item/projectile) || mover.throwing)
|
||||
return (!density || lying)
|
||||
if(mover.checkpass(PASSMOB))
|
||||
return 1
|
||||
if(buckled == mover)
|
||||
return 1
|
||||
if(ismob(mover))
|
||||
if (mover in buckled_mobs)
|
||||
return 1
|
||||
return (!mover.density || !density || lying)
|
||||
|
||||
|
||||
//The byond version of these verbs wait for the next tick before acting.
|
||||
// instant verbs however can run mid tick or even during the time between ticks.
|
||||
/client/verb/moveup()
|
||||
set name = ".moveup"
|
||||
set instant = 1
|
||||
Move(get_step(mob, NORTH), NORTH)
|
||||
|
||||
/client/verb/movedown()
|
||||
set name = ".movedown"
|
||||
set instant = 1
|
||||
Move(get_step(mob, SOUTH), SOUTH)
|
||||
|
||||
/client/verb/moveright()
|
||||
set name = ".moveright"
|
||||
set instant = 1
|
||||
Move(get_step(mob, EAST), EAST)
|
||||
|
||||
/client/verb/moveleft()
|
||||
set name = ".moveleft"
|
||||
set instant = 1
|
||||
Move(get_step(mob, WEST), WEST)
|
||||
|
||||
/client/Northeast()
|
||||
swap_hand()
|
||||
return
|
||||
|
||||
|
||||
/client/Southeast()
|
||||
attack_self()
|
||||
return
|
||||
|
||||
|
||||
/client/Southwest()
|
||||
if(iscarbon(usr))
|
||||
var/mob/living/carbon/C = usr
|
||||
C.toggle_throw_mode()
|
||||
else
|
||||
to_chat(usr, "<span class='danger'>This mob type cannot throw items.</span>")
|
||||
return
|
||||
|
||||
|
||||
/client/Northwest()
|
||||
if(!usr.get_active_held_item())
|
||||
to_chat(usr, "<span class='warning'>You have nothing to drop in your hand!</span>")
|
||||
return
|
||||
usr.drop_item()
|
||||
|
||||
//This gets called when you press the delete button.
|
||||
/client/verb/delete_key_pressed()
|
||||
set hidden = 1
|
||||
|
||||
if(!usr.pulling)
|
||||
to_chat(usr, "<span class='notice'>You are not pulling anything.</span>")
|
||||
return
|
||||
usr.stop_pulling()
|
||||
|
||||
/client/verb/swap_hand()
|
||||
set category = "IC"
|
||||
set name = "Swap hands"
|
||||
|
||||
if(mob)
|
||||
mob.swap_hand()
|
||||
|
||||
/client/verb/attack_self()
|
||||
set hidden = 1
|
||||
if(mob)
|
||||
mob.mode()
|
||||
return
|
||||
|
||||
|
||||
/client/verb/drop_item()
|
||||
set hidden = 1
|
||||
if(!iscyborg(mob))
|
||||
mob.drop_item_v()
|
||||
return
|
||||
|
||||
|
||||
/client/Center()
|
||||
if(isobj(mob.loc))
|
||||
var/obj/O = mob.loc
|
||||
if(mob.canmove)
|
||||
return O.relaymove(mob, 0)
|
||||
return
|
||||
|
||||
|
||||
/client/proc/Move_object(direct)
|
||||
if(mob && mob.control_object)
|
||||
if(mob.control_object.density)
|
||||
step(mob.control_object,direct)
|
||||
if(!mob.control_object)
|
||||
return
|
||||
mob.control_object.setDir(direct)
|
||||
else
|
||||
mob.control_object.loc = get_step(mob.control_object,direct)
|
||||
return
|
||||
|
||||
#define MOVEMENT_DELAY_BUFFER 0.75
|
||||
#define MOVEMENT_DELAY_BUFFER_DELTA 1.25
|
||||
/client/Move(n, direct)
|
||||
if(world.time < move_delay)
|
||||
return 0
|
||||
/client/Move(n, direct)
|
||||
if(world.time < move_delay)
|
||||
return 0
|
||||
var/old_move_delay = move_delay
|
||||
move_delay = world.time+world.tick_lag //this is here because Move() can now be called mutiple times per tick
|
||||
if(!mob || !mob.loc)
|
||||
return 0
|
||||
if(mob.notransform)
|
||||
return 0 //This is sota the goto stop mobs from moving var
|
||||
if(mob.control_object)
|
||||
return Move_object(direct)
|
||||
if(!isliving(mob))
|
||||
return mob.Move(n,direct)
|
||||
if(mob.stat == DEAD)
|
||||
mob.ghostize()
|
||||
return 0
|
||||
if(moving)
|
||||
return 0
|
||||
if(mob.force_moving)
|
||||
return 0
|
||||
if(isliving(mob))
|
||||
var/mob/living/L = mob
|
||||
if(L.incorporeal_move) //Move though walls
|
||||
Process_Incorpmove(direct)
|
||||
return 0
|
||||
|
||||
if(mob.remote_control) //we're controlling something, our movement is relayed to it
|
||||
return mob.remote_control.relaymove(mob, direct)
|
||||
|
||||
if(isAI(mob))
|
||||
return AIMove(n,direct,mob)
|
||||
|
||||
if(Process_Grab()) //are we restrained by someone's grip?
|
||||
return
|
||||
|
||||
if(mob.buckled) //if we're buckled to something, tell it we moved.
|
||||
return mob.buckled.relaymove(mob, direct)
|
||||
|
||||
if(!mob.canmove)
|
||||
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
|
||||
|
||||
//We are now going to move
|
||||
moving = 1
|
||||
move_delay = world.time+world.tick_lag //this is here because Move() can now be called mutiple times per tick
|
||||
if(!mob || !mob.loc)
|
||||
return 0
|
||||
if(mob.notransform)
|
||||
return 0 //This is sota the goto stop mobs from moving var
|
||||
if(mob.control_object)
|
||||
return Move_object(direct)
|
||||
if(!isliving(mob))
|
||||
return mob.Move(n,direct)
|
||||
if(mob.stat == DEAD)
|
||||
mob.ghostize()
|
||||
return 0
|
||||
if(moving)
|
||||
return 0
|
||||
if(mob.force_moving)
|
||||
return 0
|
||||
if(isliving(mob))
|
||||
var/mob/living/L = mob
|
||||
if(L.incorporeal_move) //Move though walls
|
||||
Process_Incorpmove(direct)
|
||||
return 0
|
||||
|
||||
if(mob.remote_control) //we're controlling something, our movement is relayed to it
|
||||
return mob.remote_control.relaymove(mob, direct)
|
||||
|
||||
if(isAI(mob))
|
||||
return AIMove(n,direct,mob)
|
||||
|
||||
if(Process_Grab()) //are we restrained by someone's grip?
|
||||
return
|
||||
|
||||
if(mob.buckled) //if we're buckled to something, tell it we moved.
|
||||
return mob.buckled.relaymove(mob, direct)
|
||||
|
||||
if(!mob.canmove)
|
||||
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
|
||||
|
||||
//We are now going to move
|
||||
moving = 1
|
||||
var/delay = mob.movement_delay()
|
||||
if (old_move_delay + (delay*MOVEMENT_DELAY_BUFFER_DELTA) + MOVEMENT_DELAY_BUFFER > world.time)
|
||||
move_delay = old_move_delay + delay
|
||||
else
|
||||
move_delay = delay + world.time
|
||||
|
||||
if(mob.confused)
|
||||
if(mob.confused > 40)
|
||||
step(mob, pick(GLOB.cardinal))
|
||||
else if(prob(mob.confused * 1.5))
|
||||
step(mob, angle2dir(dir2angle(direct) + pick(90, -90)))
|
||||
else if(prob(mob.confused * 3))
|
||||
step(mob, angle2dir(dir2angle(direct) + pick(45, -45)))
|
||||
else
|
||||
step(mob, direct)
|
||||
else
|
||||
. = ..()
|
||||
|
||||
moving = 0
|
||||
if(mob && .)
|
||||
if(mob.throwing)
|
||||
mob.throwing.finalize(FALSE)
|
||||
|
||||
return .
|
||||
|
||||
/mob/Moved(oldLoc, dir)
|
||||
. = ..()
|
||||
for(var/obj/O in contents)
|
||||
O.on_mob_move(dir, src, oldLoc)
|
||||
|
||||
/mob/setDir(newDir)
|
||||
. = ..()
|
||||
for(var/obj/O in contents)
|
||||
O.on_mob_turn(newDir, src)
|
||||
|
||||
|
||||
///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(mob.pulledby)
|
||||
if(mob.incapacitated(ignore_restraints = 1))
|
||||
move_delay = world.time + 10
|
||||
return 1
|
||||
else if(mob.restrained(ignore_grab = 1))
|
||||
move_delay = world.time + 10
|
||||
to_chat(src, "<span class='warning'>You're restrained! You can't move!</span>")
|
||||
return 1
|
||||
else
|
||||
return mob.resist_grab(1)
|
||||
|
||||
|
||||
///Process_Incorpmove
|
||||
///Called by client/Move()
|
||||
///Allows mobs to run though walls
|
||||
/client/proc/Process_Incorpmove(direct)
|
||||
var/turf/mobloc = get_turf(mob)
|
||||
if(!isliving(mob))
|
||||
return
|
||||
var/mob/living/L = mob
|
||||
switch(L.incorporeal_move)
|
||||
if(INCORPOREAL_MOVE_BASIC)
|
||||
L.loc = get_step(L, direct)
|
||||
L.setDir(direct)
|
||||
if(INCORPOREAL_MOVE_SHADOW)
|
||||
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
|
||||
L.loc = locate(locx,locy,mobloc.z)
|
||||
var/limit = 2//For only two trailing shadows.
|
||||
for(var/turf/T in getline(mobloc, L.loc))
|
||||
new /obj/effect/temp_visual/dir_setting/ninja/shadow(T, L.dir)
|
||||
limit--
|
||||
if(limit<=0)
|
||||
break
|
||||
else
|
||||
new /obj/effect/temp_visual/dir_setting/ninja/shadow(mobloc, L.dir)
|
||||
L.loc = get_step(L, direct)
|
||||
L.setDir(direct)
|
||||
if(INCORPOREAL_MOVE_JAUNT) //Incorporeal move, but blocked by holy-watered tiles and salt piles.
|
||||
var/turf/open/floor/stepTurf = get_step(L, direct)
|
||||
for(var/obj/effect/decal/cleanable/salt/S in stepTurf)
|
||||
to_chat(L, "<span class='warning'>[S] bars your passage!</span>")
|
||||
if(isrevenant(L))
|
||||
var/mob/living/simple_animal/revenant/R = L
|
||||
R.reveal(20)
|
||||
R.stun(20)
|
||||
return
|
||||
if(stepTurf.flags & NOJAUNT)
|
||||
to_chat(L, "<span class='warning'>Holy energies block your path.</span>")
|
||||
else
|
||||
L.loc = get_step(L, direct)
|
||||
L.setDir(direct)
|
||||
return 1
|
||||
|
||||
|
||||
///Process_Spacemove
|
||||
///Called by /client/Move()
|
||||
///For moving in space
|
||||
///Return 1 for movement 0 for none
|
||||
/mob/Process_Spacemove(movement_dir = 0)
|
||||
if(..())
|
||||
return 1
|
||||
var/atom/movable/backup = get_spacemove_backup()
|
||||
if(backup)
|
||||
if(istype(backup) && movement_dir && !backup.anchored)
|
||||
if(backup.newtonian_move(turn(movement_dir, 180))) //You're pushing off something movable, so it moves
|
||||
to_chat(src, "<span class='info'>You push off of [backup] to propel yourself.</span>")
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/get_spacemove_backup()
|
||||
for(var/A in orange(1, get_turf(src)))
|
||||
if(isarea(A))
|
||||
continue
|
||||
else if(isturf(A))
|
||||
var/turf/turf = A
|
||||
if(isspaceturf(turf))
|
||||
continue
|
||||
if(!turf.density && !mob_negates_gravity())
|
||||
continue
|
||||
return A
|
||||
else
|
||||
var/atom/movable/AM = A
|
||||
if(AM == buckled)
|
||||
continue
|
||||
if(ismob(AM))
|
||||
var/mob/M = AM
|
||||
if(M.buckled)
|
||||
continue
|
||||
if(!AM.CanPass(src) || AM.density)
|
||||
if(AM.anchored)
|
||||
return AM
|
||||
if(pulling == AM)
|
||||
continue
|
||||
. = AM
|
||||
|
||||
/mob/proc/mob_has_gravity()
|
||||
return has_gravity()
|
||||
|
||||
/mob/proc/mob_negates_gravity()
|
||||
return 0
|
||||
|
||||
//moves the mob/object we're pulling
|
||||
/mob/proc/Move_Pulled(atom/A)
|
||||
if(!pulling)
|
||||
return
|
||||
if(pulling.anchored || !pulling.Adjacent(src))
|
||||
stop_pulling()
|
||||
return
|
||||
if(isliving(pulling))
|
||||
var/mob/living/L = pulling
|
||||
if(L.buckled && L.buckled.buckle_prevents_pull) //if they're buckled to something that disallows pulling, prevent it
|
||||
stop_pulling()
|
||||
return
|
||||
if(A == loc && pulling.density)
|
||||
return
|
||||
if(!Process_Spacemove(get_dir(pulling.loc, A)))
|
||||
return
|
||||
step(pulling, get_dir(pulling.loc, A))
|
||||
|
||||
|
||||
/mob/proc/slip(s_amount, w_amount, obj/O, lube)
|
||||
return
|
||||
|
||||
/mob/proc/update_gravity()
|
||||
return
|
||||
|
||||
//bodypart selection - Cyberboss
|
||||
//8 toggles through head - eyes - mouth
|
||||
//4: r-arm 5: chest 6: l-arm
|
||||
//1: r-leg 2: groin 3: l-leg
|
||||
|
||||
/client/proc/check_has_body_select()
|
||||
return mob && mob.hud_used && mob.hud_used.zone_select && istype(mob.hud_used.zone_select, /obj/screen/zone_sel)
|
||||
|
||||
/client/verb/body_toggle_head()
|
||||
set name = "body-toggle-head"
|
||||
set hidden = 1
|
||||
|
||||
if(!check_has_body_select())
|
||||
return
|
||||
|
||||
var/next_in_line
|
||||
switch(mob.zone_selected)
|
||||
if("head")
|
||||
next_in_line = "eyes"
|
||||
if("eyes")
|
||||
next_in_line = "mouth"
|
||||
else
|
||||
next_in_line = "head"
|
||||
|
||||
var/obj/screen/zone_sel/selector = mob.hud_used.zone_select
|
||||
selector.set_selected_zone(next_in_line, mob)
|
||||
|
||||
/client/verb/body_r_arm()
|
||||
set name = "body-r-arm"
|
||||
set hidden = 1
|
||||
|
||||
if(!check_has_body_select())
|
||||
return
|
||||
|
||||
var/obj/screen/zone_sel/selector = mob.hud_used.zone_select
|
||||
selector.set_selected_zone("r_arm", mob)
|
||||
|
||||
/client/verb/body_chest()
|
||||
set name = "body-chest"
|
||||
set hidden = 1
|
||||
|
||||
if(!check_has_body_select())
|
||||
return
|
||||
|
||||
var/obj/screen/zone_sel/selector = mob.hud_used.zone_select
|
||||
selector.set_selected_zone("chest", mob)
|
||||
|
||||
/client/verb/body_l_arm()
|
||||
set name = "body-l-arm"
|
||||
set hidden = 1
|
||||
|
||||
if(!check_has_body_select())
|
||||
return
|
||||
|
||||
var/obj/screen/zone_sel/selector = mob.hud_used.zone_select
|
||||
selector.set_selected_zone("l_arm", mob)
|
||||
|
||||
/client/verb/body_r_leg()
|
||||
set name = "body-r-leg"
|
||||
set hidden = 1
|
||||
|
||||
if(!check_has_body_select())
|
||||
return
|
||||
|
||||
var/obj/screen/zone_sel/selector = mob.hud_used.zone_select
|
||||
selector.set_selected_zone("r_leg", mob)
|
||||
|
||||
/client/verb/body_groin()
|
||||
set name = "body-groin"
|
||||
set hidden = 1
|
||||
|
||||
if(!check_has_body_select())
|
||||
return
|
||||
|
||||
var/obj/screen/zone_sel/selector = mob.hud_used.zone_select
|
||||
selector.set_selected_zone("groin", mob)
|
||||
|
||||
/client/verb/body_l_leg()
|
||||
set name = "body-l-leg"
|
||||
set hidden = 1
|
||||
|
||||
if(!check_has_body_select())
|
||||
return
|
||||
|
||||
var/obj/screen/zone_sel/selector = mob.hud_used.zone_select
|
||||
selector.set_selected_zone("l_leg", mob)
|
||||
|
||||
/client/verb/toggle_walk_run()
|
||||
set name = "toggle-walk-run"
|
||||
set hidden = TRUE
|
||||
set instant = TRUE
|
||||
if(mob)
|
||||
mob.toggle_move_intent()
|
||||
|
||||
/mob/proc/toggle_move_intent()
|
||||
if(hud_used && hud_used.static_inventory)
|
||||
for(var/obj/screen/mov_intent/selector in hud_used.static_inventory)
|
||||
selector.toggle(src)
|
||||
|
||||
if(mob.confused)
|
||||
if(mob.confused > 40)
|
||||
step(mob, pick(GLOB.cardinal))
|
||||
else if(prob(mob.confused * 1.5))
|
||||
step(mob, angle2dir(dir2angle(direct) + pick(90, -90)))
|
||||
else if(prob(mob.confused * 3))
|
||||
step(mob, angle2dir(dir2angle(direct) + pick(45, -45)))
|
||||
else
|
||||
step(mob, direct)
|
||||
else
|
||||
. = ..()
|
||||
|
||||
moving = 0
|
||||
if(mob && .)
|
||||
if(mob.throwing)
|
||||
mob.throwing.finalize(FALSE)
|
||||
|
||||
return .
|
||||
|
||||
/mob/Moved(oldLoc, dir)
|
||||
. = ..()
|
||||
for(var/obj/O in contents)
|
||||
O.on_mob_move(dir, src, oldLoc)
|
||||
|
||||
/mob/setDir(newDir)
|
||||
. = ..()
|
||||
for(var/obj/O in contents)
|
||||
O.on_mob_turn(newDir, src)
|
||||
|
||||
|
||||
///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(mob.pulledby)
|
||||
if(mob.incapacitated(ignore_restraints = 1))
|
||||
move_delay = world.time + 10
|
||||
return 1
|
||||
else if(mob.restrained(ignore_grab = 1))
|
||||
move_delay = world.time + 10
|
||||
to_chat(src, "<span class='warning'>You're restrained! You can't move!</span>")
|
||||
return 1
|
||||
else
|
||||
return mob.resist_grab(1)
|
||||
|
||||
|
||||
///Process_Incorpmove
|
||||
///Called by client/Move()
|
||||
///Allows mobs to run though walls
|
||||
/client/proc/Process_Incorpmove(direct)
|
||||
var/turf/mobloc = get_turf(mob)
|
||||
if(!isliving(mob))
|
||||
return
|
||||
var/mob/living/L = mob
|
||||
switch(L.incorporeal_move)
|
||||
if(INCORPOREAL_MOVE_BASIC)
|
||||
L.loc = get_step(L, direct)
|
||||
L.setDir(direct)
|
||||
if(INCORPOREAL_MOVE_SHADOW)
|
||||
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
|
||||
L.loc = locate(locx,locy,mobloc.z)
|
||||
var/limit = 2//For only two trailing shadows.
|
||||
for(var/turf/T in getline(mobloc, L.loc))
|
||||
new /obj/effect/temp_visual/dir_setting/ninja/shadow(T, L.dir)
|
||||
limit--
|
||||
if(limit<=0)
|
||||
break
|
||||
else
|
||||
new /obj/effect/temp_visual/dir_setting/ninja/shadow(mobloc, L.dir)
|
||||
L.loc = get_step(L, direct)
|
||||
L.setDir(direct)
|
||||
if(INCORPOREAL_MOVE_JAUNT) //Incorporeal move, but blocked by holy-watered tiles and salt piles.
|
||||
var/turf/open/floor/stepTurf = get_step(L, direct)
|
||||
for(var/obj/effect/decal/cleanable/salt/S in stepTurf)
|
||||
to_chat(L, "<span class='warning'>[S] bars your passage!</span>")
|
||||
if(isrevenant(L))
|
||||
var/mob/living/simple_animal/revenant/R = L
|
||||
R.reveal(20)
|
||||
R.stun(20)
|
||||
return
|
||||
if(stepTurf.flags & NOJAUNT)
|
||||
to_chat(L, "<span class='warning'>Holy energies block your path.</span>")
|
||||
else
|
||||
L.loc = get_step(L, direct)
|
||||
L.setDir(direct)
|
||||
return 1
|
||||
|
||||
|
||||
///Process_Spacemove
|
||||
///Called by /client/Move()
|
||||
///For moving in space
|
||||
///Return 1 for movement 0 for none
|
||||
/mob/Process_Spacemove(movement_dir = 0)
|
||||
if(..())
|
||||
return 1
|
||||
var/atom/movable/backup = get_spacemove_backup()
|
||||
if(backup)
|
||||
if(istype(backup) && movement_dir && !backup.anchored)
|
||||
if(backup.newtonian_move(turn(movement_dir, 180))) //You're pushing off something movable, so it moves
|
||||
to_chat(src, "<span class='info'>You push off of [backup] to propel yourself.</span>")
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/get_spacemove_backup()
|
||||
for(var/A in orange(1, get_turf(src)))
|
||||
if(isarea(A))
|
||||
continue
|
||||
else if(isturf(A))
|
||||
var/turf/turf = A
|
||||
if(isspaceturf(turf))
|
||||
continue
|
||||
if(!turf.density && !mob_negates_gravity())
|
||||
continue
|
||||
return A
|
||||
else
|
||||
var/atom/movable/AM = A
|
||||
if(AM == buckled)
|
||||
continue
|
||||
if(ismob(AM))
|
||||
var/mob/M = AM
|
||||
if(M.buckled)
|
||||
continue
|
||||
if(!AM.CanPass(src) || AM.density)
|
||||
if(AM.anchored)
|
||||
return AM
|
||||
if(pulling == AM)
|
||||
continue
|
||||
. = AM
|
||||
|
||||
/mob/proc/mob_has_gravity()
|
||||
return has_gravity()
|
||||
|
||||
/mob/proc/mob_negates_gravity()
|
||||
return 0
|
||||
|
||||
//moves the mob/object we're pulling
|
||||
/mob/proc/Move_Pulled(atom/A)
|
||||
if(!pulling)
|
||||
return
|
||||
if(pulling.anchored || !pulling.Adjacent(src))
|
||||
stop_pulling()
|
||||
return
|
||||
if(isliving(pulling))
|
||||
var/mob/living/L = pulling
|
||||
if(L.buckled && L.buckled.buckle_prevents_pull) //if they're buckled to something that disallows pulling, prevent it
|
||||
stop_pulling()
|
||||
return
|
||||
if(A == loc && pulling.density)
|
||||
return
|
||||
if(!Process_Spacemove(get_dir(pulling.loc, A)))
|
||||
return
|
||||
step(pulling, get_dir(pulling.loc, A))
|
||||
|
||||
|
||||
/mob/proc/slip(s_amount, w_amount, obj/O, lube)
|
||||
return
|
||||
|
||||
/mob/proc/update_gravity()
|
||||
return
|
||||
|
||||
//bodypart selection - Cyberboss
|
||||
//8 toggles through head - eyes - mouth
|
||||
//4: r-arm 5: chest 6: l-arm
|
||||
//1: r-leg 2: groin 3: l-leg
|
||||
|
||||
/client/proc/check_has_body_select()
|
||||
return mob && mob.hud_used && mob.hud_used.zone_select && istype(mob.hud_used.zone_select, /obj/screen/zone_sel)
|
||||
|
||||
/client/verb/body_toggle_head()
|
||||
set name = "body-toggle-head"
|
||||
set hidden = 1
|
||||
|
||||
if(!check_has_body_select())
|
||||
return
|
||||
|
||||
var/next_in_line
|
||||
switch(mob.zone_selected)
|
||||
if("head")
|
||||
next_in_line = "eyes"
|
||||
if("eyes")
|
||||
next_in_line = "mouth"
|
||||
else
|
||||
next_in_line = "head"
|
||||
|
||||
var/obj/screen/zone_sel/selector = mob.hud_used.zone_select
|
||||
selector.set_selected_zone(next_in_line, mob)
|
||||
|
||||
/client/verb/body_r_arm()
|
||||
set name = "body-r-arm"
|
||||
set hidden = 1
|
||||
|
||||
if(!check_has_body_select())
|
||||
return
|
||||
|
||||
var/obj/screen/zone_sel/selector = mob.hud_used.zone_select
|
||||
selector.set_selected_zone("r_arm", mob)
|
||||
|
||||
/client/verb/body_chest()
|
||||
set name = "body-chest"
|
||||
set hidden = 1
|
||||
|
||||
if(!check_has_body_select())
|
||||
return
|
||||
|
||||
var/obj/screen/zone_sel/selector = mob.hud_used.zone_select
|
||||
selector.set_selected_zone("chest", mob)
|
||||
|
||||
/client/verb/body_l_arm()
|
||||
set name = "body-l-arm"
|
||||
set hidden = 1
|
||||
|
||||
if(!check_has_body_select())
|
||||
return
|
||||
|
||||
var/obj/screen/zone_sel/selector = mob.hud_used.zone_select
|
||||
selector.set_selected_zone("l_arm", mob)
|
||||
|
||||
/client/verb/body_r_leg()
|
||||
set name = "body-r-leg"
|
||||
set hidden = 1
|
||||
|
||||
if(!check_has_body_select())
|
||||
return
|
||||
|
||||
var/obj/screen/zone_sel/selector = mob.hud_used.zone_select
|
||||
selector.set_selected_zone("r_leg", mob)
|
||||
|
||||
/client/verb/body_groin()
|
||||
set name = "body-groin"
|
||||
set hidden = 1
|
||||
|
||||
if(!check_has_body_select())
|
||||
return
|
||||
|
||||
var/obj/screen/zone_sel/selector = mob.hud_used.zone_select
|
||||
selector.set_selected_zone("groin", mob)
|
||||
|
||||
/client/verb/body_l_leg()
|
||||
set name = "body-l-leg"
|
||||
set hidden = 1
|
||||
|
||||
if(!check_has_body_select())
|
||||
return
|
||||
|
||||
var/obj/screen/zone_sel/selector = mob.hud_used.zone_select
|
||||
selector.set_selected_zone("l_leg", mob)
|
||||
|
||||
/client/verb/toggle_walk_run()
|
||||
set name = "toggle-walk-run"
|
||||
set hidden = TRUE
|
||||
set instant = TRUE
|
||||
if(mob)
|
||||
mob.toggle_move_intent()
|
||||
|
||||
/mob/proc/toggle_move_intent()
|
||||
if(hud_used && hud_used.static_inventory)
|
||||
for(var/obj/screen/mov_intent/selector in hud_used.static_inventory)
|
||||
selector.toggle(src)
|
||||
|
||||
Reference in New Issue
Block a user