Syndicate ID & Crew Announcement can now spoof faction (#13206)

This commit is contained in:
mikomyazaki
2022-02-18 12:13:23 +01:00
committed by GitHub
parent ddf26300d8
commit 4af2c64e68
4 changed files with 26 additions and 4 deletions
+8 -3
View File
@@ -46,18 +46,23 @@
random_record = new(user)
var/datum/record/general/record = random_record.Copy()
if(I)
record.age = I.age
record.rank = I.assignment
record.real_rank = I.assignment
record.name = I.registered_name
record.sex = I.sex
record.employer = I.employer_faction
var/datum/faction/id_faction = SSjobs.name_factions[I.employer_faction]
var/faction_abbreviation = id_faction.title_suffix
var/assignment = "[I.assignment][ faction_abbreviation ? " ([faction_abbreviation])" : ""]"
record.rank = assignment
record.real_rank = assignment
else
var/mob/living/carbon/human/H
if(istype(user,/mob/living/carbon/human))
H = user
record.age = H.age
record.employer = H.employer_faction
else
record.age = initial(H.age)
var/assignment = GetAssignment(user)
+3 -1
View File
@@ -118,6 +118,7 @@ var/const/NO_EMAG_ACT = -50
//alt titles are handled a bit weirdly in order to unobtrusively integrate into existing ID system
var/assignment = null //can be alt title or the actual job
var/rank = null //actual job
var/employer_faction = null
var/dorm = 0 // determines if this ID has claimed a dorm already
var/datum/ntnet_user/chat_user
@@ -173,6 +174,7 @@ var/const/NO_EMAG_ACT = -50
id_card.citizenship = citizenship
id_card.religion = SSrecords.get_religion_record_name(religion)
id_card.mob = src
id_card.employer_faction = employer_faction
/obj/item/card/id/proc/dat()
var/dat = ("<table><tr><td>")
@@ -529,7 +531,7 @@ var/const/NO_EMAG_ACT = -50
/obj/item/card/id/distress/ap_eridani/New()
access = get_distress_access()
..()
/obj/item/card/id/distress/iac
name = "\improper Interstellar Aid Corps ID"
assignment = "Interstellar Aid Corps Responder"
@@ -67,6 +67,7 @@
entries[++entries.len] = list("name" = "Sex", "value" = sex)
entries[++entries.len] = list("name" = "Citizenship", "value" = citizenship)
entries[++entries.len] = list("name" = "Religion", "value" = religion)
entries[++entries.len] = list("name" = "Faction", "value" = employer_faction)
entries[++entries.len] = list("name" = "Factory Reset", "value" = "Use With Care")
data["electronic_warfare"] = electronic_warfare
data["entries"] = entries
@@ -229,6 +230,12 @@
src.religion = new_religion
to_chat(user, SPAN_NOTICE("Religion changed to '[new_religion]'."))
. = 1
if("Faction")
var/new_faction = sanitize(input(user,"Which faction would you like to put on this card?","Agent Card Faction", employer_faction) as null|text)
if(!isnull(new_faction) && CanUseTopic(user,state))
src.employer_faction = new_faction
to_chat(user, SPAN_NOTICE("Faction changed to '[new_faction]'."))
. = 1
if("Factory Reset")
if(alert("This will factory reset the card, including access and owner. Continue?", "Factory Reset", "No", "Yes") == "Yes" && CanUseTopic(user, state))
age = initial(age)
@@ -245,6 +252,7 @@
unset_registered_user()
religion = initial(religion)
sex = initial(sex)
employer_faction = initial(employer_faction)
to_chat(user, "<span class='notice'>All information has been deleted from \the [src].</span>")
. = 1
@@ -0,0 +1,7 @@
author: mikomyazaki
delete-after: True
changes:
- bugfix: "Crew Arrival Announcement/Records will now include a faction tag for valid factions, so your crew manifest listing can match everyone else's."
- tweak: "The Agent ID can now have a faction name set."