Skip to content

Commit

Permalink
good stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
FalloutFalcon committed May 11, 2024
1 parent 9535ca9 commit 0b399b1
Show file tree
Hide file tree
Showing 15 changed files with 65 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,6 @@
/obj/item/clothing/under/rank/cargo/miner,
/obj/item/clothing/suit/hooded/wintercoat/miner,
/obj/item/clothing/shoes/winterboots,
/obj/item/card/id/mining,
/obj/effect/decal/cleanable/dirt,
/turf/open/floor/wood,
/area/ruin/powered)
Expand Down
13 changes: 11 additions & 2 deletions code/datums/outfit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,13 @@
/// Type path of item to go in the glasses slot
var/glasses = null

var/wallet = null

/// Type path of item to go in the idcard slot
var/id = null

var/bank_card = null

/// Type path of item for left pocket slot
var/l_pocket = null

Expand Down Expand Up @@ -177,8 +181,13 @@
H.equip_to_slot_or_del(new ears(H),ITEM_SLOT_EARS, TRUE)
if(glasses)
H.equip_to_slot_or_del(new glasses(H),ITEM_SLOT_EYES, TRUE)
if(id)
H.equip_to_slot_or_del(new id(H),ITEM_SLOT_ID, TRUE)
if(!visualsOnly)
if(wallet)
H.equip_to_slot_or_del(new wallet(H),ITEM_SLOT_ID, TRUE)
if(id)
H.equip_to_slot_or_del(new id(H),ITEM_SLOT_ID, TRUE)
if(bank_card)
H.equip_to_slot_or_del(new bank_card(H),ITEM_SLOT_ID, TRUE)
if(suit_store)
H.equip_to_slot_or_del(new suit_store(H),ITEM_SLOT_SUITSTORE, TRUE)

Expand Down
24 changes: 9 additions & 15 deletions code/game/objects/items/bank_card.dm
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/obj/item/card/bank
name = "cash card"
icon_state = "data_1"
var/mining_points = 0 //For redeeming at mining equipment vendors
var/registered_name = null // The name registered_name on the card
var/registered_age = 18 // default age for ss13 players

var/registered_name = null // The name registered_name on the card
var/datum/bank_account/registered_account
var/obj/machinery/paystand/my_store

Expand All @@ -14,13 +14,6 @@
my_store.my_card = null
return ..()

/obj/item/card/id/vv_edit_var(var_name, var_value)
. = ..()
if(.)
switch(var_name)
if(NAMEOF(src, registered_name),NAMEOF(src, registered_age))
update_label()

/obj/item/card/bank/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/holochip))
insert_money(W, user)
Expand Down Expand Up @@ -143,23 +136,24 @@
user.put_in_hands(holochip)
to_chat(user, "<span class='notice'>You withdraw [amount_to_remove] credits into a holochip.</span>")
SSblackbox.record_feedback("amount", "credits_removed", amount_to_remove)
log_econ("[amount_to_remove] credits were removed from [src] owned by [src.registered_name]")
log_econ("[amount_to_remove] credits were removed from [src] owned by [registered_account.account_holder]")
return
else
var/difference = amount_to_remove - registered_account.account_balance
registered_account.bank_card_talk("<span class='warning'>ERROR: The linked account requires [difference] more credit\s to perform that withdrawal.</span>", TRUE)

/obj/item/card/bank/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 class='danger'>'MINOR: DO NOT SERVE ALCOHOL OR TOBACCO'</span></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] cr."
. += "The card indicates that the holder is [registered_account.holder_age] years old. [(registered_account.holder_age < AGE_MINOR) ? "There's a holographic stripe that reads <b><span class='danger'>'MINOR: DO NOT SERVE ALCOHOL OR TOBACCO'</span></b> along the bottom of the card." : ""]"
. += "<span class='info'>Alt-Click the ID to pull money from the linked account in the form of holochips.</span>"
. += "<span class='info'>You can insert credits into the linked account by pressing holochips, cash, or coins against the ID.</span>"
. += "<span class='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.</span>"
else
. += "<span class='info'>There is no registered account linked to this card. Alt-Click to add one.</span>"
if(mining_points)
. += "There's [mining_points] mining equipment redemption point\s loaded onto this card."

/obj/item/card/bank/GetBankCard()
return src
8 changes: 0 additions & 8 deletions code/game/objects/items/cards_ids.dm
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@
slot_flags = ITEM_SLOT_ID
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "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/list/ship_access = list()
var/registered_name = null // The name registered_name on the card
Expand Down Expand Up @@ -331,8 +330,6 @@
msg += "This access card is assigned to <B>[registered_name]</B>."
if(registered_age)
msg += "The card indicates that the holder is [registered_age] years old. [(registered_age < AGE_MINOR) ? "There's a holographic stripe that reads <b><span class='danger'>'MINOR: DO NOT SERVE ALCOHOL OR TOBACCO'</span></b> along the bottom of the card." : ""]"
if(mining_points)
msg += "There's [mining_points] mining equipment redemption point\s loaded onto this card."
if(length(ship_access))
var/list/ship_names = list()
for(var/datum/overmap/ship/controlled/ship in ship_access)
Expand Down Expand Up @@ -720,11 +717,6 @@ update_label()
registered_name = "Prisoner #13-007"
icon_state = "prisoner_007"

/obj/item/card/id/mining
name = "mining ID"
access = list(ACCESS_MINING, ACCESS_MINING_STATION, ACCESS_MECH_MINING, ACCESS_MAILSORTING, ACCESS_MINERAL_STOREROOM)
custom_price = 250

/obj/item/card/id/away
name = "\proper a perfectly generic identification card"
desc = "A perfectly generic identification card. Looks like it could use some flavor."
Expand Down
5 changes: 5 additions & 0 deletions code/game/objects/items/storage/wallets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@
else
return ..()

/obj/item/storage/wallet/GetBankCard()
for(var/obj/item/card/I in contents)
if(istype(I, /obj/item/card/bank))
return I

/obj/item/storage/wallet/random
icon_state = "random_wallet"

Expand Down
8 changes: 3 additions & 5 deletions code/modules/economy/account.dm
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
/datum/bank_account
var/account_holder = "Rusty Venture"
var/account_balance = 0
var/holder_age = 18
var/list/bank_cards = list()
var/add_to_accounts = TRUE
var/account_id

/datum/bank_account/New(newname, job)
/datum/bank_account/New(newname, age)
if(add_to_accounts)
SSeconomy.bank_accounts += src
account_holder = newname
holder_age = age
account_id = rand(111111,999999)

/datum/bank_account/Destroy()
Expand Down Expand Up @@ -49,10 +51,6 @@
return
for(var/obj/A in bank_cards)
var/icon_source = A
if(istype(A, /obj/item/card/bank))
var/obj/item/card/bank/bank_card = A
if(bank_card.uses_overlays)
icon_source = bank_card.get_cached_flat_icon()
var/mob/card_holder = recursive_loc_check(A, /mob)
if(ismob(card_holder)) //If on a mob
if(!card_holder.client || (!(card_holder.client.prefs.chat_toggles & CHAT_BANKCARD) && !force))
Expand Down
3 changes: 3 additions & 0 deletions code/modules/jobs/access.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
/obj/item/proc/InsertID()
return FALSE

/obj/item/proc/GetBankCard()
return null

/obj/proc/text2access(access_text)
. = list()
if(!access_text)
Expand Down
21 changes: 13 additions & 8 deletions code/modules/jobs/job_types/_job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
if(!H)
return FALSE
if(!visualsOnly)
var/datum/bank_account/bank_account = new(H.real_name, src)
var/datum/bank_account/bank_account = new(H.real_name, H.age)
bank_account.adjust_money(officer ? 250 : 100, "starting_money") //just a little bit of money for you
H.account_id = bank_account.account_id

Expand Down Expand Up @@ -179,7 +179,9 @@
var/jobtype = null

uniform = /obj/item/clothing/under/color/grey
wallet = /obj/item/storage/wallet
id = /obj/item/card/id
bank_card = /obj/item/card/bank
back = /obj/item/storage/backpack
shoes = /obj/item/clothing/shoes/sneakers/black
box = /obj/item/storage/box/survival
Expand Down Expand Up @@ -268,7 +270,7 @@
if(!J)
J = GLOB.name_occupations[H.job]

var/obj/item/card/id/C = H.wear_id
var/obj/item/card/id/C = H.get_idcard(TRUE)
if(istype(C))
C.access = J.get_access()
shuffle_inplace(C.access) // Shuffle access list to make NTNet passkeys less predictable
Expand All @@ -285,14 +287,17 @@
if(id_assignment)
C.assignment = id_assignment
C.update_label()
for(var/A in SSeconomy.bank_accounts)
var/datum/bank_account/B = A
if(B.account_id == H.account_id)
C.registered_account = B
B.bank_cards += C
break
H.sec_hud_set_ID()

var/obj/item/card/bank/bank_card = H.get_bankcard()
if(istype(bank_card))
for(var/account in SSeconomy.bank_accounts)
var/datum/bank_account/bank_account = account
if(bank_account.account_id == H.account_id)
bank_card.registered_account = bank_account
bank_account.bank_cards += bank_card
break

var/obj/item/pda/PDA = H.get_item_by_slot(pda_slot)
if(istype(PDA))
PDA.owner = H.real_name
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mining/machine_redemption.dm
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
switch(action)
if("Claim")
var/mob/M = usr
var/obj/item/card/id/I = M.get_idcard(TRUE)
var/obj/item/card/bank/I = M.get_bankcard()
if(points)
if(I)
I.mining_points += points
Expand Down
1 change: 0 additions & 1 deletion code/modules/mob/living/carbon/alien/alien.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
bubble_icon = "alien"
type_of_meat = /obj/item/reagent_containers/food/snacks/meat/slab/xeno

var/obj/item/card/id/wear_id = null // Fix for station bounced radios -- Skie
var/has_fine_manipulation = FALSE

status_flags = CANUNCONSCIOUS|CANPUSH
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/living/carbon/carbon_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
var/obj/item/tank/internal = null
var/obj/item/clothing/head = null

var/obj/item/wear_id = null //only used by humans
var/obj/item/clothing/gloves = null ///only used by humans
var/obj/item/clothing/shoes/shoes = null ///only used by humans.
var/obj/item/clothing/glasses/glasses = null ///only used by humans.
Expand Down
1 change: 0 additions & 1 deletion code/modules/mob/living/carbon/human/human_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
var/obj/item/clothing/wear_suit = null
var/obj/item/clothing/w_uniform = null
var/obj/item/belt = null
var/obj/item/wear_id = null
var/obj/item/r_store = null
var/obj/item/l_store = null
var/obj/item/s_store = null
Expand Down
21 changes: 13 additions & 8 deletions code/modules/mob/living/carbon/human/human_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,19 @@

/mob/living/carbon/human/get_bankcard()
//Check hands
var/list/obj/item/items_to_check
items_to_check += get_active_held_item()
items_to_check += get_inactive_held_item()
items_to_check += wear_id
items_to_check += belt
for(var/i in items_to_check)
if(i && istype(i, /obj/item/card/bank))
return i
var/list/items_to_check = list()
if(get_active_held_item())
items_to_check += get_active_held_item()
if(get_inactive_held_item())
items_to_check += get_inactive_held_item()
if(wear_id)
items_to_check += wear_id
if(belt)
items_to_check += belt
for(var/obj/item/i in items_to_check)
var/obj/item/card/bank/bank_card = i.GetBankCard()
if(bank_card)
return bank_card

/mob/living/carbon/human/get_id_in_hand()
var/obj/item/held_item = get_active_held_item()
Expand Down
4 changes: 3 additions & 1 deletion code/modules/mob/living/carbon/human/species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,9 @@ GLOBAL_LIST_EMPTY(roundstart_races)
return FALSE
return equip_delay_self_check(I, H, bypass_equip_delay_self)
if(ITEM_SLOT_ID)
if(H.wear_id && !swap)
if(H.wear_id)
if(SEND_SIGNAL(H.wear_id, COMSIG_TRY_STORAGE_CAN_INSERT, I, H, TRUE))
return TRUE
return FALSE

var/obj/item/bodypart/O = H.get_bodypart(BODY_ZONE_CHEST)
Expand Down
3 changes: 3 additions & 0 deletions code/modules/mob/living/carbon/inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@
if(ITEM_SLOT_BACKPACK)
if(!back || !SEND_SIGNAL(back, COMSIG_TRY_STORAGE_INSERT, I, src, TRUE))
not_handled = TRUE
if(ITEM_SLOT_ID)
if(!wear_id || !SEND_SIGNAL(wear_id, COMSIG_TRY_STORAGE_INSERT, I, src, TRUE))
not_handled = TRUE
else
not_handled = TRUE

Expand Down

0 comments on commit 0b399b1

Please sign in to comment.