mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-24 12:37:50 +01:00
Cleans up id card setup. Now with less automagic and more controlled.
This commit is contained in:
@@ -34,10 +34,9 @@
|
||||
|
||||
var/obj/item/weapon/card/id/W = new id_type(player)
|
||||
if(!W) return
|
||||
W.name = "[player.real_name]'s ID Card"
|
||||
W.access |= default_access
|
||||
W.assignment = "[assignment]"
|
||||
W.registered_name = player.real_name
|
||||
W.set_owner_info(player)
|
||||
if(equip) player.equip_to_slot_or_del(W, slot_wear_id)
|
||||
return W
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ var/datum/antagonist/deathsquad/mercenary/commandos
|
||||
role_text = "Syndicate Commando"
|
||||
role_text_plural = "Commandos"
|
||||
welcome_text = "You are in the employ of a criminal syndicate hostile to NanoTrasen."
|
||||
id_type = /obj/item/weapon/card/id/centcom/ERT
|
||||
|
||||
/datum/antagonist/deathsquad/mercenary/New()
|
||||
..(1)
|
||||
@@ -24,7 +25,6 @@ var/datum/antagonist/deathsquad/mercenary/commandos
|
||||
player.equip_to_slot_or_del(new /obj/item/weapon/rig/merc(player), slot_back)
|
||||
player.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse_rifle(player), slot_r_hand)
|
||||
|
||||
var/obj/item/weapon/card/id/id = create_id("Commando", player)
|
||||
id.access |= get_all_station_access()
|
||||
id.icon_state = "centcom"
|
||||
create_radio(SYND_FREQ, player)
|
||||
create_id("Commando", player)
|
||||
create_radio(SYND_FREQ, player)
|
||||
return 1
|
||||
|
||||
@@ -11,6 +11,7 @@ var/datum/antagonist/ert/ert
|
||||
max_antags = 5
|
||||
max_antags_round = 5 // ERT mode?
|
||||
landmark_id = "Response Team"
|
||||
id_type = /obj/item/weapon/card/id/centcom/ERT
|
||||
|
||||
flags = ANTAG_OVERRIDE_JOB | ANTAG_SET_APPEARANCE | ANTAG_HAS_LEADER | ANTAG_CHOOSE_NAME
|
||||
|
||||
@@ -36,10 +37,6 @@ var/datum/antagonist/ert/ert
|
||||
player.equip_to_slot_or_del(new /obj/item/clothing/shoes/swat(src), slot_shoes)
|
||||
player.equip_to_slot_or_del(new /obj/item/clothing/gloves/swat(src), slot_gloves)
|
||||
player.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(src), slot_glasses)
|
||||
|
||||
var/obj/item/weapon/card/id/centcom/ERT/W = new(src)
|
||||
W.registered_name = player.real_name
|
||||
W.name = "[player.real_name]'s ID Card ([W.assignment])"
|
||||
player.equip_to_slot_or_del(W, slot_wear_id)
|
||||
|
||||
|
||||
create_id(role_text, player)
|
||||
return 1
|
||||
|
||||
@@ -543,10 +543,9 @@ var/global/datum/controller/occupations/job_master
|
||||
else
|
||||
C = new /obj/item/weapon/card/id(H)
|
||||
if(C)
|
||||
C.registered_name = H.real_name
|
||||
C.rank = rank
|
||||
C.assignment = title ? title : rank
|
||||
C.name = "[C.registered_name]'s ID Card ([C.assignment])"
|
||||
C.set_owner_info(H)
|
||||
|
||||
//put the player's account number onto the ID
|
||||
if(H.mind && H.mind.initial_account)
|
||||
|
||||
@@ -111,12 +111,6 @@
|
||||
var/rank = null //actual job
|
||||
var/dorm = 0 // determines if this ID has claimed a dorm already
|
||||
|
||||
/obj/item/weapon/card/id/New()
|
||||
..()
|
||||
spawn(30)
|
||||
if(istype(loc, /mob/living/carbon/human))
|
||||
SetOwnerInfo(loc)
|
||||
|
||||
/obj/item/weapon/card/id/examine(mob/user)
|
||||
set src in oview(1)
|
||||
if(in_range(usr, src))
|
||||
@@ -128,7 +122,7 @@
|
||||
/obj/item/weapon/card/id/proc/show(mob/user as mob)
|
||||
user << browse_rsc(front, "front.png")
|
||||
user << browse_rsc(side, "side.png")
|
||||
var/datum/browser/popup = new(user, "idcard", name, 600, 200)
|
||||
var/datum/browser/popup = new(user, "idcard", name, 600, 250)
|
||||
popup.set_content(dat)
|
||||
popup.set_title_image(usr.browse_rsc_icon(src.icon, src.icon_state))
|
||||
popup.open()
|
||||
@@ -137,20 +131,22 @@
|
||||
/obj/item/weapon/card/id/proc/update_name()
|
||||
name = "[src.registered_name]'s ID Card ([src.assignment])"
|
||||
|
||||
/obj/item/weapon/card/id/syndicate/proc/set_id_photo(var/mob/M)
|
||||
/obj/item/weapon/card/id/proc/set_id_photo(var/mob/M)
|
||||
front = getFlatIcon(M, SOUTH, always_use_defdir = 1)
|
||||
side = getFlatIcon(M, WEST, always_use_defdir = 1)
|
||||
|
||||
/obj/item/weapon/card/id/proc/SetOwnerInfo(var/mob/living/carbon/human/H)
|
||||
/obj/item/weapon/card/id/proc/set_owner_info(var/mob/living/carbon/human/H)
|
||||
if(!H || !H.dna)
|
||||
return
|
||||
|
||||
sex = capitalize(H.gender)
|
||||
age = H.age
|
||||
blood_type = H.dna.b_type
|
||||
dna_hash = H.dna.unique_enzymes
|
||||
fingerprint_hash = md5(H.dna.uni_identity)
|
||||
age = H.age
|
||||
blood_type = H.dna.b_type
|
||||
dna_hash = H.dna.unique_enzymes
|
||||
fingerprint_hash = md5(H.dna.uni_identity)
|
||||
registered_name = H.real_name
|
||||
sex = capitalize(H.gender)
|
||||
set_id_photo(H)
|
||||
update_name()
|
||||
|
||||
dat = ("<table><tr><td>")
|
||||
dat += text("Name: []</A><BR>", registered_name)
|
||||
@@ -265,8 +261,6 @@
|
||||
else
|
||||
..()
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/card/id/syndicate_command
|
||||
name = "syndicate ID card"
|
||||
desc = "An ID straight from the Syndicate."
|
||||
|
||||
@@ -59,7 +59,6 @@
|
||||
M.equip_to_slot_or_del(new src.corpseback(M), slot_back)
|
||||
if(src.corpseid == 1)
|
||||
var/obj/item/weapon/card/id/W = new(M)
|
||||
W.name = "[M.real_name]'s ID Card"
|
||||
var/datum/job/jobdatum
|
||||
for(var/jobtype in typesof(/datum/job))
|
||||
var/datum/job/J = new jobtype
|
||||
@@ -75,7 +74,7 @@
|
||||
W.access = list()
|
||||
if(corpseidjob)
|
||||
W.assignment = corpseidjob
|
||||
W.registered_name = M.real_name
|
||||
W.set_owner_info(M)
|
||||
M.equip_to_slot_or_del(W, slot_wear_id)
|
||||
qdel(src)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user