Merge pull request #2432 from Tastyfish/master

Fixed how things get space cash worth, and richest escapee scoreboard line
This commit is contained in:
TheDZD
2015-10-31 16:12:05 -04:00
7 changed files with 29 additions and 35 deletions
+1 -1
View File
@@ -1203,7 +1203,7 @@ datum
check_completion()
var/held_credits = 0
for(var/obj/item/weapon/spacecash/M in owner.current.get_contents())
held_credits += M.worth
held_credits += M.get_total()
if(held_credits >= steal_amount)
return 1
return 0
+17 -9
View File
@@ -55,15 +55,7 @@
var/area/escape_zone = locate(/area/shuttle/escape/centcom)
if(E.stat != DEAD && location in escape_zone) // Escapee Scores
for(var/obj/item/weapon/card/id/C1 in E.contents)
cash_score += C1.money
for(var/obj/item/weapon/spacecash/C2 in E.contents)
cash_score += C2.worth
for(var/obj/item/weapon/storage/S in E.contents)
for(var/obj/item/weapon/card/id/C3 in S.contents)
cash_score += C3.money
for(var/obj/item/weapon/spacecash/C4 in S.contents)
cash_score += C4.worth
cash_score = get_score_container_worth(E)
if(cash_score > score_richestcash)
score_richestcash = cash_score
@@ -163,6 +155,22 @@
if(E.client.prefs && !(E.client.prefs.toggles & DISABLE_SCOREBOARD))
E.scorestats()
// A recursive function to properly determine the wealthiest escapee
/datum/controller/gameticker/proc/get_score_container_worth(atom/C, level=0)
if(level >= 5)
// in case the containers recurse or something
return 0
else
. = 0
for(var/obj/item/weapon/card/id/id in C.contents)
var/datum/money_account/A = get_money_account(id.associated_account_number)
// has an account?
if(A)
. += A.money
for(var/obj/item/weapon/spacecash/cash in C.contents)
. += cash.get_total()
for(var/obj/item/weapon/storage/S in C.contents)
. += .(S, level + 1)
/datum/game_mode/proc/get_scoreboard_stats()
return null
+2 -2
View File
@@ -292,7 +292,7 @@
* usr is the mob who gets the change.
*/
/obj/machinery/vending/proc/pay_with_cash(var/obj/item/weapon/spacecash/cashmoney, mob/user)
if(currently_vending.price > cashmoney.worth)
if(currently_vending.price > cashmoney.get_total())
// This is not a status display message, since it's something the character
// themselves is meant to see BEFORE putting the money in
usr << "\icon[cashmoney] <span class='warning'>That is not enough money.</span>"
@@ -304,7 +304,7 @@
// just assume that all spacecash that's not something else is a bill
visible_message("<span class='info'>[usr] inserts a credit chip into [src].</span>")
var/left = cashmoney.worth - currently_vending.price
var/left = cashmoney.get_total() - currently_vending.price
usr.unEquip(cashmoney)
qdel(cashmoney)
+4 -1
View File
@@ -56,6 +56,9 @@ var/global/list/moneytypes=list(
stack.color=stack_color
overlays += stack
/obj/item/weapon/spacecash/proc/get_total()
return worth * amount
/obj/item/weapon/spacecash/c10
icon_state = "cash10"
worth = 10
@@ -105,4 +108,4 @@ var/global/list/moneytypes=list(
/proc/count_cash(var/list/cash)
. = 0
for(var/obj/item/weapon/spacecash/C in cash)
. += C.amount * C.worth
. += C.get_total()
+4 -5
View File
@@ -13,8 +13,6 @@ log transactions
#define VIEW_TRANSACTION_LOGS 3
#define PRINT_DELAY 100
/obj/item/weapon/card/id/var/money = 2000
/obj/machinery/atm
name = "Nanotrasen Automatic Teller Machine"
desc = "For all your monetary needs!"
@@ -97,7 +95,8 @@ log transactions
else if(authenticated_account)
if(istype(I,/obj/item/weapon/spacecash))
//consume the money
authenticated_account.money += I:worth * I:amount
var/obj/item/weapon/spacecash/C = I
authenticated_account.money += C.get_total()
if(prob(50))
playsound(loc, 'sound/items/polaroid1.ogg', 50, 1)
else
@@ -107,13 +106,13 @@ log transactions
var/datum/transaction/T = new()
T.target_name = authenticated_account.owner_name
T.purpose = "Credit deposit"
T.amount = I:worth
T.amount = C.get_total()
T.source_terminal = machine_id
T.date = current_date_string
T.time = worldtime2text()
authenticated_account.transaction_log.Add(T)
user << "<span class='info'>You insert [I] into [src].</span>"
user << "<span class='info'>You insert [C] into [src].</span>"
src.attack_hand(user)
qdel(I)
else
+1 -1
View File
@@ -521,7 +521,7 @@ var/const/POS_HEADER = {"<html>
flick(src,"pos-error")
return
var/obj/item/weapon/spacecash/C=A
credits_held += C.worth*C.amount
credits_held += C.get_total()
if(credits_held >= credits_needed)
visible_message("\blue The machine beeps, and begins printing a receipt","You hear a beep and the sound of paper being shredded.")
PrintReceipt()
-16
View File
@@ -17,50 +17,34 @@
var/worth = 0
/obj/item/weapon/spacecash/c1
name = "1 credip chip"
icon_state = "spacecash"
desc = "It's worth 1 credit."
worth = 1
/obj/item/weapon/spacecash/c10
name = "10 credit chip"
icon_state = "spacecash10"
desc = "It's worth 10 credits."
worth = 10
/obj/item/weapon/spacecash/c20
name = "20 credit chip"
icon_state = "spacecash20"
desc = "It's worth 20 credits."
worth = 20
/obj/item/weapon/spacecash/c50
name = "50 credit chip"
icon_state = "spacecash50"
desc = "It's worth 50 credits."
worth = 50
/obj/item/weapon/spacecash/c100
name = "100 credit chip"
icon_state = "spacecash100"
desc = "It's worth 100 credits."
worth = 100
/obj/item/weapon/spacecash/c200
name = "200 credit chip"
icon_state = "spacecash200"
desc = "It's worth 200 credits."
worth = 200
/obj/item/weapon/spacecash/c500
name = "500 credit chip"
icon_state = "spacecash500"
desc = "It's worth 500 credits."
worth = 500
/obj/item/weapon/spacecash/c1000
name = "1000 credit chip"
icon_state = "spacecash1000"
desc = "It's worth 1000 credits."
worth = 1000