Further station goal fixes, fix communication computer messages

This commit is contained in:
Markolie
2017-01-24 22:07:12 +01:00
parent 14dc136fe8
commit 62afefaf2c
9 changed files with 66 additions and 59 deletions
+1 -1
View File
@@ -300,4 +300,4 @@
#define OOC_COOLDOWN 5
// The number of station goals generated each round.
#define STATION_GOAL_BUDGET 1
#define STATION_GOAL_BUDGET 3
+1 -1
View File
@@ -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
+4 -2
View File
@@ -496,12 +496,14 @@ proc/get_nt_opposed()
send_station_goals_message()
/datum/game_mode/proc/send_station_goals_message()
var/message_text = "<b><i>[command_name()] Orders</i></b><hr>"
message_text += "<b>Special Orders for [station_name()]:</b>"
var/message_text = "<div style='text-align:center;'><img src='ntlogo.png'>"
message_text += "<h3>[command_name()] Orders</h3></div><hr>"
message_text += "<b>Special Orders for [station_name()]:</b><br><br>"
for(var/datum/station_goal/G in station_goals)
G.on_report()
message_text += G.get_report()
message_text += "<hr>"
print_command_report(message_text, "[command_name()] Orders")
+21 -20
View File
@@ -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))
+3 -3
View File
@@ -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] - <a href='?src=\ref[S];announce=1'>Announce</a> | <a href='?src=\ref[S];remove=1'>Remove</a><br>"
dat += "<br><a href='?src=\ref[src];add_station_goal=1'>Add New Goal</a>"
dat += "[S.name] - <a href='?src=[S.UID()];announce=1'>Announce</a> | <a href='?src=[S.UID()];remove=1'>Remove</a><br>"
dat += "<br><a href='?src=[UID()];add_station_goal=1'>Add New Goal</a>"
usr << browse(dat, "window=goals;size=400x400")
+10 -7
View File
@@ -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 {"<b>Bluespace Artillery position construction</b><br>
Our military presence is inadequate in your sector. We need you to construct BSA-[rand(1,99)] Artillery position aboard your station.
<br><br>
Its base parts should be available for shipping by your cargo shuttle.
<br>
-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]
+16 -14
View File
@@ -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 {"<b>DNA Vault construction</b><br>
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.
<br><br>
The DNA Vault needs to contain samples of:
<ul style='margin-top: 10px; margin-bottom: 10px;'>
<li>[animal_count] unique animal data.</li>
<li>[plant_count] unique non-standard plant data.</li>
<li>[human_count] unique sapient humanoid DNA data.</li>
</ul>
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, "<span class='notice'>[src] stabilizes your genes, granting you the ability to have multiple powers.</span>")
H.ignore_gene_stability = 1
if(!H.ignore_gene_stability)
to_chat(H, "<span class='notice'>[src] stabilizes your genes, granting you the ability to have multiple powers.</span>")
H.ignore_gene_stability = 1
switch(upgrade_type)
if(VAULT_SPACEIMMUNE)
to_chat(H, "<span class='notice'>You suddenly don't feel the need to breathe anymore. Your body also feels very warm.</span>")
+5 -6
View File
@@ -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 {"<b>Station Shield construction</b><br>
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.
<br><br>
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
+5 -5
View File
@@ -111,17 +111,17 @@ Used In File(s): /code/game/machinery/computers/communications.dm
<h3>Messages</h3>
{{if data.current_message}}
{{:helper.link('Messages','home',{'operation':'messagelist'})}}
<h3>{{>title}}</h3>
<h3>{{:data.current_message_title}}</h3>
<div class="item">
{{>body}}
{{:data.current_message}}
</div>
{{else}}
{{:helper.link('Back','home',{'operation':'main'})}}
{{for data.messages}}
<div class="line">
{{:helper.link('Open','envelope-o',{'operation':'messagelist','msgid':data.id})}}
{{:helper.link('Delete','close',{'operation':'delmessage','msgid':data.id},'red')}}
{{>data.title}}
<b>{{:value.title}}</b><br>
{{:helper.link('Open','envelope-o',{'operation':'messagelist','msgid':value.id})}}
{{:helper.link('Delete','close',{'operation':'delmessage','msgid':value.id})}}
</div>
{{/for}}
{{/if}}