From 100d08ec5d44892d8fea7140bdc6aee72de4ace6 Mon Sep 17 00:00:00 2001
From: AnimeGitB <AnimeGitB@bigblueball.in>
Date: Sat, 26 Nov 2022 02:03:11 +1030
Subject: [PATCH] Fix up pity tallies for new BannerTypes Also fixes Beginner
 banner using Standard pity.

---
 .../game/gacha/PlayerGachaInfo.java           | 72 ++++++++++---------
 1 file changed, 39 insertions(+), 33 deletions(-)

diff --git a/src/main/java/emu/grasscutter/game/gacha/PlayerGachaInfo.java b/src/main/java/emu/grasscutter/game/gacha/PlayerGachaInfo.java
index 8dd0e380..275ad3d9 100644
--- a/src/main/java/emu/grasscutter/game/gacha/PlayerGachaInfo.java
+++ b/src/main/java/emu/grasscutter/game/gacha/PlayerGachaInfo.java
@@ -4,37 +4,43 @@ import dev.morphia.annotations.Entity;
 
 @Entity
 public class PlayerGachaInfo {
-	private PlayerGachaBannerInfo standardBanner;
-	private PlayerGachaBannerInfo eventCharacterBanner;
-	private PlayerGachaBannerInfo eventWeaponBanner;
-	
-	public PlayerGachaInfo() {
-		this.standardBanner = new PlayerGachaBannerInfo();
-		this.eventCharacterBanner = new PlayerGachaBannerInfo();
-		this.eventWeaponBanner = new PlayerGachaBannerInfo();
-	}
-	
-	public PlayerGachaBannerInfo getStandardBanner() {
-		return standardBanner;
-	}
-
-	public PlayerGachaBannerInfo getEventCharacterBanner() {
-		return eventCharacterBanner;
-	}
-	
-	public PlayerGachaBannerInfo getEventWeaponBanner() {
-		return eventWeaponBanner;
-	}
-
-	public PlayerGachaBannerInfo getBannerInfo(GachaBanner banner) {
-		switch (banner.getBannerType()) {
-			case EVENT:
-				return this.eventCharacterBanner;
-			case WEAPON:
-				return this.eventWeaponBanner;
-			case STANDARD:
-			default:
-				return this.standardBanner;
-		}
-	}
+    private PlayerGachaBannerInfo standardBanner;
+    private PlayerGachaBannerInfo beginnerBanner;
+    private PlayerGachaBannerInfo eventCharacterBanner;
+    private PlayerGachaBannerInfo eventWeaponBanner;
+
+    public PlayerGachaInfo() {
+        this.standardBanner = new PlayerGachaBannerInfo();
+        this.eventCharacterBanner = new PlayerGachaBannerInfo();
+        this.eventWeaponBanner = new PlayerGachaBannerInfo();
+    }
+
+    public PlayerGachaBannerInfo getStandardBanner() {
+        if (this.standardBanner == null) this.standardBanner = new PlayerGachaBannerInfo();
+        return this.standardBanner;
+    }
+
+    public PlayerGachaBannerInfo getBeginnerBanner() {
+        if (this.beginnerBanner == null) this.beginnerBanner = new PlayerGachaBannerInfo();
+        return this.beginnerBanner;
+    }
+
+    public PlayerGachaBannerInfo getEventCharacterBanner() {
+        if (this.eventCharacterBanner == null) this.eventCharacterBanner = new PlayerGachaBannerInfo();
+        return this.eventCharacterBanner;
+    }
+
+    public PlayerGachaBannerInfo getEventWeaponBanner() {
+        if (this.eventWeaponBanner == null) this.eventWeaponBanner = new PlayerGachaBannerInfo();
+        return this.eventWeaponBanner;
+    }
+
+    public PlayerGachaBannerInfo getBannerInfo(GachaBanner banner) {
+        return switch (banner.getBannerType()) {
+            case STANDARD -> this.getStandardBanner();
+            case BEGINNER -> this.getBeginnerBanner();
+            case EVENT, CHARACTER, CHARACTER2 -> this.getEventCharacterBanner();
+            case WEAPON -> this.getEventWeaponBanner();
+        };
+    }
 }
-- 
GitLab