diff --git a/code/WorkInProgress/computer3/NTOS.dm b/code/WorkInProgress/computer3/NTOS.dm
index 0b921ad43b8..86157dcc1c9 100644
--- a/code/WorkInProgress/computer3/NTOS.dm
+++ b/code/WorkInProgress/computer3/NTOS.dm
@@ -22,20 +22,21 @@
var/dat = "
"}
+
+ dat += generate_status_bar()
var/list/files = list_files()
if(current)
dat +=window(current.name,buttonbar(),filegrid(files))
@@ -175,6 +178,32 @@
usr << browse(dat, "window=\ref[computer];size=670x510")
onclose(usr, "\ref[computer]")
+ // STATUS BAR
+ // Small 16x16 icons representing status of components, etc.
+ // Currently only used by battery icon
+ // TODO: Add more icons!
+/datum/file/program/ntos/proc/generate_status_bar()
+ var/dat = ""
+
+ // Battery level icon
+ switch(computer.check_battery_status())
+ if(-1)
+ dat += "

"
+ if(0 to 5)
+ dat += "

"
+ if(6 to 20)
+ dat += "

"
+ if(21 to 40)
+ dat += "

"
+ if(41 to 60)
+ dat += "

"
+ if(61 to 80)
+ dat += "

"
+ if(81 to 100)
+ dat += "

"
+ dat += "
"
+ return dat
+
/datum/file/program/ntos/Topic(href, list/href_list)
if(!interactable() || ..(href,href_list))
return
diff --git a/code/WorkInProgress/computer3/component.dm b/code/WorkInProgress/computer3/component.dm
index 8dc2ec835bf..501bbc973eb 100644
--- a/code/WorkInProgress/computer3/component.dm
+++ b/code/WorkInProgress/computer3/component.dm
@@ -91,29 +91,127 @@
return
..(I,user)
- proc/insert(var/obj/item/weapon/card/card)
+ // cardslot.insert(card, slot)
+ // card: The card obj you want to insert (usually your ID)
+ // slot: Which slot to insert into (1: reader, 2: writer, 3: auto), 3 default
+ proc/insert(var/obj/item/weapon/card/card, var/slot = 3)
if(!computer)
return 0
- if(reader != null)
- usr << "There is already something in the slot!"
+ // This shouldn't happen, just in case..
+ if(slot == 2 && !dualslot)
+ usr << "This device has only one card slot"
return 0
- if(istype(card,/obj/item/weapon/card/emag)) // emag reader slot
- usr << "You insert \the [card], and the computer grinds, sparks, and beeps. After a moment, the card ejects itself."
- computer.emagged = 1
- return 1
- var/mob/living/L = usr
- L.drop_item()
- card.loc = src
- reader = card
- proc/remove()
- reader.loc = loc
- var/mob/living/carbon/human/user = usr
- if(istype(user) && !user.get_active_hand())
- user.put_in_hands(reader)
- else
- reader.loc = computer.loc
- reader = null
+ if(istype(card,/obj/item/weapon/card/emag)) // emag reader slot
+ if(!writer)
+ usr << "You insert \the [card], and the computer grinds, sparks, and beeps. After a moment, the card ejects itself."
+ computer.emagged = 1
+ return 1
+ else
+ usr << "You are unable to insert \the [card], as the reader slot is occupied"
+
+ var/mob/living/L = usr
+ switch(slot)
+ if(1)
+ if(equip_to_reader(card, L))
+ usr << "You insert the card into reader slot"
+ else
+ usr << "There is already something in the reader slot."
+ if(2)
+ if(equip_to_writer(card, L))
+ usr << "You insert the card into writer slot"
+ else
+ usr << "There is already something in the reader slot."
+ if(3)
+ if(equip_to_reader(card, L))
+ usr << "You insert the card into reader slot"
+ else if (equip_to_writer(card, L) && dualslot)
+ usr << "You insert the card into writer slot"
+ else if (dualslot)
+ usr << "There is already something in both slots."
+ else
+ usr << "There is already something in the reader slot."
+
+
+ // Usage of insert() preferred, as it also tells result to the user.
+ proc/equip_to_reader(var/obj/item/weapon/card/card, var/mob/living/L)
+ if(!reader)
+ L.drop_item()
+ card.loc = src
+ reader = card
+ return 1
+ return 0
+
+ proc/equip_to_writer(var/obj/item/weapon/card/card, var/mob/living/L)
+ if(!writer && dualslot)
+ L.drop_item()
+ card.loc = src
+ writer = card
+ return 1
+ return 0
+
+ // cardslot.remove(slot)
+ // slot: Which slot to remove card(s) from (1: reader only, 2: writer only, 3: both [works even with one card], 4: reader and if empty then writer ), 3 default
+ proc/remove(var/slot = 3)
+ var/mob/living/L = usr
+ switch(slot)
+ if(1)
+ if (remove_reader(L))
+ L << "You remove the card from reader slot"
+ else
+ L << "There is no card in the reader slot"
+ if(2)
+ if (remove_writer(L))
+ L << "You remove the card from writer slot"
+ else
+ L << "There is no card in the writer slot"
+ if(3)
+ if (remove_reader(L))
+ if (remove_writer(L))
+ L << "You remove cards from both slots"
+ else
+ L << "You remove the card from reader slot"
+ else
+ if(remove_writer(L))
+ L << "You remove the card from writer slot"
+ else
+ L << "There are no cards in both slots"
+ if(4)
+ if (!remove_reader(L))
+ if (remove_writer(L))
+ L << "You remove the card from writer slot"
+ else if (!dualslot)
+ L << "There is no card in the reader slot"
+ else
+ L << "There are no cards in both slots"
+ else
+ L << "You remove the card from reader slot"
+
+
+ proc/remove_reader(var/mob/living/L)
+ if(reader)
+ reader.loc = loc
+ if(istype(L) && !L.get_active_hand())
+ L.put_in_hands(reader)
+ else
+ reader.loc = computer.loc
+ reader = null
+ return 1
+ return 0
+
+ proc/remove_writer(var/mob/living/L)
+ if(writer && dualslot)
+ writer.loc = loc
+ if(istype(L) && !L.get_active_hand())
+ L.put_in_hands(writer)
+ else
+ writer.loc = computer.loc
+ writer = null
+ return 1
+ return 0
+
+
+
// Authorizes the user based on the computer's requirements
proc/authenticate()
@@ -133,6 +231,13 @@
desc = "Contains slots for inserting magnetic swipe cards for reading and writing."
dualslot = 1
+
+ /*
+ // Atlantis: Reworked card manipulation a bit.
+ // No need for separated code for dual and single readers.
+ // Both is handled in single-slot reader code now, thanks to the "dualslot" var.
+ // Leaving this code here if someone wants to somehow use it, just uncomment.
+
insert(var/obj/item/weapon/card/card,var/slot = 0)
if(!computer)
return 0
@@ -194,5 +299,6 @@
user.put_in_hands(card)
else
card.loc = computer.loc
+*/
diff --git a/code/WorkInProgress/computer3/computer.dm b/code/WorkInProgress/computer3/computer.dm
index 093f7b5ed7d..456bdf3d71f 100644
--- a/code/WorkInProgress/computer3/computer.dm
+++ b/code/WorkInProgress/computer3/computer.dm
@@ -449,6 +449,16 @@
overlays += kb
name = initial(name) + " (orange screen of death)"
+ //Returns percentage of battery charge remaining. Returns -1 if no battery is installed.
+ proc/check_battery_status()
+ if (battery)
+ var/obj/item/weapon/cell/B = battery
+ return round(B.charge / (B.maxcharge / 100))
+ else
+ return -1
+
+
+
/obj/machinery/computer3/wall_comp
name = "terminal"
icon = 'icons/obj/computer3.dmi'
diff --git a/code/WorkInProgress/computer3/computers/camera.dm b/code/WorkInProgress/computer3/computers/camera.dm
index 4da54340c1f..0883680f5c3 100644
--- a/code/WorkInProgress/computer3/computers/camera.dm
+++ b/code/WorkInProgress/computer3/computers/camera.dm
@@ -275,3 +275,7 @@
else
usr << "The screen turns to static."
return
+
+ // Atlantis: Required for camnetkeys to work.
+/datum/file/program/security/hidden
+ hidden_file = 1
\ No newline at end of file
diff --git a/code/WorkInProgress/computer3/computers/card.dm b/code/WorkInProgress/computer3/computers/card.dm
index 6080b596431..5acb7c9de2f 100644
--- a/code/WorkInProgress/computer3/computers/card.dm
+++ b/code/WorkInProgress/computer3/computers/card.dm
@@ -253,9 +253,9 @@
if("remove" in href_list)
var/which = href_list["remove"]
if(which == "writer")
- computer.cardslot.remove(computer.cardslot.writer)
+ computer.cardslot.remove(2)
else
- computer.cardslot.remove(computer.cardslot.reader)
+ computer.cardslot.remove(1)
auth = 0
if("insert" in href_list)
@@ -264,9 +264,9 @@
var/which = href_list["insert"]
if(which == "writer")
- computer.cardslot.insert(card,1)
- else
computer.cardslot.insert(card,2)
+ else
+ computer.cardslot.insert(card,1)
if("print" in href_list)
if (printing)
diff --git a/code/WorkInProgress/computer3/computers/medical.dm b/code/WorkInProgress/computer3/computers/medical.dm
index ee55a857b29..7fc5da12326 100644
--- a/code/WorkInProgress/computer3/computers/medical.dm
+++ b/code/WorkInProgress/computer3/computers/medical.dm
@@ -23,6 +23,7 @@
req_one_access = list(access_medical, access_forensics_lockers)
var/obj/item/weapon/card/id/scan = null
+ var/obj/item/weapon/card/id/scan2 = null
var/authenticated = null
var/rank = null
var/screen = null
@@ -56,7 +57,12 @@
if (temp)
dat = text("
[src.temp]Clear Screen")
else
- dat = text("Confirm Identity:
[]
", src, (src.scan ? text("[]", src.scan.name) : "----------"))
+ dat = text("Confirm Identity (R):
[]
", src, (scan ? text("[]", scan.name) : "----------"))
+ if (computer.cardslot.dualslot)
+ dat += text("Check Identity (W):
[]", src, (scan2 ? text("[]", scan2.name) : "----------"))
+ if(scan2 && !scan)
+ dat += text("
Insert card into reader slot to log in.
")
+
if (src.authenticated)
switch(src.screen)
if(1.0)
@@ -165,19 +171,32 @@
if (href_list["temp"])
src.temp = null
- if (href_list["scan"])
+ if (href_list["cardr"])
if (scan)
if(istype(usr,/mob/living/carbon/human) && !usr.get_active_hand())
- computer.cardslot.remove(scan)
+ computer.cardslot.remove(1)
else
scan.loc = get_turf(src)
scan = null
else
var/obj/item/I = usr.get_active_hand()
if (istype(I, /obj/item/weapon/card/id))
- computer.cardslot.insert(I)
+ computer.cardslot.insert(I, 1)
scan = I
+ if (href_list["cardw"])
+ if (scan2)
+ if(istype(usr,/mob/living/carbon/human) && !usr.get_active_hand())
+ computer.cardslot.remove(2)
+ else
+ scan2.loc = get_turf(src)
+ scan2 = null
+ else
+ var/obj/item/I = usr.get_active_hand()
+ if (istype(I, /obj/item/weapon/card/id))
+ computer.cardslot.insert(I, 2)
+ scan2 = I
+
else if (href_list["logout"])
src.authenticated = null
src.screen = null
diff --git a/code/WorkInProgress/computer3/computers/security.dm b/code/WorkInProgress/computer3/computers/security.dm
index f161b10cab9..f193b071396 100644
--- a/code/WorkInProgress/computer3/computers/security.dm
+++ b/code/WorkInProgress/computer3/computers/security.dm
@@ -19,6 +19,7 @@
req_one_access = list(access_security, access_forensics_lockers)
var/obj/item/weapon/card/id/scan = null
+ var/obj/item/weapon/card/id/scan2 = null
var/authenticated = null
var/rank = null
var/screen = null
@@ -49,9 +50,13 @@
return
usr.set_machine(src)
scan = computer.cardslot.reader
+
+ if (computer.cardslot.dualslot)
+ scan2 = computer.cardslot.writer
+
if(!interactable())
return
- return
+
if (computer.z > 6)
usr << "\red
Unable to establish a connection: \black You're too far away from the station!"
return
@@ -60,7 +65,11 @@
if (temp)
dat = text("
[]Clear Screen", temp, src)
else
- dat = text("Confirm Identity:
[]
", src, (scan ? text("[]", scan.name) : "----------"))
+ dat = text("Confirm Identity (R):
[]
", src, (scan ? text("[]", scan.name) : "----------"))
+ if (computer.cardslot.dualslot)
+ dat += text("Check Identity (W):
[]", src, (scan2 ? text("[]", scan2.name) : "----------"))
+ if(scan2 && !scan)
+ dat += text("
Insert card into reader slot to log in.
")
if (authenticated)
switch(screen)
if(1.0)
@@ -100,9 +109,9 @@
if("Released")
background = "'background-color:#3BB9FF;'"
if("None")
- background = "'background-color:#00FF7F;'"
- if("")
background = "'background-color:#00FF00;'"
+ if("")
+ background = "'background-color:#00FF7F;'"
crimstat = "No Record."
dat += text("
| [] | ", background, src, R, R.fields["name"])
dat += text("[] | ", R.fields["id"])
@@ -236,19 +245,32 @@ What a mess.*/
active1 = null
active2 = null
- if("Confirm Identity")
+ if("Confirm Identity R")
if (scan)
if(istype(usr,/mob/living/carbon/human) && !usr.get_active_hand())
- computer.cardslot.remove(scan)
+ computer.cardslot.remove(1)
else
scan.loc = get_turf(src)
scan = null
else
var/obj/item/I = usr.get_active_hand()
if (istype(I, /obj/item/weapon/card/id))
- computer.cardslot.insert(I)
+ computer.cardslot.insert(I, 1)
scan = I
+ if("Confirm Identity W")
+ if (scan2)
+ if(istype(usr,/mob/living/carbon/human) && !usr.get_active_hand())
+ computer.cardslot.remove(2)
+ else
+ scan2.loc = get_turf(src)
+ scan2 = null
+ else
+ var/obj/item/I = usr.get_active_hand()
+ if (istype(I, /obj/item/weapon/card/id))
+ computer.cardslot.insert(I, 2)
+ scan2 = I
+
if("Log Out")
authenticated = null
screen = null
diff --git a/code/WorkInProgress/computer3/file.dm b/code/WorkInProgress/computer3/file.dm
index 36935790673..849312ec50e 100644
--- a/code/WorkInProgress/computer3/file.dm
+++ b/code/WorkInProgress/computer3/file.dm
@@ -13,7 +13,7 @@
var/image = 'icons/ntos/file.png' // determines the icon to use, found in icons/ntos
var/obj/machinery/computer3/computer // the parent computer, if fixed
var/obj/item/part/computer/storage/device // the device that is containing this file
-
+ var/hidden_file = 0 // Prevents file from showing up on NTOS program list.
var/drm = 0 // Copy protection, called by copy() and move()
var/readonly = 0 // Edit protection, called by edit(), which is just a failcheck proc
diff --git a/code/WorkInProgress/computer3/lapvend.dm b/code/WorkInProgress/computer3/lapvend.dm
index d36af863d11..b6f93f4702f 100644
--- a/code/WorkInProgress/computer3/lapvend.dm
+++ b/code/WorkInProgress/computer3/lapvend.dm
@@ -213,58 +213,66 @@
if (istype(I, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/C = I
visible_message("[usr] swipes a card through [src].")
- if(vendor_account)
- var/attempt_pin = input("Enter pin code", "Vendor transaction") as num
- var/datum/money_account/D = attempt_account_access(C.associated_account_number, attempt_pin, 2)
- if(D)
- var/transaction_amount = total()
- if(transaction_amount <= D.money)
-
- //transfer the money
- D.money -= transaction_amount
- vendor_account.money += transaction_amount
-
- //Transaction logs
- var/datum/transaction/T = new()
- T.target_name = "[vendor_account.owner_name] (via [src.name])"
- T.purpose = "Purchase of Laptop"
- if(transaction_amount > 0)
- T.amount = "([transaction_amount])"
- else
- T.amount = "[transaction_amount]"
- T.source_terminal = src.name
- T.date = current_date_string
- T.time = worldtime2text()
- D.transaction_log.Add(T)
- //
- T = new()
- T.target_name = D.owner_name
- T.purpose = "Purchase of Laptop"
- T.amount = "[transaction_amount]"
- T.source_terminal = src.name
- T.date = current_date_string
- T.time = worldtime2text()
- vendor_account.transaction_log.Add(T)
-
- newlap = new /obj/machinery/computer3/laptop/vended(src.loc)
-
- choose_progs(C)
- vend()
- popup.close()
- newlap.close_computer()
- newlap = null
- cardreader = 0
- floppy = 0
- radionet = 0
- camera = 0
- network = 0
- power = 0
+ var/datum/money_account/CH = get_account(C.associated_account_number)
+ if(CH.security_level != 0) //If card requires pin authentication (ie seclevel 1 or 2)
+ if(vendor_account)
+ var/attempt_pin = input("Enter pin code", "Vendor transaction") as num
+ var/datum/money_account/D = attempt_account_access(C.associated_account_number, attempt_pin, 2)
+ if(D)
+ transfer_and_vend(D, C)
else
- usr << "\icon[src]You don't have that much money!"
+ usr << "\icon[src]Unable to access account. Check security settings and try again."
else
- usr << "\icon[src]Unable to access account. Check security settings and try again."
+ usr << "\icon[src]Unable to access vendor account. Please record the machine ID and call CentComm Support."
else
- usr << "\icon[src]Unable to access vendor account. Please record the machine ID and call CentComm Support."
+ transfer_and_vend(CH, C)
+
+
+// Transfers money and vends the laptop.
+/obj/machinery/lapvend/proc/transfer_and_vend(var/datum/money_account/D, var/obj/item/weapon/card/C)
+ var/transaction_amount = total()
+ if(transaction_amount <= D.money)
+
+ //transfer the money
+ D.money -= transaction_amount
+ vendor_account.money += transaction_amount
+ //Transaction logs
+ var/datum/transaction/T = new()
+ T.target_name = "[vendor_account.owner_name] (via [src.name])"
+ T.purpose = "Purchase of Laptop"
+ if(transaction_amount > 0)
+ T.amount = "([transaction_amount])"
+ else
+ T.amount = "[transaction_amount]"
+ T.source_terminal = src.name
+ T.date = current_date_string
+ T.time = worldtime2text()
+ D.transaction_log.Add(T)
+ //
+ T = new()
+ T.target_name = D.owner_name
+ T.purpose = "Purchase of Laptop"
+ T.amount = "[transaction_amount]"
+ T.source_terminal = src.name
+ T.date = current_date_string
+ T.time = worldtime2text()
+ vendor_account.transaction_log.Add(T)
+
+ newlap = new /obj/machinery/computer3/laptop/vended(src.loc)
+
+ choose_progs(C)
+ vend()
+ popup.close()
+ newlap.close_computer()
+ newlap = null
+ cardreader = 0
+ floppy = 0
+ radionet = 0
+ camera = 0
+ network = 0
+ power = 0
+ else
+ usr << "\icon[src]You don't have that much money!"
/obj/machinery/lapvend/proc/total()
var/total = 0
@@ -305,9 +313,10 @@
newlap.spawn_files += (/datum/file/program/card_comp)
if(access_heads in C.access)
newlap.spawn_files += (/datum/file/program/communications)
- if(access_medical in C.access)
- newlap.spawn_files += (/datum/file/program/crew)
+ if((access_medical in C.access) || (access_forensics_lockers in C.access)) //Gives detective the medical records program, but not the crew monitoring one.
newlap.spawn_files += (/datum/file/program/med_data)
+ if (access_medical in C.access)
+ newlap.spawn_files += (/datum/file/program/crew)
if(access_engine in C.access)
newlap.spawn_files += (/datum/file/program/powermon)
if(access_research in C.access)
@@ -320,6 +329,8 @@
newlap.spawn_files += (/datum/file/camnet_key/creed)
newlap.spawn_files += (/datum/file/program/arcade)
newlap.spawn_files += (/datum/file/camnet_key/entertainment)
+ //Atlantis: Each laptop gets "invisible" program/security - REQUIRED for camnetkeys to work.
+ newlap.spawn_files += (/datum/file/program/security/hidden)
newlap.update_spawn_files()
/obj/machinery/lapvend/proc/calc_reimburse(var/obj/item/device/laptop/L)
@@ -350,49 +361,53 @@
if (istype(I, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/C = I
visible_message("[usr] swipes a card through [src].")
- if(vendor_account)
- var/attempt_pin = input("Enter pin code", "Vendor transaction") as num
- var/datum/money_account/D = attempt_account_access(C.associated_account_number, attempt_pin, 2)
- if(D)
- var/transaction_amount = total()
-
- //transfer the money
- D.money += transaction_amount
- vendor_account.money -= transaction_amount
-
- //Transaction logs
- var/datum/transaction/T = new()
- T.target_name = "[vendor_account.owner_name] (via [src.name])"
- T.purpose = "Return purchase of Laptop"
- if(transaction_amount > 0)
- T.amount = "([transaction_amount])"
+ var/datum/money_account/CH = get_account(C.associated_account_number)
+ if(CH.security_level != 0) //If card requires pin authentication (ie seclevel 1 or 2)
+ if(vendor_account)
+ var/attempt_pin = input("Enter pin code", "Vendor transaction") as num
+ var/datum/money_account/D = attempt_account_access(C.associated_account_number, attempt_pin, 2)
+ if(D)
+ transfer_and_reimburse(D)
else
- T.amount = "[transaction_amount]"
- T.source_terminal = src.name
- T.date = current_date_string
- T.time = worldtime2text()
- D.transaction_log.Add(T)
- //
- T = new()
- T.target_name = D.owner_name
- T.purpose = "Return purchase of Laptop"
- T.amount = "[transaction_amount]"
- T.source_terminal = src.name
- T.date = current_date_string
- T.time = worldtime2text()
- vendor_account.transaction_log.Add(T)
-
- del(relap)
-
- vendmode = 0
- cardreader = 0
- floppy = 0
- radionet = 0
- camera = 0
- network = 0
- power = 0
-
+ usr << "\icon[src]Unable to access account. Check security settings and try again."
else
- usr << "\icon[src]Unable to access account. Check security settings and try again."
+ usr << "\icon[src]Unable to access vendor account. Please record the machine ID and call CentComm Support."
else
- usr << "\icon[src]Unable to access vendor account. Please record the machine ID and call CentComm Support."
\ No newline at end of file
+ transfer_and_reimburse(CH)
+
+/obj/machinery/lapvend/proc/transfer_and_reimburse(var/datum/money_account/D)
+ var/transaction_amount = total()
+ //transfer the money
+ D.money += transaction_amount
+ vendor_account.money -= transaction_amount
+
+ //Transaction logs
+ var/datum/transaction/T = new()
+ T.target_name = "[vendor_account.owner_name] (via [src.name])"
+ T.purpose = "Return purchase of Laptop"
+ if(transaction_amount > 0)
+ T.amount = "([transaction_amount])"
+ else
+ T.amount = "[transaction_amount]"
+ T.source_terminal = src.name
+ T.date = current_date_string
+ T.time = worldtime2text()
+ D.transaction_log.Add(T)
+ //
+ T = new()
+ T.target_name = D.owner_name
+ T.purpose = "Return purchase of Laptop"
+ T.amount = "[transaction_amount]"
+ T.source_terminal = src.name
+ T.date = current_date_string
+ T.time = worldtime2text()
+ vendor_account.transaction_log.Add(T)
+
+ del(relap)
+ vendmode = 0
+ cardreader = 0
+ floppy = 0
+ radionet = 0
+ camera = 0
+ network = 0
+ power = 0
diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm
index a5d9a6ce1de..307db252400 100644
--- a/code/game/machinery/recharger.dm
+++ b/code/game/machinery/recharger.dm
@@ -9,6 +9,9 @@ obj/machinery/recharger
idle_power_usage = 4
active_power_usage = 250
var/obj/item/charging = null
+ var/icon_state_charged = "recharger2"
+ var/icon_state_charging = "recharger1"
+ var/icon_state_idle = "recharger0"
obj/machinery/recharger/attackby(obj/item/weapon/G as obj, mob/user as mob)
if(istype(user,/mob/living/silicon))
@@ -71,28 +74,28 @@ obj/machinery/recharger/process()
var/obj/item/weapon/gun/energy/E = charging
if(E.power_supply.charge < E.power_supply.maxcharge)
E.power_supply.give(100)
- icon_state = "recharger1"
+ icon_state = icon_state_charging
use_power(250)
else
- icon_state = "recharger2"
+ icon_state = icon_state_charged
return
if(istype(charging, /obj/item/weapon/melee/baton))
var/obj/item/weapon/melee/baton/B = charging
if(B.charges < initial(B.charges))
B.charges++
- icon_state = "recharger1"
+ icon_state = icon_state_charging
use_power(150)
else
- icon_state = "recharger2"
+ icon_state = icon_state_charged
return
if(istype(charging, /obj/item/device/laptop))
var/obj/item/device/laptop/L = charging
if(L.stored_computer.battery.charge < L.stored_computer.battery.maxcharge)
L.stored_computer.battery.give(100)
- icon_state = "recharger1"
+ icon_state = icon_state_charging
use_power(250)
else
- icon_state = "recharger2"
+ icon_state = icon_state_charged
return
obj/machinery/recharger/emp_act(severity)
@@ -112,40 +115,15 @@ obj/machinery/recharger/emp_act(severity)
obj/machinery/recharger/update_icon() //we have an update_icon() in addition to the stuff in process to make it feel a tiny bit snappier.
if(charging)
- icon_state = "recharger1"
+ icon_state = icon_state_charging
else
- icon_state = "recharger0"
+ icon_state = icon_state_idle
+// Atlantis: No need for that copy-pasta code, just use var to store icon_states instead.
obj/machinery/recharger/wallcharger
name = "wall recharger"
icon = 'icons/obj/stationobjs.dmi'
icon_state = "wrecharger0"
-
-obj/machinery/recharger/wallcharger/process()
- if(stat & (NOPOWER|BROKEN) || !anchored)
- return
-
- if(charging)
- if(istype(charging, /obj/item/weapon/gun/energy))
- var/obj/item/weapon/gun/energy/E = charging
- if(E.power_supply.charge < E.power_supply.maxcharge)
- E.power_supply.give(100)
- icon_state = "wrecharger1"
- use_power(250)
- else
- icon_state = "wrecharger2"
- return
- if(istype(charging, /obj/item/weapon/melee/baton))
- var/obj/item/weapon/melee/baton/B = charging
- if(B.charges < initial(B.charges))
- B.charges++
- icon_state = "wrecharger1"
- use_power(150)
- else
- icon_state = "wrecharger2"
-
-obj/machinery/recharger/wallcharger/update_icon()
- if(charging)
- icon_state = "wrecharger1"
- else
- icon_state = "wrecharger0"
\ No newline at end of file
+ icon_state_idle = "wrecharger0"
+ icon_state_charging = "wrecharger1"
+ icon_state_charged = "wrecharger2"
\ No newline at end of file
diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm
index 5dd31a036ea..009ab4c809c 100644
--- a/code/game/machinery/vending.dm
+++ b/code/game/machinery/vending.dm
@@ -187,53 +187,60 @@
if (istype(I, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/C = I
visible_message("[usr] swipes a card through [src].")
- if(check_accounts)
- if(vendor_account)
- var/attempt_pin = input("Enter pin code", "Vendor transaction") as num
- var/datum/money_account/D = attempt_account_access(C.associated_account_number, attempt_pin, 2)
- if(D)
- var/transaction_amount = currently_vending.price
- if(transaction_amount <= D.money)
-
- //transfer the money
- D.money -= transaction_amount
- vendor_account.money += transaction_amount
-
- //create entries in the two account transaction logs
- var/datum/transaction/T = new()
- T.target_name = "[vendor_account.owner_name] (via [src.name])"
- T.purpose = "Purchase of [currently_vending.product_name]"
- if(transaction_amount > 0)
- T.amount = "([transaction_amount])"
- else
- T.amount = "[transaction_amount]"
- T.source_terminal = src.name
- T.date = current_date_string
- T.time = worldtime2text()
- D.transaction_log.Add(T)
- //
- T = new()
- T.target_name = D.owner_name
- T.purpose = "Purchase of [currently_vending.product_name]"
- T.amount = "[transaction_amount]"
- T.source_terminal = src.name
- T.date = current_date_string
- T.time = worldtime2text()
- vendor_account.transaction_log.Add(T)
-
- // Vend the item
- src.vend(src.currently_vending, usr)
- currently_vending = null
+ var/datum/money_account/CH = get_account(C.associated_account_number)
+ if (CH) // Only proceed if card contains proper account number.
+ if(CH.security_level != 0) //If card requires pin authentication (ie seclevel 1 or 2)
+ if(vendor_account)
+ var/attempt_pin = input("Enter pin code", "Vendor transaction") as num
+ var/datum/money_account/D = attempt_account_access(C.associated_account_number, attempt_pin, 2)
+ transfer_and_vend(D)
else
- usr << "\icon[src]You don't have that much money!"
+ usr << "\icon[src]Unable to access account. Check security settings and try again."
else
- usr << "\icon[src]Unable to access account. Check security settings and try again."
+ //Just Vend it.
+ transfer_and_vend(CH)
else
- //Just Vend it.
+ usr << "\icon[src]Error: Unable to access your account. Please contact technical support if problem persists."
+
+/obj/machinery/vending/proc/transfer_and_vend(var/datum/money_account/acc)
+ if(acc)
+ var/transaction_amount = currently_vending.price
+ if(transaction_amount <= acc.money)
+
+ //transfer the money
+ acc.money -= transaction_amount
+ vendor_account.money += transaction_amount
+
+ //create entries in the two account transaction logs
+ var/datum/transaction/T = new()
+ T.target_name = "[vendor_account.owner_name] (via [src.name])"
+ T.purpose = "Purchase of [currently_vending.product_name]"
+ if(transaction_amount > 0)
+ T.amount = "([transaction_amount])"
+ else
+ T.amount = "[transaction_amount]"
+ T.source_terminal = src.name
+ T.date = current_date_string
+ T.time = worldtime2text()
+ acc.transaction_log.Add(T)
+ //
+ T = new()
+ T.target_name = acc.owner_name
+ T.purpose = "Purchase of [currently_vending.product_name]"
+ T.amount = "[transaction_amount]"
+ T.source_terminal = src.name
+ T.date = current_date_string
+ T.time = worldtime2text()
+ vendor_account.transaction_log.Add(T)
+
+ // Vend the item
src.vend(src.currently_vending, usr)
currently_vending = null
+ else
+ usr << "\icon[src]You don't have that much money!"
else
- usr << "\icon[src]Unable to access vendor account. Please record the machine ID and call CentComm Support."
+ usr << "\icon[src]Error: Unable to access your account. Please contact technical support if problem persists."
+
/obj/machinery/vending/attack_paw(mob/user as mob)
return attack_hand(user)
diff --git a/icons/NTOS/battery_icons/batt_100.gif b/icons/NTOS/battery_icons/batt_100.gif
new file mode 100644
index 00000000000..72f04cff011
Binary files /dev/null and b/icons/NTOS/battery_icons/batt_100.gif differ
diff --git a/icons/NTOS/battery_icons/batt_20.gif b/icons/NTOS/battery_icons/batt_20.gif
new file mode 100644
index 00000000000..cc56e28214f
Binary files /dev/null and b/icons/NTOS/battery_icons/batt_20.gif differ
diff --git a/icons/NTOS/battery_icons/batt_40.gif b/icons/NTOS/battery_icons/batt_40.gif
new file mode 100644
index 00000000000..5d03a30c18e
Binary files /dev/null and b/icons/NTOS/battery_icons/batt_40.gif differ
diff --git a/icons/NTOS/battery_icons/batt_5.gif b/icons/NTOS/battery_icons/batt_5.gif
new file mode 100644
index 00000000000..eddcc6ae824
Binary files /dev/null and b/icons/NTOS/battery_icons/batt_5.gif differ
diff --git a/icons/NTOS/battery_icons/batt_60.gif b/icons/NTOS/battery_icons/batt_60.gif
new file mode 100644
index 00000000000..2a159b8e3c3
Binary files /dev/null and b/icons/NTOS/battery_icons/batt_60.gif differ
diff --git a/icons/NTOS/battery_icons/batt_80.gif b/icons/NTOS/battery_icons/batt_80.gif
new file mode 100644
index 00000000000..59efcb225e1
Binary files /dev/null and b/icons/NTOS/battery_icons/batt_80.gif differ
diff --git a/icons/NTOS/battery_icons/batt_none.gif b/icons/NTOS/battery_icons/batt_none.gif
new file mode 100644
index 00000000000..64aa24516b3
Binary files /dev/null and b/icons/NTOS/battery_icons/batt_none.gif differ