mirror of
https://github.com/CHOMPstation/CHOMPstation.git
synced 2026-08-26 13:36:48 +01:00
Adds IDs and Wallets
Adds variants of ID cards for each department and head, and adds several new colors of wallet. The wallets self-color the little ID in the corner based on the ID inserted so they always show the right picture of the ID, without needing to sprite each ID. Some are snowflaked, notably Gold and Centcom, but the rest are generated on the fly based on colors on the ID.
This commit is contained in:
@@ -117,6 +117,9 @@
|
||||
var/icon/front
|
||||
var/icon/side
|
||||
|
||||
var/primary_color = rgb(0,0,0) // Obtained by eyedroppering the stripe in the middle of the card
|
||||
var/secondary_color = rgb(0,0,0) // Likewise for the oval in the top-left corner
|
||||
|
||||
//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
|
||||
@@ -262,3 +265,88 @@
|
||||
/obj/item/weapon/card/id/centcom/ERT/New()
|
||||
..()
|
||||
access |= get_all_station_access()
|
||||
|
||||
// Department-flavor IDs
|
||||
/obj/item/weapon/card/id/medical
|
||||
name = "identification card"
|
||||
desc = "A card issued to station medical staff."
|
||||
icon_state = "med"
|
||||
primary_color = rgb(189,237,237)
|
||||
secondary_color = rgb(223,255,255)
|
||||
|
||||
/obj/item/weapon/card/id/medical/head
|
||||
name = "identification card"
|
||||
desc = "A card which represents care and compassion."
|
||||
icon_state = "medGold"
|
||||
primary_color = rgb(189,237,237)
|
||||
secondary_color = rgb(255,223,127)
|
||||
|
||||
/obj/item/weapon/card/id/security
|
||||
name = "identification card"
|
||||
desc = "A card issued to station security staff."
|
||||
icon_state = "sec"
|
||||
primary_color = rgb(189,47,0)
|
||||
secondary_color = rgb(223,127,95)
|
||||
|
||||
/obj/item/weapon/card/id/security/head
|
||||
name = "identification card"
|
||||
desc = "A card which represents honor and protection."
|
||||
icon_state = "secGold"
|
||||
primary_color = rgb(189,47,0)
|
||||
secondary_color = rgb(255,223,127)
|
||||
|
||||
/obj/item/weapon/card/id/engineering
|
||||
name = "identification card"
|
||||
desc = "A card issued to station engineering staff."
|
||||
icon_state = "eng"
|
||||
primary_color = rgb(189,94,0)
|
||||
secondary_color = rgb(223,159,95)
|
||||
|
||||
/obj/item/weapon/card/id/engineering/head
|
||||
name = "identification card"
|
||||
desc = "A card which represents creativity and ingenuity."
|
||||
icon_state = "engGold"
|
||||
primary_color = rgb(189,94,0)
|
||||
secondary_color = rgb(255,223,127)
|
||||
|
||||
/obj/item/weapon/card/id/science
|
||||
name = "identification card"
|
||||
desc = "A card issued to station science staff."
|
||||
icon_state = "sci"
|
||||
primary_color = rgb(142,47,142)
|
||||
secondary_color = rgb(191,127,191)
|
||||
|
||||
/obj/item/weapon/card/id/science/head
|
||||
name = "identification card"
|
||||
desc = "A card which represents knowledge and reasoning."
|
||||
icon_state = "sciGold"
|
||||
primary_color = rgb(142,47,142)
|
||||
secondary_color = rgb(255,223,127)
|
||||
|
||||
/obj/item/weapon/card/id/cargo
|
||||
name = "identification card"
|
||||
desc = "A card issued to station cargo staff."
|
||||
icon_state = "car"
|
||||
primary_color = rgb(142,94,0)
|
||||
secondary_color = rgb(191,159,95)
|
||||
|
||||
/obj/item/weapon/card/id/cargo/head
|
||||
name = "identification card"
|
||||
desc = "A card which represents service and planning."
|
||||
icon_state = "carGold"
|
||||
primary_color = rgb(142,94,0)
|
||||
secondary_color = rgb(255,223,127)
|
||||
|
||||
/obj/item/weapon/card/id/civilian
|
||||
name = "identification card"
|
||||
desc = "A card issued to station civilian staff."
|
||||
icon_state = "civ"
|
||||
primary_color = rgb(0,94,142)
|
||||
secondary_color = rgb(95,159,191)
|
||||
|
||||
/obj/item/weapon/card/id/civilian/head //This is not the HoP. There's no position that uses this right now.
|
||||
name = "identification card"
|
||||
desc = "A card which represents common sense and responsibility."
|
||||
icon_state = "civGold"
|
||||
primary_color = rgb(0,94,142)
|
||||
secondary_color = rgb(255,223,127)
|
||||
@@ -2,6 +2,7 @@
|
||||
name = "wallet"
|
||||
desc = "It can hold a few small and personal things."
|
||||
storage_slots = 10
|
||||
icon = 'icons/obj/wallet.dmi'
|
||||
icon_state = "wallet"
|
||||
w_class = 2
|
||||
can_hold = list(
|
||||
@@ -45,23 +46,59 @@
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/storage/wallet/update_icon()
|
||||
|
||||
if(front_id)
|
||||
switch(front_id.icon_state)
|
||||
if("id")
|
||||
icon_state = "walletid"
|
||||
if("id") //The plain assistant ID
|
||||
var/icon/new_wallet = new/icon("icon" = initial(icon), "icon_state" = initial(icon_state))
|
||||
var/icon/id_overlay = new/icon("icon" = initial(icon), "icon_state" = "wallet_id")
|
||||
new_wallet.Blend(id_overlay, ICON_OVERLAY)
|
||||
del id_overlay
|
||||
icon = new_wallet
|
||||
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"
|
||||
if("silver") //HoP's ID has a special overlay.
|
||||
var/icon/new_wallet = new/icon("icon" = initial(icon), "icon_state" = initial(icon_state))
|
||||
var/icon/id_overlay = new/icon("icon" = initial(icon), "icon_state" = "wallet_idsilver")
|
||||
new_wallet.Blend(id_overlay, ICON_OVERLAY)
|
||||
del id_overlay
|
||||
icon = new_wallet
|
||||
if("gold") //Captain's ID has a special overlay.
|
||||
var/icon/new_wallet = new/icon("icon" = initial(icon), "icon_state" = initial(icon_state))
|
||||
var/icon/id_overlay = new/icon("icon" = initial(icon), "icon_state" = "wallet_idgold")
|
||||
new_wallet.Blend(id_overlay, ICON_OVERLAY)
|
||||
del id_overlay
|
||||
icon = new_wallet
|
||||
if("centcom") //Centcom ID has a special overlay.
|
||||
var/icon/new_wallet = new/icon("icon" = initial(icon), "icon_state" = initial(icon_state))
|
||||
var/icon/id_overlay = new/icon("icon" = initial(icon), "icon_state" = "wallet_idcentcom")
|
||||
new_wallet.Blend(id_overlay, ICON_OVERLAY)
|
||||
del id_overlay
|
||||
icon = new_wallet
|
||||
else //Doesn't match a special overlay type.
|
||||
if(front_id.primary_color && front_id.secondary_color) //Colored ID with stripe and oval colors (pri/sec).
|
||||
var/icon/new_wallet = new/icon("icon" = initial(icon), "icon_state" = initial(icon_state))
|
||||
var/icon/id_icon = new/icon("icon" = initial(icon), "icon_state" = "wallet_id")
|
||||
var/icon/pri_overlay = new/icon("icon" = initial(icon), "icon_state" = "wallet_idprimary")
|
||||
var/icon/sec_overlay = new/icon("icon" = initial(icon), "icon_state" = "wallet_idsecondary")
|
||||
|
||||
pri_overlay.Blend(front_id.primary_color, ICON_ADD)
|
||||
sec_overlay.Blend(front_id.secondary_color, ICON_ADD)
|
||||
|
||||
new_wallet.Blend(id_icon, ICON_OVERLAY)
|
||||
del id_icon
|
||||
new_wallet.Blend(pri_overlay, ICON_OVERLAY)
|
||||
del pri_overlay
|
||||
new_wallet.Blend(sec_overlay, ICON_OVERLAY)
|
||||
del sec_overlay
|
||||
|
||||
icon = new_wallet
|
||||
return
|
||||
|
||||
else //Dunno what to do. Resort to plain assistant ID.
|
||||
icon_state = initial(icon_state) + "id"
|
||||
return
|
||||
else
|
||||
icon = initial(icon)
|
||||
icon_state = initial(icon_state)
|
||||
|
||||
/obj/item/weapon/storage/wallet/GetID()
|
||||
return front_id
|
||||
@@ -73,7 +110,6 @@
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/weapon/storage/wallet/random/New()
|
||||
..()
|
||||
var/amount = rand(50, 100) + rand(50, 100) // Triangular distribution from 100 to 200
|
||||
@@ -85,4 +121,22 @@
|
||||
while(amount >= i)
|
||||
amount -= i
|
||||
SC.adjust_worth(i, 0)
|
||||
SC.update_icon()
|
||||
SC.update_icon()
|
||||
|
||||
/obj/item/weapon/storage/wallet/grey
|
||||
icon_state = "greywallet"
|
||||
|
||||
/obj/item/weapon/storage/wallet/green
|
||||
icon_state = "greenwallet"
|
||||
|
||||
/obj/item/weapon/storage/wallet/purple
|
||||
icon_state = "purplewallet"
|
||||
|
||||
/obj/item/weapon/storage/wallet/red
|
||||
icon_state = "redwallet"
|
||||
|
||||
/obj/item/weapon/storage/wallet/blue
|
||||
icon_state = "bluewallet"
|
||||
|
||||
/obj/item/weapon/storage/wallet/white
|
||||
icon_state = "whitewallet"
|
||||
|
||||
Reference in New Issue
Block a user