Part 1 of economy rework: Spacecash refactor - See commit for full changelog.

* Implements stacking and stack overlays
 * Simplified tiers of cash (1,10,100,500,1000, may remove 500)
 * Simplified API (dispense_cash, count_cash)

Conflicts:
	code/modules/admin/admin_verbs.dm
	code/modules/admin/verbs/debug.dm
	code/modules/economy/ATM.dm
This commit is contained in:
Rob Nelson
2014-04-19 20:47:41 -04:00
committed by ZomgPonies
parent b34d436756
commit 56d8ce28c8
10 changed files with 124 additions and 38 deletions
+1
View File
@@ -95,6 +95,7 @@ var/list/admin_verbs_fun = list(
/client/proc/toggle_random_events,
/client/proc/set_ooc,
/client/proc/editappear,
/client/proc/gib_money // /vg/
)
var/list/admin_verbs_spawn = list(
/datum/admins/proc/spawn_atom, /*allows us to spawn instances*/
+9
View File
@@ -1087,3 +1087,12 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
log_admin("[key_name(src)] has toggled [M.key]'s [blockname] block [state]!")
else
alert("Invalid mob")
/client/proc/gib_money()
set category = "Fun"
set name = "Dispense Money"
set desc = "Honk"
var/response = input(src,"How much moneys?") as num
if( response < 1) return
dispense_cash(response, mob.loc)
+7 -2
View File
@@ -72,7 +72,7 @@ log transactions
//short out the machine, shoot sparks, spew money!
emagged = 1
spark_system.start()
spawn_money(rand(100,500),src.loc)
dispense_cash(rand(100,500),src.loc)
//we don't want to grief people by locking their id in an emagged ATM
release_held_id(user)
@@ -309,7 +309,7 @@ log transactions
//remove the money
authenticated_account.money -= amount
spawn_money(amount,src.loc)
dispense_cash(amount,src.loc)
//create an entry in the account transaction log
var/datum/transaction/T = new()
@@ -365,6 +365,11 @@ log transactions
src.attack_hand(usr)
//create the most effective combination of notes to make up the requested amount
/obj/machinery/atm/proc/withdraw_arbitrary_sum(var/arbitrary_sum)
dispense_cash(arbitrary_sum,get_turf(src))
//stolen wholesale and then edited a bit from newscasters, which are awesome and by Agouri
/obj/machinery/atm/proc/scan_user(mob/living/carbon/human/human_user as mob)
if(!authenticated_account)
-8
View File
@@ -64,11 +64,3 @@
desc = "It's worth 1000 credits."
worth = 1000
proc/spawn_money(var/sum, spawnloc)
var/cash_type
for(var/i in list(1000,500,200,100,50,20,10,1))
cash_type = text2path("/obj/item/weapon/spacecash/c[i]")
while(sum >= i)
sum -= i
new cash_type(spawnloc)
return
+1 -2
View File
@@ -44,8 +44,7 @@
return "\[NO TAGS\]"
var/str=""
if(artist!="")
str += "[artist]"
str += " - "
str += "[artist] - "
if(title!="")
str += "\"[title]\""
else
@@ -1089,23 +1089,7 @@
icon_state = "spawner"
potency = 10
New()
switch(rand(1,100))//(potency) //It wants to use the default potency instead of the new, so it was always 10. Will try to come back to this later - Cheridan
if(0 to 10)
new/obj/item/weapon/spacecash/(src.loc)
if(11 to 20)
new/obj/item/weapon/spacecash/c10(src.loc)
if(21 to 30)
new/obj/item/weapon/spacecash/c20(src.loc)
if(31 to 40)
new/obj/item/weapon/spacecash/c50(src.loc)
if(41 to 50)
new/obj/item/weapon/spacecash/c100(src.loc)
if(51 to 60)
new/obj/item/weapon/spacecash/c200(src.loc)
if(61 to 80)
new/obj/item/weapon/spacecash/c500(src.loc)
else
new/obj/item/weapon/spacecash/c1000(src.loc)
dispense_cash(rand(1,100)*10,src.loc)//(potency) //It wants to use the default potency instead of the new, so it was always 10. Will try to come back to this later - Cheridan
spawn(5) //Workaround to keep harvesting from working weirdly.
del(src)