From dbed21991d03508c7eb566b5ce5caf0db9f579dc Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Fri, 10 May 2024 20:37:45 -0500 Subject: [PATCH 01/17] bankacoount --- code/game/machinery/bounty_board.dm | 4 +- code/game/machinery/computer/cloning.dm | 4 +- code/game/machinery/roulette_machine.dm | 14 +- code/game/objects/items/bank_card.dm | 165 +++++++++++++++++ code/game/objects/items/cards_ids.dm | 173 +----------------- code/modules/economy/account.dm | 12 +- .../mob/living/carbon/human/human_helpers.dm | 15 +- code/modules/mob/mob.dm | 3 + code/modules/vending/_vending.dm | 8 +- shiptest.dme | 1 + 10 files changed, 204 insertions(+), 195 deletions(-) create mode 100644 code/game/objects/items/bank_card.dm diff --git a/code/game/machinery/bounty_board.dm b/code/game/machinery/bounty_board.dm index b0991110e80d..75cf67a8bd2f 100644 --- a/code/game/machinery/bounty_board.dm +++ b/code/game/machinery/bounty_board.dm @@ -33,8 +33,8 @@ GLOBAL_LIST_EMPTY(request_list) /obj/machinery/bounty_board/attackby(obj/item/I, mob/living/user, params) . = ..() - if(istype(I,/obj/item/card/id)) - var/obj/item/card/id/current_card = I + if(istype(I,/obj/item/card/bank)) + var/obj/item/card/bank/current_card = I if(current_card.registered_account) current_user = current_card.registered_account return TRUE diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index 0fe059653d5c..3916ad0d4b00 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -534,9 +534,7 @@ if(ishuman(mob_occupant)) dna = C.has_dna() - var/obj/item/card/id/I = C.get_idcard(TRUE) - if(I) - has_bank_account = I.registered_account + has_bank_account = C.get_bank_account() if(isbrain(mob_occupant)) dna = B.stored_dna diff --git a/code/game/machinery/roulette_machine.dm b/code/game/machinery/roulette_machine.dm index c9e1d108c1e5..8617a0f8c507 100644 --- a/code/game/machinery/roulette_machine.dm +++ b/code/game/machinery/roulette_machine.dm @@ -39,7 +39,7 @@ var/chosen_bet_type = "0" var/last_anti_spam = 0 var/anti_spam_cooldown = 20 - var/obj/item/card/id/my_card + var/obj/item/card/bank/my_card var/playing = FALSE var/locked = FALSE var/drop_dir = SOUTH @@ -81,7 +81,7 @@ data["Spinning"] = playing if(ishuman(user)) var/mob/living/carbon/human/H = user - var/obj/item/card/id/C = H.get_idcard(TRUE) + var/obj/item/card/bank/C = H.get_bankcard() if(C) data["AccountBalance"] = C.registered_account.account_balance else @@ -114,7 +114,7 @@ return if(playing) return ..() - if(istype(W, /obj/item/card/id)) + if(istype(W, /obj/item/card/bank)) playsound(src, 'sound/machines/card_slide.ogg', 50, TRUE) if(machine_stat & MAINT || !on || locked) @@ -122,7 +122,7 @@ return FALSE if(my_card) - var/obj/item/card/id/player_card = W + var/obj/item/card/bank/player_card = W if(player_card.registered_account.account_balance < chosen_bet_amount) //Does the player have enough funds audible_message("You do not have the funds to play! Lower your bet or get more money.") playsound(src, 'sound/machines/buzz-two.ogg', 30, TRUE) @@ -167,7 +167,7 @@ addtimer(CALLBACK(src, PROC_REF(play), user, player_card, chosen_bet_type, chosen_bet_amount, potential_payout), 4) //Animation first return TRUE else - var/obj/item/card/id/new_card = W + var/obj/item/card/bank/new_card = W if(new_card.registered_account) var/msg = stripped_input(user, "Name of your roulette wheel:", "Roulette Naming", "Roulette Machine") if(!msg) @@ -181,7 +181,7 @@ return ..() ///Proc called when player is going to try and play -/obj/machinery/roulette/proc/play(mob/user, obj/item/card/id/player_id, bet_type, bet_amount, potential_payout) +/obj/machinery/roulette/proc/play(mob/user, obj/item/card/bank/player_id, bet_type, bet_amount, potential_payout) var/payout = potential_payout @@ -203,7 +203,7 @@ playsound(src, 'sound/machines/piston_lower.ogg', 70) ///Ran after a while to check if the player won or not. -/obj/machinery/roulette/proc/finish_play(obj/item/card/id/player_id, bet_type, bet_amount, potential_payout, rolled_number) +/obj/machinery/roulette/proc/finish_play(obj/item/card/bank/player_id, bet_type, bet_amount, potential_payout, rolled_number) last_spin = rolled_number var/is_winner = check_win(bet_type, bet_amount, rolled_number) //Predetermine if we won diff --git a/code/game/objects/items/bank_card.dm b/code/game/objects/items/bank_card.dm new file mode 100644 index 000000000000..d1d9b1b7c3fb --- /dev/null +++ b/code/game/objects/items/bank_card.dm @@ -0,0 +1,165 @@ +/obj/item/card/bank + name = "cash card" + 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/datum/bank_account/registered_account + var/obj/machinery/paystand/my_store + +/obj/item/card/bank/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/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) + return + else if(istype(W, /obj/item/spacecash/bundle)) + insert_money(W, user, TRUE) + return + else if(istype(W, /obj/item/coin)) + insert_money(W, user, TRUE) + return + else if(istype(W, /obj/item/storage/bag/money)) + var/obj/item/storage/bag/money/money_bag = W + var/list/money_contained = money_bag.contents + + var/money_added = mass_insert_money(money_contained, user) + + if (money_added) + to_chat(user, "You stuff the contents into the card! They disappear in a puff of bluespace smoke, adding [money_added] worth of credits to the linked account.") + return + else + return ..() + +/obj/item/card/bank/proc/insert_money(obj/item/I, mob/user, physical_currency) + var/cash_money = I.get_item_credit_value() + if(!cash_money) + to_chat(user, "[I] doesn't seem to be worth anything!") + return + + if(!registered_account) + to_chat(user, "[src] doesn't have a linked account to deposit [I] into!") + return + + registered_account.adjust_money(cash_money) + SSblackbox.record_feedback("amount", "credits_inserted", cash_money) + log_econ("[cash_money] credits were inserted into [src] owned by [src.registered_name]") + if(physical_currency) + to_chat(user, "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, "You insert [I] into [src], adding [cash_money] credits to the linked account.") + + to_chat(user, "The linked account now reports a balance of [registered_account.account_balance] cr.") + qdel(I) + +/obj/item/card/bank/proc/mass_insert_money(list/money, mob/user) + if (!money || !money.len) + return FALSE + + var/total = 0 + + for (var/obj/item/physical_money in money) + var/cash_money = physical_money.get_item_credit_value() + + total += cash_money + + registered_account.adjust_money(cash_money) + SSblackbox.record_feedback("amount", "credits_inserted", total) + log_econ("[total] credits were inserted into [src] owned by [src.registered_name]") + QDEL_LIST(money) + + return total + +/obj/item/card/bank/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 + +// Returns true if new account was set. +/obj/item/card/bank/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, "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, "The account ID was already assigned to this card.") + return + + for(var/A in SSeconomy.bank_accounts) + var/datum/bank_account/B = A + if(B.account_id == new_bank_id) + if (old_account) + old_account.bank_cards -= src + + B.bank_cards += src + registered_account = B + to_chat(user, "The provided account has been linked to this ID card.") + + return TRUE + + to_chat(user, "The account ID number provided is invalid.") + return + +/obj/item/card/bank/AltClick(mob/living/user) + if(!alt_click_can_use_id(user)) + return + + if(!registered_account) + set_new_account(user) + 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|null, 1) + + if(!amount_to_remove || amount_to_remove < 0) + return + if(!alt_click_can_use_id(user)) + return + if(registered_account.adjust_money(-amount_to_remove)) + var/obj/item/holochip/holochip = new (user.drop_location(), amount_to_remove) + user.put_in_hands(holochip) + to_chat(user, "You withdraw [amount_to_remove] credits into a holochip.") + SSblackbox.record_feedback("amount", "credits_removed", amount_to_remove) + log_econ("[amount_to_remove] credits were removed from [src] owned by [src.registered_name]") + return + else + var/difference = amount_to_remove - registered_account.account_balance + registered_account.bank_card_talk("ERROR: The linked account requires [difference] more credit\s to perform that withdrawal.", 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 'MINOR: DO NOT SERVE ALCOHOL OR TOBACCO' 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." + . += "Alt-Click the ID to pull money from the linked account in the form of holochips." + . += "You can insert credits into the linked account by pressing holochips, cash, or coins against the ID." + . += "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 + . += "There is no registered account linked to this card. Alt-Click to add one." diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index 2e93b662799a..713ff1f3fc4b 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -149,19 +149,16 @@ 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 var/assignment = null var/access_txt // mapping aid - var/datum/bank_account/registered_account - var/obj/machinery/paystand/my_store var/uses_overlays = TRUE var/icon/cached_flat_icon - var/registered_age = 18 // default age for ss13 players var/job_icon var/faction_icon + var/registered_name = null // The name registered_name on the card + var/registered_age = 18 // default age for ss13 players /obj/item/card/id/Initialize(mapload) . = ..() @@ -171,12 +168,6 @@ update_appearance() RegisterSignal(src, COMSIG_ATOM_UPDATED_ICON, PROC_REF(update_in_wallet)) -/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)) @@ -190,138 +181,8 @@ if(NAMEOF(src, assignment),NAMEOF(src, registered_name),NAMEOF(src, 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/spacecash/bundle)) - insert_money(W, user, TRUE) - return - else if(istype(W, /obj/item/coin)) - insert_money(W, user, TRUE) - return - else if(istype(W, /obj/item/storage/bag/money)) - var/obj/item/storage/bag/money/money_bag = W - var/list/money_contained = money_bag.contents - - var/money_added = mass_insert_money(money_contained, user) - - if (money_added) - to_chat(user, "You stuff the contents into the card! They disappear in a puff of bluespace smoke, adding [money_added] worth of credits to the linked account.") - 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, "[I] doesn't seem to be worth anything!") - return - - if(!registered_account) - to_chat(user, "[src] doesn't have a linked account to deposit [I] into!") - return - - registered_account.adjust_money(cash_money) - SSblackbox.record_feedback("amount", "credits_inserted", cash_money) - log_econ("[cash_money] credits were inserted into [src] owned by [src.registered_name]") - if(physical_currency) - to_chat(user, "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, "You insert [I] into [src], adding [cash_money] credits to the linked account.") - - to_chat(user, "The linked account now reports a balance of [registered_account.account_balance] cr.") - qdel(I) - -/obj/item/card/id/proc/mass_insert_money(list/money, mob/user) - if (!money || !money.len) - return FALSE - - var/total = 0 - - for (var/obj/item/physical_money in money) - var/cash_money = physical_money.get_item_credit_value() - - total += cash_money - - registered_account.adjust_money(cash_money) - SSblackbox.record_feedback("amount", "credits_inserted", total) - log_econ("[total] credits were inserted into [src] owned by [src.registered_name]") - QDEL_LIST(money) - - return total - -/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 - -// 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, "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, "The account ID was already assigned to this card.") - return - - for(var/A in SSeconomy.bank_accounts) - var/datum/bank_account/B = A - if(B.account_id == new_bank_id) - if (old_account) - old_account.bank_cards -= src - - B.bank_cards += src - registered_account = B - to_chat(user, "The provided account has been linked to this ID card.") - - return TRUE - - to_chat(user, "The account ID number provided is invalid.") - return - -/obj/item/card/id/AltClick(mob/living/user) - if(!alt_click_can_use_id(user)) - return - - if(!registered_account) - set_new_account(user) - 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|null, 1) - - if(!amount_to_remove || amount_to_remove < 0) - return - if(!alt_click_can_use_id(user)) - return - if(registered_account.adjust_money(-amount_to_remove)) - var/obj/item/holochip/holochip = new (user.drop_location(), amount_to_remove) - user.put_in_hands(holochip) - to_chat(user, "You withdraw [amount_to_remove] credits into a holochip.") - SSblackbox.record_feedback("amount", "credits_removed", amount_to_remove) - log_econ("[amount_to_remove] credits were removed from [src] owned by [src.registered_name]") - return - else - var/difference = amount_to_remove - registered_account.account_balance - registered_account.bank_card_talk("ERROR: The linked account requires [difference] more credit\s to perform that withdrawal.", TRUE) - /obj/item/card/id/examine(mob/user) . = ..() - if(registered_account) - . += "The account linked to the card belongs to '[registered_account.account_holder]' and reports a balance of [registered_account.account_balance] cr." . += "There's more information below, you can look again to take a closer look..." /obj/item/card/id/examine_more(mob/user) @@ -329,24 +190,11 @@ if(registered_name) msg += "This access card is assigned to [registered_name]." - 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 'MINOR: DO NOT SERVE ALCOHOL OR TOBACCO' 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) ship_names += ship.name msg += "The card has access to the following ships: [ship_names.Join(", ")]" - if(registered_account) - msg += "The account linked to the ID belongs to '[registered_account.account_holder]' and reports a balance of [registered_account.account_balance] cr." - msg += "Alt-Click the ID to pull money from the linked account in the form of holochips." - msg += "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) - msg += "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 - msg += "There is no registered account linked to this card. Alt-Click to add one." - return msg /obj/item/card/id/GetAccess() @@ -463,7 +311,7 @@ update_label() else return ..() - var/popup_input = alert(user, "Choose Action", "Agent ID", "Show", "Forge/Reset", "Change Account ID") + var/popup_input = alert(user, "Choose Action", "Agent ID", "Show", "Forge/Reset") if(user.incapacitated()) return if(popup_input == "Forge/Reset" && !forged) @@ -492,18 +340,6 @@ update_label() forged = TRUE to_chat(user, "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 - - for(var/bank_account in SSeconomy.bank_accounts) - var/datum/bank_account/account = bank_account - if(account.account_id == accountowner.account_id) - account.bank_cards += src - registered_account = account - to_chat(user, "Your account number has been automatically assigned.") return else if (popup_input == "Forge/Reset" && forged) registered_name = initial(registered_name) @@ -515,9 +351,6 @@ update_label() forged = FALSE to_chat(user, "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/anyone diff --git a/code/modules/economy/account.dm b/code/modules/economy/account.dm index 64280475664a..436791fecabb 100644 --- a/code/modules/economy/account.dm +++ b/code/modules/economy/account.dm @@ -14,8 +14,8 @@ /datum/bank_account/Destroy() if(add_to_accounts) SSeconomy.bank_accounts -= src - for(var/obj/item/card/id/id_card as anything in bank_cards) - id_card.registered_account = null + for(var/obj/item/card/bank/bank_card as anything in bank_cards) + bank_card.registered_account = null SSeconomy.bank_money -= account_balance return ..() @@ -49,10 +49,10 @@ return for(var/obj/A in bank_cards) var/icon_source = A - if(istype(A, /obj/item/card/id)) - var/obj/item/card/id/id_card = A - if(id_card.uses_overlays) - icon_source = id_card.get_cached_flat_icon() + 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)) diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index b98466301f63..84d2e8f70486 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -101,6 +101,17 @@ if(id_card) return id_card +/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 + /mob/living/carbon/human/get_id_in_hand() var/obj/item/held_item = get_active_held_item() if(!held_item) @@ -137,10 +148,10 @@ to_chat(src, "You can't bring yourself to use a ranged weapon!") return FALSE -/mob/living/carbon/human/proc/get_bank_account() +/mob/living/carbon/proc/get_bank_account() RETURN_TYPE(/datum/bank_account) var/datum/bank_account/account - var/obj/item/card/id/I = get_idcard() + var/obj/item/card/bank/I = get_bankcard() if(I && I.registered_account) account = I.registered_account diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 131e3f971113..697d23982642 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1301,6 +1301,9 @@ /mob/proc/get_idcard(hand_first) return +/mob/proc/get_bankcard() + return + /mob/proc/get_id_in_hand() return diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm index 93fcacba45b1..cf478b7e2dd7 100644 --- a/code/modules/vending/_vending.dm +++ b/code/modules/vending/_vending.dm @@ -712,15 +712,13 @@ IF YOU MODIFY THE PRODUCTS LIST OF A MACHINE, MAKE SURE TO UPDATE ITS RESUPPLY C /obj/machinery/vending/ui_data(mob/user) . = list() var/mob/living/carbon/human/H - var/obj/item/card/id/card + var/obj/item/card/bank/card if(ishuman(user)) H = user - card = H.get_idcard(TRUE) + card = H.get_bankcard() if(card) .["user"] = list() .["user"]["points"] = card.mining_points - .["user"]["name"] = card.registered_name - .["user"]["job"] = card.assignment || "No Job" if(card.registered_account) .["user"]["name"] = card.registered_account.account_holder .["user"]["cash"] = card.registered_account.account_balance @@ -767,7 +765,7 @@ IF YOU MODIFY THE PRODUCTS LIST OF A MACHINE, MAKE SURE TO UPDATE ITS RESUPPLY C return if(!all_items_free && ishuman(usr)) var/mob/living/carbon/human/H = usr - var/obj/item/card/id/C = H.get_idcard(TRUE) + var/obj/item/card/bank/C = H.get_bankcard() if(!C) say("No card found.") diff --git a/shiptest.dme b/shiptest.dme index 113d1da2b1ff..9002753da9a1 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -1100,6 +1100,7 @@ #include "code\game\objects\items\AI_modules.dm" #include "code\game\objects\items\airlock_painter.dm" #include "code\game\objects\items\apc_frame.dm" +#include "code\game\objects\items\bank_card.dm" #include "code\game\objects\items\bell.dm" #include "code\game\objects\items\binoculars.dm" #include "code\game\objects\items\blueprints.dm" From 9535ca9e6d28a6a1e6ad3f1550c1dae8162fc8f1 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Fri, 10 May 2024 20:41:40 -0500 Subject: [PATCH 02/17] revert removing the stuff from id first --- code/game/objects/items/cards_ids.dm | 173 ++++++++++++++++++++++++++- 1 file changed, 170 insertions(+), 3 deletions(-) diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index 713ff1f3fc4b..2e93b662799a 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -149,16 +149,19 @@ 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 var/assignment = null var/access_txt // mapping aid + var/datum/bank_account/registered_account + var/obj/machinery/paystand/my_store var/uses_overlays = TRUE var/icon/cached_flat_icon + var/registered_age = 18 // default age for ss13 players var/job_icon var/faction_icon - var/registered_name = null // The name registered_name on the card - var/registered_age = 18 // default age for ss13 players /obj/item/card/id/Initialize(mapload) . = ..() @@ -168,6 +171,12 @@ update_appearance() RegisterSignal(src, COMSIG_ATOM_UPDATED_ICON, PROC_REF(update_in_wallet)) +/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)) @@ -181,8 +190,138 @@ if(NAMEOF(src, assignment),NAMEOF(src, registered_name),NAMEOF(src, 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/spacecash/bundle)) + insert_money(W, user, TRUE) + return + else if(istype(W, /obj/item/coin)) + insert_money(W, user, TRUE) + return + else if(istype(W, /obj/item/storage/bag/money)) + var/obj/item/storage/bag/money/money_bag = W + var/list/money_contained = money_bag.contents + + var/money_added = mass_insert_money(money_contained, user) + + if (money_added) + to_chat(user, "You stuff the contents into the card! They disappear in a puff of bluespace smoke, adding [money_added] worth of credits to the linked account.") + 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, "[I] doesn't seem to be worth anything!") + return + + if(!registered_account) + to_chat(user, "[src] doesn't have a linked account to deposit [I] into!") + return + + registered_account.adjust_money(cash_money) + SSblackbox.record_feedback("amount", "credits_inserted", cash_money) + log_econ("[cash_money] credits were inserted into [src] owned by [src.registered_name]") + if(physical_currency) + to_chat(user, "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, "You insert [I] into [src], adding [cash_money] credits to the linked account.") + + to_chat(user, "The linked account now reports a balance of [registered_account.account_balance] cr.") + qdel(I) + +/obj/item/card/id/proc/mass_insert_money(list/money, mob/user) + if (!money || !money.len) + return FALSE + + var/total = 0 + + for (var/obj/item/physical_money in money) + var/cash_money = physical_money.get_item_credit_value() + + total += cash_money + + registered_account.adjust_money(cash_money) + SSblackbox.record_feedback("amount", "credits_inserted", total) + log_econ("[total] credits were inserted into [src] owned by [src.registered_name]") + QDEL_LIST(money) + + return total + +/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 + +// 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, "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, "The account ID was already assigned to this card.") + return + + for(var/A in SSeconomy.bank_accounts) + var/datum/bank_account/B = A + if(B.account_id == new_bank_id) + if (old_account) + old_account.bank_cards -= src + + B.bank_cards += src + registered_account = B + to_chat(user, "The provided account has been linked to this ID card.") + + return TRUE + + to_chat(user, "The account ID number provided is invalid.") + return + +/obj/item/card/id/AltClick(mob/living/user) + if(!alt_click_can_use_id(user)) + return + + if(!registered_account) + set_new_account(user) + 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|null, 1) + + if(!amount_to_remove || amount_to_remove < 0) + return + if(!alt_click_can_use_id(user)) + return + if(registered_account.adjust_money(-amount_to_remove)) + var/obj/item/holochip/holochip = new (user.drop_location(), amount_to_remove) + user.put_in_hands(holochip) + to_chat(user, "You withdraw [amount_to_remove] credits into a holochip.") + SSblackbox.record_feedback("amount", "credits_removed", amount_to_remove) + log_econ("[amount_to_remove] credits were removed from [src] owned by [src.registered_name]") + return + else + var/difference = amount_to_remove - registered_account.account_balance + registered_account.bank_card_talk("ERROR: The linked account requires [difference] more credit\s to perform that withdrawal.", TRUE) + /obj/item/card/id/examine(mob/user) . = ..() + if(registered_account) + . += "The account linked to the card belongs to '[registered_account.account_holder]' and reports a balance of [registered_account.account_balance] cr." . += "There's more information below, you can look again to take a closer look..." /obj/item/card/id/examine_more(mob/user) @@ -190,11 +329,24 @@ if(registered_name) msg += "This access card is assigned to [registered_name]." + 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 'MINOR: DO NOT SERVE ALCOHOL OR TOBACCO' 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) ship_names += ship.name msg += "The card has access to the following ships: [ship_names.Join(", ")]" + if(registered_account) + msg += "The account linked to the ID belongs to '[registered_account.account_holder]' and reports a balance of [registered_account.account_balance] cr." + msg += "Alt-Click the ID to pull money from the linked account in the form of holochips." + msg += "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) + msg += "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 + msg += "There is no registered account linked to this card. Alt-Click to add one." + return msg /obj/item/card/id/GetAccess() @@ -311,7 +463,7 @@ update_label() else return ..() - var/popup_input = alert(user, "Choose Action", "Agent ID", "Show", "Forge/Reset") + 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) @@ -340,6 +492,18 @@ update_label() forged = TRUE to_chat(user, "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 + + for(var/bank_account in SSeconomy.bank_accounts) + var/datum/bank_account/account = bank_account + if(account.account_id == accountowner.account_id) + account.bank_cards += src + registered_account = account + to_chat(user, "Your account number has been automatically assigned.") return else if (popup_input == "Forge/Reset" && forged) registered_name = initial(registered_name) @@ -351,6 +515,9 @@ update_label() forged = FALSE to_chat(user, "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/anyone From 0b399b1c21073decf6ce479b70846521c755ed84 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Fri, 10 May 2024 23:01:20 -0500 Subject: [PATCH 03/17] good stuff --- .../icemoon_underground_abandoned_village.dmm | 1 - code/datums/outfit.dm | 13 ++++++++-- code/game/objects/items/bank_card.dm | 24 +++++++------------ code/game/objects/items/cards_ids.dm | 8 ------- code/game/objects/items/storage/wallets.dm | 5 ++++ code/modules/economy/account.dm | 8 +++---- code/modules/jobs/access.dm | 3 +++ code/modules/jobs/job_types/_job.dm | 21 +++++++++------- code/modules/mining/machine_redemption.dm | 2 +- code/modules/mob/living/carbon/alien/alien.dm | 1 - .../mob/living/carbon/carbon_defines.dm | 1 + .../mob/living/carbon/human/human_defines.dm | 1 - .../mob/living/carbon/human/human_helpers.dm | 21 +++++++++------- .../mob/living/carbon/human/species.dm | 4 +++- code/modules/mob/living/carbon/inventory.dm | 3 +++ 15 files changed, 65 insertions(+), 51 deletions(-) diff --git a/_maps/RandomRuins/IceRuins/icemoon_underground_abandoned_village.dmm b/_maps/RandomRuins/IceRuins/icemoon_underground_abandoned_village.dmm index 946d28dc1a13..a2b21b28c4b9 100644 --- a/_maps/RandomRuins/IceRuins/icemoon_underground_abandoned_village.dmm +++ b/_maps/RandomRuins/IceRuins/icemoon_underground_abandoned_village.dmm @@ -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) diff --git a/code/datums/outfit.dm b/code/datums/outfit.dm index 964c269b5f43..bcbd27f9720c 100644 --- a/code/datums/outfit.dm +++ b/code/datums/outfit.dm @@ -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 @@ -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) diff --git a/code/game/objects/items/bank_card.dm b/code/game/objects/items/bank_card.dm index d1d9b1b7c3fb..f28e969d845c 100644 --- a/code/game/objects/items/bank_card.dm +++ b/code/game/objects/items/bank_card.dm @@ -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 @@ -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) @@ -143,7 +136,7 @@ user.put_in_hands(holochip) to_chat(user, "You withdraw [amount_to_remove] credits into a holochip.") 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 @@ -151,15 +144,16 @@ /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 'MINOR: DO NOT SERVE ALCOHOL OR TOBACCO' 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 'MINOR: DO NOT SERVE ALCOHOL OR TOBACCO' along the bottom of the card." : ""]" . += "Alt-Click the ID to pull money from the linked account in the form of holochips." . += "You can insert credits into the linked account by pressing holochips, cash, or coins against the ID." . += "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 . += "There is no registered account linked to this card. Alt-Click to add one." + if(mining_points) + . += "There's [mining_points] mining equipment redemption point\s loaded onto this card." + +/obj/item/card/bank/GetBankCard() + return src diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index 2e93b662799a..802d70344c4f 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -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 @@ -331,8 +330,6 @@ msg += "This access card is assigned to [registered_name]." 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 'MINOR: DO NOT SERVE ALCOHOL OR TOBACCO' 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) @@ -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." diff --git a/code/game/objects/items/storage/wallets.dm b/code/game/objects/items/storage/wallets.dm index 91f47f56cdd5..c031e998cdcc 100644 --- a/code/game/objects/items/storage/wallets.dm +++ b/code/game/objects/items/storage/wallets.dm @@ -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" diff --git a/code/modules/economy/account.dm b/code/modules/economy/account.dm index 436791fecabb..4213ae91376b 100644 --- a/code/modules/economy/account.dm +++ b/code/modules/economy/account.dm @@ -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() @@ -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)) diff --git a/code/modules/jobs/access.dm b/code/modules/jobs/access.dm index cdd44cab9ae8..550e413f1a59 100644 --- a/code/modules/jobs/access.dm +++ b/code/modules/jobs/access.dm @@ -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) diff --git a/code/modules/jobs/job_types/_job.dm b/code/modules/jobs/job_types/_job.dm index 20ad6e089730..f850eded96d4 100644 --- a/code/modules/jobs/job_types/_job.dm +++ b/code/modules/jobs/job_types/_job.dm @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/code/modules/mining/machine_redemption.dm b/code/modules/mining/machine_redemption.dm index fd36a4bb4ab1..b2d6a2cedd04 100644 --- a/code/modules/mining/machine_redemption.dm +++ b/code/modules/mining/machine_redemption.dm @@ -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 diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm index 23e937acf102..b0b36b151f5a 100644 --- a/code/modules/mob/living/carbon/alien/alien.dm +++ b/code/modules/mob/living/carbon/alien/alien.dm @@ -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 diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm index a7dc41b307c4..8743fe33289e 100644 --- a/code/modules/mob/living/carbon/carbon_defines.dm +++ b/code/modules/mob/living/carbon/carbon_defines.dm @@ -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. diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index 8cc9e5002749..8debc54455cf 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -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 diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index 84d2e8f70486..0a8074cf22bd 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -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() diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index d9b4da586e79..33eb5f8f60b6 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -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) diff --git a/code/modules/mob/living/carbon/inventory.dm b/code/modules/mob/living/carbon/inventory.dm index 7a995dea28da..d5b97a942da2 100644 --- a/code/modules/mob/living/carbon/inventory.dm +++ b/code/modules/mob/living/carbon/inventory.dm @@ -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 From 54949adc2efd9a0de564653d7635ff3688b8348e Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Fri, 10 May 2024 23:37:49 -0500 Subject: [PATCH 04/17] paystand --- code/game/objects/items/bank_card.dm | 5 +- code/game/objects/items/cards_ids.dm | 160 +-------------------------- code/modules/economy/pay_stand.dm | 8 +- 3 files changed, 12 insertions(+), 161 deletions(-) diff --git a/code/game/objects/items/bank_card.dm b/code/game/objects/items/bank_card.dm index f28e969d845c..4a7f2f9d2f21 100644 --- a/code/game/objects/items/bank_card.dm +++ b/code/game/objects/items/bank_card.dm @@ -1,5 +1,6 @@ /obj/item/card/bank name = "cash card" + desc = "Managed by a bank outside the sector." icon_state = "data_1" var/mining_points = 0 //For redeeming at mining equipment vendors @@ -145,8 +146,8 @@ /obj/item/card/bank/examine(mob/user) . = ..() 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 'MINOR: DO NOT SERVE ALCOHOL OR TOBACCO' along the bottom of the card." : ""]" + . += "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 'MINOR: DO NOT SERVE ALCOHOL OR TOBACCO' along the bottom of the card." : ""]" . += "Alt-Click the ID to pull money from the linked account in the form of holochips." . += "You can insert credits into the linked account by pressing holochips, cash, or coins against the ID." . += "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." diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index 802d70344c4f..89d372d241a5 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -155,7 +155,6 @@ var/assignment = null var/access_txt // mapping aid var/datum/bank_account/registered_account - var/obj/machinery/paystand/my_store var/uses_overlays = TRUE var/icon/cached_flat_icon var/registered_age = 18 // default age for ss13 players @@ -173,8 +172,6 @@ /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) @@ -189,162 +186,18 @@ if(NAMEOF(src, assignment),NAMEOF(src, registered_name),NAMEOF(src, 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/spacecash/bundle)) - insert_money(W, user, TRUE) - return - else if(istype(W, /obj/item/coin)) - insert_money(W, user, TRUE) - return - else if(istype(W, /obj/item/storage/bag/money)) - var/obj/item/storage/bag/money/money_bag = W - var/list/money_contained = money_bag.contents - - var/money_added = mass_insert_money(money_contained, user) - - if (money_added) - to_chat(user, "You stuff the contents into the card! They disappear in a puff of bluespace smoke, adding [money_added] worth of credits to the linked account.") - 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, "[I] doesn't seem to be worth anything!") - return - - if(!registered_account) - to_chat(user, "[src] doesn't have a linked account to deposit [I] into!") - return - - registered_account.adjust_money(cash_money) - SSblackbox.record_feedback("amount", "credits_inserted", cash_money) - log_econ("[cash_money] credits were inserted into [src] owned by [src.registered_name]") - if(physical_currency) - to_chat(user, "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, "You insert [I] into [src], adding [cash_money] credits to the linked account.") - - to_chat(user, "The linked account now reports a balance of [registered_account.account_balance] cr.") - qdel(I) - -/obj/item/card/id/proc/mass_insert_money(list/money, mob/user) - if (!money || !money.len) - return FALSE - - var/total = 0 - - for (var/obj/item/physical_money in money) - var/cash_money = physical_money.get_item_credit_value() - - total += cash_money - - registered_account.adjust_money(cash_money) - SSblackbox.record_feedback("amount", "credits_inserted", total) - log_econ("[total] credits were inserted into [src] owned by [src.registered_name]") - QDEL_LIST(money) - - return total - -/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 - -// 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, "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, "The account ID was already assigned to this card.") - return - - for(var/A in SSeconomy.bank_accounts) - var/datum/bank_account/B = A - if(B.account_id == new_bank_id) - if (old_account) - old_account.bank_cards -= src - - B.bank_cards += src - registered_account = B - to_chat(user, "The provided account has been linked to this ID card.") - - return TRUE - - to_chat(user, "The account ID number provided is invalid.") - return - -/obj/item/card/id/AltClick(mob/living/user) - if(!alt_click_can_use_id(user)) - return - - if(!registered_account) - set_new_account(user) - 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|null, 1) - - if(!amount_to_remove || amount_to_remove < 0) - return - if(!alt_click_can_use_id(user)) - return - if(registered_account.adjust_money(-amount_to_remove)) - var/obj/item/holochip/holochip = new (user.drop_location(), amount_to_remove) - user.put_in_hands(holochip) - to_chat(user, "You withdraw [amount_to_remove] credits into a holochip.") - SSblackbox.record_feedback("amount", "credits_removed", amount_to_remove) - log_econ("[amount_to_remove] credits were removed from [src] owned by [src.registered_name]") - return - else - var/difference = amount_to_remove - registered_account.account_balance - registered_account.bank_card_talk("ERROR: The linked account requires [difference] more credit\s to perform that withdrawal.", TRUE) - /obj/item/card/id/examine(mob/user) . = ..() - if(registered_account) - . += "The account linked to the card belongs to '[registered_account.account_holder]' and reports a balance of [registered_account.account_balance] cr." - . += "There's more information below, you can look again to take a closer look..." - -/obj/item/card/id/examine_more(mob/user) - var/list/msg = list("You examine [src] closer, and note the following...") - + . += "
CARD INFO:" if(registered_name) - msg += "This access card is assigned to [registered_name]." + . += "This access card is assigned to [registered_name]." 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 'MINOR: DO NOT SERVE ALCOHOL OR TOBACCO' along the bottom of the card." : ""]" + . += "The card indicates that the holder is [registered_age] years old. [(registered_age < AGE_MINOR) ? "There's a holographic stripe that reads 'MINOR: DO NOT SERVE ALCOHOL OR TOBACCO' along the bottom of the card." : ""]" if(length(ship_access)) var/list/ship_names = list() for(var/datum/overmap/ship/controlled/ship in ship_access) ship_names += ship.name - msg += "The card has access to the following ships: [ship_names.Join(", ")]" - if(registered_account) - msg += "The account linked to the ID belongs to '[registered_account.account_holder]' and reports a balance of [registered_account.account_balance] cr." - msg += "Alt-Click the ID to pull money from the linked account in the form of holochips." - msg += "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) - msg += "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 - msg += "There is no registered account linked to this card. Alt-Click to add one." - - return msg + . += "The card has access to the following ships: [ship_names.Join(", ")]" /obj/item/card/id/GetAccess() return access @@ -460,7 +313,7 @@ update_label() else return ..() - var/popup_input = alert(user, "Choose Action", "Agent ID", "Show", "Forge/Reset", "Change Account ID") + var/popup_input = alert(user, "Choose Action", "Agent ID", "Show", "Forge/Reset") if(user.incapacitated()) return if(popup_input == "Forge/Reset" && !forged) @@ -512,9 +365,6 @@ update_label() forged = FALSE to_chat(user, "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/anyone diff --git a/code/modules/economy/pay_stand.dm b/code/modules/economy/pay_stand.dm index af7d9be4b947..9382a03d062e 100644 --- a/code/modules/economy/pay_stand.dm +++ b/code/modules/economy/pay_stand.dm @@ -6,14 +6,14 @@ density = TRUE anchored = TRUE var/locked = FALSE - var/obj/item/card/id/my_card + var/obj/item/card/bank/my_card var/obj/item/assembly/signaler/signaler //attached signaler, let people attach signalers that get activated if the user's transaction limit is achieved. var/signaler_threshold = 0 //signaler threshold amount var/amount_deposited = 0 //keep track of the amount deposited over time so you can pay multiple times to reach the signaler threshold var/force_fee = 0 //replaces the "pay whatever" functionality with a set amount when non-zero. /obj/machinery/paystand/attackby(obj/item/W, mob/user, params) - if(istype(W, /obj/item/card/id)) + if(istype(W, /obj/item/card/bank)) if(W == my_card) if(user.a_intent == INTENT_DISARM) var/rename_msg = stripped_input(user, "Rename the Paystand:", "Paystand Naming", name) @@ -31,7 +31,7 @@ to_chat(user, "You [src.locked ? "lock" : "unlock"] the paystand, protecting the bolts from [anchored ? "loosening" : "tightening"].") return if(!my_card) - var/obj/item/card/id/assistant_mains_need_to_die = W + var/obj/item/card/bank/assistant_mains_need_to_die = W if(!assistant_mains_need_to_die.registered_account) return var/msg = stripped_input(user, "Name of pay stand:", "Paystand Naming", "[user]'s Awesome Paystand") @@ -42,7 +42,7 @@ my_card = assistant_mains_need_to_die to_chat(user, "You link the stand to your account.") return - var/obj/item/card/id/vbucks = W + var/obj/item/card/bank/vbucks = W if(vbucks.registered_account) var/momsdebitcard = 0 if(!force_fee) From 45c4248bb7e49ada6ffa501406f1e40b8f9719f3 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Sat, 11 May 2024 00:22:26 -0500 Subject: [PATCH 05/17] unit test fails --- code/modules/awaymissions/corpse.dm | 4 ++-- code/modules/clothing/outfits/factions/syndicate.dm | 4 ++-- code/modules/jobs/job_types/bartender.dm | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/code/modules/awaymissions/corpse.dm b/code/modules/awaymissions/corpse.dm index 40932634cfa4..fbd2034dd1c1 100644 --- a/code/modules/awaymissions/corpse.dm +++ b/code/modules/awaymissions/corpse.dm @@ -224,7 +224,7 @@ C.sensor_mode = NO_SENSORS - var/obj/item/card/id/W = H.wear_id + var/obj/item/card/id/W = H.get_idcard() if(W) if(H.age) W.registered_age = H.age @@ -437,7 +437,7 @@ /datum/outfit/spacebartender/post_equip(mob/living/carbon/human/H, visualsOnly) . = ..() - var/obj/item/card/id/W = H.wear_id + var/obj/item/card/id/W = H.get_idcard() if(H.age < AGE_MINOR) W.registered_age = AGE_MINOR to_chat(H, "You're not technically old enough to access or serve alcohol, but your ID has been discreetly modified to display your age as [AGE_MINOR]. Try to keep that a secret!") diff --git a/code/modules/clothing/outfits/factions/syndicate.dm b/code/modules/clothing/outfits/factions/syndicate.dm index 8f98f29a6b1f..c82fc06f036b 100644 --- a/code/modules/clothing/outfits/factions/syndicate.dm +++ b/code/modules/clothing/outfits/factions/syndicate.dm @@ -22,7 +22,7 @@ //generates a codename and assigns syndicate access, used in the twinkleshine. /datum/outfit/job/syndicate/proc/assign_codename(mob/living/carbon/human/H) - var/obj/item/card/id/I = H.wear_id + var/obj/item/card/id/I = H.get_idcard() I.registered_name = pick(GLOB.twinkle_names) + "-" + num2text(rand(1, 12)) // squidquest real I.access |= list(ACCESS_SYNDICATE) I.update_label() @@ -195,7 +195,7 @@ /datum/outfit/job/syndicate/bartender/post_equip(mob/living/carbon/human/H, visualsOnly) . = ..() - var/obj/item/card/id/W = H.wear_id + var/obj/item/card/id/W = H.get_idcard() if(H.age < AGE_MINOR) W.registered_age = AGE_MINOR to_chat(H, "You're not technically old enough to access or serve alcohol, but your ID has been discreetly modified to display your age as [AGE_MINOR]. Try to keep that a secret!") diff --git a/code/modules/jobs/job_types/bartender.dm b/code/modules/jobs/job_types/bartender.dm index 9c5d28e693e8..994f34404efc 100644 --- a/code/modules/jobs/job_types/bartender.dm +++ b/code/modules/jobs/job_types/bartender.dm @@ -27,7 +27,7 @@ /datum/outfit/job/bartender/post_equip(mob/living/carbon/human/H, visualsOnly) . = ..() - var/obj/item/card/id/W = H.wear_id + var/obj/item/card/id/W = H.get_idcard() if(H.age < AGE_MINOR) W.registered_age = AGE_MINOR to_chat(H, "You're not technically old enough to access or serve alcohol, but your ID has been discreetly modified to display your age as [AGE_MINOR]. Try to keep that a secret!") From b04ee42a9f99e96629829a0962f32c943d8c97e8 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Sat, 11 May 2024 00:34:21 -0500 Subject: [PATCH 06/17] idk why that was null --- code/game/objects/items/cards_ids.dm | 1 - code/modules/clothing/outfits/factions/syndicate.dm | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index 89d372d241a5..611a41243e7e 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -379,7 +379,6 @@ update_label() icon_state = "syndie" access = list(ACCESS_SYNDICATE) uses_overlays = FALSE - registered_age = null /obj/item/card/id/syndicate_command/crew_id assignment = "Operative" diff --git a/code/modules/clothing/outfits/factions/syndicate.dm b/code/modules/clothing/outfits/factions/syndicate.dm index c82fc06f036b..635f65cc449c 100644 --- a/code/modules/clothing/outfits/factions/syndicate.dm +++ b/code/modules/clothing/outfits/factions/syndicate.dm @@ -23,9 +23,10 @@ //generates a codename and assigns syndicate access, used in the twinkleshine. /datum/outfit/job/syndicate/proc/assign_codename(mob/living/carbon/human/H) var/obj/item/card/id/I = H.get_idcard() - I.registered_name = pick(GLOB.twinkle_names) + "-" + num2text(rand(1, 12)) // squidquest real - I.access |= list(ACCESS_SYNDICATE) - I.update_label() + if(I) + I.registered_name = pick(GLOB.twinkle_names) + "-" + num2text(rand(1, 12)) // squidquest real + I.access |= list(ACCESS_SYNDICATE) + I.update_label() //and now, for the Assistants From 68524f2836f70d8f13eb28e9478e4861ce598398 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Sat, 11 May 2024 01:36:53 -0500 Subject: [PATCH 07/17] some random cruft removal plus minor stuff --- .../game/objects/effects/spawners/lootdrop.dm | 6 + code/modules/shuttle/shuttle_rotate.dm | 4 - code/modules/shuttle/special.dm | 386 ------------------ code/modules/shuttle/white_ship.dm | 5 - code/modules/vending/_vending.dm | 6 +- shiptest.dme | 2 - 6 files changed, 9 insertions(+), 400 deletions(-) delete mode 100644 code/modules/shuttle/special.dm delete mode 100644 code/modules/shuttle/white_ship.dm diff --git a/code/game/objects/effects/spawners/lootdrop.dm b/code/game/objects/effects/spawners/lootdrop.dm index d763c46e84e9..7231cd7b6053 100644 --- a/code/game/objects/effects/spawners/lootdrop.dm +++ b/code/game/objects/effects/spawners/lootdrop.dm @@ -468,6 +468,12 @@ /obj/structure/salvageable/destructive_analyzer ) +/obj/effect/spawner/lootdrop/whiteship_cere_ripley + name = "25% mech 75% wreckage ripley spawner" + loot = list(/obj/mecha/working/ripley/mining = 1, + /obj/structure/mecha_wreckage/ripley = 5) + lootdoubles = FALSE + /obj/effect/spawner/lootdrop/salvage_50 name = "50% salvage spawner" loot = list( diff --git a/code/modules/shuttle/shuttle_rotate.dm b/code/modules/shuttle/shuttle_rotate.dm index d0b4b49a92f6..31e650a90a31 100644 --- a/code/modules/shuttle/shuttle_rotate.dm +++ b/code/modules/shuttle/shuttle_rotate.dm @@ -70,10 +70,6 @@ If ever any of these procs are useful for non-shuttles, rename it to proc/rotate new_dpdir = new_dpdir | angle2dir(rotation+dir2angle(D)) dpdir = new_dpdir -/obj/structure/table/wood/bar/shuttleRotate(rotation, params) - . = ..() - boot_dir = angle2dir(rotation + dir2angle(boot_dir)) - /obj/structure/alien/weeds/shuttleRotate(rotation, params) params &= ~ROTATE_OFFSET return ..() diff --git a/code/modules/shuttle/special.dm b/code/modules/shuttle/special.dm deleted file mode 100644 index 2603d9ea3e24..000000000000 --- a/code/modules/shuttle/special.dm +++ /dev/null @@ -1,386 +0,0 @@ -// Special objects for shuttle templates go here if nowhere else - -// Wabbajack statue, a sleeping frog statue that shoots bolts of change if -// living carbons are put on its altar/tables - -/obj/machinery/power/emitter/energycannon/magical - name = "wabbajack statue" - desc = "Who am I? What is my purpose in life? What do I mean by who am I?" - projectile_type = /obj/projectile/magic/change - icon = 'icons/obj/machines/magic_emitter.dmi' - icon_state = "wabbajack_statue" - icon_state_on = "wabbajack_statue_on" - base_icon_state = "wabbajack_statue" - active = FALSE - allow_switch_interact = FALSE - var/list/active_tables = list() - var/tables_required = 2 - -/obj/machinery/power/emitter/energycannon/magical/Initialize() - . = ..() - if(prob(50)) - desc = "Oh no, not again." - update_appearance() - -/obj/machinery/power/emitter/energycannon/magical/update_icon_state() - . = ..() - icon_state = active ? icon_state_on : initial(icon_state) - -/obj/machinery/power/emitter/energycannon/magical/process() - . = ..() - if(active_tables.len >= tables_required) - if(!active) - visible_message("\ - [src] opens its eyes.") - active = TRUE - else - if(active) - visible_message("\ - [src] closes its eyes.") - active = FALSE - update_appearance() - -/obj/machinery/power/emitter/energycannon/magical/attackby(obj/item/W, mob/user, params) - return - -/obj/machinery/power/emitter/energycannon/magical/ex_act(severity) - return - -/obj/machinery/power/emitter/energycannon/magical/emag_act(mob/user) - return - -/obj/structure/table/abductor/wabbajack - name = "wabbajack altar" - desc = "Whether you're sleeping or waking, it's going to be quite chaotic." - max_integrity = 1000 - verb_say = "chants" - var/obj/machinery/power/emitter/energycannon/magical/our_statue - var/list/mob/living/sleepers = list() - var/never_spoken = TRUE - flags_1 = NODECONSTRUCT_1 - -/obj/structure/table/abductor/wabbajack/Initialize(mapload) - . = ..() - START_PROCESSING(SSobj, src) - -/obj/structure/table/abductor/wabbajack/Destroy() - STOP_PROCESSING(SSobj, src) - . = ..() - -/obj/structure/table/abductor/wabbajack/process() - var/area = orange(4, src) - if(!our_statue) - for(var/obj/machinery/power/emitter/energycannon/magical/M in area) - our_statue = M - break - - if(!our_statue) - name = "inert [initial(name)]" - return - else - name = initial(name) - - var/turf/T = get_turf(src) - var/list/found = list() - for(var/mob/living/carbon/C in T) - if(C.stat != DEAD) - found += C - - // New sleepers - for(var/i in found - sleepers) - var/mob/living/L = i - L.add_atom_colour("#800080", TEMPORARY_COLOUR_PRIORITY) - L.visible_message("A strange purple glow wraps itself around [L] as [L.p_they()] suddenly fall[L.p_s()] unconscious.", - "[desc]") - // Don't let them sit suround unconscious forever - addtimer(CALLBACK(src, PROC_REF(sleeper_dreams), L), 100) - - // Existing sleepers - for(var/i in found) - var/mob/living/L = i - L.SetSleeping(200) - - // Missing sleepers - for(var/i in sleepers - found) - var/mob/living/L = i - L.remove_atom_colour(TEMPORARY_COLOUR_PRIORITY, "#800080") - L.visible_message("The glow from [L] fades \ - away.") - L.grab_ghost() - - sleepers = found - - if(sleepers.len) - our_statue.active_tables |= src - if(never_spoken || prob(5)) - say(desc) - never_spoken = FALSE - else - our_statue.active_tables -= src - -/obj/structure/table/abductor/wabbajack/proc/sleeper_dreams(mob/living/sleeper) - if(sleeper in sleepers) - to_chat(sleeper, "While you slumber, you have the strangest dream, like you can see yourself from the outside.") - sleeper.ghostize(TRUE) - -/obj/structure/table/abductor/wabbajack/left - desc = "You sleep so it may wake." - -/obj/structure/table/abductor/wabbajack/right - desc = "It wakes so you may sleep." - -// Bar staff, GODMODE mobs(as long as they stay in the shuttle) that just want to make sure people have drinks -// and a good time. - -/mob/living/simple_animal/drone/snowflake/bardrone - name = "Bardrone" - desc = "A barkeeping drone, a robot built to tend bars." - hacked = TRUE - laws = "1. Serve drinks.\n\ - 2. Talk to patrons.\n\ - 3. Don't get messed up in their affairs." - unique_name = FALSE // disables the (123) number suffix - initial_language_holder = /datum/language_holder/universal - -/mob/living/simple_animal/drone/snowflake/bardrone/Initialize() - . = ..() - access_card.access |= ACCESS_CENT_BAR - become_area_sensitive(ROUNDSTART_TRAIT) - RegisterSignal(src, COMSIG_ENTER_AREA, PROC_REF(check_barstaff_godmode)) - check_barstaff_godmode() - -/mob/living/simple_animal/drone/snowflake/bardrone/Destroy() - lose_area_sensitivity(ROUNDSTART_TRAIT) - return ..() - -/mob/living/simple_animal/hostile/alien/maid/barmaid - gold_core_spawnable = NO_SPAWN - name = "Barmaid" - desc = "A barmaid, a maiden found in a bar." - pass_flags = PASSTABLE - unique_name = FALSE - AIStatus = AI_OFF - stop_automated_movement = TRUE - initial_language_holder = /datum/language_holder/universal - -/mob/living/simple_animal/hostile/alien/maid/barmaid/Initialize() - . = ..() - access_card = new /obj/item/card/id(src) - var/datum/job/captain/C = new /datum/job/captain - access_card.access = C.get_access() - access_card.access |= ACCESS_CENT_BAR - ADD_TRAIT(access_card, TRAIT_NODROP, ABSTRACT_ITEM_TRAIT) - become_area_sensitive(ROUNDSTART_TRAIT) - RegisterSignal(src, COMSIG_ENTER_AREA, PROC_REF(check_barstaff_godmode)) - check_barstaff_godmode() - -/mob/living/simple_animal/hostile/alien/maid/barmaid/Destroy() - qdel(access_card) - lose_area_sensitivity(ROUNDSTART_TRAIT) - return ..() - -/mob/living/simple_animal/proc/check_barstaff_godmode() - SIGNAL_HANDLER - - if(istype(get_area(loc), /area/shuttle/escape)) - status_flags |= GODMODE - else - status_flags &= ~GODMODE - -// Bar table, a wooden table that kicks you in a direction if you're not -// barstaff (defined as someone who was a roundstart bartender or someone -// with CENTCOM_BARSTAFF) - -/obj/structure/table/wood/bar - resistance_flags = LAVA_PROOF | FIRE_PROOF | ACID_PROOF - flags_1 = NODECONSTRUCT_1 - max_integrity = 1000 - var/boot_dir = 1 - -/obj/structure/table/wood/bar/Initialize() - . = ..() - var/static/list/loc_connections = list( - COMSIG_ATOM_ENTERED = PROC_REF(on_entered) - ) - AddElement(/datum/element/connect_loc, loc_connections) - -/obj/structure/table/wood/bar/proc/on_entered(datum/source, atom/movable/AM) - SIGNAL_HANDLER - if(isliving(AM) && !is_barstaff(AM)) - // No climbing on the bar please - var/mob/living/M = AM - var/throwtarget = get_edge_target_turf(src, boot_dir) - M.Paralyze(40) - M.throw_at(throwtarget, 5, 1) - to_chat(M, "No climbing on the bar please.") - -/obj/structure/table/wood/bar/proc/is_barstaff(mob/living/user) - . = FALSE - if(ishuman(user)) - var/mob/living/carbon/human/H = user - if(H.mind && H.mind.assigned_role == "Bartender") - return TRUE - - var/obj/item/card/id/ID = user.get_idcard(FALSE) - if(ID && (ACCESS_CENT_BAR in ID.access)) - return TRUE - -//Luxury Shuttle Blockers - -/obj/machinery/scanner_gate/luxury_shuttle - name = "luxury shuttle ticket field" - density = FALSE //allows shuttle airlocks to close, nothing but an approved passenger gets past CanPass - locked = TRUE - use_power = FALSE - var/threshold = 500 - var/static/list/approved_passengers = list() - var/static/list/check_times = list() - var/list/payees = list() - -/obj/machinery/scanner_gate/luxury_shuttle/CanAllowThrough(atom/movable/mover, border_dir) - . = ..() - - if(mover in approved_passengers) - set_scanline("scanning", 10) - return TRUE - - if(!isliving(mover)) //No stowaways - return FALSE - -/obj/machinery/scanner_gate/luxury_shuttle/auto_scan(atom/movable/AM) - return - -/obj/machinery/scanner_gate/luxury_shuttle/attackby(obj/item/W, mob/user, params) - return - -/obj/machinery/scanner_gate/luxury_shuttle/emag_act(mob/user) - return - -#define LUXURY_MESSAGE_COOLDOWN 100 -/obj/machinery/scanner_gate/luxury_shuttle/Bumped(atom/movable/AM) - if(!isliving(AM)) - alarm_beep() - return ..() - - var/datum/bank_account/account - if(istype(AM.pulling, /obj/item/card/id)) - var/obj/item/card/id/I = AM.pulling - if(I.registered_account) - account = I.registered_account - else if(!check_times[AM] || check_times[AM] < world.time) //Let's not spam the message - to_chat(AM, "This ID card doesn't have an owner associated with it!") - check_times[AM] = world.time + LUXURY_MESSAGE_COOLDOWN - else if(ishuman(AM)) - var/mob/living/carbon/human/H = AM - if(H.get_bank_account()) - account = H.get_bank_account() - - if(account) - if(account.account_balance < threshold - payees[AM]) - account.adjust_money(-account.account_balance, "luxury_shuttle") - payees[AM] += account.account_balance - else - var/money_owed = threshold - payees[AM] - account.adjust_money(-money_owed) - payees[AM] += money_owed - - var/list/counted_money = list() - - for(var/obj/item/coin/C in AM.GetAllContents()) - if(payees[AM] >= threshold) - break - payees[AM] += C.value - counted_money += C - for(var/obj/item/spacecash/bundle/S in AM.GetAllContents()) - if(payees[AM] >= threshold) - break - payees[AM] += S.value - counted_money += S - for(var/obj/item/holochip/H in AM.GetAllContents()) - if(payees[AM] >= threshold) - break - payees[AM] += H.credits - counted_money += H - - if(payees[AM] < threshold && istype(AM.pulling, /obj/item/coin)) - var/obj/item/coin/C = AM.pulling - payees[AM] += C.value - counted_money += C - - else if(payees[AM] < threshold && istype(AM.pulling, /obj/item/spacecash/bundle)) - var/obj/item/spacecash/bundle/S = AM.pulling - payees[AM] += S.value - counted_money += S - - else if(payees[AM] < threshold && istype(AM.pulling, /obj/item/holochip)) - var/obj/item/holochip/H = AM.pulling - payees[AM] += H.credits - counted_money += H - - if(payees[AM] < threshold) - var/armless - if(!ishuman(AM) && !istype(AM, /mob/living/simple_animal/slime)) - armless = TRUE - else - var/mob/living/carbon/human/H = AM - if(!H.get_bodypart(BODY_ZONE_L_ARM) && !H.get_bodypart(BODY_ZONE_R_ARM)) - armless = TRUE - - if(armless) - if(!AM.pulling || !iscash(AM.pulling) && !istype(AM.pulling, /obj/item/card/id)) - if(!check_times[AM] || check_times[AM] < world.time) //Let's not spam the message - to_chat(AM, "Try pulling a valid ID, space cash, holochip or coin into \the [src]!") - check_times[AM] = world.time + LUXURY_MESSAGE_COOLDOWN - - if(payees[AM] >= threshold) - for(var/obj/I in counted_money) - qdel(I) - payees[AM] -= threshold - - var/change = FALSE - if(payees[AM] > 0) - change = TRUE - var/obj/item/holochip/HC = new /obj/item/holochip(AM.loc) - HC.credits = payees[AM] - HC.name = "[HC.credits] credit holochip" - if(istype(AM, /mob/living/carbon/human)) - var/mob/living/carbon/human/H = AM - if(!H.put_in_hands(HC)) - AM.pulling = HC - else - AM.pulling = HC - payees[AM] -= payees[AM] - - say("Welcome to first class, [AM]![change ? " Here is your change." : ""]") - approved_passengers += AM - - check_times -= AM - return - else if (payees[AM] > 0) - for(var/obj/I in counted_money) - qdel(I) - if(!check_times[AM] || check_times[AM] < world.time) //Let's not spam the message - to_chat(AM, "[payees[AM]] cr received. You need [threshold-payees[AM]] cr more.") - check_times[AM] = world.time + LUXURY_MESSAGE_COOLDOWN - alarm_beep() - return ..() - else - alarm_beep() - return ..() - -/mob/living/simple_animal/hostile/bear/fightpit - name = "fight pit bear" - desc = "This bear's trained through ancient Solarian secrets to fear the walls of its glass prison." - environment_smash = ENVIRONMENT_SMASH_NONE - -/obj/effect/decal/hammerandsickle - name = "hammer and sickle" - desc = "Communism powerful force." - icon = 'icons/effects/96x96.dmi' - icon_state = "communist" - layer = ABOVE_OPEN_TURF_LAYER - pixel_x = -32 - pixel_y = -32 - -/obj/effect/decal/hammerandsickle/shuttleRotate(rotation) - setDir(angle2dir(rotation+dir2angle(dir))) // No parentcall, rest of the rotate code breaks the pixel offset. diff --git a/code/modules/shuttle/white_ship.dm b/code/modules/shuttle/white_ship.dm deleted file mode 100644 index 71afa1c9bc72..000000000000 --- a/code/modules/shuttle/white_ship.dm +++ /dev/null @@ -1,5 +0,0 @@ -/obj/effect/spawner/lootdrop/whiteship_cere_ripley - name = "25% mech 75% wreckage ripley spawner" - loot = list(/obj/mecha/working/ripley/mining = 1, - /obj/structure/mecha_wreckage/ripley = 5) - lootdoubles = FALSE diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm index cf478b7e2dd7..575a12ec26e1 100644 --- a/code/modules/vending/_vending.dm +++ b/code/modules/vending/_vending.dm @@ -999,7 +999,7 @@ IF YOU MODIFY THE PRODUCTS LIST OF A MACHINE, MAKE SURE TO UPDATE ITS RESUPPLY C vend_ready = FALSE if(ishuman(usr)) var/mob/living/carbon/human/H = usr - var/obj/item/card/id/C = H.get_idcard(TRUE) + var/obj/item/card/bank/C = H.get_bankcard() if(!C) say("No card found.") @@ -1051,10 +1051,10 @@ IF YOU MODIFY THE PRODUCTS LIST OF A MACHINE, MAKE SURE TO UPDATE ITS RESUPPLY C /obj/machinery/vending/custom/attackby(obj/item/I, mob/user, params) if(!private_a) var/mob/living/carbon/human/H - var/obj/item/card/id/C + var/obj/item/card/bank/C if(ishuman(user)) H = user - C = H.get_idcard(TRUE) + C = H.get_bankcard(TRUE) if(C?.registered_account) private_a = C.registered_account say("\The [src] has been linked to [C].") diff --git a/shiptest.dme b/shiptest.dme index 9002753da9a1..7ba2d0d895b5 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -3282,9 +3282,7 @@ #include "code\modules\shuttle\ripple.dm" #include "code\modules\shuttle\shuttle.dm" #include "code\modules\shuttle\shuttle_rotate.dm" -#include "code\modules\shuttle\special.dm" #include "code\modules\shuttle\supply.dm" -#include "code\modules\shuttle\white_ship.dm" #include "code\modules\spells\spell.dm" #include "code\modules\spells\spell_types\aimed.dm" #include "code\modules\spells\spell_types\area_teleport.dm" From 9d4314ae826f9b90d01c764548abe4ea7e46216f Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Sat, 11 May 2024 13:41:21 -0500 Subject: [PATCH 08/17] commit --- code/game/objects/effects/spawners/lootdrop.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/objects/effects/spawners/lootdrop.dm b/code/game/objects/effects/spawners/lootdrop.dm index 7231cd7b6053..08d1514f7bbe 100644 --- a/code/game/objects/effects/spawners/lootdrop.dm +++ b/code/game/objects/effects/spawners/lootdrop.dm @@ -468,7 +468,7 @@ /obj/structure/salvageable/destructive_analyzer ) -/obj/effect/spawner/lootdrop/whiteship_cere_ripley +/obj/effect/spawner/lootdrop/ripley name = "25% mech 75% wreckage ripley spawner" loot = list(/obj/mecha/working/ripley/mining = 1, /obj/structure/mecha_wreckage/ripley = 5) @@ -479,7 +479,7 @@ loot = list( /obj/effect/spawner/lootdrop/maintenance = 13, /obj/effect/spawner/lootdrop/salvage_machine = 12, - /obj/effect/spawner/lootdrop/whiteship_cere_ripley = 12, + /obj/effect/spawner/lootdrop/ripley = 12, /obj/structure/closet/crate/secure/loot = 13, "" = 50 ) From 1c9f6806935bd2efdbff7ff7bd984d327eba7963 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Sun, 12 May 2024 00:52:53 -0500 Subject: [PATCH 09/17] all the stuff --- code/__DEFINES/is_helpers.dm | 2 ++ code/game/machinery/bounty_board.dm | 6 +++--- code/game/objects/items/cards_ids.dm | 18 +----------------- .../structures/crates_lockers/crates/secure.dm | 8 ++++---- code/game/objects/structures/displaycase.dm | 6 +++--- .../antagonists/traitor/syndicate_contract.dm | 4 ++-- code/modules/mob/mob.dm | 15 +++++++++++---- .../file_system/programs/bounty_board.dm | 4 ++-- .../file_system/programs/cargoship.dm | 10 +++++----- .../modular_computers/hardware/card_slot.dm | 1 + .../modules/modular_computers/laptop_vendor.dm | 4 ++-- code/modules/recycling/sortingmachinery.dm | 4 ++-- code/modules/research/bepis.dm | 10 +++++----- code/modules/vending/_vending.dm | 4 ++-- 14 files changed, 45 insertions(+), 51 deletions(-) diff --git a/code/__DEFINES/is_helpers.dm b/code/__DEFINES/is_helpers.dm index 2ba7553f823c..241136c297b9 100644 --- a/code/__DEFINES/is_helpers.dm +++ b/code/__DEFINES/is_helpers.dm @@ -176,6 +176,8 @@ GLOBAL_LIST_INIT(turfs_without_ground, typecacheof(list( #define isidcard(I) (istype(I, /obj/item/card/id)) +#define isbankcard(I) (istype(I, /obj/item/card/bank)) + #define isstructure(A) (istype(A, /obj/structure)) #define ismachinery(A) (istype(A, /obj/machinery)) diff --git a/code/game/machinery/bounty_board.dm b/code/game/machinery/bounty_board.dm index 75cf67a8bd2f..4cc3413fe9d9 100644 --- a/code/game/machinery/bounty_board.dm +++ b/code/game/machinery/bounty_board.dm @@ -72,9 +72,9 @@ GLOBAL_LIST_EMPTY(request_list) if(request.applicants) for(var/datum/bank_account/j in request.applicants) formatted_applicants += list(list("name" = j.account_holder, "request_id" = request.owner_account.account_id, "requestee_id" = j.account_id)) - var/obj/item/card/id/id_card = user.get_idcard() - if(id_card?.registered_account) - current_user = id_card.registered_account + var/obj/item/card/bank/bank_card = user.get_bankcard() + if(bank_card?.registered_account) + current_user = bank_card.registered_account if(current_user) data["accountName"] = current_user.account_holder data["requests"] = formatted_requests diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index 611a41243e7e..9ac4a2426358 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -154,7 +154,7 @@ var/registered_name = null // The name registered_name on the card var/assignment = null var/access_txt // mapping aid - var/datum/bank_account/registered_account + //var/datum/bank_account/registered_account var/uses_overlays = TRUE var/icon/cached_flat_icon var/registered_age = 18 // default age for ss13 players @@ -169,11 +169,6 @@ update_appearance() RegisterSignal(src, COMSIG_ATOM_UPDATED_ICON, PROC_REF(update_in_wallet)) -/obj/item/card/id/Destroy() - if (registered_account) - registered_account.bank_cards -= src - return ..() - /obj/item/card/id/attack_self(mob/user) if(Adjacent(user)) user.visible_message("[user] shows you: [icon2html(src, viewers(user))] \the [initial(name)] [(!registered_name) ? "(" : "([registered_name]"][(!assignment) ? ")" : ", [assignment])"].", "You show \the [initial(name)] [(!registered_name) ? "(" : "([registered_name],"] [(!assignment) ? ")" : "[assignment])"].") @@ -343,17 +338,6 @@ update_label() to_chat(user, "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 - - for(var/bank_account in SSeconomy.bank_accounts) - var/datum/bank_account/account = bank_account - if(account.account_id == accountowner.account_id) - account.bank_cards += src - registered_account = account - to_chat(user, "Your account number has been automatically assigned.") return else if (popup_input == "Forge/Reset" && forged) registered_name = initial(registered_name) diff --git a/code/game/objects/structures/crates_lockers/crates/secure.dm b/code/game/objects/structures/crates_lockers/crates/secure.dm index cdd98f22196f..77d75164b185 100644 --- a/code/game/objects/structures/crates_lockers/crates/secure.dm +++ b/code/game/objects/structures/crates_lockers/crates/secure.dm @@ -83,10 +83,10 @@ /obj/structure/closet/crate/secure/owned/togglelock(mob/living/user, silent) if(privacy_lock) if(!broken) - var/obj/item/card/id/id_card = user.get_idcard(TRUE) - if(id_card) - if(id_card.registered_account) - if(id_card.registered_account == buyer_account) + var/obj/item/card/bank/bank_card = user.get_bankcard() + if(bank_card) + if(bank_card.registered_account) + if(bank_card.registered_account == buyer_account) if(iscarbon(user)) add_fingerprint(user) locked = !locked diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm index 37c816335977..4e95b5558842 100644 --- a/code/game/objects/structures/displaycase.dm +++ b/code/game/objects/structures/displaycase.dm @@ -422,7 +422,7 @@ . = ..() if(.) return - var/obj/item/card/id/potential_acc = usr.get_idcard(hand_first = TRUE) + var/obj/item/card/bank/potential_acc = usr.get_bankcard() switch(action) if("Buy") if(!showpiece) @@ -497,9 +497,9 @@ return TRUE . = TRUE /obj/structure/displaycase/forsale/attackby(obj/item/I, mob/living/user, params) - if(isidcard(I)) + if(isbankcard(I)) //Card Registration - var/obj/item/card/id/potential_acc = I + var/obj/item/card/bank/potential_acc = I if(!potential_acc.registered_account) to_chat(user, "This ID card has no account registered!") return diff --git a/code/modules/antagonists/traitor/syndicate_contract.dm b/code/modules/antagonists/traitor/syndicate_contract.dm index a6edcb075361..d6bbba359303 100644 --- a/code/modules/antagonists/traitor/syndicate_contract.dm +++ b/code/modules/antagonists/traitor/syndicate_contract.dm @@ -143,10 +143,10 @@ // Pay contractor their portion of ransom if (status == CONTRACT_STATUS_COMPLETE) var/mob/living/carbon/human/H - var/obj/item/card/id/C + var/obj/item/card/bank/C if(ishuman(contract.owner.current)) H = contract.owner.current - C = H.get_idcard(TRUE) + C = H.get_bankcard() if(C && C.registered_account) C.registered_account.adjust_money(ransom * 0.35, "syndicate_contract") diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 697d23982642..9914c0aec902 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1200,6 +1200,7 @@ var/list/searching = GetAllContents() var/search_id = 1 var/search_pda = 1 + var/search_bankcard = 1 for(var/A in searching) if(search_id && istype(A, /obj/item/card/id)) @@ -1207,18 +1208,24 @@ if(ID.registered_name == oldname) ID.registered_name = newname ID.update_label() - if(ID.registered_account?.account_holder == oldname) - ID.registered_account.account_holder = newname - if(!search_pda) + if(!search_pda || !search_bankcard) break search_id = 0 + if(search_bankcard && istype(A, /obj/item/card/bank)) + var/obj/item/card/bank/bank_card = A + if(bank_card.registered_account?.account_holder == oldname) + bank_card.registered_account.account_holder = newname + if(!search_id || !search_pda) + break + search_bankcard = 0 + else if(search_pda && istype(A, /obj/item/pda)) var/obj/item/pda/PDA = A if(PDA.owner == oldname) PDA.owner = newname PDA.update_label() - if(!search_id) + if(!search_id || !search_bankcard) break search_pda = 0 diff --git a/code/modules/modular_computers/file_system/programs/bounty_board.dm b/code/modules/modular_computers/file_system/programs/bounty_board.dm index 496011cfdddd..b3b9051e5b8f 100644 --- a/code/modules/modular_computers/file_system/programs/bounty_board.dm +++ b/code/modules/modular_computers/file_system/programs/bounty_board.dm @@ -25,8 +25,8 @@ if(!networked) GLOB.allbountyboards += computer networked = TRUE - if(card_slot && card_slot.stored_card && card_slot.stored_card.registered_account) - current_user = card_slot.stored_card.registered_account + if(card_slot && card_slot.bank_card && card_slot.bank_card.registered_account) + current_user = card_slot.bank_card.registered_account for(var/i in GLOB.request_list) if(!i) continue diff --git a/code/modules/modular_computers/file_system/programs/cargoship.dm b/code/modules/modular_computers/file_system/programs/cargoship.dm index 1bfe53b215f2..2aa9b68565ca 100644 --- a/code/modules/modular_computers/file_system/programs/cargoship.dm +++ b/code/modules/modular_computers/file_system/programs/cargoship.dm @@ -35,21 +35,21 @@ // Get components var/obj/item/computer_hardware/card_slot/card_slot = computer.all_components[MC_CARD] var/obj/item/computer_hardware/printer/printer = computer.all_components[MC_PRINT] - var/obj/item/card/id/id_card = card_slot ? card_slot.stored_card : null + var/obj/item/card/bank/bank_card = card_slot ? card_slot.stored_card : null if(!card_slot || !printer) //We need both to successfully use this app. return switch(action) if("ejectid") - if(id_card) + if(bank_card) card_slot.try_eject(TRUE, usr) if("selectid") - if(!id_card) + if(!bank_card) return - if(!id_card.registered_account) + if(!bank_card.registered_account) playsound(get_turf(ui_host()), 'sound/machines/buzz-sigh.ogg', 50, TRUE, -1) return - payments_acc = id_card.registered_account + payments_acc = bank_card.registered_account playsound(get_turf(ui_host()), 'sound/machines/ping.ogg', 50, TRUE, -1) if("resetid") payments_acc = null diff --git a/code/modules/modular_computers/hardware/card_slot.dm b/code/modules/modular_computers/hardware/card_slot.dm index 1acdb72f400e..1ef62b7617f3 100644 --- a/code/modules/modular_computers/hardware/card_slot.dm +++ b/code/modules/modular_computers/hardware/card_slot.dm @@ -8,6 +8,7 @@ var/obj/item/card/id/stored_card var/obj/item/card/id/stored_card2 + var/obj/item/card/bank/bank_card /obj/item/computer_hardware/card_slot/Exited(atom/ejected, atom/newloc) if(!(ejected == stored_card || ejected == stored_card2)) diff --git a/code/modules/modular_computers/laptop_vendor.dm b/code/modules/modular_computers/laptop_vendor.dm index eb363de15792..b1ec3d3edc16 100644 --- a/code/modules/modular_computers/laptop_vendor.dm +++ b/code/modules/modular_computers/laptop_vendor.dm @@ -248,10 +248,10 @@ visible_message("[user] inserts a [HC.credits] cr holocredit chip into [src].") qdel(HC) return - else if(istype(I, /obj/item/card/id)) + else if(istype(I, /obj/item/card/bank)) if(state != 2) return - var/obj/item/card/id/ID = I + var/obj/item/card/bank/ID = I var/datum/bank_account/account = ID.registered_account var/target_credits = total_price - credits if(!account.adjust_money(-target_credits, "laptop_vendor")) diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index 77525a1f309e..96e027a55476 100644 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -388,8 +388,8 @@ /obj/item/sales_tagger/attackby(obj/item/I, mob/living/user, params) . = ..() - if(istype(I, /obj/item/card/id)) - var/obj/item/card/id/potential_acc = I + if(isbankcard(I)) + var/obj/item/card/bank/potential_acc = I if(potential_acc.registered_account) payments_acc = potential_acc.registered_account playsound(src, 'sound/machines/ping.ogg', 40, TRUE) diff --git a/code/modules/research/bepis.dm b/code/modules/research/bepis.dm index 84d948f7c2b9..cddf98506a49 100644 --- a/code/modules/research/bepis.dm +++ b/code/modules/research/bepis.dm @@ -58,11 +58,11 @@ say("Deposited [deposit_value] credits into storage.") update_icon_state() return - if(istype(O, /obj/item/card/id)) - var/obj/item/card/id/Card = O - if(Card.registered_account) - account = Card.registered_account - account_name = Card.registered_name + if(istype(O, /obj/item/card/bank)) + var/obj/item/card/bank/bank_card = O + if(bank_card.registered_account) + account = bank_card.registered_account + account_name = bank_card.registered_name say("New account detected. Console Updated.") else say("No account detected on card. Aborting.") diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm index 575a12ec26e1..70b153f892ed 100644 --- a/code/modules/vending/_vending.dm +++ b/code/modules/vending/_vending.dm @@ -942,10 +942,10 @@ IF YOU MODIFY THE PRODUCTS LIST OF A MACHINE, MAKE SURE TO UPDATE ITS RESUPPLY C /obj/machinery/vending/custom/compartmentLoadAccessCheck(mob/user) . = FALSE var/mob/living/carbon/human/H - var/obj/item/card/id/C + var/obj/item/card/bank/C if(ishuman(user)) H = user - C = H.get_idcard(FALSE) + C = H.get_bankcard(FALSE) if(C?.registered_account && C.registered_account == private_a) return TRUE From 243eb2d3cf0832c00ff20fff1fb24f62618f2095 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Sun, 12 May 2024 01:06:37 -0500 Subject: [PATCH 10/17] rename some stuff --- .../machinery/{droneDispenser.dm => drone_dispenser.dm} | 0 shiptest.dme | 6 +++--- 2 files changed, 3 insertions(+), 3 deletions(-) rename code/game/machinery/{droneDispenser.dm => drone_dispenser.dm} (100%) diff --git a/code/game/machinery/droneDispenser.dm b/code/game/machinery/drone_dispenser.dm similarity index 100% rename from code/game/machinery/droneDispenser.dm rename to code/game/machinery/drone_dispenser.dm diff --git a/shiptest.dme b/shiptest.dme index 7ba2d0d895b5..f1f47798140a 100644 --- a/shiptest.dme +++ b/shiptest.dme @@ -853,7 +853,7 @@ #include "code\game\machinery\aug_manipulator.dm" #include "code\game\machinery\autolathe.dm" #include "code\game\machinery\bank_machine.dm" -#include "code\game\machinery\Beacon.dm" +#include "code\game\machinery\beacon.dm" #include "code\game\machinery\bounty_board.dm" #include "code\game\machinery\buttons.dm" #include "code\game\machinery\cell_charger.dm" @@ -866,7 +866,7 @@ #include "code\game\machinery\dish_drive.dm" #include "code\game\machinery\dna_scanner.dm" #include "code\game\machinery\doppler_array.dm" -#include "code\game\machinery\droneDispenser.dm" +#include "code\game\machinery\drone_dispenser.dm" #include "code\game\machinery\exp_cloner.dm" #include "code\game\machinery\firealarm.dm" #include "code\game\machinery\flasher.dm" @@ -896,7 +896,7 @@ #include "code\game\machinery\scan_gate.dm" #include "code\game\machinery\sheetifier.dm" #include "code\game\machinery\shieldgen.dm" -#include "code\game\machinery\Sleeper.dm" +#include "code\game\machinery\sleeper.dm" #include "code\game\machinery\slotmachine.dm" #include "code\game\machinery\spaceheater.dm" #include "code\game\machinery\stasis.dm" From b6eb016b184db6c4e0d5d89166b4e87393463ac8 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Sun, 12 May 2024 01:11:36 -0500 Subject: [PATCH 11/17] temp cause this is weird --- code/game/machinery/{Beacon.dm => temp/beacon.dm} | 0 code/game/machinery/{Sleeper.dm => temp/sleeper.dm} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename code/game/machinery/{Beacon.dm => temp/beacon.dm} (100%) rename code/game/machinery/{Sleeper.dm => temp/sleeper.dm} (100%) diff --git a/code/game/machinery/Beacon.dm b/code/game/machinery/temp/beacon.dm similarity index 100% rename from code/game/machinery/Beacon.dm rename to code/game/machinery/temp/beacon.dm diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/temp/sleeper.dm similarity index 100% rename from code/game/machinery/Sleeper.dm rename to code/game/machinery/temp/sleeper.dm From 2b3e211cdb26fbf898061f381e8d14f4af5b8470 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Sun, 12 May 2024 01:11:53 -0500 Subject: [PATCH 12/17] rename these --- code/game/machinery/{temp => }/beacon.dm | 0 code/game/machinery/{temp => }/sleeper.dm | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename code/game/machinery/{temp => }/beacon.dm (100%) rename code/game/machinery/{temp => }/sleeper.dm (100%) diff --git a/code/game/machinery/temp/beacon.dm b/code/game/machinery/beacon.dm similarity index 100% rename from code/game/machinery/temp/beacon.dm rename to code/game/machinery/beacon.dm diff --git a/code/game/machinery/temp/sleeper.dm b/code/game/machinery/sleeper.dm similarity index 100% rename from code/game/machinery/temp/sleeper.dm rename to code/game/machinery/sleeper.dm From 8878b29ae122e11e04f417565b9f5ef2ed03ce98 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Fri, 31 May 2024 06:55:59 -0500 Subject: [PATCH 13/17] removes wallet from loadout --- code/modules/client/loadout/loadout_general.dm | 4 ---- 1 file changed, 4 deletions(-) diff --git a/code/modules/client/loadout/loadout_general.dm b/code/modules/client/loadout/loadout_general.dm index 265a7728d2ab..52072aa86213 100644 --- a/code/modules/client/loadout/loadout_general.dm +++ b/code/modules/client/loadout/loadout_general.dm @@ -62,10 +62,6 @@ display_name = "toy, magic eight ball" path = /obj/item/toy/eightball -/datum/gear/wallet - display_name = "wallet" - path = /obj/item/storage/wallet - /datum/gear/pai display_name = "personal AI device" path = /obj/item/paicard From 6f378ef198de7e9aec4eeda02be201a01e18288f Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Sun, 2 Jun 2024 16:47:51 -0500 Subject: [PATCH 14/17] yea --- code/game/objects/items/cards_ids.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index 3aa4bd468c47..c26e99925455 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -200,14 +200,14 @@ 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 'MINOR: DO NOT SERVE ALCOHOL OR TOBACCO' along the bottom of the card." : ""]" if(length(ship_access)) - msg += "SHIP ACCESS:" + . += "SHIP ACCESS:" var/list/ship_factions = list() for(var/datum/overmap/ship/controlled/ship in ship_access) var/faction = ship.get_faction() if(!(faction in ship_factions)) ship_factions += faction - msg += "[ship_factions.Join(", ")]" + . += "[ship_factions.Join(", ")]" var/list/ship_names = list() for(var/datum/overmap/ship/controlled/ship in ship_access) From b0772ba387f9551717371357ba6a9b7dfb1c587b Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Sun, 2 Jun 2024 16:50:41 -0500 Subject: [PATCH 15/17] yea --- code/game/objects/items/cards_ids.dm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index c26e99925455..370fee580ae6 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -196,9 +196,11 @@ . = ..() . += "
CARD INFO:" if(registered_name) - . += "This access card is assigned to [registered_name]." + . += "NAME:" + . += "[registered_name]" 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 'MINOR: DO NOT SERVE ALCOHOL OR TOBACCO' along the bottom of the card." : ""]" + . += "AGE:" + . += "[registered_age] years old [(registered_age < AGE_MINOR) ? "There's a holographic stripe that reads 'MINOR: DO NOT SERVE ALCOHOL OR TOBACCO' along the bottom of the card." : ""]" if(length(ship_access)) . += "SHIP ACCESS:" @@ -212,7 +214,7 @@ var/list/ship_names = list() for(var/datum/overmap/ship/controlled/ship in ship_access) ship_names += ship.name - . += "The card has access to the following ships: [ship_names.Join(", ")]" + . += "[ship_names.Join(", ")]" /obj/item/card/id/GetAccess() return access From 3b24c8d7371f812cc044a819368cd7a0d433ddac Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Sun, 2 Jun 2024 16:56:06 -0500 Subject: [PATCH 16/17] yea --- _maps/RandomRuins/RockRuins/rockplanet_shippingdock.dmm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_maps/RandomRuins/RockRuins/rockplanet_shippingdock.dmm b/_maps/RandomRuins/RockRuins/rockplanet_shippingdock.dmm index f4307cf7a84b..6bb4f2e48c99 100644 --- a/_maps/RandomRuins/RockRuins/rockplanet_shippingdock.dmm +++ b/_maps/RandomRuins/RockRuins/rockplanet_shippingdock.dmm @@ -2068,7 +2068,7 @@ "sa" = ( /obj/effect/turf_decal/rechargefloor, /obj/effect/turf_decal/industrial/warning/dust, -/obj/effect/spawner/lootdrop/whiteship_cere_ripley, +/obj/effect/spawner/lootdrop/ripley, /turf/open/floor/plasteel/mono/dark, /area/ruin/rockplanet/shippingdockwarehouse) "sc" = ( From 4d74220d24a672060aff2491afa03670d9ca4e00 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Wed, 5 Jun 2024 20:54:19 -0500 Subject: [PATCH 17/17] removes wallets from a few outfits --- code/modules/clothing/outfits/factions/independent.dm | 4 ---- code/modules/clothing/outfits/factions/nanotrasen.dm | 1 - 2 files changed, 5 deletions(-) diff --git a/code/modules/clothing/outfits/factions/independent.dm b/code/modules/clothing/outfits/factions/independent.dm index c819246f7cae..4df0633ec7e1 100644 --- a/code/modules/clothing/outfits/factions/independent.dm +++ b/code/modules/clothing/outfits/factions/independent.dm @@ -6,8 +6,6 @@ box = /obj/item/storage/box/survival id = /obj/item/card/id - r_pocket = /obj/item/storage/wallet - // Assistant /datum/outfit/job/independent/assistant @@ -289,7 +287,6 @@ jobtype = /datum/job/engineer belt = /obj/item/storage/belt/utility/full/engi - l_pocket = /obj/item/storage/wallet gloves = /obj/item/clothing/gloves/color/yellow ears = /obj/item/radio/headset/headset_eng uniform = /obj/item/clothing/under/rank/engineering/engineer @@ -368,7 +365,6 @@ id = /obj/item/card/id/silver belt = /obj/item/storage/belt/utility/chief/full - l_pocket = /obj/item/storage/wallet ears = /obj/item/radio/headset/headset_com uniform = /obj/item/clothing/under/rank/engineering/chief_engineer dcoat = /obj/item/clothing/suit/hooded/wintercoat/engineering diff --git a/code/modules/clothing/outfits/factions/nanotrasen.dm b/code/modules/clothing/outfits/factions/nanotrasen.dm index 93f1ee3a347c..e93c7b4b8e52 100644 --- a/code/modules/clothing/outfits/factions/nanotrasen.dm +++ b/code/modules/clothing/outfits/factions/nanotrasen.dm @@ -220,7 +220,6 @@ id = /obj/item/card/id/silver belt = /obj/item/storage/belt/utility/chief/full - l_pocket = /obj/item/storage/wallet ears = /obj/item/radio/headset/headset_com uniform = /obj/item/clothing/under/nanotrasen/engineering/director dcoat = /obj/item/clothing/suit/hooded/wintercoat/engineering