mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
# Conflicts: # code/__defines/holomap.dm # code/__defines/mobs.dm # code/_helpers/icons.dm # code/_helpers/unsorted.dm # code/_onclick/hud/hud.dm # code/_onclick/item_attack.dm # code/controllers/Processes/supply.dm # code/controllers/subsystems/planets.dm # code/datums/supplypacks/munitions.dm # code/datums/supplypacks/science.dm # code/datums/supplypacks/security.dm # code/datums/supplypacks/supply.dm # code/game/area/Space Station 13 areas.dm # code/game/atoms_movable.dm # code/game/machinery/autolathe.dm # code/game/machinery/doors/door.dm # code/game/machinery/jukebox.dm # code/game/machinery/recharger.dm # code/game/machinery/vending.dm # code/game/mecha/equipment/tools/medical_tools.dm # code/game/mecha/equipment/weapons/weapons.dm # code/game/objects/items/devices/PDA/PDA.dm # code/game/objects/items/devices/megaphone.dm # code/game/objects/items/poi_items.dm # code/game/objects/items/weapons/implants/implantlanguage.dm # code/game/objects/items/weapons/storage/firstaid.dm # code/game/objects/items/weapons/tools/weldingtool.dm # code/game/objects/structures/flora/trees.dm # code/game/objects/structures/plasticflaps.dm # code/game/supplyshuttle.dm # code/game/turfs/simulated/wall_attacks.dm # code/modules/admin/admin_verbs.dm # code/modules/assembly/infrared.dm # code/modules/client/client procs.dm # code/modules/client/preference_setup/loadout/loadout_utility.dm # code/modules/client/preferences.dm # code/modules/clothing/suits/miscellaneous.dm # code/modules/holomap/holomap_datum.dm # code/modules/holomap/station_holomap.dm # code/modules/integrated_electronics/core/printer.dm # code/modules/mining/machine_processing.dm # code/modules/mob/living/carbon/human/human_defense.dm # code/modules/mob/living/carbon/human/species/virtual_reality/avatar.dm # code/modules/mob/living/death.dm # code/modules/mob/living/silicon/ai/ai.dm # code/modules/mob/living/silicon/pai/pai.dm # code/modules/mob/living/silicon/robot/robot.dm # code/modules/mob/living/simple_animal/animals/parrot.dm # code/modules/mob/mob_movement.dm # code/modules/organs/organ_external.dm # code/modules/organs/organ_icon.dm # code/modules/organs/subtypes/standard.dm # code/modules/planet/weather.dm # code/modules/power/cable.dm # code/modules/power/fusion/core/core_control.dm # code/modules/power/fusion/fuel_assembly/fuel_control.dm # code/modules/power/fusion/gyrotron/gyrotron_control.dm # code/modules/projectiles/gun.dm # code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Food-Drinks.dm # config/names/first_name_skrell.txt # config/names/last_name_skrell.txt # icons/mob/head.dmi # icons/mob/robots.dmi # icons/mob/species/tajaran/helmet.dmi # icons/obj/ammo.dmi # icons/obj/gun.dmi # icons/obj/mining.dmi # icons/obj/projectiles.dmi # icons/obj/rig_modules.dmi # icons/obj/surgery.dmi # icons/turf/walls.dmi # maps/southern_cross/southern_cross-1.dmm # maps/southern_cross/southern_cross-3.dmm # maps/southern_cross/southern_cross-6.dmm # maps/southern_cross/southern_cross-8.dmm # maps/submaps/surface_submaps/mountains/backup/IceCave1.dmm # maps/submaps/surface_submaps/mountains/backup/IceCave1A.dmm # maps/submaps/surface_submaps/mountains/backup/IceCave1B.dmm # maps/submaps/surface_submaps/mountains/backup/IceCave1C.dmm # maps/submaps/surface_submaps/mountains/crashedcontainmentshuttle.dmm # maps/submaps/surface_submaps/mountains/deadspy.dmm # maps/submaps/surface_submaps/mountains/mountains_areas.dm # maps/submaps/surface_submaps/plains/Thiefc.dmm # maps/~map_system/maps.dm # vorestation.dme
134 lines
3.7 KiB
Plaintext
134 lines
3.7 KiB
Plaintext
/mob // TODO: rewrite as obj.
|
|
var/mob/zshadow/shadow
|
|
|
|
/mob/zshadow
|
|
plane = OVER_OPENSPACE_PLANE
|
|
name = "shadow"
|
|
desc = "Z-level shadow"
|
|
status_flags = GODMODE
|
|
anchored = 1
|
|
unacidable = 1
|
|
density = 0
|
|
opacity = 0 // Don't trigger lighting recalcs gah! TODO - consider multi-z lighting.
|
|
//auto_init = FALSE // We do not need to be initialize()d
|
|
var/mob/owner = null // What we are a shadow of.
|
|
|
|
/mob/zshadow/can_fall()
|
|
return FALSE
|
|
|
|
/mob/zshadow/New(var/mob/L)
|
|
if(!istype(L))
|
|
qdel(src)
|
|
return
|
|
owner = L
|
|
sync_icon(L)
|
|
|
|
/mob/zshadow/Destroy()
|
|
owner = null
|
|
..() //But we don't return because the hint is wrong
|
|
return QDEL_HINT_QUEUE
|
|
|
|
/mob/Destroy()
|
|
QDEL_NULL(shadow)
|
|
. = ..()
|
|
|
|
/mob/zshadow/examine(mob/user, distance, infix, suffix)
|
|
if(!owner)
|
|
// The only time we should have a null owner is if we are in nullspace. Help figure out why we were examined.
|
|
crash_with("[src] ([type]) @ [log_info_line()] was examined by [user] @ [global.log_info_line(user)]")
|
|
return
|
|
return owner.examine(user, distance, infix, suffix)
|
|
|
|
// Relay some stuff they hear
|
|
/mob/zshadow/hear_say(var/message, var/verb = "says", var/datum/language/language = null, var/alt_name = "", var/italics = 0, var/mob/speaker = null, var/sound/speech_sound, var/sound_vol)
|
|
if(speaker && speaker.z != src.z)
|
|
return // Only relay speech on our acutal z, otherwise we might relay sounds that were themselves relayed up!
|
|
if(isliving(owner))
|
|
verb += " from above"
|
|
return owner.hear_say(message, verb, language, alt_name, italics, speaker, speech_sound, sound_vol)
|
|
|
|
/mob/zshadow/proc/sync_icon(var/mob/M)
|
|
name = M.name
|
|
icon = M.icon
|
|
icon_state = M.icon_state
|
|
//color = M.color
|
|
color = "#848484"
|
|
overlays = M.overlays
|
|
transform = M.transform
|
|
dir = M.dir
|
|
invisibility = M.invisibility
|
|
if(shadow)
|
|
shadow.sync_icon(src)
|
|
|
|
/mob/living/Move()
|
|
. = ..()
|
|
check_shadow()
|
|
|
|
/mob/living/forceMove()
|
|
. = ..()
|
|
check_shadow()
|
|
|
|
/mob/living/on_mob_jump()
|
|
// We're about to be admin-jumped.
|
|
// Unfortuantely loc isn't set until after this proc is called. So we must spawn() so check_shadow executes with the new loc.
|
|
. = ..()
|
|
if(shadow)
|
|
spawn(0)
|
|
check_shadow()
|
|
|
|
/mob/living/proc/check_shadow()
|
|
var/mob/M = src
|
|
if(isturf(M.loc))
|
|
var/turf/simulated/open/OS = GetAbove(src)
|
|
while(OS && istype(OS))
|
|
if(!M.shadow)
|
|
M.shadow = new /mob/zshadow(M)
|
|
M.shadow.forceMove(OS)
|
|
M = M.shadow
|
|
OS = GetAbove(M)
|
|
// The topmost level does not need a shadow!
|
|
if(M.shadow)
|
|
qdel(M.shadow)
|
|
M.shadow = null
|
|
|
|
//
|
|
// Handle cases where the owner mob might have changed its icon or overlays.
|
|
//
|
|
|
|
/mob/living/update_icons()
|
|
. = ..()
|
|
if(shadow)
|
|
shadow.sync_icon(src)
|
|
|
|
// WARNING - the true carbon/human/update_icons does not call ..(), therefore we must sideways override this.
|
|
// But be careful, we don't want to screw with that proc. So lets be cautious about what we do here.
|
|
/mob/living/carbon/human/update_icons()
|
|
. = ..()
|
|
if(shadow)
|
|
shadow.sync_icon(src)
|
|
|
|
/mob/set_dir(new_dir)
|
|
. = ..()
|
|
if(shadow)
|
|
shadow.set_dir(new_dir)
|
|
|
|
// Transfer messages about what we are doing to upstairs
|
|
/mob/visible_message(var/message, var/self_message, var/blind_message)
|
|
. = ..()
|
|
if(shadow)
|
|
shadow.visible_message(message, self_message, blind_message)
|
|
|
|
/mob/zshadow/set_typing_indicator(var/state)
|
|
if(!typing_indicator)
|
|
typing_indicator = new
|
|
typing_indicator.icon = 'icons/mob/talk_vr.dmi' // Looks better on the right with job icons. //VOREStation Edit - talk_vr.dmi instead of talk.dmi for right-side icons
|
|
typing_indicator.icon_state = "typing"
|
|
if(state && !typing)
|
|
overlays += typing_indicator
|
|
typing = 1
|
|
else if(!state && typing)
|
|
overlays -= typing_indicator
|
|
typing = 0
|
|
if(shadow)
|
|
shadow.set_typing_indicator(state)
|