mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
* fixes contractions to proper english in negative.dm * fixes possessives in miscellaneous.dm * fixes capitalization in brain_item.dm * fixes capitalization in liver.dm * Fixes negative.dm typo * adds a missing i to ai _DEFINES * Fixes typo in cargo defines to spell auxiliary properly * fixes contractions in code\datums\action.dm * fixes capitalization in code\datums\components\religious_tool.dm * Fixes spelling of sudoriferous in code\datums\diseases\advance\symptoms\fire.dm * changes necrotizing tissues and organs to necrosing tissues and organs in code\datums\diseases\advance\symptoms\flesh_eating.dm necrosing is proper english here * Fixes a missing letter in code\datums\diseases\advance\symptoms\itching.dm * Changes s to z in code\datums\diseases\advance\symptoms\radiation.dm * Updates clarity in code\datums\diseases\brainrot.dm * spells vengeance properly in code\datums\diseases\parrotpossession.dm * fixes grammar in code\datums\diseases\wizarditis.dm * fixes the spelling of "casualties" in code\datums\ert.dm * removes extra t in code\datums\martial\cqc.dm * Updates code\datums\martial\flying_fang.dm to match style of previous code * adds t to code\datums\mutations\antenna.dm * spells agitation right in code\datums\mutations\hulk.dm * spells perceive right in code\datums\mutations\sight.dm * fixes a contraction in code\datums\ruins\lavaland.dm * changes "unbreachable" to "impenetrable" and "tradestation" to "trade station", as well as fixing a typo in code\datums\ruins\space.dm * fixes typos in code\datums\shuttles.dm * fixes a typo in code\datums\station_traits\negative_traits.dm * Fixes a typo in code\datums\station_traits\positive_traits.dm * Fixes spelling in code\datums\wires\mech_fabricator.dm * fixes typo in code\datums\wounds\burns.dm * resanguination is not a real word * fixes typo in code\game\gamemodes\changeling\traitor_chan.dm * fixes typos in code\game\gamemodes\clock_cult\clock_cult.dm * fixes spelling in code\game\gamemodes\cult\cult.dm * adds an s to posses in code\game\gamemodes\eldritch_cult\eldritch_cult.dm * fixes a spelling mistake in code\game\gamemodes\hivemind\radar.dm * fixes a typo in code\game\gamemodes\malfunction\malf.dm * fixes spelling mistake in code\game\gamemodes\wizard\wizard.dm * Fixes a spelling mistake in code\game\machinery\bounty_board.dm * fixes whatever the fuck medical kiosks were spelling wise * removes a t and lowercases bluespace as it isn't a proper noun in code\game\machinery\sci_bombardment.dm * Fixes spelling mistake in code\game\machinery\shuttle\shuttle_heater.dm * Fixes spelling issue in code\game\machinery\stasis.dm * Fixes spelling issue in code\game\machinery\telecomms\computers\logbrowser.dm * oranges can't fucking spell in code\game\mecha\equipment\tools\medical_tools.dm * authentication is now spelled correctly in code\game\mecha\mech_fabricator.dm * fixes spelling mistake in code\game\mecha\mecha.dm * Updates "Defence" to "Defense" to be more in line with sprite information * Fixes spelling issue in code\game\objects\items\grenades\chem_grenade.dm * updates mecha defence mode to defense mode to be more in line with what is written as the icon_state * Fixes english in code\game\objects\items\implants\implant_greytide.dm * fixes spelling issue in code\game\objects\items\robot\robot_parts.dm * fixes spelling issues in code\game\objects\items\storage\lockbox.dm * Revert "Changes s to z in code\datums\diseases\advance\symptoms\radiation.dm" This reverts commit170f514f67to change the z back to an s * updates an extra m in object path in code\game\objects\structures\signs\signs_departments.dm * spelling fix in code\game\objects\structures\crates_lockers\closets\bodybag.dm * spells otherworldly correctly in code\game\objects\items\twohanded.dm * food service is 2 separate words in code\game\objects\structures\crates_lockers\closets\job_closets.dm * Fixes a spelling mistake in code\game\objects\items\toys.dm * Fixes spelling of Nanotrasen in code\game\objects\items\supermatter_delaminator.dm * Adderall is a proper noun in code\game\objects\items\sharpener.dm * fixes spelling mistake in code\game\objects\items\religion.dm * code\game\objects\items\puzzle_pieces.dm * Janitalia is a proper noun * Fixes spelling of occurrence in code\game\objects\items\miscellaneous.dm * fixes the spelling of nurture and fixes a title in code\game\objects\items\manuals.dm * @cuackles can't capitalize in code\game\objects\items\holy_weapons.dm * nobody can spell environment in code\game\objects\items\holosign_creator.dm * code\game\objects\items\gems.dm spelling fix * spelling fix in code\game\objects\items\cards_ids.dm * spelling fix code\game\objects\items\airlock_painter.dm * map object paths updated for the one letter change to an object path * more fixes * Revert "updates an extra m in object path in code\game\objects\structures\signs\signs_departments.dm" This reverts commit98cb63b396. * Revert "map object paths updated for the one letter change to an object path" This reverts commitf4220a3505. * Update mecha_topic.dm * i hate myself
847 lines
30 KiB
Plaintext
847 lines
30 KiB
Plaintext
/* Cards
|
|
* Contains:
|
|
* DATA CARD
|
|
* ID CARD
|
|
* FINGERPRINT CARD HOLDER
|
|
* FINGERPRINT CARD
|
|
*/
|
|
|
|
|
|
|
|
|
|
//DATA CARDS - Used for the IC data card reader
|
|
|
|
/obj/item/card
|
|
name = "card"
|
|
desc = "Does card things."
|
|
icon = 'icons/obj/card.dmi'
|
|
w_class = WEIGHT_CLASS_TINY
|
|
|
|
var/list/files = list()
|
|
|
|
/obj/item/card/suicide_act(mob/living/carbon/user)
|
|
user.visible_message(span_suicide("[user] begins to swipe [user.p_their()] neck with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!"))
|
|
return BRUTELOSS
|
|
|
|
/obj/item/card/data
|
|
name = "data card"
|
|
desc = "A plastic magstripe card for simple and speedy data storage and transfer. This one has a stripe running down the middle."
|
|
icon_state = "data_1"
|
|
obj_flags = UNIQUE_RENAME
|
|
var/function = "storage"
|
|
var/data = "null"
|
|
var/special = null
|
|
item_state = "card-id"
|
|
lefthand_file = 'icons/mob/inhands/equipment/idcards_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/equipment/idcards_righthand.dmi'
|
|
var/detail_color = COLOR_ASSEMBLY_ORANGE
|
|
|
|
/obj/item/card/data/Initialize()
|
|
.=..()
|
|
update_icon()
|
|
|
|
/obj/item/card/data/update_icon()
|
|
cut_overlays()
|
|
if(detail_color == COLOR_FLOORTILE_GRAY)
|
|
return
|
|
var/mutable_appearance/detail_overlay = mutable_appearance('icons/obj/card.dmi', "[icon_state]-color")
|
|
detail_overlay.color = detail_color
|
|
add_overlay(detail_overlay)
|
|
|
|
/obj/item/card/data/full_color
|
|
desc = "A plastic magstripe card for simple and speedy data storage and transfer. This one has the entire card colored."
|
|
icon_state = "data_2"
|
|
|
|
/obj/item/card/data/disk
|
|
desc = "A plastic magstripe card for simple and speedy data storage and transfer. This one inexplicably looks like a floppy disk."
|
|
icon_state = "data_3"
|
|
|
|
/*
|
|
* ID CARDS
|
|
*/
|
|
/obj/item/card/emag
|
|
desc = "It's a card with a magnetic strip attached to some circuitry."
|
|
name = "cryptographic sequencer"
|
|
icon_state = "emag"
|
|
item_state = "card-id"
|
|
lefthand_file = 'icons/mob/inhands/equipment/idcards_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/equipment/idcards_righthand.dmi'
|
|
item_flags = NO_MAT_REDEMPTION | NOBLUDGEON
|
|
var/prox_check = TRUE //If the emag requires you to be in range
|
|
|
|
/obj/item/card/emag/bluespace
|
|
name = "bluespace cryptographic sequencer"
|
|
desc = "It's a blue card with a magnetic strip attached to some circuitry. It appears to have some sort of transmitter attached to it."
|
|
color = rgb(40, 130, 255)
|
|
prox_check = FALSE
|
|
|
|
/obj/item/card/emag/improvised
|
|
name = "improvised cryptographic sequencer"
|
|
desc = "It's a card with some junk circuitry strapped to it. It doesn't look like it would be reliable or fast due to shoddy construction, and needs to be manually recharged with uranium sheets."
|
|
icon_state = "emag_shitty"
|
|
var/charges = 5 //how many times can we use the emag before needing to reload it?
|
|
var/max_charges = 5
|
|
var/emagging //are we currently emagging something
|
|
|
|
/obj/item/card/emag/improvised/afterattack(atom/target, mob/user, proximity)
|
|
if(charges > 0)
|
|
if(emagging)
|
|
return
|
|
if(!proximity && prox_check) //left in for badmins
|
|
return
|
|
emagging = TRUE
|
|
if(do_after(user, rand(5, 10) SECONDS, target))
|
|
charges--
|
|
if (prob(40))
|
|
to_chat(user, span_notice("[src] emits a puff of smoke, but nothing happens."))
|
|
emagging = FALSE
|
|
return
|
|
if (prob(5))
|
|
var/mob/living/M = user
|
|
M.adjust_fire_stacks(1)
|
|
M.IgniteMob()
|
|
to_chat(user, span_danger("The card shorts out and catches fire in your hands!"))
|
|
log_combat(user, target, "attempted to emag")
|
|
if (!istype(target, /obj/machinery/computer/cargo))
|
|
target.emag_act(user)
|
|
else
|
|
to_chat(user, span_notice("The cheap circuitry isn't strong enough to subvert this!"))
|
|
emagging = FALSE
|
|
|
|
/obj/item/card/emag/improvised/attackby(obj/item/W, mob/user, params)
|
|
. = ..()
|
|
if (max_charges > charges)
|
|
if (istype(W, /obj/item/stack/sheet/mineral/uranium))
|
|
var/obj/item/stack/sheet/mineral/uranium/T = W
|
|
T.use(1)
|
|
charges++
|
|
to_chat(user, span_notice("You add another charge to the [src]. It now has [charges] use[charges == 1 ? "" : "s"] remaining."))
|
|
|
|
/obj/item/card/emag/improvised/examine(mob/user)
|
|
. = ..()
|
|
. += span_notice("The charge meter indicates that it has [charges] charge[charges == 1 ? "" : "s"] remaining out of [max_charges] charges.")
|
|
|
|
/obj/item/card/emag/attack()
|
|
return
|
|
|
|
/obj/item/card/emag/afterattack(atom/target, mob/user, proximity)
|
|
. = ..()
|
|
var/atom/A = target
|
|
if(!proximity && prox_check)
|
|
return
|
|
log_combat(user, A, "attempted to emag")
|
|
A.emag_act(user)
|
|
|
|
/obj/item/card/emagfake
|
|
desc = "It's a card with a magnetic strip attached to some circuitry. Closer inspection shows that this card is a poorly made replica, with a \"DonkCo\" logo stamped on the back."
|
|
name = "cryptographic sequencer"
|
|
icon_state = "emag"
|
|
item_state = "card-id"
|
|
lefthand_file = 'icons/mob/inhands/equipment/idcards_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/equipment/idcards_righthand.dmi'
|
|
|
|
/obj/item/card/emagfake/afterattack()
|
|
. = ..()
|
|
playsound(src, 'sound/items/bikehorn.ogg', 50, 1)
|
|
|
|
/obj/item/card/id
|
|
name = "identification card"
|
|
desc = "A card used to provide ID and determine access across the station."
|
|
icon_state = "id"
|
|
item_state = "card-id"
|
|
lefthand_file = 'icons/mob/inhands/equipment/idcards_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/equipment/idcards_righthand.dmi'
|
|
slot_flags = ITEM_SLOT_ID
|
|
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 25, BIO = 0, RAD = 0, FIRE = 100, ACID = 100)
|
|
resistance_flags = FIRE_PROOF | ACID_PROOF
|
|
var/mining_points = 0 //For redeeming at mining equipment vendors
|
|
var/list/access = list()
|
|
var/registered_name = null // The name registered_name on the card
|
|
var/assignment = null
|
|
var/originalassignment = null
|
|
var/access_txt // mapping aid
|
|
var/datum/bank_account/registered_account
|
|
var/obj/machinery/paystand/my_store
|
|
var/registered_age = 21 // default age for ss13 players
|
|
var/critter_money = FALSE //does exactly what it says
|
|
|
|
/obj/item/card/id/Initialize(mapload)
|
|
. = ..()
|
|
if(mapload && access_txt)
|
|
access = text2access(access_txt)
|
|
|
|
/obj/item/card/id/Destroy()
|
|
if (registered_account)
|
|
registered_account.bank_cards -= src
|
|
if (my_store && my_store.my_card == src)
|
|
my_store.my_card = null
|
|
return ..()
|
|
|
|
/obj/item/card/id/attack_self(mob/user)
|
|
if(Adjacent(user))
|
|
var/minor
|
|
if(registered_name && registered_age && registered_age < AGE_MINOR)
|
|
minor = " <b>(MINOR)</b>"
|
|
user.visible_message(span_notice("[user] shows you: [icon2html(src, viewers(user))] [src.name][minor]."), span_notice("You show \the [src.name][minor]."))
|
|
|
|
/obj/item/card/id/vv_edit_var(var_name, var_value)
|
|
. = ..()
|
|
if(.)
|
|
switch(var_name)
|
|
if("assignment","registered_name","registered_age")
|
|
update_label()
|
|
|
|
/obj/item/card/id/attackby(obj/item/W, mob/user, params)
|
|
if(istype(W, /obj/item/holochip))
|
|
insert_money(W, user)
|
|
return
|
|
else if(istype(W, /obj/item/stack/spacecash))
|
|
insert_money(W, user, TRUE)
|
|
return
|
|
else if(istype(W, /obj/item/coin))
|
|
insert_money(W, user, TRUE)
|
|
return
|
|
else
|
|
return ..()
|
|
|
|
/obj/item/card/id/proc/insert_money(obj/item/I, mob/user, physical_currency)
|
|
var/cash_money = I.get_item_credit_value()
|
|
if(!cash_money)
|
|
to_chat(user, span_warning("[I] doesn't seem to be worth anything!"))
|
|
return
|
|
|
|
if(!registered_account)
|
|
to_chat(user, span_warning("[src] doesn't have a linked account to deposit [I] into!"))
|
|
return
|
|
|
|
registered_account.adjust_money(cash_money)
|
|
if(physical_currency)
|
|
to_chat(user, span_notice("You stuff [I] into [src]. It disappears in a small puff of bluespace smoke, adding [cash_money] credits to the linked account."))
|
|
else
|
|
to_chat(user, span_notice("You insert [I] into [src], adding [cash_money] credits to the linked account."))
|
|
|
|
to_chat(user, span_notice("The linked account now reports a balance of $[registered_account.account_balance]."))
|
|
qdel(I)
|
|
|
|
|
|
/obj/item/card/id/proc/alt_click_can_use_id(mob/living/user)
|
|
if(!isliving(user))
|
|
return
|
|
if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
|
return
|
|
|
|
return TRUE
|
|
|
|
/obj/item/card/id/AltClick(mob/living/user)
|
|
if(!alt_click_can_use_id(user))
|
|
return
|
|
if(!registered_account)
|
|
var/new_bank_id = input(user, "Enter your account ID number.", "Account Reclamation", 111111) as num
|
|
if(!alt_click_can_use_id(user))
|
|
return
|
|
if(!new_bank_id || new_bank_id < 111111 || new_bank_id > 999999)
|
|
to_chat(user, span_warning("The account ID number needs to be between 111111 and 999999."))
|
|
return
|
|
var/bank_id = "[new_bank_id]"
|
|
if(bank_id in SSeconomy.bank_accounts)
|
|
var/datum/bank_account/B = SSeconomy.bank_accounts[bank_id]
|
|
B.bank_cards += src
|
|
registered_account = B
|
|
to_chat(user, span_notice("The provided account has been linked to this ID card."))
|
|
return
|
|
to_chat(user, span_warning("The account ID number provided is invalid."))
|
|
return
|
|
|
|
if (world.time < registered_account.withdrawDelay)
|
|
registered_account.bank_card_talk(span_warning("ERROR: UNABLE TO LOGIN DUE TO SCHEDULED MAINTENANCE. MAINTENANCE IS SCHEDULED TO COMPLETE IN [(registered_account.withdrawDelay - world.time)/10] SECONDS."), TRUE)
|
|
return
|
|
|
|
var/amount_to_remove = FLOOR(input(user, "How much do you want to withdraw? Current Balance: [registered_account.account_balance]", "Withdraw Funds", 5) as num, 1)
|
|
|
|
if(!amount_to_remove || amount_to_remove < 0)
|
|
to_chat(user, span_warning("You're pretty sure that's not how money works."))
|
|
return
|
|
if(!alt_click_can_use_id(user))
|
|
return
|
|
if(registered_account.adjust_money(-amount_to_remove))
|
|
if(!critter_money)
|
|
var/obj/item/holochip/holochip = new (user.drop_location(), amount_to_remove)
|
|
user.put_in_hands(holochip)
|
|
to_chat(user, span_notice("You withdraw [amount_to_remove] credits into a holochip."))
|
|
else
|
|
var/mob/living/simple_animal/critter
|
|
switch(amount_to_remove)
|
|
if(1 to 10)
|
|
critter = new /mob/living/simple_animal/mouse(get_turf(src))
|
|
if(10 to 25)
|
|
if(prob(50))
|
|
critter = new /mob/living/simple_animal/hostile/lizard(get_turf(src))
|
|
else
|
|
critter = new /mob/living/simple_animal/turtle(get_turf(src))
|
|
if(25 to 50)
|
|
if(prob(50))
|
|
critter = new /mob/living/simple_animal/pet/cat(get_turf(src))
|
|
else
|
|
critter = new /mob/living/simple_animal/pet/dog/corgi(get_turf(src))
|
|
if(50 to 100)
|
|
if(prob(50))
|
|
critter = new /mob/living/simple_animal/opossum(get_turf(src))
|
|
else
|
|
critter = new /mob/living/simple_animal/pet/catslug(get_turf(src))
|
|
if(100 to 200)
|
|
if(prob(50))
|
|
critter = new /mob/living/simple_animal/pet/fox(get_turf(src))
|
|
else
|
|
critter = new /mob/living/simple_animal/hostile/retaliate/poison/snake(get_turf(src))
|
|
if(200 to 250)
|
|
critter = new /mob/living/simple_animal/pet/gondola(get_turf(src))
|
|
if(250 to INFINITY)
|
|
critter = new /mob/living/simple_animal/cheese(get_turf(src))
|
|
var/list/candidates = pollCandidatesForMob("Do you want to play as cheese?", ROLE_SENTIENCE, null, ROLE_SENTIENCE, 5 SECONDS, critter, POLL_IGNORE_SENTIENCE_POTION) // see poll_ignore.dm
|
|
if(!LAZYLEN(candidates))
|
|
return
|
|
var/mob/dead/observer/O = pick(candidates)
|
|
critter.key = O.key
|
|
critter.sentience_act()
|
|
to_chat(critter, span_warning(span_danger("CHEESE!")))
|
|
return
|
|
var/obj/item/clothing/mob_holder/holder = new (get_turf(src), critter, critter.held_state, critter.held_icon, critter.held_lh, critter.held_rh, \
|
|
critter.worn_layer, critter.mob_size, critter.worn_slot_flags)
|
|
user.put_in_hands(holder)
|
|
return
|
|
else
|
|
var/difference = amount_to_remove - registered_account.account_balance
|
|
registered_account.bank_card_talk(span_warning("ERROR: The linked account requires [difference] more credit\s to perform that withdrawal."), TRUE)
|
|
|
|
/obj/item/card/id/examine(mob/user)
|
|
.=..()
|
|
if(registered_age)
|
|
. += "The card indicates that the holder is [registered_age] years old. [(registered_age < AGE_MINOR) ? "There's a holographic stripe that reads <b>[span_danger("'MINOR: DO NOT SERVE ALCOHOL OR TOBACCO'")]</b> along the bottom of the card." : ""]"
|
|
if(mining_points)
|
|
. += "There's [mining_points] mining equipment redemption point\s loaded onto this card."
|
|
|
|
if(registered_account)
|
|
. += "The account linked to the ID belongs to '[registered_account.account_holder]' and reports a balance of $[registered_account.account_balance]."
|
|
if(registered_account.account_job)
|
|
var/datum/bank_account/D = SSeconomy.get_dep_account(registered_account.account_job.paycheck_department)
|
|
if(D)
|
|
. += "The [D.account_holder] reports a balance of $[D.account_balance]."
|
|
. += span_info("Alt-Click the ID to pull money from the linked account in the form of holochips.")
|
|
. += span_info("You can insert credits into the linked account by pressing holochips, cash, or coins against the ID.")
|
|
if(registered_account.account_holder == user.real_name)
|
|
. += span_boldnotice("If you lose this ID card, you can reclaim your account by Alt-Clicking a blank ID card while holding it and entering your account ID number.")
|
|
else
|
|
. += span_info("There is no registered account linked to this card. Alt-Click to add one.")
|
|
|
|
/obj/item/card/id/GetAccess()
|
|
return access
|
|
|
|
/obj/item/card/id/GetID()
|
|
return src
|
|
|
|
/obj/item/card/id/RemoveID()
|
|
return src
|
|
|
|
/*
|
|
Usage:
|
|
update_label()
|
|
Sets the id name to whatever registered_name and assignment is
|
|
update_label("John Doe", "Clowny")
|
|
Properly formats the name and occupation and sets the id name to the arguments
|
|
*/
|
|
/obj/item/card/id/proc/update_label(newname, newjob)
|
|
if(newname || newjob)
|
|
name = "[(!newname) ? "identification card" : "[newname]'s ID Card"][(!newjob) ? "" : " ([newjob])"]"
|
|
return
|
|
|
|
name = "[(!registered_name) ? "identification card" : "[registered_name]'s ID Card"][(!assignment) ? "" : " ([assignment])"]"
|
|
|
|
/obj/item/card/id/silver
|
|
name = "silver identification card"
|
|
desc = "A silver card which shows honour and dedication."
|
|
icon_state = "silver"
|
|
item_state = "silver_id"
|
|
lefthand_file = 'icons/mob/inhands/equipment/idcards_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/equipment/idcards_righthand.dmi'
|
|
|
|
/obj/item/card/id/silver/reaper
|
|
name = "Thirteen's ID Card (Reaper)"
|
|
access = list(ACCESS_MAINT_TUNNELS)
|
|
assignment = "Reaper"
|
|
originalassignment = "Reaper"
|
|
registered_name = "Thirteen"
|
|
|
|
/obj/item/card/id/gold
|
|
name = "gold identification card"
|
|
desc = "A golden card which shows power and might."
|
|
icon_state = "gold"
|
|
item_state = "gold_id"
|
|
lefthand_file = 'icons/mob/inhands/equipment/idcards_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/equipment/idcards_righthand.dmi'
|
|
|
|
/obj/item/card/id/syndicate
|
|
name = "agent card"
|
|
access = list(ACCESS_MAINT_TUNNELS, ACCESS_SYNDICATE)
|
|
var/anyone = FALSE //Can anyone forge the ID or just syndicate?
|
|
var/forged = FALSE //have we set a custom name and job assignment, or will we use what we're given when we chameleon change?
|
|
|
|
/obj/item/card/id/syndicate/Initialize()
|
|
. = ..()
|
|
var/datum/action/item_action/chameleon/change/chameleon_action = new(src)
|
|
chameleon_action.syndicate = TRUE
|
|
chameleon_action.chameleon_type = /obj/item/card/id
|
|
chameleon_action.chameleon_name = "ID Card"
|
|
chameleon_action.initialize_disguises()
|
|
|
|
/obj/item/card/id/syndicate/afterattack(obj/item/O, mob/user, proximity)
|
|
if(!proximity)
|
|
return
|
|
if(istype(O, /obj/item/card/id))
|
|
var/obj/item/card/id/I = O
|
|
src.access |= I.access
|
|
if(isliving(user) && user.mind)
|
|
if(user.mind.special_role || anyone)
|
|
to_chat(usr, span_notice("The card's microscanners activate as you pass it over the ID, copying its access."))
|
|
|
|
/obj/item/card/id/syndicate/attack_self(mob/user)
|
|
if(isliving(user) && user.mind)
|
|
var/first_use = registered_name ? FALSE : TRUE
|
|
if(!(user.mind.special_role || anyone)) //Unless anyone is allowed, only syndies can use the card, to stop metagaming.
|
|
if(first_use) //If a non-syndie is the first to forge an unassigned agent ID, then anyone can forge it.
|
|
anyone = TRUE
|
|
else
|
|
return ..()
|
|
|
|
var/popup_input = alert(user, "Choose Action", "Agent ID", "Show", "Forge/Reset", "Change Account ID")
|
|
if(user.incapacitated())
|
|
return
|
|
if(popup_input == "Forge/Reset" && !forged)
|
|
var/input_name = stripped_input(user, "What name would you like to put on this card? Leave blank to randomise.", "Agent card name", registered_name ? registered_name : (ishuman(user) ? user.real_name : user.name), MAX_NAME_LEN)
|
|
input_name = reject_bad_name(input_name)
|
|
if(!input_name)
|
|
// Invalid/blank names give a randomly generated one.
|
|
if(user.gender == FEMALE)
|
|
input_name = "[pick(GLOB.first_names_female)] [pick(GLOB.last_names)]"
|
|
else
|
|
input_name = "[pick(GLOB.first_names_male)] [pick(GLOB.last_names)]"
|
|
|
|
var/target_occupation = stripped_input(user, "What occupation would you like to put on this card?\nNote: This will not grant any access levels other than Maintenance.", "Agent card job assignment", assignment ? assignment : "Assistant", MAX_MESSAGE_LEN)
|
|
if(!target_occupation)
|
|
return
|
|
|
|
var/newAge = input(user, "Choose the ID's age:\n([AGE_MIN]-[AGE_MAX])", "Agent card age") as num|null
|
|
if(newAge)
|
|
registered_age = max(round(text2num(newAge)), 0)
|
|
|
|
registered_name = input_name
|
|
assignment = target_occupation
|
|
originalassignment = target_occupation
|
|
update_label()
|
|
forged = TRUE
|
|
to_chat(user, span_notice("You successfully forge the ID card."))
|
|
log_game("[key_name(user)] has forged \the [initial(name)] with name \"[registered_name]\" and occupation \"[assignment]\".")
|
|
|
|
// First time use automatically sets the account id to the user.
|
|
if (first_use && !registered_account)
|
|
if(ishuman(user))
|
|
var/mob/living/carbon/human/accountowner = user
|
|
var/acc_id = "[accountowner.account_id]"
|
|
if(acc_id in SSeconomy.bank_accounts)
|
|
var/datum/bank_account/account = SSeconomy.bank_accounts[acc_id]
|
|
account.bank_cards += src
|
|
registered_account = account
|
|
to_chat(user, span_notice("Your account number has been automatically assigned."))
|
|
return
|
|
else if (popup_input == "Forge/Reset" && forged)
|
|
registered_name = initial(registered_name)
|
|
assignment = initial(assignment)
|
|
originalassignment = initial(originalassignment)
|
|
log_game("[key_name(user)] has reset \the [initial(name)] named \"[src]\" to default.")
|
|
update_label()
|
|
forged = FALSE
|
|
to_chat(user, span_notice("You successfully reset the ID card."))
|
|
return
|
|
else if (popup_input == "Change Account ID")
|
|
set_new_account(user)
|
|
return
|
|
return ..()
|
|
|
|
/obj/item/card/id/syndicate/on_chameleon_change()
|
|
. = ..()
|
|
update_label()
|
|
|
|
// Returns true if new account was set.
|
|
/obj/item/card/id/proc/set_new_account(mob/living/user)
|
|
. = FALSE
|
|
var/datum/bank_account/old_account = registered_account
|
|
|
|
var/new_bank_id = input(user, "Enter your account ID number.", "Account Reclamation", 111111) as num | null
|
|
|
|
if (isnull(new_bank_id))
|
|
return
|
|
|
|
if(!alt_click_can_use_id(user))
|
|
return
|
|
if(!new_bank_id || new_bank_id < 111111 || new_bank_id > 999999)
|
|
to_chat(user, span_warning("The account ID number needs to be between 111111 and 999999."))
|
|
return
|
|
if (registered_account && registered_account.account_id == new_bank_id)
|
|
to_chat(user, span_warning("The account ID was already assigned to this card."))
|
|
return
|
|
|
|
var/acc_id = "[new_bank_id]"
|
|
if(acc_id in SSeconomy.bank_accounts)
|
|
var/datum/bank_account/B = SSeconomy.bank_accounts[acc_id]
|
|
if (old_account)
|
|
old_account.bank_cards -= src
|
|
|
|
B.bank_cards += src
|
|
registered_account = B
|
|
to_chat(user, span_notice("The provided account has been linked to this ID card."))
|
|
return TRUE
|
|
|
|
to_chat(user, span_warning("The account ID number provided is invalid."))
|
|
return
|
|
|
|
/obj/item/card/id/makeshift
|
|
name = "makeshift ID"
|
|
desc = "A humble piece of cardboard with a name written on it. This will probably never fool anyone."
|
|
icon = 'icons/obj/card.dmi'
|
|
icon_state = "makeshift"
|
|
item_state = "makeshift"
|
|
registered_name = "John Doe"
|
|
var/bank_account = FALSE
|
|
var/forged = FALSE
|
|
|
|
/obj/item/card/id/makeshift/attack_self(mob/user)
|
|
if(isliving(user) && user.mind)
|
|
var/popup_input = alert(user, "Choose Action", "ID", "Show", "Forge/Reset")
|
|
if(user.incapacitated())
|
|
return
|
|
if(popup_input == "Forge/Reset")
|
|
var/input_name = stripped_input(user, "What name would you like to write on this card? Leave blank to randomize.", "Agent card name", registered_name ? registered_name : (ishuman(user) ? user.real_name : user.name), MAX_NAME_LEN)
|
|
input_name = reject_bad_name(input_name)
|
|
if(!input_name)
|
|
// Invalid/blank names give a randomly generated one.
|
|
if(user.gender == FEMALE)
|
|
input_name = "[pick(GLOB.first_names_female)] [pick(GLOB.last_names)]"
|
|
else
|
|
input_name = "[pick(GLOB.first_names_male)] [pick(GLOB.last_names)]"
|
|
|
|
var/newAge = input(user, "Choose an age to display:\n([AGE_MIN]-[AGE_MAX])", "Agent card age") as num|null
|
|
if(newAge)
|
|
registered_age = max(round(text2num(newAge)), 0)
|
|
|
|
registered_name = input_name
|
|
forged = TRUE
|
|
to_chat(user, span_notice("You scribble a new name onto the makeshift ID."))
|
|
|
|
/obj/item/card/id/syndicate/anyone
|
|
anyone = TRUE
|
|
|
|
/obj/item/card/id/syndicate/nuke_leader
|
|
name = "lead agent card"
|
|
access = list(ACCESS_MAINT_TUNNELS, ACCESS_SYNDICATE, ACCESS_SYNDICATE_LEADER)
|
|
registered_age = null
|
|
|
|
/obj/item/card/id/syndicate_command
|
|
name = "syndicate ID card"
|
|
desc = "An ID straight from the Syndicate."
|
|
registered_name = "Syndicate"
|
|
assignment = "Syndicate Overlord"
|
|
originalassignment = "Syndicate Overlord"
|
|
access = list(ACCESS_SYNDICATE)
|
|
|
|
/obj/item/card/id/captains_spare
|
|
name = "captain's spare ID"
|
|
desc = "The spare ID of the High Lord himself."
|
|
icon_state = "gold"
|
|
item_state = "gold_id"
|
|
lefthand_file = 'icons/mob/inhands/equipment/idcards_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/equipment/idcards_righthand.dmi'
|
|
registered_name = "Captain"
|
|
assignment = "Captain"
|
|
originalassignment = "Captain"
|
|
registered_age = null
|
|
|
|
/obj/item/card/id/captains_spare/Initialize()
|
|
var/datum/job/captain/J = new/datum/job/captain
|
|
access = J.get_access()
|
|
. = ..()
|
|
|
|
/obj/item/card/id/captains_spare/temporary
|
|
name = "emergency id card"
|
|
desc = "A temporary ID for access to secure areas in the event of an emergency"
|
|
resistance_flags = FLAMMABLE
|
|
|
|
/obj/item/card/id/captains_spare/temporary/Initialize()
|
|
. = ..()
|
|
access -= ACCESS_CHANGE_IDS
|
|
access -= ACCESS_HEADS
|
|
addtimer(CALLBACK(src, .proc/wipe_id), 50 SECONDS)
|
|
|
|
/obj/item/card/id/captains_spare/temporary/proc/wipe_id()
|
|
visible_message(span_danger("The temporary spare begins to smolder"), span_userdanger("The temporary spare begins to smolder"), span_userdanger("The temporary spare begins to smolder"))
|
|
sleep(10 SECONDS)
|
|
if(isliving(loc))
|
|
var/mob/living/M = loc
|
|
M.adjust_fire_stacks(1)
|
|
M.IgniteMob()
|
|
if(istype(loc,/obj/structure/fireaxecabinet/bridge/spare)) //if somebody is being naughty and putting the temporary spare in the cabinet
|
|
var/obj/structure/fireaxecabinet/bridge/spare/holder = loc
|
|
forceMove(holder.loc)
|
|
holder.spareid = null
|
|
if(holder.obj_integrity > holder.integrity_failure) //we dont want to heal it by accident
|
|
holder.take_damage(holder.obj_integrity - holder.integrity_failure, BURN) //we do a bit of trolling for being naughty
|
|
else
|
|
holder.update_icon() //update the icon anyway so it pops out
|
|
visible_message(span_danger("The heat of the temporary spare shatters the glass!"));
|
|
fire_act()
|
|
sleep(2 SECONDS)
|
|
if(istype(loc,/obj/structure/fireaxecabinet/bridge/spare)) //dude you put it back?
|
|
var/obj/structure/fireaxecabinet/bridge/spare/holder = loc
|
|
forceMove(holder.loc)
|
|
holder.spareid = null
|
|
holder.update_icon()
|
|
burn()
|
|
|
|
/obj/item/card/id/centcom
|
|
name = "\improper CentCom ID"
|
|
desc = "An ID straight from Central Command."
|
|
icon_state = "centcom"
|
|
registered_name = "Central Command"
|
|
assignment = "CentCom Official"
|
|
originalassignment = "CentCom Official"
|
|
registered_age = null
|
|
|
|
/obj/item/card/id/centcom/silver
|
|
name = "\improper silver CentCom ID"
|
|
desc = "A silver ID straight from Central Command."
|
|
icon_state = "centcom_silver"
|
|
|
|
/obj/item/card/id/centcom/gold
|
|
name = "\improper gold CentCom ID"
|
|
desc = "A gold ID straight from Central Command."
|
|
icon_state = "centcom_gold"
|
|
|
|
|
|
|
|
/obj/item/card/id/centcom/Initialize()
|
|
access = get_all_centcom_access()
|
|
. = ..()
|
|
|
|
/obj/item/card/id/ert
|
|
name = "\improper CentCom ID"
|
|
desc = "An ERT ID card."
|
|
icon_state = "centcom"
|
|
registered_name = "Emergency Response Team Commander"
|
|
assignment = "Emergency Response Team Commander"
|
|
originalassignment = "Emergency Response Team Commander"
|
|
registered_age = null
|
|
|
|
/obj/item/card/id/ert/debug/Initialize()
|
|
. = ..()
|
|
access = get_debug_access()
|
|
|
|
/obj/item/card/id/ert/amber
|
|
name = "\improper Amber Task Force ID"
|
|
desc = "An Amber Task Force ID card."
|
|
assignment = "Amber Task Force"
|
|
originalassignment = "Amber Task Force"
|
|
|
|
/obj/item/card/id/ert/occupying
|
|
name = "\improper Occupying Force ID"
|
|
desc = "An Occupying Force ID card."
|
|
assignment = "Occupying Officer"
|
|
originalassignment = "Occupying Officer"
|
|
|
|
/obj/item/card/id/ert/occupying/Initialize()
|
|
access = list(ACCESS_SECURITY,ACCESS_BRIG,ACCESS_WEAPONS,ACCESS_SEC_DOORS,ACCESS_MAINT_TUNNELS)+get_ert_access("sec")
|
|
. = ..()
|
|
|
|
/obj/item/card/id/ert/Initialize()
|
|
access = get_all_accesses()+get_ert_access("commander")-ACCESS_CHANGE_IDS
|
|
. = ..()
|
|
|
|
/obj/item/card/id/ert/Security
|
|
registered_name = "Security Response Officer"
|
|
assignment = "Security Response Officer"
|
|
originalassignment = "Security Response Officer"
|
|
|
|
/obj/item/card/id/ert/Security/Initialize()
|
|
access = get_all_accesses()+get_ert_access("sec")-ACCESS_CHANGE_IDS
|
|
. = ..()
|
|
|
|
/obj/item/card/id/ert/Engineer
|
|
registered_name = "Engineer Response Officer"
|
|
assignment = "Engineer Response Officer"
|
|
originalassignment = "Engineer Response Officer"
|
|
|
|
/obj/item/card/id/ert/Engineer/Initialize()
|
|
access = get_all_accesses()+get_ert_access("eng")-ACCESS_CHANGE_IDS
|
|
. = ..()
|
|
|
|
/obj/item/card/id/ert/Medical
|
|
registered_name = "Medical Response Officer"
|
|
assignment = "Medical Response Officer"
|
|
originalassignment = "Medical Response Officer"
|
|
|
|
/obj/item/card/id/ert/Medical/Initialize()
|
|
access = get_all_accesses()+get_ert_access("med")-ACCESS_CHANGE_IDS
|
|
. = ..()
|
|
|
|
/obj/item/card/id/ert/chaplain
|
|
registered_name = "Religious Response Officer"
|
|
assignment = "Religious Response Officer"
|
|
originalassignment = "Religious Response Officer"
|
|
|
|
/obj/item/card/id/ert/chaplain/Initialize()
|
|
access = get_all_accesses()+get_ert_access("sec")-ACCESS_CHANGE_IDS
|
|
. = ..()
|
|
|
|
/obj/item/card/id/ert/Janitor
|
|
registered_name = "Janitorial Response Officer"
|
|
assignment = "Janitorial Response Officer"
|
|
originalassignment = "Janitorial Response Officer"
|
|
|
|
/obj/item/card/id/ert/Janitor/Initialize()
|
|
access = get_all_accesses()
|
|
. = ..()
|
|
|
|
/obj/item/card/id/ert/clown
|
|
registered_name = "Clown"
|
|
assignment = "Clown ERT"
|
|
originalassignment = "Clown ERT"
|
|
|
|
/obj/item/card/id/ert/clown/Initialize()
|
|
access = get_all_accesses()
|
|
. = ..()
|
|
|
|
/obj/item/card/id/prisoner
|
|
name = "prisoner ID card"
|
|
desc = "You are a number, you are not a free man."
|
|
icon_state = "orange"
|
|
item_state = "orange-id"
|
|
lefthand_file = 'icons/mob/inhands/equipment/idcards_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/equipment/idcards_righthand.dmi'
|
|
assignment = "Prisoner"
|
|
originalassignment = "Prisoner"
|
|
registered_name = "Scum"
|
|
var/goal = 0 //How far from freedom?
|
|
var/points = 0
|
|
registered_age = null
|
|
|
|
/obj/item/card/id/prisoner/attack_self(mob/user)
|
|
to_chat(usr, span_notice("You have accumulated [points] out of the [goal] points you need for freedom."))
|
|
|
|
/obj/item/card/id/prisoner/one
|
|
name = "Prisoner #13-001"
|
|
registered_name = "Prisoner #13-001"
|
|
|
|
/obj/item/card/id/prisoner/two
|
|
name = "Prisoner #13-002"
|
|
registered_name = "Prisoner #13-002"
|
|
|
|
/obj/item/card/id/prisoner/three
|
|
name = "Prisoner #13-003"
|
|
registered_name = "Prisoner #13-003"
|
|
|
|
/obj/item/card/id/prisoner/four
|
|
name = "Prisoner #13-004"
|
|
registered_name = "Prisoner #13-004"
|
|
|
|
/obj/item/card/id/prisoner/five
|
|
name = "Prisoner #13-005"
|
|
registered_name = "Prisoner #13-005"
|
|
|
|
/obj/item/card/id/prisoner/six
|
|
name = "Prisoner #13-006"
|
|
registered_name = "Prisoner #13-006"
|
|
|
|
/obj/item/card/id/prisoner/seven
|
|
name = "Prisoner #13-007"
|
|
registered_name = "Prisoner #13-007"
|
|
|
|
/obj/item/card/id/mining
|
|
name = "mining ID"
|
|
access = list(ACCESS_MINING, ACCESS_MINING_STATION, ACCESS_MECH_MINING, ACCESS_MAILSORTING, ACCESS_MINERAL_STOREROOM)
|
|
|
|
/obj/item/card/id/away
|
|
name = "a perfectly generic identification card"
|
|
desc = "A perfectly generic identification card. Looks like it could use some flavor."
|
|
access = list(ACCESS_AWAY_GENERAL)
|
|
registered_age = null
|
|
|
|
/obj/item/card/id/away/hotel
|
|
name = "Staff ID"
|
|
desc = "A staff ID used to access the hotel's doors."
|
|
access = list(ACCESS_AWAY_GENERAL, ACCESS_AWAY_MAINT)
|
|
|
|
/obj/item/card/id/away/hotel/securty
|
|
name = "Officer ID"
|
|
access = list(ACCESS_AWAY_GENERAL, ACCESS_AWAY_MAINT, ACCESS_AWAY_SEC)
|
|
|
|
/obj/item/card/id/away/old
|
|
name = "a perfectly generic identification card"
|
|
desc = "A perfectly generic identification card. Looks like it could use some flavor."
|
|
icon_state = "centcom"
|
|
|
|
/obj/item/card/id/away/old/sec
|
|
name = "Charlie Station Security Officer's ID card"
|
|
desc = "A faded Charlie Station ID card. You can make out the rank \"Security Officer\"."
|
|
assignment = "Charlie Station Security Officer"
|
|
originalassignment = "Security Officer"
|
|
access = list(ACCESS_AWAY_GENERAL, ACCESS_AWAY_SEC)
|
|
|
|
/obj/item/card/id/away/old/sci
|
|
name = "Charlie Station Scientist's ID card"
|
|
desc = "A faded Charlie Station ID card. You can make out the rank \"Scientist\"."
|
|
assignment = "Charlie Station Scientist"
|
|
originalassignment = "Scientist"
|
|
access = list(ACCESS_AWAY_GENERAL)
|
|
|
|
/obj/item/card/id/away/old/eng
|
|
name = "Charlie Station Engineer's ID card"
|
|
desc = "A faded Charlie Station ID card. You can make out the rank \"Station Engineer\"."
|
|
assignment = "Charlie Station Engineer"
|
|
originalassignment = "Engineer"
|
|
access = list(ACCESS_AWAY_GENERAL, ACCESS_AWAY_ENGINE)
|
|
|
|
/obj/item/card/id/away/old/apc
|
|
name = "APC Access ID"
|
|
desc = "A special ID card that allows access to APC terminals."
|
|
access = list(ACCESS_ENGINE_EQUIP)
|
|
|
|
/obj/item/card/id/away/deep_storage //deepstorage.dmm space ruin
|
|
name = "bunker access ID"
|
|
|
|
/obj/item/card/id/departmental_budget
|
|
name = "departmental card (FUCK)"
|
|
desc = "Provides access to the departmental budget."
|
|
var/department_ID = ACCOUNT_CIV
|
|
var/department_name = ACCOUNT_CIV_NAME
|
|
registered_age = null
|
|
|
|
/obj/item/card/id/departmental_budget/Initialize()
|
|
. = ..()
|
|
var/datum/bank_account/B = SSeconomy.get_dep_account(department_ID)
|
|
if(B)
|
|
registered_account = B
|
|
if(!B.bank_cards.Find(src))
|
|
B.bank_cards += src
|
|
name = "departmental card ([department_name])"
|
|
desc = "Provides access to the [department_name]."
|
|
SSeconomy.dep_cards += src
|
|
|
|
/obj/item/card/id/departmental_budget/Destroy()
|
|
SSeconomy.dep_cards -= src
|
|
return ..()
|
|
|
|
/obj/item/card/id/departmental_budget/car
|
|
department_ID = ACCOUNT_CAR
|
|
department_name = ACCOUNT_CAR_NAME
|
|
|
|
/obj/item/card/id/departmental_budget/sec
|
|
department_ID = ACCOUNT_SEC
|
|
department_name = ACCOUNT_SEC_NAME
|