Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NON MODULAR] [WIP!] adds libre and orion currencies #185

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/__DEFINES/is_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ GLOBAL_LIST_INIT(turfs_pass_meteor, typecacheof(list(

#define ispickedupmob(A) (istype(A, /obj/item/clothing/head/mob_holder)) // Checks if clothing item is actually a held mob

#define iscash(A) (istype(A, /obj/item/coin) || istype(A, /obj/item/stack/spacecash) || istype(A, /obj/item/holochip))
#define iscash(A) (istype(A, /obj/item/coin) || istype(A, /obj/item/stack/spacecash) || istype(A, /obj/item/holochip) || istype(A, /obj/item/libre))

#define isbodypart(A) (istype(A, /obj/item/bodypart))

Expand Down
7 changes: 5 additions & 2 deletions code/game/machinery/bank_machine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
else if(istype(weapon, /obj/item/holochip))
var/obj/item/holochip/inserted_holochip = weapon
value = inserted_holochip.credits
else if(istype(weapon, /obj/item/libre/bundle)) // DOPPLER EDIT: you can turn holochips into normal money, if you somehow get a hold of that sort of thing after I'm through
var/obj/item/libre/bundle/inserted_libre = weapon
value = inserted_libre.value
if(value)
if(synced_bank_account)
synced_bank_account.adjust_money(value)
Expand Down Expand Up @@ -125,8 +128,8 @@
/obj/machinery/computer/bank_machine/proc/end_siphon()
siphoning = FALSE
unauthorized = FALSE
if(syphoning_credits > 0)
new /obj/item/holochip(drop_location(), syphoning_credits) //get the loot
if(syphoning_credits > 0) // DOPPLER EDIT: from holocredits to normalcash
new /obj/item/libre/bundle(drop_location(), syphoning_credits) //get the loot
syphoning_credits = 0

/obj/machinery/computer/bank_machine/proc/start_siphon(mob/living/carbon/user)
Expand Down
52 changes: 26 additions & 26 deletions code/game/machinery/slotmachine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define SPIN_TIME 65 //As always, deciseconds.
#define REEL_DEACTIVATE_DELAY 7
#define JACKPOT_SEVENS FA_ICON_7
#define HOLOCHIP 1
#define CASH 1 // DOPPLER EDIT: previously HOLOCHIP. replaced with cash in the great fuckup; far from modular.
#define COIN 2

/obj/machinery/computer/slot_machine
Expand All @@ -30,7 +30,7 @@
var/working = FALSE
var/balance = 0 //How much money is in the machine, ready to be CONSUMED.
var/jackpots = 0
var/paymode = HOLOCHIP //toggles between HOLOCHIP/COIN, defined above
var/paymode = CASH // DOPPLER EDIT: toggles between CASH/COIN, defined above
var/cointype = /obj/item/coin/iron //default cointype
/// Icons that can be displayed by the slot machine.
var/static/list/icons = list(
Expand Down Expand Up @@ -114,17 +114,17 @@
qdel(inserted_coin)
return ITEM_INTERACT_SUCCESS
else
balloon_alert(user, "holochips only!")
balloon_alert(user, "cash only!") // DOPPLER EDIT
return ITEM_INTERACT_BLOCKING

if(istype(inserted, /obj/item/holochip))
if(paymode == HOLOCHIP)
var/obj/item/holochip/inserted_chip = inserted
if(!user.temporarilyRemoveItemFromInventory(inserted_chip))
if(istype(inserted, /obj/item/libre/bundle))
if(paymode == CASH)
var/obj/item/libre/bundle/inserted_cash = inserted
if(!user.temporarilyRemoveItemFromInventory(inserted_cash))
return ITEM_INTERACT_BLOCKING
balloon_alert(user, "[inserted_chip.credits] credit[inserted_chip.credits == 1 ? "" : "s"] inserted")
balance += inserted_chip.credits
qdel(inserted_chip)
balloon_alert(user, "[inserted_cash.value] credit[inserted_cash.value == 1 ? "" : "s"] inserted")
balance += inserted_cash.value
qdel(inserted_cash) // DOPPLER EDIT ENDS HERE (for a moment)
return ITEM_INTERACT_SUCCESS
else
balloon_alert(user, "coins only!")
Expand All @@ -137,12 +137,12 @@
visible_message("<b>[src]</b> says, 'ERROR! Please empty the machine balance before altering paymode'") //Prevents converting coins into holocredits and vice versa
return ITEM_INTERACT_BLOCKING

if(paymode == HOLOCHIP)
if(paymode == CASH) // DOPPLER EDIT: yeah, I thought this was weird too
paymode = COIN
balloon_alert(user, "now using coins")
balloon_alert(user, "now using material coins")
else
paymode = HOLOCHIP
balloon_alert(user, "now using holochips")
paymode = CASH
balloon_alert(user, "now using Libres") // END DOPPLER EDIT (for now)
return ITEM_INTERACT_SUCCESS

/obj/machinery/computer/slot_machine/emag_act(mob/user, obj/item/card/emag/emag_card)
Expand Down Expand Up @@ -306,12 +306,12 @@

else if(check_jackpot(JACKPOT_SEVENS))
var/prize = money + JACKPOT
visible_message("<b>[src]</b> says, 'JACKPOT! You win [prize] credits!'")
visible_message("<b>[src]</b> says, 'JACKPOT! You win [prize] Libres!'")
priority_announce("Congratulations to [user ? user.real_name : usrname] for winning the jackpot at the slot machine in [get_area(src)]!")
jackpots += 1
money = 0
if(paymode == HOLOCHIP)
new /obj/item/holochip(loc, prize)
if(paymode == CASH) // DOPPLER EDIT
new /obj/item/libre/bundle(loc, prize)
else
for(var/i in 1 to 5)
cointype = pick(subtypesof(/obj/item/coin))
Expand All @@ -321,11 +321,11 @@
sleep(REEL_DEACTIVATE_DELAY)

else if(linelength == 5)
visible_message("<b>[src]</b> says, 'Big Winner! You win a thousand credits!'")
visible_message("<b>[src]</b> says, 'Big Winner! You win a thousand Libres!'")
give_money(BIG_PRIZE)

else if(linelength == 4)
visible_message("<b>[src]</b> says, 'Winner! You win four hundred credits!'")
visible_message("<b>[src]</b> says, 'Winner! You win four hundred Libres!'")
give_money(SMALL_PRIZE)

else if(linelength == 3)
Expand Down Expand Up @@ -375,10 +375,10 @@
money -= amount_to_give
balance += surplus

/// Pay out the specified amount in either coins or holochips
/// Pay out the specified amount in either coins or (DOPPLER EDIT) cash!
/obj/machinery/computer/slot_machine/proc/give_payout(amount)
if(paymode == HOLOCHIP)
cointype = /obj/item/holochip
if(paymode == CASH)
cointype = /obj/item/libre/bundle
else
cointype = obj_flags & EMAGGED ? /obj/item/coin/iron : /obj/item/coin/silver

Expand All @@ -395,11 +395,11 @@
/// Dispense the given amount. If machine is set to use coins, will use the specified coin type.
/// If throwit and target are set, will launch the payment at the target
/obj/machinery/computer/slot_machine/proc/dispense(amount = 0, cointype = /obj/item/coin/silver, throwit = FALSE, mob/living/target)
if(paymode == HOLOCHIP)
var/obj/item/holochip/chip = new /obj/item/holochip(loc,amount)
if(paymode == CASH)
var/obj/item/libre/bundle/payload = new /obj/item/libre/bundle(loc,amount)

if(throwit && target)
chip.throw_at(target, 3, 10)
payload.throw_at(target, 3, 10)
else
var/value = coinvalues["[cointype]"]
if(value <= 0)
Expand All @@ -417,7 +417,7 @@

#undef BIG_PRIZE
#undef COIN
#undef HOLOCHIP
#undef CASH // DOPPLER EDIT: previously HOLOCHIP
#undef JACKPOT
#undef REEL_DEACTIVATE_DELAY
#undef JACKPOT_SEVENS
Expand Down
38 changes: 21 additions & 17 deletions code/game/objects/items/cards_ids.dm
Original file line number Diff line number Diff line change
Expand Up @@ -580,31 +580,34 @@
if(ispath(trim))
SSid_access.apply_trim_to_card(src, trim)

/obj/item/card/id/item_interaction(mob/living/user, obj/item/tool, list/modifiers)
if(istype(tool, /obj/item/rupee))
to_chat(user, span_warning("Your ID smartly rejects the strange shard of glass. Who knew, apparently it's not ACTUALLY valuable!"))
/obj/item/card/id/item_interaction(mob/living/user, obj/item/tool, list/modifiers) // DOPPLER EDIT - REMOVING INSERT_MONEY AND HOLOCHIPS. I also had to remove the rupee interaction, but that doesn't seem a great loss.
// if(istype(tool, /obj/item/rupee))
// to_chat(user, span_warning("Your ID smartly rejects the strange shard of glass. Who knew, apparently it's not ACTUALLY valuable!"))
// return ITEM_INTERACT_BLOCKING
if(iscash(tool))
to_chat(user, span_notice("You'll need to visit an ATM to get your money into your account."))
return ITEM_INTERACT_BLOCKING
else if(iscash(tool))
return insert_money(tool, user) ? ITEM_INTERACT_SUCCESS : ITEM_INTERACT_BLOCKING
else if(istype(tool, /obj/item/storage/bag/money))
// return insert_money(tool, user) ? ITEM_INTERACT_SUCCESS : ITEM_INTERACT_BLOCKING

/** else if(istype(tool, /obj/item/storage/bag/money))
var/obj/item/storage/bag/money/money_bag = tool
var/list/money_contained = money_bag.contents
var/money_added = mass_insert_money(money_contained, user)
if(!money_added)
return ITEM_INTERACT_BLOCKING
to_chat(user, span_notice("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 ITEM_INTERACT_SUCCESS
return ITEM_INTERACT_SUCCESS [END DOPPLER EDIT SEGMENT] **/
return NONE

/**
/** DOPPLER EDIT - REMOVING INSERT_MONEY AND HOLOCHIPS
* Insert credits or coins into the ID card and add their value to the associated bank account.
*
* Returns TRUE if the money was successfully inserted, FALSE otherwise.
* Arguments:
* money - The item to attempt to convert to credits and insert into the card.
* user - The user inserting the item.
* physical_currency - Boolean, whether this is a physical currency such as a coin and not a holochip.
*/

/obj/item/card/id/proc/insert_money(obj/item/money, mob/user)
var/physical_currency
if(istype(money, /obj/item/stack/spacecash) || istype(money, /obj/item/coin))
Expand Down Expand Up @@ -636,7 +639,7 @@
* money - List of items to attempt to convert to credits and insert into the card.
* user - The user inserting the items.
*/
/obj/item/card/id/proc/mass_insert_money(list/money, mob/user)
/obj/item/card/id/proc/mass_insert_money(list/money, mob/user)
if(!registered_account)
to_chat(user, span_warning("[src] doesn't have a linked account to deposit into!"))
return FALSE
Expand All @@ -655,7 +658,7 @@
log_econ("[total] credits were inserted into [src] owned by [src.registered_name]")
QDEL_LIST(money)

return total
return total END DOPPLER EDIT SEGMENT **/

/// Helper proc. Can the user alt-click the ID?
/obj/item/card/id/proc/alt_click_can_use_id(mob/living/user)
Expand Down Expand Up @@ -695,7 +698,7 @@
if(!alt_click_can_use_id(user))
return NONE
if(registered_account.account_debt)
var/choice = tgui_alert(user, "Choose An Action", "Bank Account", list("Withdraw", "Pay Debt"))
var/choice = tgui_alert(user, "Choose An Action", "Bank Account", list("Pay Debt"))
if(!choice || QDELETED(user) || QDELETED(src) || !alt_click_can_use_id(user) || loc != user)
return CLICK_ACTION_BLOCKING
if(choice == "Pay Debt")
Expand All @@ -714,7 +717,7 @@
if(choice == "Link Account")
set_new_account(user)
return CLICK_ACTION_SUCCESS
var/amount_to_remove = tgui_input_number(user, "How much do you want to withdraw? (Max: [registered_account.account_balance] cr)", "Withdraw Funds", max_value = registered_account.account_balance)
/** var/amount_to_remove = tgui_input_number(user, "How much do you want to withdraw? (Max: [registered_account.account_balance] cr)", "Withdraw Funds", max_value = registered_account.account_balance)
if(!amount_to_remove || QDELETED(user) || QDELETED(src) || issilicon(user) || loc != user)
return CLICK_ACTION_BLOCKING
if(!alt_click_can_use_id(user))
Expand All @@ -728,7 +731,8 @@
return CLICK_ACTION_SUCCESS
else
var/difference = amount_to_remove - registered_account.account_balance
registered_account.bank_card_talk(span_warning("ERROR: The linked account requires [difference] more credit\s to perform that withdrawal."), TRUE)
registered_account.bank_card_talk(span_warning("ERROR: The linked account requires [difference] more credit\s to perform that withdrawal."), TRUE) **/
else
return CLICK_ACTION_BLOCKING

/obj/item/card/id/click_alt_secondary(mob/user)
Expand Down Expand Up @@ -763,7 +767,7 @@
. += span_notice("Alt-Right-Click the ID to set the linked bank account.")

if(HAS_TRAIT(user, TRAIT_ID_APPRAISER))
. += HAS_TRAIT(src, TRAIT_JOB_FIRST_ID_CARD) ? span_boldnotice("Hmm... yes, this ID was issued from Central Command!") : span_boldnotice("This ID was created in this sector, not by Central Command.")
. += HAS_TRAIT(src, TRAIT_JOB_FIRST_ID_CARD) ? span_boldnotice("Hmm... yes, this ID was issued by the Port Authority!") : span_boldnotice("This ID was created in this sector, not by the Port Authority.") // DOPPLER EDIT - while I'm here...
if(HAS_TRAIT(src, TRAIT_TASTEFULLY_THICK_ID_CARD) && (user.is_holding(src) || (user.CanReach(src) && user.put_in_hands(src, ignore_animation = FALSE))))
ADD_TRAIT(src, TRAIT_NODROP, "psycho")
. += span_hypnophrase("Look at that subtle coloring... The tasteful thickness of it. Oh my God, it even has a watermark...")
Expand Down Expand Up @@ -864,8 +868,8 @@
return trim?.sechud_icon_state || SECHUD_UNKNOWN

/obj/item/card/id/interact_with_atom(atom/interacting_with, mob/living/user, list/modifiers)
if(iscash(interacting_with))
return insert_money(interacting_with, user) ? ITEM_INTERACT_SUCCESS : ITEM_INTERACT_BLOCKING
//if(iscash(interacting_with)) DOPPLER EDIT - REMOVING INSERT_MONEY AND HOLOCHIPS
// return insert_money(interacting_with, user) ? ITEM_INTERACT_SUCCESS : ITEM_INTERACT_BLOCKING
return NONE

/obj/item/card/id/away
Expand Down
8 changes: 4 additions & 4 deletions code/modules/modular_computers/computers/item/computer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -822,8 +822,8 @@
if(isidcard(tool))
return InsertID(tool, user) ? ITEM_INTERACT_SUCCESS : ITEM_INTERACT_BLOCKING

if(iscash(tool))
return money_act(user, tool)
//if(iscash(tool)) DOPPLER EDIT - removing ID money insertion.
// return money_act(user, tool)

if(istype(tool, /obj/item/pai_card))
return pai_act(user, tool)
Expand All @@ -849,12 +849,12 @@
if(istype(tool, /obj/item/computer_disk))
return computer_disk_act(user, tool)

/obj/item/modular_computer/proc/money_act(mob/user, obj/item/money)
/** /obj/item/modular_computer/proc/money_act(mob/user, obj/item/money) DOPPLER EDIT - removing insert_money. Sneaky one, this.
var/obj/item/card/id/inserted_id = computer_id_slot?.GetID()
if(!inserted_id)
balloon_alert(user, "no ID!")
return ITEM_INTERACT_BLOCKING
return inserted_id.insert_money(money, user) ? ITEM_INTERACT_SUCCESS : ITEM_INTERACT_BLOCKING
return inserted_id.insert_money(money, user) ? ITEM_INTERACT_SUCCESS : ITEM_INTERACT_BLOCKING **/

/obj/item/modular_computer/proc/pai_act(mob/user, obj/item/pai_card/card)
if(inserted_pai)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/modular_computers/computers/item/pda.dm
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@
return . || NONE

/obj/item/modular_computer/pda/interact_with_atom(atom/interacting_with, mob/living/user, list/modifiers)
if(iscash(interacting_with))
return money_act(user,interacting_with)
// if(iscash(interacting_with))
// return money_act(user,interacting_with)
return NONE

/obj/item/modular_computer/pda/item_interaction(mob/living/user, obj/item/tool, list/modifiers)
Expand Down
Binary file added modular_doppler/dopple_cash/icons/atm.dmi
Binary file not shown.
Binary file not shown.
Binary file added modular_doppler/dopple_cash/icons/money_orion.dmi
Binary file not shown.
Binary file added modular_doppler/dopple_cash/icons/money_orions.dmi
Binary file not shown.
Loading
Loading