Revert "12/21 modernizations from TG live"
This commit is contained in:
+151
-128
@@ -2,11 +2,6 @@
|
||||
mob_list -= src
|
||||
dead_mob_list -= src
|
||||
living_mob_list -= src
|
||||
all_clockwork_mobs -= src
|
||||
if(observers && observers.len)
|
||||
for(var/M in observers)
|
||||
var/mob/dead/observe = M
|
||||
observe.reset_perspective(null)
|
||||
qdel(hud_used)
|
||||
if(mind && mind.current == src)
|
||||
spellremove(src)
|
||||
@@ -16,8 +11,7 @@
|
||||
qdel(cc)
|
||||
client_colours = null
|
||||
ghostize()
|
||||
..()
|
||||
return QDEL_HINT_HARDDEL
|
||||
return ..()
|
||||
|
||||
var/next_mob_id = 0
|
||||
/mob/New()
|
||||
@@ -28,13 +22,14 @@ var/next_mob_id = 0
|
||||
else
|
||||
living_mob_list += src
|
||||
prepare_huds()
|
||||
hook_vr("mob_new",list(src))
|
||||
..()
|
||||
|
||||
/atom/proc/prepare_huds()
|
||||
hud_list = list()
|
||||
for(var/hud in hud_possible)
|
||||
var/image/I = image('icons/mob/hud.dmi', src, "")
|
||||
I.appearance_flags = RESET_COLOR|RESET_TRANSFORM
|
||||
I.appearance_flags = RESET_COLOR
|
||||
hud_list[hud] = I
|
||||
|
||||
/mob/proc/Cell()
|
||||
@@ -84,43 +79,63 @@ var/next_mob_id = 0
|
||||
else
|
||||
src << msg
|
||||
|
||||
// Show a message to all player mobs who sees this atom
|
||||
// Show a message to the src mob (if the src is a mob)
|
||||
// Use for atoms performing visible actions
|
||||
// message is output to anyone who can see, e.g. "The [src] does something!"
|
||||
// Show a message the src mob and to all player mobs who sees the src mob
|
||||
// This would be for visible actions by the src mob
|
||||
// message is the message output to anyone who can see e.g. "[src] does something!"
|
||||
// self_message (optional) is what the src mob sees e.g. "You do something!"
|
||||
// blind_message (optional) is what blind people will hear e.g. "You hear something!"
|
||||
// vision_distance (optional) define how many tiles away the message can be seen.
|
||||
// ignored_mob (optional) doesn't show any message to a given mob if TRUE.
|
||||
|
||||
/atom/proc/visible_message(message, self_message, blind_message, vision_distance, ignored_mob)
|
||||
/mob/visible_message(message, self_message, blind_message)
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T)
|
||||
return
|
||||
var/range = 7
|
||||
if(vision_distance)
|
||||
range = vision_distance
|
||||
for(var/mob/M in get_hearers_in_view(range, src))
|
||||
for(var/mob/M in get_hearers_in_view(7, src))
|
||||
if(!M.client)
|
||||
continue
|
||||
if(M == ignored_mob)
|
||||
continue
|
||||
var/msg = message
|
||||
if(M == src) //the src always see the main message or self message
|
||||
if(self_message)
|
||||
msg = self_message
|
||||
else
|
||||
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(M.see_invisible<invisibility || T != loc) //if src is inside something or invisible to us,
|
||||
if(blind_message) // then people see blind message if there is one, otherwise nothing.
|
||||
msg = blind_message
|
||||
else
|
||||
continue
|
||||
else if(T.lighting_object)
|
||||
if(T.lighting_object.invisibility <= M.see_invisible && !T.lighting_object.luminosity) //the light object is dark and not invisible to us
|
||||
if(blind_message)
|
||||
msg = blind_message
|
||||
else
|
||||
continue
|
||||
|
||||
M.show_message(msg,1,blind_message,2)
|
||||
|
||||
/mob/proc/get_top_level_mob()
|
||||
if(istype(src.loc,/mob)&&src.loc!=src)
|
||||
var/mob/M=src.loc
|
||||
return M.get_top_level_mob()
|
||||
return src
|
||||
|
||||
proc/get_top_level_mob(var/mob/S)
|
||||
if(istype(S.loc,/mob)&&S.loc!=S)
|
||||
var/mob/M=S.loc
|
||||
return M.get_top_level_mob()
|
||||
return S
|
||||
|
||||
// Show a message to all player mobs who sees this atom
|
||||
// Use for objects performing visible actions
|
||||
// message is output to anyone who can see, e.g. "The [src] does something!"
|
||||
// blind_message (optional) is what blind people will hear e.g. "You hear something!"
|
||||
|
||||
/atom/proc/visible_message(message, blind_message)
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T)
|
||||
return
|
||||
for(var/mob/M in get_hearers_in_view(7, src))
|
||||
if(!M.client)
|
||||
continue
|
||||
var/msg = message
|
||||
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
|
||||
continue
|
||||
|
||||
M.show_message(msg,1,blind_message,2)
|
||||
|
||||
// Show a message to all mobs in earshot of this one
|
||||
@@ -161,6 +176,11 @@ var/next_mob_id = 0
|
||||
return
|
||||
|
||||
/mob/proc/get_item_by_slot(slot_id)
|
||||
switch(slot_id)
|
||||
if(slot_l_hand)
|
||||
return l_hand
|
||||
if(slot_r_hand)
|
||||
return r_hand
|
||||
return null
|
||||
|
||||
/mob/proc/restrained(ignore_grab)
|
||||
@@ -171,7 +191,7 @@ var/next_mob_id = 0
|
||||
|
||||
//This proc is called whenever someone clicks an inventory ui slot.
|
||||
/mob/proc/attack_ui(slot)
|
||||
var/obj/item/W = get_active_held_item()
|
||||
var/obj/item/W = get_active_hand()
|
||||
|
||||
if(istype(W))
|
||||
if(equip_to_slot_if_possible(W, slot,0,0,0))
|
||||
@@ -191,7 +211,7 @@ var/next_mob_id = 0
|
||||
//unset redraw_mob to prevent the mob from being redrawn at the end.
|
||||
/mob/proc/equip_to_slot_if_possible(obj/item/W, slot, qdel_on_fail = 0, disable_warning = 0, redraw_mob = 1)
|
||||
if(!istype(W)) return 0
|
||||
if(!W.mob_can_equip(src, null, slot, disable_warning))
|
||||
if(!W.mob_can_equip(src, slot, disable_warning))
|
||||
if(qdel_on_fail)
|
||||
qdel(W)
|
||||
else
|
||||
@@ -208,7 +228,7 @@ var/next_mob_id = 0
|
||||
|
||||
//This is just a commonly used configuration for the equip_to_slot_if_possible() proc, used to equip people when the rounds tarts and when events happen and such.
|
||||
/mob/proc/equip_to_slot_or_del(obj/item/W, slot)
|
||||
return equip_to_slot_if_possible(W, slot, 1, 1, 0)
|
||||
equip_to_slot_if_possible(W, slot, 1, 1, 0)
|
||||
|
||||
//puts the item "W" into an appropriate slot in a human's inventory
|
||||
//returns 0 if it cannot, 1 if successful
|
||||
@@ -220,12 +240,12 @@ var/next_mob_id = 0
|
||||
slot_priority = list( \
|
||||
slot_back, slot_wear_id,\
|
||||
slot_w_uniform, slot_wear_suit,\
|
||||
slot_wear_mask, slot_head, slot_neck,\
|
||||
slot_wear_mask, slot_head,\
|
||||
slot_shoes, slot_gloves,\
|
||||
slot_ears, slot_glasses,\
|
||||
slot_belt, slot_s_store,\
|
||||
slot_l_store, slot_r_store,\
|
||||
slot_generic_dextrous_storage\
|
||||
slot_drone_storage\
|
||||
)
|
||||
|
||||
for(var/slot in slot_priority)
|
||||
@@ -258,6 +278,7 @@ var/next_mob_id = 0
|
||||
clear_fullscreen("remote_view", 0)
|
||||
update_pipe_vision()
|
||||
|
||||
|
||||
/mob/proc/show_inv(mob/user)
|
||||
return
|
||||
|
||||
@@ -302,10 +323,6 @@ var/next_mob_id = 0
|
||||
return
|
||||
if(AM.anchored || AM.throwing)
|
||||
return
|
||||
if(isliving(AM))
|
||||
var/mob/living/L = AM
|
||||
if(L.buckled && L.buckled.buckle_prevents_pull)
|
||||
return
|
||||
if(throwing || incapacitated())
|
||||
return
|
||||
|
||||
@@ -367,11 +384,16 @@ var/next_mob_id = 0
|
||||
if(incapacitated())
|
||||
return
|
||||
|
||||
var/obj/item/I = get_active_held_item()
|
||||
if(I)
|
||||
I.attack_self(src)
|
||||
update_inv_hands()
|
||||
|
||||
if(hand)
|
||||
var/obj/item/W = l_hand
|
||||
if (W)
|
||||
W.attack_self(src)
|
||||
update_inv_l_hand()
|
||||
else
|
||||
var/obj/item/W = r_hand
|
||||
if (W)
|
||||
W.attack_self(src)
|
||||
update_inv_r_hand()
|
||||
|
||||
/*
|
||||
/mob/verb/dump_source()
|
||||
@@ -387,11 +409,10 @@ var/next_mob_id = 0
|
||||
/mob/verb/memory()
|
||||
set name = "Notes"
|
||||
set category = "IC"
|
||||
set desc = "View your character's notes memory."
|
||||
if(mind)
|
||||
mind.show_memory(src)
|
||||
else
|
||||
src << "You don't have a mind datum for some reason, so you can't look at your notes, if you had any."
|
||||
src << "The game appears to have misplaced your mind datum, so we can't show you your notes."
|
||||
|
||||
/mob/verb/add_memory(msg as message)
|
||||
set name = "Add Note"
|
||||
@@ -403,7 +424,46 @@ var/next_mob_id = 0
|
||||
if(mind)
|
||||
mind.store_memory(msg)
|
||||
else
|
||||
src << "You don't have a mind datum for some reason, so you can't add a note to it."
|
||||
src << "The game appears to have misplaced your mind datum, so we can't show you your notes."
|
||||
|
||||
/mob/proc/store_memory(msg as message, popup, sane = 1)
|
||||
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
|
||||
|
||||
if (sane)
|
||||
msg = sanitize(msg)
|
||||
|
||||
if (length(memory) == 0)
|
||||
memory += msg
|
||||
else
|
||||
memory += "<BR>[msg]"
|
||||
|
||||
if (popup)
|
||||
memory()
|
||||
|
||||
/mob/proc/update_flavor_text()
|
||||
set src in usr
|
||||
if(usr != src)
|
||||
usr << "No."
|
||||
var/msg = input(usr,"Set the flavor text in your 'examine' verb. Can also be used for OOC notes about your character.","Flavor Text",html_decode(flavor_text)) as message|null
|
||||
|
||||
if(msg != null)
|
||||
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
|
||||
msg = html_encode(msg)
|
||||
|
||||
flavor_text = msg
|
||||
|
||||
/mob/proc/warn_flavor_changed()
|
||||
if(flavor_text && flavor_text != "") // don't spam people that don't use it!
|
||||
src << "<h2 class='alert'>OOC Warning:</h2>"
|
||||
src << "<span class='alert'>Your flavor text is likely out of date! <a href='byond://?src=\ref[src];flavor_change=1'>Change</a></span>"
|
||||
|
||||
/mob/proc/print_flavor_text()
|
||||
if(flavor_text && flavor_text != "")
|
||||
var/msg = replacetext(flavor_text, "\n", " ")
|
||||
if(lentext(msg) <= 40)
|
||||
return "\blue [msg]"
|
||||
else
|
||||
return "\blue [copytext(msg, 1, 37)]... <a href='byond://?src=\ref[src];flavor_more=1'>More...</a>"
|
||||
|
||||
/mob/verb/abandon_mob()
|
||||
set name = "Respawn"
|
||||
@@ -438,31 +498,36 @@ var/next_mob_id = 0
|
||||
// M.Login() //wat
|
||||
return
|
||||
|
||||
/mob/verb/observe()
|
||||
set name = "Observe"
|
||||
set category = "OOC"
|
||||
var/is_admin = 0
|
||||
|
||||
/mob/proc/update_flavor_text()
|
||||
set src in usr
|
||||
if(usr != src)
|
||||
usr << "No."
|
||||
var/msg = input(usr,"Set the flavor text in your 'examine' verb. Can also be used for OOC notes about your character.","Flavor Text",html_decode(flavor_text)) as message|null
|
||||
if(check_rights_for(client,R_ADMIN))
|
||||
is_admin = 1
|
||||
else if(stat != DEAD || istype(src, /mob/new_player))
|
||||
usr << "<span class='notice'>You must be observing to use this!</span>"
|
||||
return
|
||||
|
||||
if(msg != null)
|
||||
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
|
||||
msg = html_encode(msg)
|
||||
if(is_admin && stat == DEAD)
|
||||
is_admin = 0
|
||||
|
||||
flavor_text = msg
|
||||
var/list/creatures = getpois()
|
||||
|
||||
/mob/proc/warn_flavor_changed()
|
||||
if(flavor_text && flavor_text != "") // don't spam people that don't use it!
|
||||
src << "<h2 class='alert'>OOC Warning:</h2>"
|
||||
src << "<span class='alert'>Your flavor text is likely out of date! <a href='byond://?src=\ref[src];flavor_change=1'>Change</a></span>"
|
||||
client.perspective = EYE_PERSPECTIVE
|
||||
|
||||
/mob/proc/print_flavor_text()
|
||||
if(flavor_text && flavor_text != "")
|
||||
var/msg = replacetext(flavor_text, "\n", " ")
|
||||
if(lentext(msg) <= 40)
|
||||
return "\blue [msg]"
|
||||
else
|
||||
return "\blue [copytext(msg, 1, 37)]... <a href='byond://?src=\ref[src];flavor_more=1'>More...</a>"
|
||||
var/eye_name = null
|
||||
|
||||
var/ok = "[is_admin ? "Admin Observe" : "Observe"]"
|
||||
eye_name = input("Please, select a player!", ok, null, null) as null|anything in creatures
|
||||
|
||||
if (!eye_name)
|
||||
return
|
||||
|
||||
var/mob/mob_eye = creatures[eye_name]
|
||||
|
||||
if(client && mob_eye)
|
||||
client.eye = mob_eye
|
||||
|
||||
/mob/verb/cancel_camera()
|
||||
set name = "Cancel Camera View"
|
||||
@@ -490,13 +555,8 @@ var/next_mob_id = 0
|
||||
if(usr.canUseTopic(src, BE_CLOSE, NO_DEXTERY))
|
||||
if(href_list["item"])
|
||||
var/slot = text2num(href_list["item"])
|
||||
var/hand_index = text2num(href_list["hand_index"])
|
||||
var/obj/item/what
|
||||
if(hand_index)
|
||||
what = get_item_for_held_index(hand_index)
|
||||
slot = list(slot,hand_index)
|
||||
else
|
||||
what = get_item_by_slot(slot)
|
||||
var/obj/item/what = get_item_by_slot(slot)
|
||||
|
||||
if(what)
|
||||
usr.stripPanelUnequip(what,src,slot)
|
||||
else
|
||||
@@ -526,7 +586,7 @@ var/next_mob_id = 0
|
||||
return
|
||||
if(!Adjacent(usr))
|
||||
return
|
||||
if(isAI(M))
|
||||
if(istype(M, /mob/living/silicon/ai))
|
||||
return
|
||||
show_inv(usr)
|
||||
|
||||
@@ -551,11 +611,10 @@ var/next_mob_id = 0
|
||||
|
||||
if(statpanel("Status"))
|
||||
stat(null, "Map: [MAP_NAME]")
|
||||
if(nextmap && istype(nextmap))
|
||||
if (nextmap && istype(nextmap))
|
||||
stat(null, "Next Map: [nextmap.friendlyname]")
|
||||
stat(null, "Server Time: [time2text(world.realtime, "YYYY-MM-DD hh:mm")]")
|
||||
if(SSshuttle.emergency)
|
||||
stat(null, "Current Shuttle: [SSshuttle.emergency.name]")
|
||||
var/ETA = SSshuttle.emergency.getModeStr()
|
||||
if(ETA)
|
||||
stat(null, "[ETA] [SSshuttle.emergency.getTimerStr()]")
|
||||
@@ -590,7 +649,7 @@ var/next_mob_id = 0
|
||||
var/list/overrides = list()
|
||||
for(var/image/I in client.images)
|
||||
if(I.loc && I.loc.loc == listed_turf && I.override)
|
||||
overrides += I.loc
|
||||
overrides = I.loc
|
||||
for(var/atom/A in listed_turf)
|
||||
if(!A.mouse_opacity)
|
||||
continue
|
||||
@@ -652,7 +711,8 @@ var/next_mob_id = 0
|
||||
var/has_arms = get_num_arms()
|
||||
var/ignore_legs = get_leg_ignore()
|
||||
if(ko || resting || stunned || chokehold)
|
||||
drop_all_held_items()
|
||||
drop_r_hand()
|
||||
drop_l_hand()
|
||||
unset_machine()
|
||||
if(pulling)
|
||||
stop_pulling()
|
||||
@@ -676,16 +736,13 @@ var/next_mob_id = 0
|
||||
layer = initial(layer)
|
||||
update_transform()
|
||||
update_action_buttons_icon()
|
||||
if(isliving(src))
|
||||
var/mob/living/L = src
|
||||
if(L.has_status_effect(/datum/status_effect/freon))
|
||||
canmove = 0
|
||||
lying_prev = lying
|
||||
return canmove
|
||||
|
||||
|
||||
/mob/proc/fall(forced)
|
||||
drop_all_held_items()
|
||||
drop_l_hand()
|
||||
drop_r_hand()
|
||||
|
||||
/mob/verb/eastface()
|
||||
set hidden = 1
|
||||
@@ -887,68 +944,34 @@ var/next_mob_id = 0
|
||||
/mob/proc/update_health_hud()
|
||||
return
|
||||
|
||||
/mob/living/vv_edit_var(var_name, var_value)
|
||||
switch(var_name)
|
||||
if("stat")
|
||||
if((stat == DEAD) && (var_value < DEAD))//Bringing the dead back to life
|
||||
dead_mob_list -= src
|
||||
living_mob_list += src
|
||||
if((stat < DEAD) && (var_value == DEAD))//Kill he
|
||||
living_mob_list -= src
|
||||
dead_mob_list += src
|
||||
. = ..()
|
||||
switch(var_name)
|
||||
/mob/living/on_varedit(modified_var)
|
||||
switch(modified_var)
|
||||
if("weakened")
|
||||
SetWeakened(var_value)
|
||||
SetWeakened(weakened)
|
||||
if("stunned")
|
||||
SetStunned(var_value)
|
||||
SetStunned(stunned)
|
||||
if("paralysis")
|
||||
SetParalysis(var_value)
|
||||
SetParalysis(paralysis)
|
||||
if("sleeping")
|
||||
SetSleeping(var_value)
|
||||
SetSleeping(sleeping)
|
||||
if("eye_blind")
|
||||
set_blindness(var_value)
|
||||
set_blindness(eye_blind)
|
||||
if("eye_damage")
|
||||
set_eye_damage(var_value)
|
||||
set_eye_damage(eye_damage)
|
||||
if("eye_blurry")
|
||||
set_blurriness(var_value)
|
||||
set_blurriness(eye_blurry)
|
||||
if("ear_deaf")
|
||||
setEarDamage(-1, var_value)
|
||||
setEarDamage(-1, ear_deaf)
|
||||
if("ear_damage")
|
||||
setEarDamage(var_value, -1)
|
||||
setEarDamage(ear_damage, -1)
|
||||
if("maxHealth")
|
||||
updatehealth()
|
||||
if("resize")
|
||||
update_transform()
|
||||
|
||||
..()
|
||||
|
||||
/mob/proc/is_literate()
|
||||
return 0
|
||||
|
||||
/mob/proc/can_hold_items()
|
||||
return FALSE
|
||||
|
||||
/mob/proc/get_idcard()
|
||||
return
|
||||
|
||||
/mob/vv_get_dropdown()
|
||||
. = ..()
|
||||
. += "---"
|
||||
.["Gib"] = "?_src_=vars;gib=\ref[src]"
|
||||
.["Give Spell"] = "?_src_=vars;give_spell=\ref[src]"
|
||||
.["Remove Spell"] = "?_src_=vars;remove_spell=\ref[src]"
|
||||
.["Give Disease"] = "?_src_=vars;give_disease=\ref[src]"
|
||||
.["Toggle Godmode"] = "?_src_=vars;godmode=\ref[src]"
|
||||
.["Drop Everything"] = "?_src_=vars;drop_everything=\ref[src]"
|
||||
.["Regenerate Icons"] = "?_src_=vars;regenerateicons=\ref[src]"
|
||||
.["Make Space Ninja"] = "?_src_=vars;ninja=\ref[src]"
|
||||
.["Show player panel"] = "?_src_=vars;mob_player_panel=\ref[src]"
|
||||
.["Toggle Build Mode"] = "?_src_=vars;build_mode=\ref[src]"
|
||||
.["Assume Direct Control"] = "?_src_=vars;direct_control=\ref[src]"
|
||||
.["Offer Control to Ghosts"] = "?_src_=vars;offer_control=\ref[src]"
|
||||
|
||||
/mob/vv_get_var(var_name)
|
||||
switch(var_name)
|
||||
if ("attack_log")
|
||||
return debug_variable(var_name, attack_log, 0, src, FALSE)
|
||||
. = ..()
|
||||
Reference in New Issue
Block a user