Merge pull request #12778 from AnturK/minor_upgrades

Mech Speech Bubbles, POI list for Observe
This commit is contained in:
Razharas
2015-11-15 09:07:21 +03:00
10 changed files with 43 additions and 64 deletions

View File

@@ -368,13 +368,13 @@ Turf and target are seperate in case you want to teleport some distance from a t
else . = pick(ais) else . = pick(ais)
return . return .
//Returns a list of all mobs with their name //Returns a list of all items of interest with their name
/proc/getmobs() /proc/getpois(mobs_only=0)
var/list/mobs = sortmobs() var/list/mobs = sortmobs()
var/list/names = list() var/list/names = list()
var/list/creatures = list() var/list/pois = list()
var/list/namecounts = list() var/list/namecounts = list()
for(var/mob/M in mobs) for(var/mob/M in mobs)
var/name = M.name var/name = M.name
if (name in names) 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\]" name += " \[ghost\]"
else else
name += " \[dead\]" 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 //Orders mobs by type then by name
/proc/sortmobs() /proc/sortmobs()
var/list/moblist = list() var/list/moblist = list()

View File

@@ -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/table_recipes = list() //list of all table craft recipes
var/global/list/rcd_list = list() //list of Rapid Construction Devices. 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/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... 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

View File

@@ -180,7 +180,7 @@
/datum/game_mode/nuclear/declare_completion() /datum/game_mode/nuclear/declare_completion()
var/disk_rescued = 1 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()) if(!D.onCentcom())
disk_rescued = 0 disk_rescued = 0
break break

View File

@@ -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() /obj/item/weapon/disk/nuclear/New()
..() ..()
poi_list |= src
SSobj.processing |= src SSobj.processing |= src
/obj/item/weapon/disk/nuclear/process() /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() /obj/item/weapon/disk/nuclear/Destroy()
if(blobstart.len > 0) if(blobstart.len > 0)
poi_list.Remove(src)
var/obj/item/weapon/disk/nuclear/NEWDISK = new(pick(blobstart)) var/obj/item/weapon/disk/nuclear/NEWDISK = new(pick(blobstart))
transfer_fingerprints_to(NEWDISK) transfer_fingerprints_to(NEWDISK)
var/turf/diskturf = get_turf(src) var/turf/diskturf = get_turf(src)

View File

@@ -19,6 +19,7 @@
layer = MOB_LAYER - 0.2//icon draw layer layer = MOB_LAYER - 0.2//icon draw layer
infra_luminosity = 15 //byond implementation is bugged. infra_luminosity = 15 //byond implementation is bugged.
force = 5 force = 5
flags = HEAR
var/can_move = 1 var/can_move = 1
var/mob/living/carbon/occupant = null var/mob/living/carbon/occupant = null
var/step_in = 10 //make a step in step_in/10 sec. 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) hud_possible = list (DIAG_STAT_HUD, DIAG_BATT_HUD, DIAG_MECH_HUD)
/obj/mecha/New() /obj/mecha/New()
..() ..()
events = new events = new
@@ -90,6 +90,7 @@
spark_system.attach(src) spark_system.attach(src)
add_cell() add_cell()
SSobj.processing |= src SSobj.processing |= src
poi_list |= src
log_message("[src.name] created.") log_message("[src.name] created.")
mechas_list += src //global mech list mechas_list += src //global mech list
prepare_huds() prepare_huds()
@@ -139,6 +140,7 @@
if(internal_tank) if(internal_tank)
qdel(internal_tank) qdel(internal_tank)
SSobj.processing.Remove(src) SSobj.processing.Remove(src)
poi_list.Remove(src)
equipment.Cut() equipment.Cut()
cell = null cell = null
internal_tank = null internal_tank = null
@@ -333,8 +335,16 @@
return return
/obj/mecha/Hear(message, atom/movable/speaker, message_langs, raw_message, radio_freq, list/spans) /obj/mecha/Hear(message, atom/movable/speaker, message_langs, raw_message, radio_freq, list/spans)
if(speaker == occupant && radio.broadcasting) if(speaker == occupant)
radio.talk_into(speaker, text, , spans) 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 return
//////////////////////////// ////////////////////////////

View File

@@ -125,7 +125,7 @@ var/list/freqtospan = list(
output = "[output]'>" output = "[output]'>"
return output return output
/mob/living/proc/say_test(text) /proc/say_test(text)
var/ending = copytext(text, length(text)) var/ending = copytext(text, length(text))
if (ending == "?") if (ending == "?")
return "1" return "1"

View File

@@ -351,7 +351,7 @@
else else
dat += "<tr><td><i>Nuclear Operative not found!</i></td></tr>" dat += "<tr><td><i>Nuclear Operative not found!</i></td></tr>"
dat += "</table><br><table><tr><td><B>Nuclear Disk(s)</B></td></tr>" dat += "</table><br><table><tr><td><B>Nuclear Disk(s)</B></td></tr>"
for(var/obj/item/weapon/disk/nuclear/N in world) for(var/obj/item/weapon/disk/nuclear/N in poi_list)
dat += "<tr><td>[N.name], " dat += "<tr><td>[N.name], "
var/atom/disk_loc = N.loc var/atom/disk_loc = N.loc
while(!istype(disk_loc, /turf)) while(!istype(disk_loc, /turf))

View File

@@ -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 name = "Orbit" // "Haunt"
set desc = "Follow and orbit a mob." 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/input = input("Please, select a mob!", "Haunt", null, null) as null|anything in mobs
var/mob/target = mobs[input] var/mob/target = mobs[input]
ManualFollow(target) 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/list/dest = list() //List of possible destinations (mobs)
var/target = null //Chosen target. 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 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 if (!target)//Make sure we actually have a target

View File

@@ -539,55 +539,7 @@ var/list/slot_equipment_priority = list( \
if(is_admin && stat == DEAD) if(is_admin && stat == DEAD)
is_admin = 0 is_admin = 0
var/list/names = list() var/list/creatures = getpois()
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
client.perspective = EYE_PERSPECTIVE client.perspective = EYE_PERSPECTIVE

View File

@@ -34,6 +34,7 @@
src.energy = starting_energy src.energy = starting_energy
..() ..()
SSobj.processing |= src SSobj.processing |= src
poi_list |= src
for(var/obj/machinery/power/singularity_beacon/singubeacon in machines) for(var/obj/machinery/power/singularity_beacon/singubeacon in machines)
if(singubeacon.active) if(singubeacon.active)
target = singubeacon target = singubeacon
@@ -42,6 +43,7 @@
/obj/singularity/Destroy() /obj/singularity/Destroy()
SSobj.processing.Remove(src) SSobj.processing.Remove(src)
poi_list.Remove(src)
return ..() return ..()
/obj/singularity/Move(atom/newloc, direct) /obj/singularity/Move(atom/newloc, direct)