Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 45 additions & 13 deletions code/datums/mind.dm
Original file line number Diff line number Diff line change
Expand Up @@ -123,22 +123,54 @@
return output

/datum/mind/proc/show_memory(mob/recipient)
var/output = "<B>[current.real_name]'s Memory</B><HR>"
output += memory
ui_interact(recipient)

/datum/mind/ui_state()
return GLOB.always_state

/datum/mind/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "Memory")
ui.open()

/datum/mind/ui_data(mob/user)
var/list/data = list()
data["name"] = current ? current.real_name : name
data["memory"] = memory

var/list/obj_groups = list()
for(var/datum/antagonist/A as anything in antagonist)
if(!length(A.objectives))
break
if(A.faction)
output += "<br><b>Your [A.faction.name] faction objectives:</b>"
else
output += "<br><b>Your [A.role_text] objectives:</b>"
output += "[A.print_objectives(FALSE)]"
output += print_individualobjectives()

var/datum/browser/panel = new(recipient, "memory", "Memory", 333, 333)
panel.set_content(output)
panel.open()
continue
var/list/group = list()
group["label"] = A.faction ? "Your [A.faction.name] faction objectives:" : "Your [A.role_text] objectives:"
var/list/objs = list()
for(var/datum/objective/O in A.objectives)
objs += list(list("text" = O.explanation_text))
group["objectives"] = objs
obj_groups += list(group)
data["objective_groups"] = obj_groups

var/list/ind_objs = list()
var/ind_la_explanation
if(LAZYLEN(individual_objectives))
var/obj_count = 1
for(var/datum/individual_objective/objective in individual_objectives)
var/list/obj = list()
obj["num"] = obj_count
obj["name"] = objective.name
obj["desc"] = objective.get_description()
obj["limited_antag"] = objective.limited_antag ? TRUE : FALSE
if(objective.limited_antag)
obj["show_la"] = objective.show_la
ind_la_explanation = objective.la_explanation
ind_objs += list(obj)
obj_count++
data["individual_objectives"] = ind_objs
data["la_explanation"] = ind_la_explanation

return data

/datum/mind/proc/edit_memory()
if(!SSticker.IsRoundInProgress())
Expand Down
2 changes: 1 addition & 1 deletion code/datums/uplink/uplink_sources.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ GLOBAL_LIST_INIT(default_uplink_source_priority, list(
R.hidden_uplink = T
T.trigger_code = freq
to_chat(M, span_notice("A portable object teleportation relay has been installed in your [R.name]. Simply dial the frequency [format_frequency(freq)] to unlock its hidden features."))
M.mind.store_memory("<B>Radio Freq:</B> [format_frequency(freq)] ([R.name]).")
M.mind.store_memory("<B>Radio Freq:</B> [format_frequency(freq)] ([R.name]).<BR>")

/decl/uplink_source/implant
name = "Implant"
Expand Down
2 changes: 1 addition & 1 deletion code/game/antagonist/station/contractor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
to_chat(contractor_mob, "<b>Code Phrase</b>: [span_danger("[syndicate_code_phrase]")]")
to_chat(contractor_mob, "<b>Code Response</b>: [span_danger("[syndicate_code_response]")]")
contractor_mob.mind.store_memory("<b>Code Phrase</b>: [syndicate_code_phrase]")
contractor_mob.mind.store_memory("<b>Code Response</b>: [syndicate_code_response]")
contractor_mob.mind.store_memory("<b>Code Response</b>: [syndicate_code_response]<BR>")
to_chat(contractor_mob, "Use the code words, preferably in the order provided, during regular conversation, to identify other agents. Proceed with caution, however, as everyone is a potential foe.")


Expand Down
67 changes: 55 additions & 12 deletions code/game/machinery/vending.dm
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@
var/purchase_message = ""
var/purchase_error = FALSE

var/needs_pin = FALSE
var/obj/item/card/id/pending_pin_card
var/pending_pin_mode = "" // "purchase" or "manage"

/*
Variables used to initialize the product list
These are used for initialization only, and so are optional if
Expand Down Expand Up @@ -411,11 +415,11 @@

// Enter PIN, so you can't loot a vending machine with only the owner's ID card (as long as they increased the sec level)
if(user_account.security_level != 0)
var/attempt_pin = input("Enter pin code", "Vendor transaction") as num | null
user_account = attempt_account_access(ID.associated_account_number, attempt_pin, 2)
if(!user_account)
to_chat(user, span_warning("Unable to access account! Credentials are incorrect."))
return
pending_pin_card = ID
pending_pin_mode = "manage"
needs_pin = TRUE
ui_interact(user)
return

if(!machine_vendor_account)
machine_vendor_account = user_account
Expand Down Expand Up @@ -528,13 +532,11 @@
// Have the customer punch in the PIN before checking if there's enough money. Prevents people from figuring out acct is
// empty at high security levels
if(customer_account.security_level != 0) //If card requires pin authentication (ie seclevel 1 or 2)
var/attempt_pin = input("Enter pin code", "Vendor transaction") as num
customer_account = attempt_account_access(I.associated_account_number, attempt_pin, 2)

if(!customer_account)
purchase_message = "Unable to access account: incorrect credentials."
purchase_error = TRUE
return FALSE
pending_pin_card = I
pending_pin_mode = "purchase"
needs_pin = TRUE
ui_interact(usr)
return FALSE

if(currently_vending.price > customer_account.money)
purchase_message = "Insufficient funds in account."
Expand Down Expand Up @@ -646,6 +648,8 @@
"message" = purchase_message,
"isError" = purchase_error
)
data["needsPin"] = needs_pin ? TRUE : FALSE
data["pinMode"] = pending_pin_mode

var/list/listed_products = list()
for(var/key = 1 to length(product_records))
Expand Down Expand Up @@ -767,6 +771,45 @@

if("cancelpurchase")
currently_vending = null
needs_pin = FALSE
pending_pin_card = null
return TRUE

if("submit_pin")
if(!needs_pin || !pending_pin_card)
return TRUE
var/datum/money_account/verified = attempt_account_access(pending_pin_card.associated_account_number, text2num(params["pin"]), 2)
if(!verified)
purchase_message = "Unable to access account: incorrect PIN."
purchase_error = TRUE
needs_pin = FALSE
pending_pin_card = null
return TRUE
if(pending_pin_mode == "purchase")
if(!currently_vending)
needs_pin = FALSE
return TRUE
if(currently_vending.price > verified.money)
purchase_message = "Insufficient funds in account."
purchase_error = TRUE
else
var/datum/transaction/T = new(-currently_vending.price, earnings_account.get_name(), "Purchase of [currently_vending.product_name]", src)
T.apply_to(verified)
credit_purchase(verified.owner_name)
needs_pin = FALSE
pending_pin_card = null
vend(currently_vending, usr)
return TRUE
else if(pending_pin_mode == "manage")
if(!machine_vendor_account)
machine_vendor_account = verified
earnings_account = verified
locked = !locked
playsound(usr.loc, 'sound/machines/id_swipe.ogg', 60, 1)
to_chat(usr, span_notice("You [locked ? "" : "un"]lock \the [src]."))
log_econ("[src] was [locked ? "" : "un"]locked by [usr].")
needs_pin = FALSE
pending_pin_card = null
return TRUE

if("togglevoice")
Expand Down
Loading
Loading