Updates wallets (#21531)

* wallet update wooo

* didnt want to do that

* undo accidental changes

* i have a problem

* i swear I can type comments well
This commit is contained in:
Contrabang
2023-07-07 13:26:07 +01:00
committed by GitHub
parent 0ac521e633
commit e212ca48ed
4 changed files with 36 additions and 83 deletions
@@ -33,6 +33,10 @@
var/obj/item/card/id/front_id = null
// allows for clicking of stuff on our person/on the ground to put in the wallet, so easy to stick your ID in your wallet
use_to_pickup = TRUE
pickup_all_on_tile = FALSE
/obj/item/storage/wallet/remove_from_storage(obj/item/I, atom/new_location)
. = ..()
@@ -57,35 +61,32 @@
if(wearing_human.wear_id == src)
wearing_human.sec_hud_set_ID()
update_appearance(UPDATE_NAME|UPDATE_ICON_STATE)
update_appearance(UPDATE_NAME|UPDATE_OVERLAYS)
/obj/item/storage/wallet/update_icon_state()
if(front_id)
switch(front_id.icon_state)
if("silver")
icon_state = "walletid_silver"
return
if("gold")
icon_state = "walletid_gold"
return
if("centcom")
icon_state = "walletid_centcom"
return
else
icon_state = "walletid"
return
icon_state = "wallet"
/obj/item/storage/wallet/update_overlays()
. = ..()
if(!front_id)
return
. += mutable_appearance(front_id.icon, front_id.icon_state)
. += front_id.overlays
. += mutable_appearance(icon, "wallet_overlay")
// fuck yeah, ass photo in my wallet
var/obj/item/photo/photo = locate(/obj/item/photo) in contents
if(!photo)
return
var/mutable_appearance/MA = mutable_appearance(photo.appearance)
MA.pixel_x = 11
MA.pixel_y = 1
. += MA
. += mutable_appearance(icon, "photo_overlay")
/obj/item/storage/wallet/update_name(updates)
. = ..()
if(front_id)
name = "wallet displaying [front_id]"
else
name = get_empty_wallet_name()
/obj/item/storage/wallet/proc/get_empty_wallet_name()
return initial(name)
name = initial(name)
/obj/item/storage/wallet/GetID()
return front_id
@@ -112,62 +113,9 @@
new cash(src)
new coin(src)
//////////////////////////////////////
// Color Wallets //
//////////////////////////////////////
/obj/item/storage/wallet/color
// Arcade Wallet
/obj/item/storage/wallet/cheap
name = "cheap wallet"
desc = "A cheap wallet from the arcade."
desc = "A cheap and flimsy wallet from the arcade."
storage_slots = 5 //smaller storage than normal wallets
/obj/item/storage/wallet/color/Initialize(mapload)
. = ..()
if(!item_color)
var/color_wallet = pick(subtypesof(/obj/item/storage/wallet/color))
new color_wallet(loc)
qdel(src)
return
update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_ICON_STATE)
/obj/item/storage/wallet/color/update_desc(updates)
. = ..()
desc = "A cheap, [item_color] wallet from the arcade."
/obj/item/storage/wallet/color/update_icon_state()
if(front_id)
switch(front_id.icon_state)
if("silver")
icon_state = "[item_color]_walletid_silver"
return
if("gold")
icon_state = "[item_color]_walletid_gold"
return
if("centcom")
icon_state = "[item_color]_walletid_centcom"
return
else
icon_state = "[item_color]_walletid"
return
icon_state = "[item_color]_wallet"
/obj/item/storage/wallet/color/blue
item_color = "blue"
/obj/item/storage/wallet/color/red
item_color = "red"
/obj/item/storage/wallet/color/yellow
item_color = "yellow"
/obj/item/storage/wallet/color/green
item_color = "green"
/obj/item/storage/wallet/color/pink
item_color = "pink"
/obj/item/storage/waller/color/brown
item_color = "brown"
/obj/item/storage/wallet/color/get_empty_wallet_name()
return "cheap [item_color] wallet"
+6 -6
View File
@@ -117,6 +117,12 @@ GLOBAL_DATUM_INIT(global_prizes, /datum/prizes, new())
typepath = /obj/item/ammo_box/caps
cost = 30
/datum/prize_item/wallet
name = "Cheap Wallet"
desc = "A cheap and big enough for standard issue ID cards."
typepath = /obj/item/storage/wallet/cheap
cost = 30
/datum/prize_item/crayons
name = "Box of Crayons"
desc = "A six-pack of crayons, just like back in kindergarten."
@@ -141,12 +147,6 @@ GLOBAL_DATUM_INIT(global_prizes, /datum/prizes, new())
typepath = /obj/item/deck/cards/tiny/doublecards
cost = 50
/datum/prize_item/wallet
name = "Colored Wallet"
desc = "Brightly colored and big enough for standard issue ID cards."
typepath = /obj/item/storage/wallet/color
cost = 50
/datum/prize_item/id_sticker
name = "Prisoner ID Sticker"
desc = "A sticker that can make any ID look like a prisoner ID."
+5
View File
@@ -251,6 +251,11 @@
S.handle_item_insertion(src)
return 1
S = M.get_item_by_slot(slot_wear_id)
if(istype(S) && S.can_be_inserted(src, 1)) //else we put in a wallet
S.handle_item_insertion(src)
return 1
S = M.get_item_by_slot(slot_belt)
if(istype(S) && S.can_be_inserted(src, 1)) //else we put in belt
S.handle_item_insertion(src)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB