Money spawning.

This commit is contained in:
Segrain
2013-10-21 05:06:46 +03:00
parent 9a662594f2
commit 188e68feb8
2 changed files with 11 additions and 29 deletions

View File

@@ -282,7 +282,7 @@ log transactions
//remove the money
authenticated_account.money -= amount
withdraw_arbitrary_sum(amount)
spawn_money(amount,src.loc)
//create an entry in the account transaction log
var/datum/transaction/T = new()
@@ -340,33 +340,6 @@ 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)
while(arbitrary_sum >= 1000)
arbitrary_sum -= 1000
new /obj/item/weapon/spacecash/c1000(src)
while(arbitrary_sum >= 500)
arbitrary_sum -= 500
new /obj/item/weapon/spacecash/c500(src)
while(arbitrary_sum >= 200)
arbitrary_sum -= 200
new /obj/item/weapon/spacecash/c200(src)
while(arbitrary_sum >= 100)
arbitrary_sum -= 100
new /obj/item/weapon/spacecash/c100(src)
while(arbitrary_sum >= 50)
arbitrary_sum -= 50
new /obj/item/weapon/spacecash/c50(src)
while(arbitrary_sum >= 20)
arbitrary_sum -= 20
new /obj/item/weapon/spacecash/c20(src)
while(arbitrary_sum >= 10)
arbitrary_sum -= 10
new /obj/item/weapon/spacecash/c10(src)
while(arbitrary_sum >= 1)
arbitrary_sum -= 1
new /obj/item/weapon/spacecash(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)

View File

@@ -62,4 +62,13 @@
name = "1000 credit chip"
icon_state = "spacecash1000"
desc = "It's worth 1000 credits."
worth = 1000
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