Skip to content

Commit

Permalink
various fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
crunchypretzels committed Feb 11, 2025
1 parent cca1f37 commit faf2539
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 18 deletions.
1 change: 1 addition & 0 deletions code/__HELPERS/global_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ GLOBAL_LIST_INIT(WALLITEMS_EXTERIOR, typecacheof(list(
GLOBAL_LIST_INIT(allowed_money, typecacheof(list(
/obj/item/coin,
/obj/item/holochip,
/obj/item/libre/bundle, //DOPPLER EDIT: adds libre to the list
/obj/item/stack/spacecash,
)))

Expand Down
22 changes: 11 additions & 11 deletions code/datums/components/payment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@

if(armless)
if(!user.pulling || !iscash(user.pulling) && !istype(user.pulling, /obj/item/card/id))
to_chat(user, span_notice("Try pulling a valid ID, space cash, holochip or coin while using \the [parent]!"))
to_chat(user, span_notice("Try pulling a valid ID, or some sort of physical currency, while using \the [parent]!")) // DOPPLER EDIT: libre only, punk
return FALSE
return FALSE

Expand All @@ -109,19 +109,19 @@
physical_cash_total -= total_cost

if(physical_cash_total > 0)
var/obj/item/holochip/holochange = new /obj/item/holochip(user.loc, physical_cash_total) //Change is made in holocredits exclusively.
holochange.name = "[holochange.credits] credit holochip"
var/obj/item/libre/bundle/librechange = new /obj/item/libre/bundle(user.loc, physical_cash_total) //DOPPLER EDIT: change is now in libre
// librechange.name = "[holochange.credits] credit holochip" // DOPPLER EDIT: holochip > libre
if(ishuman(user))
var/mob/living/carbon/human/paying_customer = user
var/successfully_put_in_hands
ASYNC //Put_in_hands can sleep, we don't want that to block this proc.
successfully_put_in_hands = paying_customer.put_in_hands(holochange)
successfully_put_in_hands = paying_customer.put_in_hands(librechange) // DOPPLER EDIT: holochip > libre
if(!successfully_put_in_hands)
user.pulling = holochange
user.pulling = librechange // DOPPLER EDIT: holochip > libre
else
user.pulling = holochange
log_econ("[total_cost] credits were spent on [parent] by [user].")
to_chat(user, span_notice("Purchase completed with held credits."))
user.pulling = librechange // DOPPLER EDIT: holochip > libre
log_econ("[total_cost] libre were spent on [parent] by [user].") // DOPPLER EDIT: credits > libre
to_chat(user, span_notice("Purchase completed with held libre.")) // DOPPLER EDIT: credits > libre
playsound(user, 'sound/effects/cashregister.ogg', 20, TRUE)
return TRUE

Expand Down Expand Up @@ -162,12 +162,12 @@
to_chat(user, span_warning("ID Card lacks funds. Aborting."))
if(PAYMENT_VENDING)
to_chat(user, span_warning("You do not possess the funds to purchase that."))
atom_parent.balloon_alert(user, "needs [total_cost] credit\s!")
atom_parent.balloon_alert(user, "needs [total_cost] libre!") // DOPPLER EDIT: credits > libre
return FALSE
//target_acc.transfer_money(idcard.registered_account, total_cost, "Nanotrasen: Usage of Corporate Machinery") // ORIGINAL
target_acc.transfer_money(idcard.registered_account, total_cost, "The Port Authority: Usage of Corporate Machinery") // DOPPLER EDIT - NT -> PA
log_econ("[total_cost] credits were spent on [parent] by [user] via [idcard.registered_account.account_holder]'s card.")
idcard.registered_account.bank_card_talk("[total_cost] credits deducted from your account.")
log_econ("[total_cost] libre were spent on [parent] by [user] via [idcard.registered_account.account_holder]'s card.") // DOPPLER EDIT: credits > libre
idcard.registered_account.bank_card_talk("[total_cost] libre deducted from your account.") // DOPPLER EDIT: credits > libre
playsound(src, 'sound/effects/cashregister.ogg', 20, TRUE)
SSeconomy.track_purchase(idcard.registered_account, total_cost, parent)
return TRUE
Expand Down
6 changes: 3 additions & 3 deletions code/datums/station_traits/neutral_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,9 @@

id_card.forceMove(wallet)

var/holochip_amount = id_card.registered_account.account_balance
new /obj/item/holochip(wallet, holochip_amount)
id_card.registered_account.adjust_money(-holochip_amount, "System: Withdrawal")
var/cash_amount = id_card.registered_account.account_balance // DOPPLER EDIT: spawns a wad of cash instead of a holochip
new /obj/item/libre/bundle(wallet, cash_amount)
id_card.registered_account.adjust_money(-cash_amount, "System: Withdrawal")

new /obj/effect/spawner/random/entertainment/wallet_storage(wallet)

Expand Down
8 changes: 4 additions & 4 deletions code/modules/vending/_vending.dm
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ GLOBAL_LIST_EMPTY(vending_machines_to_restock)
///fontawesome icon name to use in to display the user's balance in the vendor UI
var/displayed_currency_icon = "coins"
///String of the used currency to display in the vendor UI
var/displayed_currency_name = " cr"
var/displayed_currency_name = " ♎︎" // DOPPLER EDIT: cr to ♎︎
///Whether our age check is currently functional
var/age_restrictions = TRUE
/// How many credits does this vending machine have? 20% of all sales go to this pool, and are given freely when the machine is restocked, or successfully tilted. Lost on deconstruction.
Expand Down Expand Up @@ -1852,10 +1852,10 @@ GLOBAL_LIST_EMPTY(vending_machines_to_restock)
payee.adjust_money(-dispensed_item.custom_price, , "Vending: [dispensed_item]")
linked_account.adjust_money(dispensed_item.custom_price, "Vending: [dispensed_item] Bought")
linked_account.bank_card_talk("[payee.account_holder] made a [dispensed_item.custom_price] \
cr purchase at your custom vendor.")
/// Log the transaction
♎︎ purchase at your custom vendor.")
/// Log the transaction // DOPPLER EDIT: cr to ♎︎
SSblackbox.record_feedback("amount", "vending_spent", dispensed_item.custom_price)
log_econ("[dispensed_item.custom_price] credits were spent on [src] buying a \
log_econ("[dispensed_item.custom_price] libre were spent on [src] buying a \
[dispensed_item] by [payee.account_holder], owned by [linked_account.account_holder].")
/// Make an alert
if(last_shopper != REF(usr) || purchase_message_cooldown < world.time)
Expand Down
3 changes: 3 additions & 0 deletions modular_doppler/dopple_cash/items/dopplecash.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
value += amount
update_appearance()

/obj/item/libre/get_item_credit_value()
return (value)

/obj/item/libre/proc/transfer_value(amount, obj/item/libre/target)
amount = clamp(amount, 0, value)
value -= amount
Expand Down

0 comments on commit faf2539

Please sign in to comment.