mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
IAA demotions and commendations v2
Fuck you salvage captain. inb4 this build gets fucked again by this blend stuff that won't compile. Compiled on a working previous bleeding edge build and it worked. Fixed the poster.len thing. Did not fix the findtext string stuff, doing text2num would further confuse things and would require more conversion to text to work.
This commit is contained in:
135
code/WorkInProgress/Cutelilduck/human_resources.dm
Normal file
135
code/WorkInProgress/Cutelilduck/human_resources.dm
Normal file
@@ -0,0 +1,135 @@
|
||||
/obj/item/weapon/paper/demotion_key
|
||||
name = "Human Resources: Demotion Fax Key"
|
||||
info = "<center><B>Fax Machine Demotion Key</B></center><BR><BR>This document is intended for use in the station fax machines.<br><ol><li>Insert into fax with your Internal Affairs ID.</li><li>Select NANOTRASEN HR to send to; Requires official Agent authorization.</li><li>Use the printed chip to carefully set a name.</li></ol> Remember to probably capitolize the employee name. Acquire Heads of Staff stamps to bar respective access, and once you have completed gathering authorizations you can apply the chip to the intended ID card.<br><br>In case of a mistake, acquire a new ID card as Identification Computers cannot bypass the chip."
|
||||
icon = 'icons/obj/bureaucracy.dmi'
|
||||
icon_state = "paper_words"
|
||||
stamps = "<br><br><i>This document has an intricate Nanontrasen logo in magnetic ink. It looks impossible to forge.</i>"
|
||||
|
||||
/obj/item/weapon/paper/commendation_key
|
||||
name = "Human Resources: Commendation Fax Key"
|
||||
info = "<center><B>Fax Machine Commendation Key</B></center><BR><BR>This document is intended for use in the station fax machines.<br><ol><li>Insert into fax with your Internal Affairs ID.</li><li>Select NANOTRASEN HR to send to; Requires official Agent authorization.</li><li>Take the printed sticker and give cordially to valued employee.</li></ol> Commendations should only be given to outstanding crew members and those who exhibit positive, productive qualities."
|
||||
icon = 'icons/obj/bureaucracy.dmi'
|
||||
icon_state = "paper_words"
|
||||
stamps = "<br><br><i>This document has an intricate Nanontrasen logo in magnetic ink. It looks impossible to forge.</i>"
|
||||
|
||||
|
||||
/obj/item/demote_chip //messy variables but I hate lists in byond
|
||||
name = "unprogrammed demotion microchip"
|
||||
desc = "A microchip that removes certain access when applied to ID cards."
|
||||
icon = 'icons/obj/card.dmi'
|
||||
icon_state = "demote_chip"
|
||||
w_class = 1.0
|
||||
var/target_name = null
|
||||
var/cap = 0
|
||||
var/hos = 0
|
||||
var/cmo = 0
|
||||
var/ce = 0
|
||||
var/hop = 0
|
||||
var/rd = 0
|
||||
var/clown = 0
|
||||
|
||||
|
||||
/obj/item/demote_chip/New()
|
||||
..()
|
||||
|
||||
/obj/item/demote_chip/attack_self(mob/user as mob)
|
||||
if(target_name != null) //Used hand-labeler as example
|
||||
user << "<span class='notice'>The target name cannot be reset!</span>"
|
||||
return
|
||||
else
|
||||
var/str = copytext(reject_bad_text(input(user,"Enter the properly capitolized name for demotion","Set name","")),1,MAX_NAME_LEN)
|
||||
if(!str)
|
||||
alert("Invalid name.")
|
||||
target_name = null
|
||||
return
|
||||
target_name = str
|
||||
name = "[target_name]'s demotion microchip"
|
||||
desc = desc + " Stamped by:"
|
||||
user << "\blue The demotion microchip for [src.target_name] is now ready to be stamped."
|
||||
|
||||
/obj/item/demote_chip/attackby(obj/item/weapon/stamp/S as obj, mob/user as mob)
|
||||
|
||||
if(target_name != null)//Stamper must be able to see who he is banning
|
||||
if(istype(S, /obj/item/weapon/stamp/captain))
|
||||
if(cap == 0)
|
||||
desc = desc + "/Captain"
|
||||
cap = 1
|
||||
user << "\blue You stamp the demotion microchip of [target_name]."
|
||||
if(istype(S, /obj/item/weapon/stamp/hop))
|
||||
if(hop == 0)
|
||||
desc = desc + "/HoP"
|
||||
hop = 1
|
||||
user << "\blue You stamp the demotion microchip of [target_name]."
|
||||
if(istype(S, /obj/item/weapon/stamp/hos))
|
||||
if(hos == 0)
|
||||
desc = desc + "/HoS"
|
||||
hos = 1
|
||||
user << "\blue You stamp the demotion microchip of [target_name]."
|
||||
if(istype(S, /obj/item/weapon/stamp/ce))
|
||||
if(ce == 0)
|
||||
desc = desc + "/CE"
|
||||
ce = 1
|
||||
user << "\blue You stamp the demotion microchip of [target_name]."
|
||||
if(istype(S, /obj/item/weapon/stamp/rd))
|
||||
if(rd == 0)
|
||||
desc = desc + "/RD"
|
||||
rd = 1
|
||||
user << "\blue You stamp the demotion microchip of [target_name]."
|
||||
if(istype(S, /obj/item/weapon/stamp/cmo))
|
||||
if(cmo == 0)
|
||||
desc = desc + "/CMO"
|
||||
cmo = 1
|
||||
user << "\blue You stamp the demotion microchip of [target_name]."
|
||||
if(istype(S, /obj/item/weapon/stamp/clown))
|
||||
if(clown == 0)
|
||||
desc = desc + "/HONK"
|
||||
clown = 1
|
||||
user << "\blue You stamp the demotion microchip of [target_name]."
|
||||
else
|
||||
user << "\blue The chip has not been initialized."
|
||||
|
||||
/obj/item/weapon/card/id/syndicate/attackby(var/obj/item/demote_chip/DE as obj, mob/user as mob)
|
||||
//placebo, does not affect access on syndie agent card
|
||||
if(registered_name != DE.target_name)
|
||||
user << "\blue Failed to apply, names do not match."
|
||||
else if(bans != null)
|
||||
user << "\blue This card already has a microchip applied"
|
||||
else
|
||||
icon_state = "centcom_old"
|
||||
bans = "9" //if get_region_accesses ever uses 9 we're fucked
|
||||
del(DE)
|
||||
|
||||
/obj/item/weapon/card/id/attackby(var/obj/item/demote_chip/D as obj, mob/user as mob)
|
||||
//Check for if names match, card already has a chip, and its not a captains ID.
|
||||
if(registered_name != D.target_name)
|
||||
user << "\blue Failed to apply, names do not match."
|
||||
else if(bans != null)
|
||||
user << "\blue This card already has a microchip applied"
|
||||
else if(icon_state == "gold")
|
||||
user << "\blue This microchip cannot apply to this card type."
|
||||
else
|
||||
|
||||
if(D.cap == 1)
|
||||
access -= get_region_accesses(5)
|
||||
bans = bans + "5"
|
||||
if(D.hop == 1)
|
||||
access -= get_region_accesses(6)
|
||||
access -= get_region_accesses(7)
|
||||
bans = bans + "67"
|
||||
if(D.hos == 1)
|
||||
access -= get_region_accesses(1)
|
||||
bans = bans + "1"
|
||||
if(D.ce == 1)
|
||||
access -= get_region_accesses(4)
|
||||
bans = bans + "4"
|
||||
if(D.rd == 1)
|
||||
access -= get_region_accesses(3)
|
||||
bans = bans + "3"
|
||||
if(D.cmo == 1)
|
||||
access -= get_region_accesses(2)
|
||||
bans = bans + "2"
|
||||
if(bans == null)
|
||||
user << "\blue You require at least one stamp."
|
||||
return
|
||||
icon_state = "centcom_old"
|
||||
del(D)
|
||||
@@ -1,3 +1,5 @@
|
||||
//Updated by Cutelildick
|
||||
|
||||
var/list/obj/machinery/faxmachine/allfaxes = list()
|
||||
var/list/alldepartments = list("Central Command")
|
||||
|
||||
@@ -75,6 +77,9 @@ var/list/alldepartments = list("Central Command")
|
||||
else
|
||||
dat += "<a href='byond://?src=\ref[src];send=1'>Send</a><br>"
|
||||
dat += "<b>Currently sending:</b> [tofax.name]<br>"
|
||||
if(dpt == null)
|
||||
//Old bug fix. Not selecting a dpt and/or my new lawyer access feature broke the dpt select.
|
||||
dpt = "Central Command"
|
||||
dat += "<b>Sending to:</b> <a href='byond://?src=\ref[src];dept=1'>[dpt]</a><br>"
|
||||
|
||||
else
|
||||
@@ -98,8 +103,15 @@ var/list/alldepartments = list("Central Command")
|
||||
if(href_list["send"])
|
||||
if(tofax)
|
||||
|
||||
if(dpt == "Central Command")
|
||||
Centcomm_fax(tofax.info, tofax.name, usr)
|
||||
if((dpt == "Central Command") | (dpt == "Nanotrasen HR"))
|
||||
if(dpt == "Central Command")
|
||||
Centcomm_fax(tofax.info, tofax.name, usr)
|
||||
if(dpt == "Nanotrasen HR")
|
||||
if(findtext(tofax.stamps, "magnetic"))
|
||||
if(findtext(tofax.name,"Demotion"))
|
||||
new /obj/item/demote_chip(src.loc)
|
||||
if(findtext(tofax.name,"Commendation"))
|
||||
new /obj/item/weapon/contraband/poster(src.loc,-1)
|
||||
sendcooldown = 1800
|
||||
|
||||
else
|
||||
@@ -143,9 +155,13 @@ var/list/alldepartments = list("Central Command")
|
||||
if ( (!( authenticated ) && (scan)) )
|
||||
if (check_access(scan))
|
||||
authenticated = 1
|
||||
if(access_lawyer in scan.access)
|
||||
alldepartments += "Nanotrasen HR"
|
||||
|
||||
if(href_list["logout"])
|
||||
authenticated = 0
|
||||
if(access_lawyer in scan.access)
|
||||
alldepartments -= "Nanotrasen HR"
|
||||
|
||||
updateUsrDialog()
|
||||
|
||||
@@ -183,7 +199,9 @@ var/list/alldepartments = list("Central Command")
|
||||
|
||||
proc/SendFax(var/sent, var/sentname, var/mob/Sender, var/dpt)
|
||||
|
||||
|
||||
for(var/obj/machinery/faxmachine/F in allfaxes)
|
||||
|
||||
if( F.department == dpt )
|
||||
if(! (F.stat & (BROKEN|NOPOWER) ) )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user