Adds POI List, makes orbit use it.

This commit is contained in:
AnturK
2015-10-31 19:58:46 +01:00
parent d139f8c6ee
commit a7334f95b6
9 changed files with 31 additions and 61 deletions

View File

@@ -366,13 +366,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)
@@ -388,10 +388,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()

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/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...
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()
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

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()
..()
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)

View File

@@ -79,7 +79,6 @@
hud_possible = list (DIAG_STAT_HUD, DIAG_BATT_HUD, DIAG_MECH_HUD)
/obj/mecha/New()
..()
events = new
@@ -91,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()
@@ -140,6 +140,7 @@
if(internal_tank)
qdel(internal_tank)
SSobj.processing.Remove(src)
poi_list.Remove(src)
equipment.Cut()
cell = null
internal_tank = null

View File

@@ -351,7 +351,7 @@
else
dat += "<tr><td><i>Nuclear Operative not found!</i></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], "
var/atom/disk_loc = N.loc
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 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

View File

@@ -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

View File

@@ -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)