From 62afefaf2cd4c8b23b81145bdddb17ae7a7e8ca6 Mon Sep 17 00:00:00 2001 From: Markolie Date: Tue, 24 Jan 2017 22:07:12 +0100 Subject: [PATCH] Further station goal fixes, fix communication computer messages --- code/__DEFINES/misc.dm | 2 +- code/defines/procs/orphaned.dm | 2 +- code/game/gamemodes/game_mode.dm | 6 ++- .../game/machinery/computer/communications.dm | 41 ++++++++++--------- code/modules/admin/verbs/randomverbs.dm | 6 +-- code/modules/station_goals/bsa.dm | 17 ++++---- code/modules/station_goals/dna_vault.dm | 30 +++++++------- code/modules/station_goals/shield.dm | 11 +++-- nano/templates/comm_console.tmpl | 10 ++--- 9 files changed, 66 insertions(+), 59 deletions(-) diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index 699df755703..e160f5327b6 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -300,4 +300,4 @@ #define OOC_COOLDOWN 5 // The number of station goals generated each round. -#define STATION_GOAL_BUDGET 1 \ No newline at end of file +#define STATION_GOAL_BUDGET 3 \ No newline at end of file diff --git a/code/defines/procs/orphaned.dm b/code/defines/procs/orphaned.dm index 4a7055b24e5..5ceafcf0031 100644 --- a/code/defines/procs/orphaned.dm +++ b/code/defines/procs/orphaned.dm @@ -1,6 +1,6 @@ /proc/print_command_report(text = "", title = "Central Command Update") for(var/obj/machinery/computer/communications/C in machines) - if(!(C.stat & (BROKEN|NOPOWER)) && C.z == STATION_LEVEL) + if(!(C.stat & (BROKEN|NOPOWER)) && is_station_contact(C.z)) var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(C.loc) P.name = "paper- '[title]'" P.info = text diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 5d4d7d7b93f..2a9c9851478 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -496,12 +496,14 @@ proc/get_nt_opposed() send_station_goals_message() /datum/game_mode/proc/send_station_goals_message() - var/message_text = "[command_name()] Orders
" - message_text += "Special Orders for [station_name()]:" + var/message_text = "
" + message_text += "

[command_name()] Orders


" + message_text += "Special Orders for [station_name()]:

" for(var/datum/station_goal/G in station_goals) G.on_report() message_text += G.get_report() + message_text += "
" print_command_report(message_text, "[command_name()] Orders") diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index 8b838ceade5..ed5e3d2fb00 100644 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -172,24 +172,26 @@ setMenuState(usr,COMM_SCREEN_MAIN) if("messagelist") - src.currmsg = 0 + currmsg = 0 if(href_list["msgid"]) setCurrentMessage(usr, text2num(href_list["msgid"])) setMenuState(usr,COMM_SCREEN_MESSAGES) if("delmessage") if(href_list["msgid"]) - src.currmsg = text2num(href_list["msgid"]) + currmsg = text2num(href_list["msgid"]) var/response = alert("Are you sure you wish to delete this message?", "Confirm", "Yes", "No") if(response == "Yes") - if(src.currmsg) + if(currmsg) var/id = getCurrentMessage() - var/title = src.messagetitle[id] - var/text = src.messagetext[id] - src.messagetitle.Remove(title) - src.messagetext.Remove(text) - if(currmsg==id) currmsg=0 - if(aicurrmsg==id) aicurrmsg=0 + var/title = messagetitle[id] + var/text = messagetext[id] + messagetitle.Remove(title) + messagetext.Remove(text) + if(currmsg == id) + currmsg = 0 + if(aicurrmsg == id) + aicurrmsg = 0 setMenuState(usr,COMM_SCREEN_MESSAGES) if("status") @@ -336,7 +338,7 @@ /obj/machinery/computer/communications/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state) var/data[0] - data["is_ai"] = isAI(user)||isrobot(user) + data["is_ai"] = isAI(user) || isrobot(user) data["menu_state"] = data["is_ai"] ? ai_menu_state : menu_state data["emagged"] = emagged data["authenticated"] = is_authenticated(user, 0) @@ -368,16 +370,15 @@ list("id" = SEC_LEVEL_BLUE, "name" = "Blue"), //SEC_LEVEL_RED = list("name"="Red"), ) - - var/msg_data[0] - for(var/i = 1; i <= src.messagetext.len; i++) - var/cur_msg[0] - cur_msg["title"] = messagetitle[i] - cur_msg["body"] = messagetext[i] - msg_data += list(cur_msg) + + var/list/msg_data = list() + for(var/i = 1; i <= messagetext.len; i++) + msg_data.Add(list(list("title" = messagetitle[i], "body" = messagetext[i], "id" = i))) data["messages"] = msg_data - data["current_message"] = data["is_ai"] ? aicurrmsg : currmsg + if((data["is_ai"] && aicurrmsg) || (!data["is_ai"] && currmsg)) + data["current_message"] = data["is_ai"] ? messagetext[aicurrmsg] : messagetext[currmsg] + data["current_message_title"] = data["is_ai"] ? messagetitle[aicurrmsg] : messagetitle[currmsg] data["lastCallLoc"] = shuttle_master.emergencyLastCallLoc ? format_text(shuttle_master.emergencyLastCallLoc.name) : null @@ -403,9 +404,9 @@ /obj/machinery/computer/communications/proc/setCurrentMessage(var/mob/user,var/value) if(isAI(user) || isrobot(user)) - aicurrmsg=value + aicurrmsg = value else - currmsg=value + currmsg = value /obj/machinery/computer/communications/proc/getCurrentMessage(var/mob/user) if(isAI(user) || isrobot(user)) diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 263758ee605..6b4660a8a37 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -899,7 +899,7 @@ Traitors and the like can also be revived with the previous role mostly intact. /client/proc/modify_goals() set category = "Event" - set name = "Modify station goals" + set name = "Modify Station Goals" if(!check_rights(R_EVENT)) return @@ -909,6 +909,6 @@ Traitors and the like can also be revived with the previous role mostly intact. /datum/admins/proc/modify_goals() var/dat = "" for(var/datum/station_goal/S in ticker.mode.station_goals) - dat += "[S.name] - Announce | Remove
" - dat += "
Add New Goal" + dat += "[S.name] - Announce | Remove
" + dat += "
Add New Goal" usr << browse(dat, "window=goals;size=400x400") \ No newline at end of file diff --git a/code/modules/station_goals/bsa.dm b/code/modules/station_goals/bsa.dm index 7546338ea5b..1c886ce71a3 100644 --- a/code/modules/station_goals/bsa.dm +++ b/code/modules/station_goals/bsa.dm @@ -6,11 +6,12 @@ name = "Bluespace Artillery" /datum/station_goal/bluespace_cannon/get_report() - return {"Our military presence is inadequate in your sector. - We need you to construct BSA-[rand(1,99)] Artillery position aboard your station. - - Base parts should be available for shipping by your cargo shuttle. - -Nanotrasen Naval Command"} + return {"Bluespace Artillery position construction
+ Our military presence is inadequate in your sector. We need you to construct BSA-[rand(1,99)] Artillery position aboard your station. +

+ Its base parts should be available for shipping by your cargo shuttle. +
+ -Nanotrasen Naval Command"} /datum/station_goal/bluespace_cannon/on_report() //Unlock BSA parts @@ -21,7 +22,7 @@ if(..()) return TRUE var/obj/machinery/bsa/full/B = locate() - if(B && !B.stat && B.z == STATION_LEVEL) + if(B && !B.stat && is_station_contact(B.z)) return TRUE return FALSE @@ -248,9 +249,11 @@ icon_keyboard = "accelerator_key" icon_state = "computer-wires" var/area_aim = FALSE //should also show areas for targeting + var/target_all_areas = FALSE //allows all areas (including admin areas) to be targetted /obj/machinery/computer/bsa_control/admin area_aim = TRUE + target_all_areas = TRUE /obj/machinery/computer/bsa_control/attack_hand(mob/user) if(..()) @@ -294,7 +297,7 @@ var/list/options = gps_locators if(area_aim) - options += ghostteleportlocs + options += target_all_areas ? ghostteleportlocs : teleportlocs var/V = input(user,"Select target", "Select target",null) in options|null target = options[V] diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm index a9fc977b02f..38855aece3c 100644 --- a/code/modules/station_goals/dna_vault.dm +++ b/code/modules/station_goals/dna_vault.dm @@ -24,21 +24,22 @@ /datum/station_goal/dna_vault/proc/non_standard_plants_count() . = 0 - for(var/T in subtypesof(/datum/seed)) //put a cache if it's used anywhere else - var/datum/seed/S = T + for(var/T in plant_controller.seeds) + var/datum/seed/S = plant_controller.seeds[T] if(S.get_trait(TRAIT_RARITY) > 0) .++ /datum/station_goal/dna_vault/get_report() - return {"Our long term prediction systems say there's 99% chance of system-wide cataclysm in near future. - We need you to construct DNA Vault aboard your station. - - DNA Vault needs to contain samples of: - [animal_count] unique animal data - [plant_count] unique non-standard plant data - [human_count] unique sapient humanoid DNA data - - Base vault parts should be availible for shipping by your cargo shuttle."} + return {"DNA Vault construction
+ Our long term prediction systems say there's 99% chance of system-wide cataclysm in near future. As such, we need you to construct a DNA Vault aboard your station. +

+ The DNA Vault needs to contain samples of: + + The base vault parts should be available for shipping by your cargo shuttle."} /datum/station_goal/dna_vault/on_report() var/datum/supply_packs/P = shuttle_master.supply_packs["[/datum/supply_packs/misc/dna_vault]"] @@ -51,7 +52,7 @@ if(..()) return TRUE for(var/obj/machinery/dna_vault/V in machines) - if(V.animals.len >= animal_count && V.plants.len >= plant_count && V.dna.len >= human_count && V.z == STATION_LEVEL) + if(V.animals.len >= animal_count && V.plants.len >= plant_count && V.dna.len >= human_count && is_station_contact(V.z)) return TRUE return FALSE @@ -250,8 +251,9 @@ var/list/non_simple_animals = typecacheof(list(/mob/living/carbon/human/monkey,/ /obj/machinery/dna_vault/proc/upgrade(mob/living/carbon/human/H, upgrade_type) if(!(upgrade_type in power_lottery[H])) return - to_chat(H, "[src] stabilizes your genes, granting you the ability to have multiple powers.") - H.ignore_gene_stability = 1 + if(!H.ignore_gene_stability) + to_chat(H, "[src] stabilizes your genes, granting you the ability to have multiple powers.") + H.ignore_gene_stability = 1 switch(upgrade_type) if(VAULT_SPACEIMMUNE) to_chat(H, "You suddenly don't feel the need to breathe anymore. Your body also feels very warm.") diff --git a/code/modules/station_goals/shield.dm b/code/modules/station_goals/shield.dm index 9b5478285ed..f39f731e9c4 100644 --- a/code/modules/station_goals/shield.dm +++ b/code/modules/station_goals/shield.dm @@ -6,11 +6,10 @@ var/coverage_goal = 500 /datum/station_goal/station_shield/get_report() - return {"The station is located in a zone full of space debris. - We have a prototype shielding system you will deploy to reduce collision related accidents. - - You can order the satellites and control systems through cargo shuttle. - "} + return {"Station Shield construction
+ The station is located in a zone full of space debris. We have a prototype shielding system you will deploy to reduce collision related accidents. +

+ You can order the satellites and control systems through cargo shuttle."} /datum/station_goal/station_shield/on_report() //Unlock @@ -30,7 +29,7 @@ /datum/station_goal/proc/get_coverage() var/list/coverage = list() for(var/obj/machinery/satellite/meteor_shield/A in machines) - if(!A.active || (A.z != STATION_LEVEL)) + if(!A.active || is_station_level(A.z)) continue coverage |= view(A.kill_range, A) return coverage.len diff --git a/nano/templates/comm_console.tmpl b/nano/templates/comm_console.tmpl index c4e1799afcf..062c8d844f3 100644 --- a/nano/templates/comm_console.tmpl +++ b/nano/templates/comm_console.tmpl @@ -111,17 +111,17 @@ Used In File(s): /code/game/machinery/computers/communications.dm

Messages

{{if data.current_message}} {{:helper.link('Messages','home',{'operation':'messagelist'})}} -

{{>title}}

+

{{:data.current_message_title}}

- {{>body}} + {{:data.current_message}}
{{else}} {{:helper.link('Back','home',{'operation':'main'})}} {{for data.messages}}
- {{:helper.link('Open','envelope-o',{'operation':'messagelist','msgid':data.id})}} - {{:helper.link('Delete','close',{'operation':'delmessage','msgid':data.id},'red')}} - {{>data.title}} + {{:value.title}}
+ {{:helper.link('Open','envelope-o',{'operation':'messagelist','msgid':value.id})}} + {{:helper.link('Delete','close',{'operation':'delmessage','msgid':value.id})}}
{{/for}} {{/if}}