diff --git a/.travis.yml b/.travis.yml
index 87eeb862d56..5895a706b17 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -17,4 +17,5 @@ install:
- cd ..
script:
+ - (! grep -q 'step_[xy]' maps/tgstation2.dmm)
- DreamMaker baystation12.dme
diff --git a/baystation12.dme b/baystation12.dme
index de02865c783..cc76085482a 100644
--- a/baystation12.dme
+++ b/baystation12.dme
@@ -835,7 +835,6 @@
#include "code\modules\events\money_hacker.dm"
#include "code\modules\events\money_lotto.dm"
#include "code\modules\events\money_spam.dm"
-#include "code\modules\events\organ_failure.dm"
#include "code\modules\events\prison_break.dm"
#include "code\modules\events\radiation_storm.dm"
#include "code\modules\events\rogue_drones.dm"
@@ -1159,7 +1158,8 @@
#include "code\modules\projectiles\guns\energy\stun.dm"
#include "code\modules\projectiles\guns\energy\temperature.dm"
#include "code\modules\projectiles\guns\projectile\automatic.dm"
-#include "code\modules\projectiles\guns\projectile\bow.dm"
+#include "code\modules\projectiles\guns\projectile\crossbow.dm"
+#include "code\modules\projectiles\guns\projectile\launcher.dm"
#include "code\modules\projectiles\guns\projectile\pistol.dm"
#include "code\modules\projectiles\guns\projectile\pneumatic.dm"
#include "code\modules\projectiles\guns\projectile\revolver.dm"
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/ZAS/Phoron.dm b/code/ZAS/Phoron.dm
index 1e3df5292a7..f96e47c188d 100644
--- a/code/ZAS/Phoron.dm
+++ b/code/ZAS/Phoron.dm
@@ -118,7 +118,7 @@ obj/var/contaminated = 0
/mob/living/carbon/human/proc/burn_eyes()
//The proc that handles eye burning.
if(prob(20)) src << "\red Your eyes burn!"
- var/datum/organ/internal/eyes/E = internal_organs["eyes"]
+ var/datum/organ/internal/eyes/E = internal_organs_by_name["eyes"]
E.damage += 2.5
eye_blurry = min(eye_blurry+1.5,50)
if (prob(max(0,E.damage - 15) + 1) &&!eye_blind)
diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm
index 63854ca1b51..0bc0cd986a6 100644
--- a/code/__HELPERS/global_lists.dm
+++ b/code/__HELPERS/global_lists.dm
@@ -104,6 +104,8 @@ var/global/list/backbaglist = list("Nothing", "Backpack", "Satchel", "Satchel Al
for (var/language_name in all_languages)
var/datum/language/L = all_languages[language_name]
language_keys[":[lowertext(L.key)]"] = L
+ language_keys[".[lowertext(L.key)]"] = L
+ language_keys["#[lowertext(L.key)]"] = L
var/rkey = 0
paths = typesof(/datum/species)-/datum/species
@@ -128,4 +130,4 @@ var/global/list/backbaglist = list("Nothing", "Backpack", "Satchel", "Satchel Al
for(var/t in L)
. += " has: [t]\n"
world << .
-*/
\ No newline at end of file
+*/
diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm
index 31f3f0cb97b..3d40b556f69 100644
--- a/code/game/area/areas.dm
+++ b/code/game/area/areas.dm
@@ -87,8 +87,6 @@
for(var/area/RA in related)
for(var/obj/machinery/camera/C in RA)
C.network.Remove("Atmosphere Alarms")
- for (var/obj/machinery/alarm/AA in RA)
- AA.update_icon()
for(var/mob/living/silicon/aiPlayer in player_list)
aiPlayer.cancelAlarm("Atmosphere", src, src)
for(var/obj/machinery/computer/station_alert/a in machines)
@@ -101,8 +99,6 @@
for(var/obj/machinery/camera/C in RA)
cameras += C
C.network.Add("Atmosphere Alarms")
- for (var/obj/machinery/alarm/AA in RA)
- AA.update_icon()
for(var/mob/living/silicon/aiPlayer in player_list)
aiPlayer.triggerAlarm("Atmosphere", src, cameras, src)
for(var/obj/machinery/computer/station_alert/a in machines)
@@ -110,6 +106,10 @@
air_doors_close()
atmosalm = danger_level
+ for(var/area/RA in related)
+ for (var/obj/machinery/alarm/AA in RA)
+ AA.update_icon()
+
return 1
return 0
diff --git a/code/game/gamemodes/changeling/changeling_powers.dm b/code/game/gamemodes/changeling/changeling_powers.dm
index c338b2e42d7..be2bb88a172 100644
--- a/code/game/gamemodes/changeling/changeling_powers.dm
+++ b/code/game/gamemodes/changeling/changeling_powers.dm
@@ -844,11 +844,13 @@ var/list/datum/dna/hivemind_bank = list()
if(!changeling)
return 0
- var/mob/living/carbon/T = changeling_sting(40, /mob/proc/changeling_extract_dna_sting)
+ var/mob/living/carbon/human/T = changeling_sting(40, /mob/proc/changeling_extract_dna_sting)
if(!T) return 0
T.dna.real_name = T.real_name
changeling.absorbed_dna |= T.dna
+ if(T.species && !(T.species.name in changeling.absorbed_species))
+ changeling.absorbed_species += T.species.name
feedback_add_details("changeling_powers","ED")
return 1
\ No newline at end of file
diff --git a/code/game/jobs/job/captain.dm b/code/game/jobs/job/captain.dm
index acc7c3e853d..b75ed7c4587 100644
--- a/code/game/jobs/job/captain.dm
+++ b/code/game/jobs/job/captain.dm
@@ -5,7 +5,7 @@
faction = "Station"
total_positions = 1
spawn_positions = 1
- supervisors = "Nanotrasen officials and Space law"
+ supervisors = "Nanotrasen officials and Corporate Regulations"
selection_color = "#ccccff"
idtype = /obj/item/weapon/card/id/gold
req_admin_notify = 1
diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm
index ec5529c80ce..435c8acf15e 100644
--- a/code/game/machinery/adv_med.dm
+++ b/code/game/machinery/adv_med.dm
@@ -309,10 +309,18 @@
if(e.open)
open = "Open:"
switch (e.germ_level)
- if (INFECTION_LEVEL_ONE + 50 to INFECTION_LEVEL_TWO)
+ if (INFECTION_LEVEL_ONE to INFECTION_LEVEL_ONE + 200)
infected = "Mild Infection:"
- if (INFECTION_LEVEL_TWO to INFECTION_LEVEL_THREE)
+ if (INFECTION_LEVEL_ONE + 200 to INFECTION_LEVEL_ONE + 300)
+ infected = "Mild Infection+:"
+ if (INFECTION_LEVEL_ONE + 300 to INFECTION_LEVEL_ONE + 400)
+ infected = "Mild Infection++:"
+ if (INFECTION_LEVEL_TWO to INFECTION_LEVEL_TWO + 200)
infected = "Acute Infection:"
+ if (INFECTION_LEVEL_TWO + 200 to INFECTION_LEVEL_TWO + 300)
+ infected = "Acute Infection+:"
+ if (INFECTION_LEVEL_TWO + 300 to INFECTION_LEVEL_TWO + 400)
+ infected = "Acute Infection++:"
if (INFECTION_LEVEL_THREE to INFINITY)
infected = "Septic:"
@@ -332,8 +340,7 @@
else
dat += "[e.display_name] | - | - | Not Found | "
dat += "
"
- for(var/organ_name in occupant.internal_organs)
- var/datum/organ/internal/i = occupant.internal_organs[organ_name]
+ for(var/datum/organ/internal/i in occupant.internal_organs)
var/mech = ""
if(i.robotic == 1)
mech = "Assisted:"
@@ -342,10 +349,18 @@
var/infection = "None"
switch (i.germ_level)
- if (1 to INFECTION_LEVEL_TWO)
+ if (1 to INFECTION_LEVEL_ONE + 200)
infection = "Mild Infection:"
- if (INFECTION_LEVEL_TWO to INFINITY)
+ if (INFECTION_LEVEL_ONE + 200 to INFECTION_LEVEL_ONE + 300)
+ infection = "Mild Infection+:"
+ if (INFECTION_LEVEL_ONE + 300 to INFECTION_LEVEL_ONE + 400)
+ infection = "Mild Infection++:"
+ if (INFECTION_LEVEL_TWO to INFECTION_LEVEL_TWO + 200)
infection = "Acute Infection:"
+ if (INFECTION_LEVEL_TWO + 200 to INFECTION_LEVEL_TWO + 300)
+ infection = "Acute Infection+:"
+ if (INFECTION_LEVEL_TWO + 300 to INFINITY)
+ infection = "Acute Infection++:"
dat += "
"
dat += "| [i.name] | N/A | [i.damage] | [infection]:[mech] | | "
diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm
index 501749a1231..eb1e9118493 100644
--- a/code/game/machinery/alarm.dm
+++ b/code/game/machinery/alarm.dm
@@ -405,6 +405,12 @@
return 1
/obj/machinery/alarm/proc/apply_mode()
+ //propagate mode to other air alarms in the area
+ //TODO: make it so that players can choose between applying the new mode to the room they are in (related area) vs the entire alarm area
+ for (var/area/RA in alarm_area.related)
+ for (var/obj/machinery/alarm/AA in RA)
+ AA.mode = mode
+
switch(mode)
if(AALARM_MODE_SCRUBBING)
for(var/device_id in alarm_area.air_scrub_names)
diff --git a/code/game/machinery/computer/crew.dm b/code/game/machinery/computer/crew.dm
index 528815ad07e..4d5810869b4 100644
--- a/code/game/machinery/computer/crew.dm
+++ b/code/game/machinery/computer/crew.dm
@@ -85,7 +85,8 @@
crewmemberData["fire"] = round(H.getFireLoss(), 1)
crewmemberData["brute"] = round(H.getBruteLoss(), 1)
crewmemberData["name"] = (H.wear_id ? H.wear_id.name : "Unknown")
- crewmemberData["area"] = get_area(H)
+ var/area/A = get_area(H)
+ crewmemberData["area"] = sanitize(A.name)
crewmemberData["x"] = pos.x
crewmemberData["y"] = pos.y
@@ -113,4 +114,4 @@
var/obj/item/clothing/under/C = H.w_uniform
if (C.has_sensor)
tracked |= C
- return 1
\ No newline at end of file
+ return 1
diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm
index 2949498ae3f..38985931728 100644
--- a/code/game/machinery/computer/medical.dm
+++ b/code/game/machinery/computer/medical.dm
@@ -253,7 +253,7 @@
switch(href_list["field"])
if("fingerprint")
if (istype(src.active1, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please input fingerprint hash:", "Med. records", src.active1.fields["fingerprint"], null) as text),1,MAX_MESSAGE_LEN)
+ var/t1 = copytext(trim(sanitize(input("Please input fingerprint hash:", "Med. records", src.active1.fields["fingerprint"], null) as text)),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
return
src.active1.fields["fingerprint"] = t1
@@ -271,55 +271,55 @@
src.active1.fields["age"] = t1
if("mi_dis")
if (istype(src.active2, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please input minor disabilities list:", "Med. records", src.active2.fields["mi_dis"], null) as text),1,MAX_MESSAGE_LEN)
+ var/t1 = copytext(trim(sanitize(input("Please input minor disabilities list:", "Med. records", src.active2.fields["mi_dis"], null) as text)),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["mi_dis"] = t1
if("mi_dis_d")
if (istype(src.active2, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please summarize minor dis.:", "Med. records", src.active2.fields["mi_dis_d"], null) as message),1,MAX_MESSAGE_LEN)
+ var/t1 = copytext(trim(sanitize(input("Please summarize minor dis.:", "Med. records", src.active2.fields["mi_dis_d"], null) as message)),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["mi_dis_d"] = t1
if("ma_dis")
if (istype(src.active2, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please input major diabilities list:", "Med. records", src.active2.fields["ma_dis"], null) as text),1,MAX_MESSAGE_LEN)
+ var/t1 = copytext(trim(sanitize(input("Please input major diabilities list:", "Med. records", src.active2.fields["ma_dis"], null) as text)),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["ma_dis"] = t1
if("ma_dis_d")
if (istype(src.active2, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please summarize major dis.:", "Med. records", src.active2.fields["ma_dis_d"], null) as message),1,MAX_MESSAGE_LEN)
+ var/t1 = copytext(trim(sanitize(input("Please summarize major dis.:", "Med. records", src.active2.fields["ma_dis_d"], null) as message)),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["ma_dis_d"] = t1
if("alg")
if (istype(src.active2, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please state allergies:", "Med. records", src.active2.fields["alg"], null) as text),1,MAX_MESSAGE_LEN)
+ var/t1 = copytext(trim(sanitize(input("Please state allergies:", "Med. records", src.active2.fields["alg"], null) as text)),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["alg"] = t1
if("alg_d")
if (istype(src.active2, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please summarize allergies:", "Med. records", src.active2.fields["alg_d"], null) as message),1,MAX_MESSAGE_LEN)
+ var/t1 = copytext(trim(sanitize(input("Please summarize allergies:", "Med. records", src.active2.fields["alg_d"], null) as message)),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["alg_d"] = t1
if("cdi")
if (istype(src.active2, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please state diseases:", "Med. records", src.active2.fields["cdi"], null) as text),1,MAX_MESSAGE_LEN)
+ var/t1 = copytext(trim(sanitize(input("Please state diseases:", "Med. records", src.active2.fields["cdi"], null) as text)),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["cdi"] = t1
if("cdi_d")
if (istype(src.active2, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please summarize diseases:", "Med. records", src.active2.fields["cdi_d"], null) as message),1,MAX_MESSAGE_LEN)
+ var/t1 = copytext(trim(sanitize(input("Please summarize diseases:", "Med. records", src.active2.fields["cdi_d"], null) as message)),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["cdi_d"] = t1
if("notes")
if (istype(src.active2, /datum/data/record))
- var/t1 = copytext(html_encode(input("Please summarize notes:", "Med. records", html_decode(src.active2.fields["notes"]), null) as message),1,MAX_MESSAGE_LEN)
+ var/t1 = copytext(html_encode(trim(input("Please summarize notes:", "Med. records", html_decode(src.active2.fields["notes"]), null) as message)),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["notes"] = t1
@@ -334,21 +334,21 @@
src.temp = text("Blood Type:
\n\tA- A+
\n\tB- B+
\n\tAB- AB+
\n\tO- O+
", src, src, src, src, src, src, src, src)
if("b_dna")
if (istype(src.active1, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please input DNA hash:", "Med. records", src.active1.fields["dna"], null) as text),1,MAX_MESSAGE_LEN)
+ var/t1 = copytext(trim(sanitize(input("Please input DNA hash:", "Med. records", src.active1.fields["dna"], null) as text)),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
return
src.active1.fields["dna"] = t1
if("vir_name")
var/datum/data/record/v = locate(href_list["edit_vir"])
if (v)
- var/t1 = copytext(sanitize(input("Please input pathogen name:", "VirusDB", v.fields["name"], null) as text),1,MAX_MESSAGE_LEN)
+ var/t1 = copytext(trim(sanitize(input("Please input pathogen name:", "VirusDB", v.fields["name"], null) as text)),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
return
v.fields["name"] = t1
if("vir_desc")
var/datum/data/record/v = locate(href_list["edit_vir"])
if (v)
- var/t1 = copytext(sanitize(input("Please input information about pathogen:", "VirusDB", v.fields["description"], null) as message),1,MAX_MESSAGE_LEN)
+ var/t1 = copytext(trim(sanitize(input("Please input information about pathogen:", "VirusDB", v.fields["description"], null) as message)),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
return
v.fields["description"] = t1
@@ -451,7 +451,7 @@
if (!( istype(src.active2, /datum/data/record) ))
return
var/a2 = src.active2
- var/t1 = copytext(sanitize(input("Add Comment:", "Med. records", null, null) as message),1,MAX_MESSAGE_LEN)
+ var/t1 = copytext(trim(sanitize(input("Add Comment:", "Med. records", null, null) as message)),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
var/counter = 1
diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm
index 58a77c950d4..e7060f75775 100644
--- a/code/game/machinery/computer/security.dm
+++ b/code/game/machinery/computer/security.dm
@@ -387,7 +387,7 @@ What a mess.*/
if (!( istype(active2, /datum/data/record) ))
return
var/a2 = active2
- var/t1 = copytext(sanitize(input("Add Comment:", "Secure. records", null, null) as message),1,MAX_MESSAGE_LEN)
+ var/t1 = copytext(trim(sanitize(input("Add Comment:", "Secure. records", null, null) as message)),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return
var/counter = 1
@@ -450,19 +450,19 @@ What a mess.*/
switch(href_list["field"])
if("name")
if (istype(active1, /datum/data/record))
- var/t1 = input("Please input name:", "Secure. records", active1.fields["name"], null) as text
+ var/t1 = reject_bad_name(input("Please input name:", "Secure. records", active1.fields["name"], null) as text)
if ((!( t1 ) || !length(trim(t1)) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon)))) || active1 != a1)
return
active1.fields["name"] = t1
if("id")
if (istype(active2, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please input id:", "Secure. records", active1.fields["id"], null) as text),1,MAX_MESSAGE_LEN)
+ var/t1 = copytext(trim(sanitize(input("Please input id:", "Secure. records", active1.fields["id"], null) as text)),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active1 != a1))
return
active1.fields["id"] = t1
if("fingerprint")
if (istype(active1, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please input fingerprint hash:", "Secure. records", active1.fields["fingerprint"], null) as text),1,MAX_MESSAGE_LEN)
+ var/t1 = copytext(trim(sanitize(input("Please input fingerprint hash:", "Secure. records", active1.fields["fingerprint"], null) as text)),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active1 != a1))
return
active1.fields["fingerprint"] = t1
@@ -480,31 +480,31 @@ What a mess.*/
active1.fields["age"] = t1
if("mi_crim")
if (istype(active2, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please input minor disabilities list:", "Secure. records", active2.fields["mi_crim"], null) as text),1,MAX_MESSAGE_LEN)
+ var/t1 = copytext(trim(sanitize(input("Please input minor disabilities list:", "Secure. records", active2.fields["mi_crim"], null) as text)),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return
active2.fields["mi_crim"] = t1
if("mi_crim_d")
if (istype(active2, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please summarize minor dis.:", "Secure. records", active2.fields["mi_crim_d"], null) as message),1,MAX_MESSAGE_LEN)
+ var/t1 = copytext(trim(sanitize(input("Please summarize minor dis.:", "Secure. records", active2.fields["mi_crim_d"], null) as message)),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return
active2.fields["mi_crim_d"] = t1
if("ma_crim")
if (istype(active2, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please input major diabilities list:", "Secure. records", active2.fields["ma_crim"], null) as text),1,MAX_MESSAGE_LEN)
+ var/t1 = copytext(trim(sanitize(input("Please input major diabilities list:", "Secure. records", active2.fields["ma_crim"], null) as text)),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return
active2.fields["ma_crim"] = t1
if("ma_crim_d")
if (istype(active2, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please summarize major dis.:", "Secure. records", active2.fields["ma_crim_d"], null) as message),1,MAX_MESSAGE_LEN)
+ var/t1 = copytext(trim(sanitize(input("Please summarize major dis.:", "Secure. records", active2.fields["ma_crim_d"], null) as message)),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return
active2.fields["ma_crim_d"] = t1
if("notes")
if (istype(active2, /datum/data/record))
- var/t1 = copytext(html_encode(input("Please summarize notes:", "Secure. records", html_decode(active2.fields["notes"]), null) as message),1,MAX_MESSAGE_LEN)
+ var/t1 = copytext(html_encode(trim(input("Please summarize notes:", "Secure. records", html_decode(active2.fields["notes"]), null) as message)),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return
active2.fields["notes"] = t1
@@ -531,7 +531,7 @@ What a mess.*/
alert(usr, "You do not have the required rank to do this!")
if("species")
if (istype(active1, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please enter race:", "General records", active1.fields["species"], null) as message),1,MAX_MESSAGE_LEN)
+ var/t1 = copytext(trim(sanitize(input("Please enter race:", "General records", active1.fields["species"], null) as message)),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active1 != a1))
return
active1.fields["species"] = t1
diff --git a/code/game/machinery/computer/skills.dm b/code/game/machinery/computer/skills.dm
index 27360e963e2..bc4d977dad1 100644
--- a/code/game/machinery/computer/skills.dm
+++ b/code/game/machinery/computer/skills.dm
@@ -325,19 +325,19 @@ What a mess.*/
switch(href_list["field"])
if("name")
if (istype(active1, /datum/data/record))
- var/t1 = input("Please input name:", "Secure. records", active1.fields["name"], null) as text
+ var/t1 = reject_bad_name(input("Please input name:", "Secure. records", active1.fields["name"], null) as text)
if ((!( t1 ) || !length(trim(t1)) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon)))) || active1 != a1)
return
active1.fields["name"] = t1
if("id")
if (istype(active1, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please input id:", "Secure. records", active1.fields["id"], null) as text),1,MAX_MESSAGE_LEN)
+ var/t1 = copytext(trim(sanitize(input("Please input id:", "Secure. records", active1.fields["id"], null) as text)),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active1 != a1))
return
active1.fields["id"] = t1
if("fingerprint")
if (istype(active1, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please input fingerprint hash:", "Secure. records", active1.fields["fingerprint"], null) as text),1,MAX_MESSAGE_LEN)
+ var/t1 = copytext(trim(sanitize(input("Please input fingerprint hash:", "Secure. records", active1.fields["fingerprint"], null) as text)),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active1 != a1))
return
active1.fields["fingerprint"] = t1
@@ -366,7 +366,7 @@ What a mess.*/
alert(usr, "You do not have the required rank to do this!")
if("species")
if (istype(active1, /datum/data/record))
- var/t1 = copytext(sanitize(input("Please enter race:", "General records", active1.fields["species"], null) as message),1,MAX_MESSAGE_LEN)
+ var/t1 = copytext(trim(sanitize(input("Please enter race:", "General records", active1.fields["species"], null) as message)),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active1 != a1))
return
active1.fields["species"] = t1
diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index 83d58a975da..7c34359236d 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -77,6 +77,7 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }.
icon_state = "door_closed"
power_channel = ENVIRON
+ explosion_resistance = 15
var/aiControlDisabled = 0 //If 1, AI control is disabled until the AI hacks back in and disables the lock. If 2, the AI has bypassed the lock. If -1, the control is enabled but the AI had bypassed it earlier, so if it is disabled again the AI would have no trouble getting back in.
var/hackProof = 0 // if 1, this door can't be hacked by the AI
var/secondsMainPowerLost = 0 //The number of seconds until power is restored.
diff --git a/code/game/machinery/doors/airlock_control.dm b/code/game/machinery/doors/airlock_control.dm
index 59ed905a0ad..afd2f725297 100644
--- a/code/game/machinery/doors/airlock_control.dm
+++ b/code/game/machinery/doors/airlock_control.dm
@@ -6,13 +6,16 @@ obj/machinery/door/airlock
var/frequency
var/shockedby = list()
var/datum/radio_frequency/radio_connection
- explosion_resistance = 15
+ var/cur_command = null //the command the door is currently attempting to complete
obj/machinery/door/airlock/proc/can_radio()
if( !arePowerSystemsOn() || (stat & NOPOWER) || isWireCut(AIRLOCK_WIRE_AI_CONTROL) )
return 0
return 1
+obj/machinery/door/airlock/process()
+ ..()
+ execute_current_command()
obj/machinery/door/airlock/receive_signal(datum/signal/signal)
if (!can_radio()) return
@@ -21,7 +24,19 @@ obj/machinery/door/airlock/receive_signal(datum/signal/signal)
if(id_tag != signal.data["tag"] || !signal.data["command"]) return
- switch(signal.data["command"])
+ cur_command = signal.data["command"]
+ execute_current_command()
+
+obj/machinery/door/airlock/proc/execute_current_command()
+ if (!cur_command)
+ return
+
+ do_command(cur_command)
+ if (command_completed(cur_command))
+ cur_command = null
+
+obj/machinery/door/airlock/proc/do_command(var/command)
+ switch(command)
if("open")
open()
@@ -48,9 +63,30 @@ obj/machinery/door/airlock/receive_signal(datum/signal/signal)
lock()
sleep(2)
-
+
send_status()
+obj/machinery/door/airlock/proc/command_completed(var/command)
+ switch(command)
+ if("open")
+ return (!density)
+
+ if("close")
+ return density
+
+ if("unlock")
+ return !locked
+
+ if("lock")
+ return locked
+
+ if("secure_open")
+ return (locked && !density)
+
+ if("secure_close")
+ return (locked && density)
+
+ return 1 //Unknown command. Just assume it's completed.
obj/machinery/door/airlock/proc/send_status()
if(radio_connection)
diff --git a/code/game/machinery/embedded_controller/airlock_docking_controller.dm b/code/game/machinery/embedded_controller/airlock_docking_controller.dm
index 0e9877d797e..6edf07e221e 100644
--- a/code/game/machinery/embedded_controller/airlock_docking_controller.dm
+++ b/code/game/machinery/embedded_controller/airlock_docking_controller.dm
@@ -108,7 +108,9 @@
//are we ready for undocking?
/datum/computer/file/embedded_program/docking/airlock/ready_for_undocking()
- return airlock_program.check_doors_secured()
+ var/ext_closed = airlock_program.check_exterior_door_secured()
+ var/int_closed = airlock_program.check_interior_door_secured()
+ return (ext_closed || int_closed)
//An airlock controller to be used by the airlock-based docking port controller.
//Same as a regular airlock controller but allows disabling of the regular airlock functions when docking
diff --git a/code/game/machinery/embedded_controller/airlock_program.dm b/code/game/machinery/embedded_controller/airlock_program.dm
index 29b93b3583e..3d7d306df38 100644
--- a/code/game/machinery/embedded_controller/airlock_program.dm
+++ b/code/game/machinery/embedded_controller/airlock_program.dm
@@ -35,10 +35,10 @@
if (istype(M, /obj/machinery/embedded_controller/radio/airlock)) //if our controller is an airlock controller than we can auto-init our tags
var/obj/machinery/embedded_controller/radio/airlock/controller = M
- tag_exterior_door = controller.tag_exterior_door
- tag_interior_door = controller.tag_interior_door
- tag_airpump = controller.tag_airpump
- tag_chamber_sensor = controller.tag_chamber_sensor
+ tag_exterior_door = controller.tag_exterior_door? controller.tag_exterior_door : "[id_tag]_outer"
+ tag_interior_door = controller.tag_interior_door? controller.tag_interior_door : "[id_tag]_inner"
+ tag_airpump = controller.tag_airpump? controller.tag_airpump : "[id_tag]_pump"
+ tag_chamber_sensor = controller.tag_chamber_sensor? controller.tag_chamber_sensor : "[id_tag]_sensor"
tag_exterior_sensor = controller.tag_exterior_sensor
tag_interior_sensor = controller.tag_interior_sensor
memory["secure"] = controller.tag_secure
@@ -248,9 +248,15 @@
return (state == STATE_WAIT && target_state == TARGET_NONE)
//are the doors closed and locked?
+/datum/computer/file/embedded_program/airlock/proc/check_exterior_door_secured()
+ return (memory["exterior_status"]["state"] == "closed" && memory["exterior_status"]["lock"] == "locked")
+
+/datum/computer/file/embedded_program/airlock/proc/check_interior_door_secured()
+ return (memory["interior_status"]["state"] == "closed" && memory["interior_status"]["lock"] == "locked")
+
/datum/computer/file/embedded_program/airlock/proc/check_doors_secured()
- var/ext_closed = (memory["exterior_status"]["state"] == "closed" && memory["exterior_status"]["lock"] == "locked")
- var/int_closed = (memory["interior_status"]["state"] == "closed" && memory["interior_status"]["lock"] == "locked")
+ var/ext_closed = check_exterior_door_secured()
+ var/int_closed = check_interior_door_secured()
return (ext_closed && int_closed)
/datum/computer/file/embedded_program/airlock/proc/signalDoor(var/tag, var/command)
diff --git a/code/game/machinery/embedded_controller/escape_pod_docking_controller.dm b/code/game/machinery/embedded_controller/escape_pod_docking_controller.dm
index f84fbf0b323..50348591287 100644
--- a/code/game/machinery/embedded_controller/escape_pod_docking_controller.dm
+++ b/code/game/machinery/embedded_controller/escape_pod_docking_controller.dm
@@ -1,5 +1,6 @@
//This controller goes on the escape pod itself
/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod
+ name = "escape pod controller"
var/datum/shuttle/ferry/escape_pod/pod
/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
diff --git a/code/game/machinery/embedded_controller/simple_docking_controller.dm b/code/game/machinery/embedded_controller/simple_docking_controller.dm
index 877247799bd..a8a4ad490f6 100644
--- a/code/game/machinery/embedded_controller/simple_docking_controller.dm
+++ b/code/game/machinery/embedded_controller/simple_docking_controller.dm
@@ -58,7 +58,7 @@
if (istype(M, /obj/machinery/embedded_controller/radio/simple_docking_controller))
var/obj/machinery/embedded_controller/radio/simple_docking_controller/controller = M
- tag_door = controller.tag_door
+ tag_door = controller.tag_door? controller.tag_door : "[id_tag]_hatch"
spawn(10)
signal_door("update") //signals connected doors to update their status
diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm
index 303e814ef11..eff51fc6976 100644
--- a/code/game/machinery/flasher.dm
+++ b/code/game/machinery/flasher.dm
@@ -81,7 +81,7 @@
O.Weaken(strength)
if (istype(O, /mob/living/carbon/human))
var/mob/living/carbon/human/H = O
- var/datum/organ/internal/eyes/E = H.internal_organs["eyes"]
+ var/datum/organ/internal/eyes/E = H.internal_organs_by_name["eyes"]
if ((E.damage > E.min_bruised_damage && prob(E.damage + 50)))
flick("e_flash", O:flash)
E.damage += rand(1, 5)
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/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm
index 7e6f1e3f7e6..2db29d4ab04 100644
--- a/code/game/machinery/suit_storage_unit.dm
+++ b/code/game/machinery/suit_storage_unit.dm
@@ -1064,19 +1064,9 @@
if(!target_species || !target_department)
return
- switch(target_species)
- if("Skrell")
- if(helmet) helmet.species_restricted = list("Skrell")
- if(suit) suit.species_restricted = list("exclude","Unathi","Tajaran","Diona","Vox")
- if("Human")
- if(helmet) helmet.species_restricted = list("exclude","Unathi","Tajaran","Diona","Vox","Skrell")
- if(suit) suit.species_restricted = list("exclude","Unathi","Tajaran","Diona","Vox")
- if("Unathi")
- if(helmet) helmet.species_restricted = list("Unathi")
- if(suit) suit.species_restricted = list("Unathi")
- if("Tajaran")
- if(helmet) helmet.species_restricted = list("Tajaran")
- if(suit) suit.species_restricted = list("Tajaran")
+ if(target_species)
+ if(helmet) helmet.refit_for_species(target_species)
+ if(suit) suit.refit_for_species(target_species)
switch(target_department)
if("Engineering")
diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm
index 5dd31a036ea..a0404c6be9e 100644
--- a/code/game/machinery/vending.dm
+++ b/code/game/machinery/vending.dm
@@ -187,53 +187,63 @@
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.suspended)
+ 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]Unable to access account. Check security settings and try again."
else
- usr << "\icon[src]You don't have that much money!"
+ //Just Vend it.
+ transfer_and_vend(CH)
else
- usr << "\icon[src]Unable to access account. Check security settings and try again."
+ usr << "\icon[src]Connected account has been suspended."
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/code/game/mecha/mecha_construction_paths.dm b/code/game/mecha/mecha_construction_paths.dm
index c80eb656cb4..e9c6d644a88 100644
--- a/code/game/mecha/mecha_construction_paths.dm
+++ b/code/game/mecha/mecha_construction_paths.dm
@@ -1273,6 +1273,7 @@
else
user.visible_message("[user] cuts internal armor layer from [holder].", "You cut the internal armor layer from [holder].")
holder.icon_state = "odysseus10"
+ if(2)
if(diff==FORWARD)
user.visible_message("[user] secures external armor layer.", "You secure external reinforced armor layer.")
holder.icon_state = "odysseus13"
@@ -1293,4 +1294,4 @@
spawn_result()
..()
feedback_inc("mecha_odysseus_created",1)
- return
\ No newline at end of file
+ return
diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm
index b0897829e2e..935760efdb1 100644
--- a/code/game/objects/items.dm
+++ b/code/game/objects/items.dm
@@ -49,6 +49,18 @@
var/list/sprite_sheets = null
var/icon_override = null //Used to override hardcoded clothing dmis in human clothing proc.
+ /* Species-specific sprite sheets for object and inhand sprites
+ Works similarly to worn sprite_sheets, except the alternate sprites are used when the clothing/refit_for_species() proc is called.
+ */
+ var/list/sprite_sheets_obj = null
+
+ //Inhand is not as big a deal as the object sprites, so I'm not sure if these are worth the extra vars.
+ //Maybe in the future:
+ //var/list/sprite_sheets_inhand_l = null
+ //var/list/sprite_sheets_inhand_r = null
+ //var/icon_l_hand = 'icons/mob/items_lefthand.dmi'
+ //var/icon_r_hand = 'icons/mob/items_righthand.dmi'
+
/obj/item/device
icon = 'icons/obj/device.dmi'
@@ -539,7 +551,7 @@
"\red You stab yourself in the eyes with [src]!" \
)
if(istype(M, /mob/living/carbon/human))
- var/datum/organ/internal/eyes/eyes = H.internal_organs["eyes"]
+ var/datum/organ/internal/eyes/eyes = H.internal_organs_by_name["eyes"]
eyes.damage += rand(3,4)
if(eyes.damage >= eyes.min_bruised_damage)
if(M.stat != 2)
diff --git a/code/game/objects/items/devices/modkit.dm b/code/game/objects/items/devices/modkit.dm
index dd7c1231f45..a1de93987f1 100644
--- a/code/game/objects/items/devices/modkit.dm
+++ b/code/game/objects/items/devices/modkit.dm
@@ -7,7 +7,7 @@
desc = "A kit containing all the needed tools and parts to modify a hardsuit for another user."
icon_state = "modkit"
var/parts = MODKIT_FULL
- var/list/target_species = list("Human","Skrell")
+ var/target_species = "Human"
var/list/permitted_types = list(
/obj/item/clothing/head/helmet/space/rig,
@@ -15,6 +15,8 @@
)
/obj/item/device/modkit/afterattack(obj/O, mob/user as mob)
+ if (!target_species)
+ return //it shouldn't be null, okay?
if(!parts)
user << "This kit has no parts for this modification left."
@@ -22,11 +24,20 @@
del(src)
return
- /* TODO: list comparison
- if(istype(O,to_type))
- user << "[O] is already modified."
+ var/allowed = 0
+ for (var/permitted_type in permitted_types)
+ if(istype(O, permitted_type))
+ allowed = 1
+
+ var/obj/item/clothing/I = O
+ if (!istype(I) || !allowed)
+ user << "[src] is unable to modify that."
return
- */
+
+ var/excluding = ("exclude" in I.species_restricted)
+ var/in_list = (target_species in I.species_restricted)
+ if (excluding ^ in_list)
+ user << "[I] is already modified."
if(!isturf(O.loc))
user << "[O] must be safely placed on the ground for modification."
@@ -36,22 +47,22 @@
user.visible_message("\red [user] opens \the [src] and modifies \the [O].","\red You open \the [src] and modify \the [O].")
- var/obj/item/clothing/I = O
- if(istype(I))
- I.species_restricted = target_species.Copy()
+ I.refit_for_species(target_species)
- parts--
+ if (istype(I, /obj/item/clothing/head/helmet))
+ parts &= ~MODKIT_HELMET
+ if (istype(I, /obj/item/clothing/suit))
+ parts &= ~MODKIT_SUIT
+
if(!parts)
user.drop_from_inventory(src)
del(src)
-/obj/item/device/modkit/tajaran
- name = "tajaran hardsuit modification kit"
- desc = "A kit containing all the needed tools and parts to modify a hardsuit for another user. This one looks like it's meant for Tajara."
- target_species = list("Tajaran")
-
/obj/item/device/modkit/examine()
..()
- usr << "It looks as though it modifies hardsuits to fit the following users:"
- for(var/species in target_species)
- usr << "- [species]"
\ No newline at end of file
+ usr << "It looks as though it modifies hardsuits to fit [target_species] users."
+
+/obj/item/device/modkit/tajaran
+ name = "tajaran hardsuit modification kit"
+ desc = "A kit containing all the needed tools and parts to modify a hardsuit for another user. This one looks like it's meant for Tajaran."
+ target_species = "Tajaran"
\ No newline at end of file
diff --git a/code/game/objects/items/weapons/grenades/flashbang.dm b/code/game/objects/items/weapons/grenades/flashbang.dm
index 2716719fda3..dd60f16645a 100644
--- a/code/game/objects/items/weapons/grenades/flashbang.dm
+++ b/code/game/objects/items/weapons/grenades/flashbang.dm
@@ -83,7 +83,7 @@
//This really should be in mob not every check
if(ishuman(M))
var/mob/living/carbon/human/H = M
- var/datum/organ/internal/eyes/E = H.internal_organs["eyes"]
+ var/datum/organ/internal/eyes/E = H.internal_organs_by_name["eyes"]
if (E.damage >= E.min_bruised_damage)
M << "\red Your eyes start to burn badly!"
if(!banglet && !(istype(src , /obj/item/weapon/grenade/flashbang/clusterbang)))
diff --git a/code/game/objects/items/weapons/kitchen.dm b/code/game/objects/items/weapons/kitchen.dm
index 12af48f6c84..5d724955206 100644
--- a/code/game/objects/items/weapons/kitchen.dm
+++ b/code/game/objects/items/weapons/kitchen.dm
@@ -32,9 +32,9 @@
/obj/item/weapon/kitchen/utensil/New()
if (prob(60))
src.pixel_y = rand(0, 4)
- return
create_reagents(5)
+ return
/obj/item/weapon/kitchen/utensil/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
if(!istype(M))
@@ -58,7 +58,7 @@
for(var/mob/O in viewers(M, null))
O.show_message(text("\blue [] feeds [] some [] from \the []", user, M, loaded, src), 1)
M.reagents.add_reagent("nutriment", 1)
-
+ playsound(M.loc,'sound/items/eatfood.ogg', rand(10,40), 1)
overlays.Cut()
return
diff --git a/code/game/objects/items/weapons/manuals.dm b/code/game/objects/items/weapons/manuals.dm
index 319486d6a3e..b301a77e764 100644
--- a/code/game/objects/items/weapons/manuals.dm
+++ b/code/game/objects/items/weapons/manuals.dm
@@ -737,11 +737,11 @@
/obj/item/weapon/book/manual/security_space_law
- name = "Space Law"
+ name = "Corporate Regulations"
desc = "A set of NanoTrasen guidelines for keeping law and order on their space stations."
icon_state = "bookSpaceLaw"
author = "NanoTrasen"
- title = "Space Law"
+ title = "Corporate Regulations"
dat = {"
@@ -749,7 +749,7 @@
-
+