forked from AnalogMan151/sumoCheatMenu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
currency_modifiers.c
87 lines (71 loc) · 2.5 KB
/
currency_modifiers.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// Filename: currency_modifiers.c
#include "cheats.h"
#include "hid.h"
/********************************
* *
* Currency Modifiers *
* *
********************************/
static u32 quantity = 500000;
// Currency menu entry
void currencyMenu(void) {
new_spoiler("Currency");
new_entry_managed("Increase Quantity +500,000", increaseCurrencyQuantity, INCREASECURRENCYQUANTITY, AUTO_DISABLE);
new_separator();
new_entry_managed("Poke Dollars xCCCCCCC", maxMoney, MAXMONEY, EXECUTE_ONCE);
new_entry_managed("Battle Points xCCCCCCC", maxBP, MAXBP, EXECUTE_ONCE);
new_entry_managed("Festival Coins xCCCCCCC", maxCoins, MAXCOINS, EXECUTE_ONCE);
new_entry_managed("Total Festival Coins xCCCCCCC", totalCoins, TOTALCOINS, EXECUTE_ONCE);
new_entry_managed("Thumbs Up xCCCCCCC", totalThumbs, TOTALTHUMBS, EXECUTE_ONCE);
new_line();
exit_spoiler();
updateCurrencyQuantity();
}
// Increases currency quantity by 500,000
void increaseCurrencyQuantity(void) {
switch(quantity) {
case 9999999:
quantity = 500000;
break;
case 9500000:
quantity = 9999999;
break;
default:
quantity += 500000;
}
updateCurrencyQuantity();
}
// Updates currency quantity on menu and limits value for Max BP and Max FC
void updateCurrencyQuantity(void) {
char buf[9];
xsprintf(buf, "x%-7d", quantity);
replace_pattern("x*******", buf, MAXMONEY);
replace_pattern("x*******", buf, TOTALCOINS);
replace_pattern("x*******", buf, TOTALTHUMBS);
replace_pattern("x*******", (quantity > 9999) ? "x9999 " : buf, MAXBP);
replace_pattern("x*******", (quantity > 999999) ? "x999999 " : buf, MAXCOINS);
}
// Set Poké Dollars
void maxMoney(void) {
WRITEU32(0x330D8FC0, quantity);
}
// Set current Festival Coins to 999,999
void maxCoins(void) {
WRITEU32(0x33124D58, (quantity > 999999) ? 0x000F423F : quantity);
}
// Set total Festival Coins and also updates spent amount to match
void totalCoins(void) {
u32 current = READU32(0x33124D58);
u32 total = quantity;
u32 spent = total - current;
WRITEU32(0x3313DCE8, spent);
WRITEU32(0x33124D5C, total);
}
// Set total Thumbs Up for photos
void totalThumbs(void) {
WRITEU32(0x33138B8C, quantity);
}
// Set Battle Points
void maxBP(void) {
WRITEU16(0x330D90D8, (quantity > 9999) ? 0x270F : quantity);
}