forked from hhaslam11/Text-Fighter
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Stats.java
110 lines (100 loc) · 4.58 KB
/
Stats.java
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
package com.hotmail.kalebmarc.textfighter.player;
import com.hotmail.kalebmarc.textfighter.item.FirstAid;
import com.hotmail.kalebmarc.textfighter.item.InstaHealth;
import com.hotmail.kalebmarc.textfighter.item.Power;
import com.hotmail.kalebmarc.textfighter.main.*;
public class Stats {
//Battle Stats
public static int highScore;
public static int kills;
public static int totalDamageDealt;
public static int totalKills;
public static int bulletsFired;
public static int bulletsThatHit;
//Coins
public static int totalCoinsSpent;
public static int coinsSpentOnWeapons;
public static int coinsSpentOnHealth;
public static int coinsSpentOnPoison;
public static int coinsSpentOnBankInterest;
public static int xpBought;
//Other
public static int timesCheated;
public static int timesQuit;
public static int itemsCrafted;
public static int diceGamesPlayed;
public static int slotGamesPlayed;
public static int lotteryTicketsBought;
public static int lotteryWon;
public static int blackjackGamesPlayed;
private static String killDeathRatio;
private Stats() {
}
public static void view() {
updateKillDeathRatio();
Ui.cls();
Ui.println("-------------------------------------------------");
Ui.println(" PLAYER STATS ");
Ui.println();
Ui.println("Battle stats:");
Ui.println(" High Score - " + highScore);
Ui.println(" Current Kill Streak - " + kills);
Ui.println(" Total POWER's Used - " + Power.used);
Ui.println(" Current Weapon - " + Weapon.get().getName());
Ui.println(" Current Enemy - " + com.hotmail.kalebmarc.textfighter.main.Enemy.get().getName());
Ui.println(" Total Damage Dealt - " + totalDamageDealt);
Ui.println(" Total Kills - " + totalKills);
Ui.println(" Bullets Fired - " + bulletsFired);
Ui.println(" Bullets that hit - " + bulletsThatHit);
Ui.println(" K:D - " + killDeathRatio);
Ui.println();
Ui.println("Coins:");
Ui.println(" Coins - " + Coins.get());
Ui.println(" Coins in bank - " + Bank.get());
Ui.println(" Total Coins Won in Casino - " + Casino.totalCoinsWon);
Ui.println(" Total Games Played in Casino - " + Casino.gamesPlayed);
Ui.println(" Total coins spent - " + totalCoinsSpent);
Ui.println(" Coins spent on bank interest - " + coinsSpentOnBankInterest);
Ui.println(" Coins spent on weapons - " + coinsSpentOnWeapons);
Ui.println(" Coins spent on health - " + coinsSpentOnHealth);
Ui.println(" Coins spent on poison - " + coinsSpentOnPoison);
Ui.println(" XP bought - " + xpBought);
Ui.println();
Ui.println("Health:");
Ui.println(" Health - " + Health.getStr());
Ui.println(" Insta-Healths used - " + InstaHealth.used);
Ui.println(" First-Aid kits used - " + FirstAid.used);
Ui.println(" Potions used - " + (Potion.spUsed + Potion.rpUsed + Potion.ppUsed));
Ui.println(" Times Died - " + Health.timesDied);
Ui.println(" Food items eaten - " + Food.totalEaten);
Ui.println();
Ui.println("Other: ");
Ui.println(" Cheats Enabled? - " + Cheats.enabled());
Ui.println(" Level - " + Xp.getLevel());
Ui.println(" Xp - " + Xp.getFull());
Ui.println(" Total Xp gained - " + Xp.total);
Ui.println(" Times cheated - " + timesCheated);
Ui.println(" Times quit - " + timesQuit);
Ui.println(" Items Crafted - " + itemsCrafted);
Ui.println(" Dice Games Played - " + diceGamesPlayed);
Ui.println(" Slot Games Played - " + slotGamesPlayed);
Ui.println(" Blackjack Games Played - " + blackjackGamesPlayed);
Ui.println(" Lottery Tickets Bought - " + lotteryTicketsBought);
Ui.println(" Lotteries Won - " + lotteryWon);
Ui.println();
Ui.println("-------------------------------------------------");
Ui.pause();
}
private static void updateKillDeathRatio() {
int i, gcm = 1, first = totalKills, second = Health.timesDied;
i = (first >= second) ? first : second;
while (i != 0) {
if (first % i == 0 && second % i == 0) {
gcm = i;
break;
}
i--;
}
killDeathRatio = first / gcm + ":" + second / gcm;
}
}