From d139f8c6ee7d0a0f2b9d3b33f25b2a4366dce5eb Mon Sep 17 00:00:00 2001 From: AnturK Date: Sat, 31 Oct 2015 14:42:12 +0100 Subject: [PATCH 1/4] Mecha Speech Bubbles --- code/game/mecha/mecha.dm | 13 +++++++++++-- code/game/say.dm | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 5ffbfc0e68e1..4d70eab12510 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. @@ -333,8 +334,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 ec015f496743..e4d53e7b5b54 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" From a7334f95b67bdd20275087b49165af8d3e3870e3 Mon Sep 17 00:00:00 2001 From: AnturK Date: Sat, 31 Oct 2015 19:58:46 +0100 Subject: [PATCH 2/4] Adds POI List, makes orbit use it. --- code/__HELPERS/unsorted.dm | 24 ++++++--- code/_globalvars/lists/objects.dm | 3 +- code/game/gamemodes/nuclear/nuclear.dm | 2 +- code/game/gamemodes/nuclear/nuclearbomb.dm | 2 + code/game/mecha/mecha.dm | 3 +- code/modules/admin/player_panel.dm | 2 +- code/modules/mob/dead/observer/observer.dm | 4 +- code/modules/mob/mob.dm | 50 +------------------ code/modules/power/singularity/singularity.dm | 2 + 9 files changed, 31 insertions(+), 61 deletions(-) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 676c81fdb43d..92ca2cfae55c 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -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() diff --git a/code/_globalvars/lists/objects.dm b/code/_globalvars/lists/objects.dm index 0df52bd675d9..647c2274bf3c 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 aa1e62280ffc..094831fbed55 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 f9596694bcd3..c96b6a5f70bc 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 4d70eab12510..f318ec85e7ff 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -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 diff --git a/code/modules/admin/player_panel.dm b/code/modules/admin/player_panel.dm index d8c04a9bbd6d..1c6597943dcc 100644 --- a/code/modules/admin/player_panel.dm +++ b/code/modules/admin/player_panel.dm @@ -351,7 +351,7 @@ else dat += "Nuclear Operative not found!" dat += "
" - for(var/obj/item/weapon/disk/nuclear/N in world) + for(var/obj/item/weapon/disk/nuclear/N in poi_list) 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 5f90462a02fa..089c03d2e394 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 c8921d96e995..a6e22916ca9a 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 b2a8f3d3a994..6fe3f6f91b8c 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) From 70222112f87417be209851b7a01ce6cd2201804a Mon Sep 17 00:00:00 2001 From: AnturK Date: Sat, 31 Oct 2015 23:02:50 +0100 Subject: [PATCH 3/4] Makes mechs use some of pilot huds (job,wanted,loyalty,antag) --- code/game/mecha/mecha.dm | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index f318ec85e7ff..f3af3bfa8171 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -77,7 +77,7 @@ var/datum/action/innate/mecha/mech_toggle_lights/lights_action = new var/datum/action/innate/mecha/mech_view_stats/stats_action = new - hud_possible = list (DIAG_STAT_HUD, DIAG_BATT_HUD, DIAG_MECH_HUD) + hud_possible = list (DIAG_STAT_HUD, DIAG_BATT_HUD, DIAG_MECH_HUD,ANTAG_HUD,ID_HUD,WANTED_HUD,IMPLOYAL_HUD,ANTAG_HUD) /obj/mecha/New() ..() @@ -727,6 +727,18 @@ playsound(src, 'sound/machines/windowdoor.ogg', 50, 1) if(!internal_damage) occupant << sound('sound/mecha/nominal.ogg',volume=50) + + //transfer HUD icons + for(var/hud_type in occupant.hud_possible) + if(hud_type in hud_possible) + var/image/mech_hud = hud_list[hud_type] + var/image/occupant_hud = occupant.hud_list[hud_type] + mech_hud.icon_state = occupant_hud.icon_state + //add mech to the huds + for(var/datum/atom_hud/hud in huds) + if(occupant in hud.hudatoms) + hud.add_to_hud(src) + return 1 else return 0 @@ -801,6 +813,14 @@ if(ishuman(occupant)) mob_container = occupant RemoveActions(occupant, human_occupant=1) + for(var/hud_type in occupant.hud_possible) + if(hud_type in hud_possible) + var/image/holder = hud_list[hud_type] + holder.icon_state = "" + //remove mech from huds + for(var/datum/atom_hud/hud in huds) + if(occupant in hud.hudatoms) + hud.remove_from_hud(src) else if(istype(occupant, /mob/living/carbon/brain)) var/mob/living/carbon/brain/brain = occupant RemoveActions(brain) From 686366fe98f0cc6cc8cd5915dbd33dec323361f8 Mon Sep 17 00:00:00 2001 From: AnturK Date: Wed, 11 Nov 2015 17:39:42 +0100 Subject: [PATCH 4/4] Revert "Makes mechs use some of pilot huds (job,wanted,loyalty,antag)" --- code/game/mecha/mecha.dm | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index f3af3bfa8171..f318ec85e7ff 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -77,7 +77,7 @@ var/datum/action/innate/mecha/mech_toggle_lights/lights_action = new var/datum/action/innate/mecha/mech_view_stats/stats_action = new - hud_possible = list (DIAG_STAT_HUD, DIAG_BATT_HUD, DIAG_MECH_HUD,ANTAG_HUD,ID_HUD,WANTED_HUD,IMPLOYAL_HUD,ANTAG_HUD) + hud_possible = list (DIAG_STAT_HUD, DIAG_BATT_HUD, DIAG_MECH_HUD) /obj/mecha/New() ..() @@ -727,18 +727,6 @@ playsound(src, 'sound/machines/windowdoor.ogg', 50, 1) if(!internal_damage) occupant << sound('sound/mecha/nominal.ogg',volume=50) - - //transfer HUD icons - for(var/hud_type in occupant.hud_possible) - if(hud_type in hud_possible) - var/image/mech_hud = hud_list[hud_type] - var/image/occupant_hud = occupant.hud_list[hud_type] - mech_hud.icon_state = occupant_hud.icon_state - //add mech to the huds - for(var/datum/atom_hud/hud in huds) - if(occupant in hud.hudatoms) - hud.add_to_hud(src) - return 1 else return 0 @@ -813,14 +801,6 @@ if(ishuman(occupant)) mob_container = occupant RemoveActions(occupant, human_occupant=1) - for(var/hud_type in occupant.hud_possible) - if(hud_type in hud_possible) - var/image/holder = hud_list[hud_type] - holder.icon_state = "" - //remove mech from huds - for(var/datum/atom_hud/hud in huds) - if(occupant in hud.hudatoms) - hud.remove_from_hud(src) else if(istype(occupant, /mob/living/carbon/brain)) var/mob/living/carbon/brain/brain = occupant RemoveActions(brain)