diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 25f1aece752..f333fe7b68a 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -368,13 +368,13 @@ Turf and target are seperate in case you want to teleport some distance from a t else . = pick(ais) return . -//Returns a list of all mobs with their name -/proc/getmobs() - +//Returns a list of all items of interest with their name +/proc/getpois(mobs_only=0) var/list/mobs = sortmobs() var/list/names = list() - var/list/creatures = list() + var/list/pois = list() var/list/namecounts = list() + for(var/mob/M in mobs) var/name = M.name if (name in names) @@ -390,10 +390,22 @@ Turf and target are seperate in case you want to teleport some distance from a t name += " \[ghost\]" else name += " \[dead\]" - creatures[name] = M + pois[name] = M - return creatures + if(!mobs_only) + for(var/atom/A in poi_list) + if(!A || !A.loc) + continue + var/name = A.name + if (names.Find(name)) + namecounts[name]++ + name = "[name] ([namecounts[name]])" + else + names.Add(name) + namecounts[name] = 1 + pois[name] = A + return pois //Orders mobs by type then by name /proc/sortmobs() var/list/moblist = list() diff --git a/code/_globalvars/lists/objects.dm b/code/_globalvars/lists/objects.dm index 0df52bd675d..647c2274bf3 100644 --- a/code/_globalvars/lists/objects.dm +++ b/code/_globalvars/lists/objects.dm @@ -15,4 +15,5 @@ var/global/list/surgeries_list = list() //list of all surgeries by name, asso var/global/list/table_recipes = list() //list of all table craft recipes var/global/list/rcd_list = list() //list of Rapid Construction Devices. var/global/list/apcs_list = list() //list of all Area Power Controller machines, seperate from machines for powernet speeeeeeed. -var/global/list/tracked_implants = list() //list of all current implants that are tracked to work out what sort of trek everyone is on. Sadly not on lavaworld not implemented... \ No newline at end of file +var/global/list/tracked_implants = list() //list of all current implants that are tracked to work out what sort of trek everyone is on. Sadly not on lavaworld not implemented... +var/global/list/poi_list = list() //list of points of interest for observe/follow \ No newline at end of file diff --git a/code/game/gamemodes/nuclear/nuclear.dm b/code/game/gamemodes/nuclear/nuclear.dm index a7f098034c9..4c6231db4e3 100644 --- a/code/game/gamemodes/nuclear/nuclear.dm +++ b/code/game/gamemodes/nuclear/nuclear.dm @@ -180,7 +180,7 @@ /datum/game_mode/nuclear/declare_completion() var/disk_rescued = 1 - for(var/obj/item/weapon/disk/nuclear/D in world) + for(var/obj/item/weapon/disk/nuclear/D in poi_list) if(!D.onCentcom()) disk_rescued = 0 break diff --git a/code/game/gamemodes/nuclear/nuclearbomb.dm b/code/game/gamemodes/nuclear/nuclearbomb.dm index f9596694bcd..c96b6a5f70b 100644 --- a/code/game/gamemodes/nuclear/nuclearbomb.dm +++ b/code/game/gamemodes/nuclear/nuclearbomb.dm @@ -411,6 +411,7 @@ This is here to make the tiles around the station mininuke change when it's arme /obj/item/weapon/disk/nuclear/New() ..() + poi_list |= src SSobj.processing |= src /obj/item/weapon/disk/nuclear/process() @@ -421,6 +422,7 @@ This is here to make the tiles around the station mininuke change when it's arme /obj/item/weapon/disk/nuclear/Destroy() if(blobstart.len > 0) + poi_list.Remove(src) var/obj/item/weapon/disk/nuclear/NEWDISK = new(pick(blobstart)) transfer_fingerprints_to(NEWDISK) var/turf/diskturf = get_turf(src) diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 5ffbfc0e68e..f318ec85e7f 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -19,6 +19,7 @@ layer = MOB_LAYER - 0.2//icon draw layer infra_luminosity = 15 //byond implementation is bugged. force = 5 + flags = HEAR var/can_move = 1 var/mob/living/carbon/occupant = null var/step_in = 10 //make a step in step_in/10 sec. @@ -78,7 +79,6 @@ hud_possible = list (DIAG_STAT_HUD, DIAG_BATT_HUD, DIAG_MECH_HUD) - /obj/mecha/New() ..() events = new @@ -90,6 +90,7 @@ spark_system.attach(src) add_cell() SSobj.processing |= src + poi_list |= src log_message("[src.name] created.") mechas_list += src //global mech list prepare_huds() @@ -139,6 +140,7 @@ if(internal_tank) qdel(internal_tank) SSobj.processing.Remove(src) + poi_list.Remove(src) equipment.Cut() cell = null internal_tank = null @@ -333,8 +335,16 @@ return /obj/mecha/Hear(message, atom/movable/speaker, message_langs, raw_message, radio_freq, list/spans) - if(speaker == occupant && radio.broadcasting) - radio.talk_into(speaker, text, , spans) + if(speaker == occupant) + if(radio.broadcasting) + radio.talk_into(speaker, text, , spans) + //flick speech bubble + var/list/speech_bubble_recipients = list() + for(var/mob/M in get_hearers_in_view(7,src)) + if(M.client) + speech_bubble_recipients.Add(M.client) + spawn(0) + flick_overlay(image('icons/mob/talk.dmi', src, "hR[say_test(raw_message)]",MOB_LAYER+1), speech_bubble_recipients, 30) return //////////////////////////// diff --git a/code/game/say.dm b/code/game/say.dm index ec015f49674..e4d53e7b5b5 100644 --- a/code/game/say.dm +++ b/code/game/say.dm @@ -125,7 +125,7 @@ var/list/freqtospan = list( output = "[output]'>" return output -/mob/living/proc/say_test(text) +/proc/say_test(text) var/ending = copytext(text, length(text)) if (ending == "?") return "1" diff --git a/code/modules/admin/player_panel.dm b/code/modules/admin/player_panel.dm index bbb6e4dfc5a..39f37bc3d1a 100644 --- a/code/modules/admin/player_panel.dm +++ b/code/modules/admin/player_panel.dm @@ -351,7 +351,7 @@ else dat += "
| Nuclear Disk(s) |
| [N.name], " var/atom/disk_loc = N.loc while(!istype(disk_loc, /turf)) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index beeea0a9c18..d4275f094c6 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -207,7 +207,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp set name = "Orbit" // "Haunt" set desc = "Follow and orbit a mob." - var/list/mobs = getmobs() + var/list/mobs = getpois() var/input = input("Please, select a mob!", "Haunt", null, null) as null|anything in mobs var/mob/target = mobs[input] ManualFollow(target) @@ -246,7 +246,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp var/list/dest = list() //List of possible destinations (mobs) var/target = null //Chosen target. - dest += getmobs() //Fill list, prompt user with list + dest += getpois(mobs_only=1) //Fill list, prompt user with list target = input("Please, select a player!", "Jump to Mob", null, null) as null|anything in dest if (!target)//Make sure we actually have a target diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 3163b7a5289..b18f64eb6c4 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -539,55 +539,7 @@ var/list/slot_equipment_priority = list( \ if(is_admin && stat == DEAD) is_admin = 0 - var/list/names = list() - var/list/namecounts = list() - var/list/creatures = list() - - for(var/obj/O in world) //EWWWWWWWWWWWWWWWWWWWWWWWW ~needs to be optimised - if(!O.loc) - continue - if(istype(O, /obj/item/weapon/disk/nuclear)) - var/name = "Nuclear Disk" - if (names.Find(name)) - namecounts[name]++ - name = "[name] ([namecounts[name]])" - else - names.Add(name) - namecounts[name] = 1 - creatures[name] = O - - if(istype(O, /obj/singularity)) - var/name = "Singularity" - if (names.Find(name)) - namecounts[name]++ - name = "[name] ([namecounts[name]])" - else - names.Add(name) - namecounts[name] = 1 - creatures[name] = O - - if(istype(O, /obj/machinery/bot)) - var/name = "BOT: [O.name]" - if (names.Find(name)) - namecounts[name]++ - name = "[name] ([namecounts[name]])" - else - names.Add(name) - namecounts[name] = 1 - creatures[name] = O - - - for(var/mob/M in sortNames(mob_list)) - var/name = M.name - if (names.Find(name)) - namecounts[name]++ - name = "[name] ([namecounts[name]])" - else - names.Add(name) - namecounts[name] = 1 - - creatures[name] = M - + var/list/creatures = getpois() client.perspective = EYE_PERSPECTIVE diff --git a/code/modules/power/singularity/singularity.dm b/code/modules/power/singularity/singularity.dm index b2a8f3d3a99..6fe3f6f91b8 100644 --- a/code/modules/power/singularity/singularity.dm +++ b/code/modules/power/singularity/singularity.dm @@ -34,6 +34,7 @@ src.energy = starting_energy ..() SSobj.processing |= src + poi_list |= src for(var/obj/machinery/power/singularity_beacon/singubeacon in machines) if(singubeacon.active) target = singubeacon @@ -42,6 +43,7 @@ /obj/singularity/Destroy() SSobj.processing.Remove(src) + poi_list.Remove(src) return ..() /obj/singularity/Move(atom/newloc, direct) |