Files
Aurora.3/code/game/objects/items/weapons/storage/wallets.dm
inselc 2d8739a279 Bugfixes: Fax machines (again), crew record formatting, RnD machines and wallets (#1987)
Trying to work off some of the older bugs on the issues list:

Fix faxmachine getting stuck on "0 seconds remaining". There may be a process scheduler issue which causes a long polling interval for the faxmachine's process()-method.
Replace newline in crew record notes with <BR> when generating the records in the filing cabinets.
Surround crew record notes with "preformatted text" HTML tags on PDA / pAI screens.
When constructing protolathes or circuit imprinters, transfer the reagents contained in the beakers to internal reagent container upon completion.
Fix suspension field generator not clearing the qdel'd suspension_field reference. This fixes being unable to unwrench the generator, too.
Fix wallet sprite still showing an empty wallet when inserting a guest pass.
2017-03-25 23:47:04 +02:00

102 lines
2.9 KiB
Plaintext

/obj/item/weapon/storage/wallet
name = "wallet"
desc = "It can hold a few small and personal things."
storage_slots = 10
icon_state = "wallet"
w_class = 2
max_w_class = 2
can_hold = list(
/obj/item/weapon/spacecash,
/obj/item/weapon/card,
/obj/item/clothing/mask/smokable,
/obj/item/clothing/accessory/badge,
/obj/item/clothing/accessory/locket,
/obj/item/device/flashlight/pen,
/obj/item/seeds,
/obj/item/stack/medical,
/obj/item/weapon/coin,
/obj/item/weapon/dice,
/obj/item/weapon/disk,
/obj/item/weapon/implanter,
/obj/item/weapon/flame/lighter,
/obj/item/weapon/flame/match,
/obj/item/weapon/paper,
/obj/item/weapon/paper_bundle,
/obj/item/weapon/pen,
/obj/item/weapon/photo,
/obj/item/weapon/reagent_containers/dropper,
/obj/item/weapon/reagent_containers/syringe,
/obj/item/weapon/reagent_containers/pill,
/obj/item/weapon/reagent_containers/hypospray/autoinjector,
/obj/item/weapon/screwdriver,
/obj/item/weapon/stamp,
/obj/item/device/paicard)
slot_flags = SLOT_ID
var/obj/item/weapon/card/id/front_id = null
/obj/item/weapon/storage/wallet/remove_from_storage(obj/item/W as obj, atom/new_location)
. = ..(W, new_location)
if(.)
if(W == front_id)
front_id = null
name = initial(name)
update_icon()
/obj/item/weapon/storage/wallet/handle_item_insertion(obj/item/W as obj, prevent_warning = 0)
. = ..(W, prevent_warning)
if(.)
if(!front_id && istype(W, /obj/item/weapon/card/id))
front_id = W
name = "[name] ([front_id])"
update_icon()
/obj/item/weapon/storage/wallet/update_icon()
if(front_id)
switch(front_id.icon_state)
if("id")
icon_state = "walletid"
return
if("guest")
icon_state = "walletid"
return
if("silver")
icon_state = "walletid_silver"
return
if("gold")
icon_state = "walletid_gold"
return
if("centcom")
icon_state = "walletid_centcom"
return
icon_state = "wallet"
/obj/item/weapon/storage/wallet/GetID()
return front_id
/obj/item/weapon/storage/wallet/GetAccess()
var/obj/item/I = GetID()
if(I)
return I.GetAccess()
else
return ..()
/obj/item/weapon/storage/wallet/random/New()
..()
var/item1_type = pick( /obj/item/weapon/spacecash/c10,/obj/item/weapon/spacecash/c100,/obj/item/weapon/spacecash/c1000,/obj/item/weapon/spacecash/c20,/obj/item/weapon/spacecash/c200,/obj/item/weapon/spacecash/c50, /obj/item/weapon/spacecash/c500)
var/item2_type
if(prob(50))
item2_type = pick( /obj/item/weapon/spacecash/c10,/obj/item/weapon/spacecash/c100,/obj/item/weapon/spacecash/c1000,/obj/item/weapon/spacecash/c20,/obj/item/weapon/spacecash/c200,/obj/item/weapon/spacecash/c50, /obj/item/weapon/spacecash/c500)
var/item3_type = pick( /obj/item/weapon/coin/silver, /obj/item/weapon/coin/silver, /obj/item/weapon/coin/gold, /obj/item/weapon/coin/iron, /obj/item/weapon/coin/iron, /obj/item/weapon/coin/iron )
spawn(2)
if(item1_type)
new item1_type(src)
if(item2_type)
new item2_type(src)
if(item3_type)
new item3_type(src)