mob folder - root

This commit is contained in:
deathride58
2018-01-04 01:02:04 -05:00
parent fd9bc8c35e
commit bdd460ed4a
7 changed files with 36 additions and 113 deletions
-2
View File
@@ -30,8 +30,6 @@
sync_mind()
client.sethotkeys() //set mob specific hotkeys
//Reload alternate appearances
for(var/v in GLOB.active_alternate_appearances)
if(!v)
+2 -1
View File
@@ -30,6 +30,7 @@
GLOB.dead_mob_list += src
else
GLOB.alive_mob_list += src
set_focus(src)
prepare_huds()
for(var/v in GLOB.active_alternate_appearances)
if(!v)
@@ -125,7 +126,7 @@
if(self_message)
msg = self_message
else
if(M.see_invisible<invisibility)//if src is invisible to us,
if(M.see_invisible<invisibility || (T != loc && T != src))//if src is invisible to us or is inside something (and isn't a turf),
if(blind_message) // then people see blind message if there is one, otherwise nothing.
msg = blind_message
else
-5
View File
@@ -21,18 +21,13 @@
*/
var/zone_selected = null
var/macro_default = "default"
var/macro_hotkeys = "hotkeys"
var/damageoverlaytemp = 0
var/computer_id = null
var/lastattacker = null
var/lastattackerckey = null
var/list/logging = list(INDIVIDUAL_ATTACK_LOG, INDIVIDUAL_SAY_LOG, INDIVIDUAL_EMOTE_LOG, INDIVIDUAL_OOC_LOG)
var/obj/machinery/machine = null
var/other_mobs = null
var/disabilities = 0 //Carbon
var/atom/movable/pulling = null
var/grab_state = 0
-5
View File
@@ -285,11 +285,6 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
firstname.Find(real_name)
return firstname.match
/mob/proc/abiotic(full_body = 0)
for(var/obj/item/I in held_items)
if(!(I.flags_1 & NODROP_1))
return 1
return 0
//change a mob's act-intent. Input the intent as a string such as "help" or use "right"/"left
/mob/verb/a_intent_change(input as text)
+25 -97
View File
@@ -11,94 +11,12 @@
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()
var/obj/item/I = usr.get_active_held_item()
if(!I)
to_chat(usr, "<span class='warning'>You have nothing to drop in your hand!</span>")
return
usr.dropItemToGround(I)
//This gets called when you press the delete button.
/client/verb/delete_key_pressed()
set hidden = 1
if(!isliving(usr))
return
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.stat == CONSCIOUS)
mob.dropItemToGround(mob.get_active_held_item())
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)
@@ -114,19 +32,23 @@
#define MOVEMENT_DELAY_BUFFER_DELTA 1.25
/client/Move(n, direct)
if(world.time < move_delay)
if(world.time < move_delay) //do not move anything ahead of this check please
return FALSE
else
next_move_dir_add = 0
next_move_dir_sub = 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 FALSE
var/oldloc = mob.loc
if(!n || !direct)
return FALSE
if(mob.notransform)
return FALSE //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)
return mob.Move(n, direct)
if(mob.stat == DEAD)
mob.ghostize()
return FALSE
@@ -159,26 +81,32 @@
if(!mob.Process_Spacemove(direct))
return FALSE
//We are now going to move
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
var/add_delay = mob.movement_delay()
if(old_move_delay + (add_delay*MOVEMENT_DELAY_BUFFER_DELTA) + MOVEMENT_DELAY_BUFFER > world.time)
move_delay = old_move_delay
else
move_delay = delay + world.time
move_delay = world.time
var/oldloc = mob.loc
if(mob.confused)
var/newdir = 0
if(mob.confused > 40)
step(mob, pick(GLOB.cardinals))
newdir = pick(GLOB.alldirs)
else if(prob(mob.confused * 1.5))
step(mob, angle2dir(dir2angle(direct) + pick(90, -90)))
newdir = 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
. = ..()
newdir = angle2dir(dir2angle(direct) + pick(45, -45))
if(newdir)
direct = newdir
n = get_step(mob, direct)
. = ..()
if((direct & (direct - 1)) && mob.loc == n) //moved diagonally successfully
add_delay *= 2
if(mob.loc != oldloc)
move_delay += add_delay
if(.) // If mob is null here, we deserve the runtime
if(mob.throwing)
mob.throwing.finalize(FALSE)
+7 -1
View File
@@ -5,7 +5,8 @@
if(GLOB.say_disabled) //This is here to try to identify lag problems
to_chat(usr, "<span class='danger'>Speech is currently admin-disabled.</span>")
return
usr.say(message)
if(message)
say(message)
/mob/verb/whisper_verb(message as text)
@@ -72,6 +73,11 @@
deadchat_broadcast(rendered, follow_target = src, speaker_key = K)
/mob/proc/check_emote(message)
if(copytext(message, 1, 2) == "*")
emote(copytext(message, 2))
return 1
/mob/proc/emote(var/act)
return
+2 -2
View File
@@ -11,7 +11,7 @@ This rewrite was needed, but is far from perfect. Report any bugs you come acros
Radio code, while very much related to saycode, is not something I wanted to touch, so the code related to that may be messy.
If you came here to see how to use saycode, all you will ever really need to call is say(message).
To have things react when other things speak around them, add the HEAR_1 flag to their flags_1 variable and
To have things react when other things speak around them, add the HEAR_1 flag to their flags variable and
override their Hear() proc.
=======================PROCS & VARIABLES=======================
@@ -43,7 +43,7 @@ global procs
Attaches span classes around input.
/atom/movable
flags_1
flags
The HEAR_1 flag determines whether something is a hearer or not.
Hear() is only called on procs with this flag.