PlayerGachaBannerInfo.java 2.48 KB
Newer Older
Melledy's avatar
Melledy committed
1
2
package emu.grasscutter.game.gacha;

3
import dev.morphia.annotations.Entity;
4
5
import lombok.Getter;
import lombok.Setter;
6
7

@Entity
Melledy's avatar
Melledy committed
8
public class PlayerGachaBannerInfo {
9
10
11
	@Getter @Setter private int totalPulls = 0;
	@Getter @Setter private int pity5 = 0;
	@Getter @Setter private int pity4 = 0;
Melledy's avatar
Melledy committed
12
	private int failedFeaturedItemPulls = 0;
AnimeGitB's avatar
AnimeGitB committed
13
14
15
16
17
	private int failedFeatured4ItemPulls = 0;
	private int pity5Pool1 = 0;
	private int pity5Pool2 = 0;
	private int pity4Pool1 = 0;
	private int pity4Pool2 = 0;
CamChua_VN's avatar
CamChua_VN committed
18

19
20
21
22
23
	@Getter @Setter private int failedChosenItemPulls = 0;
	@Getter @Setter private int wishItemId = 0;

	public void addTotalPulls(int amount) {
		this.totalPulls += amount;
Melledy's avatar
Melledy committed
24
	}
25

Melledy's avatar
Melledy committed
26
27
28
	public void addPity5(int amount) {
		this.pity5 += amount;
	}
29

Melledy's avatar
Melledy committed
30
31
32
	public void addPity4(int amount) {
		this.pity4 += amount;
	}
CamChua_VN's avatar
CamChua_VN committed
33
34
35
36

	public void addFailedChosenItemPulls(int amount) {
		failedChosenItemPulls += amount;
	}
Melledy's avatar
Melledy committed
37
	
AnimeGitB's avatar
AnimeGitB committed
38
39
40
41
42
	public int getFailedFeaturedItemPulls(int rarity) {
		return switch (rarity) {
			case 4 -> failedFeatured4ItemPulls;
			default -> failedFeaturedItemPulls;  // 5
		};
Melledy's avatar
Melledy committed
43
44
	}
	
AnimeGitB's avatar
AnimeGitB committed
45
46
47
48
49
	public void setFailedFeaturedItemPulls(int rarity, int amount) {
		switch (rarity) {
			case 4 -> failedFeatured4ItemPulls = amount;
			default -> failedFeaturedItemPulls = amount;  // 5
		};
Melledy's avatar
Melledy committed
50
51
	}
	
AnimeGitB's avatar
AnimeGitB committed
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
111
112
113
114
	public void addFailedFeaturedItemPulls(int rarity, int amount) {
		switch (rarity) {
			case 4 -> failedFeatured4ItemPulls += amount;
			default -> failedFeaturedItemPulls += amount;  // 5
		};
	}
	
	public int getPityPool(int rarity, int pool) {
		return switch (rarity) {
			case 4 -> switch (pool) {
				case 1 -> pity4Pool1;
				default -> pity4Pool2;
			};
			default -> switch (pool) {
				case 1 -> pity5Pool1;
				default -> pity5Pool2;
			};
		};
	}
	
	public void setPityPool(int rarity, int pool, int amount) {
		switch (rarity) {
			case 4:
				switch (pool) {
					case 1 -> pity4Pool1 = amount;
					default -> pity4Pool2 = amount;
				};
				break;
			case 5:
			default:
				switch (pool) {
					case 1 -> pity5Pool1 = amount;
					default -> pity5Pool2 = amount;
				};
				break;
		};
	}
	
	public void addPityPool(int rarity, int pool, int amount) {
		switch (rarity) {
			case 4:
				switch (pool) {
					case 1 -> pity4Pool1 += amount;
					default -> pity4Pool2 += amount;
				};
				break;
			case 5:
			default:
				switch (pool) {
					case 1 -> pity5Pool1 += amount;
					default -> pity5Pool2 += amount;
				};
				break;
		};
	}

	public void incPityAll() {
		pity4++;
		pity5++;
		pity4Pool1++;
		pity4Pool2++;
		pity5Pool1++;
		pity5Pool2++;
Melledy's avatar
Melledy committed
115
116
	}
}