mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-24 12:54:38 +01:00
Gacha rework
Add fallback stripping and C6 stripping Converting banner definitions from pity vars to lerp arrays Properly implement rates and pool smoothing Also move reusable functions to Utils
This commit is contained in:
@@ -7,6 +7,11 @@ public class PlayerGachaBannerInfo {
|
||||
private int pity5 = 0;
|
||||
private int pity4 = 0;
|
||||
private int failedFeaturedItemPulls = 0;
|
||||
private int failedFeatured4ItemPulls = 0;
|
||||
private int pity5Pool1 = 0;
|
||||
private int pity5Pool2 = 0;
|
||||
private int pity4Pool1 = 0;
|
||||
private int pity4Pool2 = 0;
|
||||
|
||||
public int getPity5() {
|
||||
return pity5;
|
||||
@@ -32,15 +37,82 @@ public class PlayerGachaBannerInfo {
|
||||
this.pity4 += amount;
|
||||
}
|
||||
|
||||
public int getFailedFeaturedItemPulls() {
|
||||
return failedFeaturedItemPulls;
|
||||
public int getFailedFeaturedItemPulls(int rarity) {
|
||||
return switch (rarity) {
|
||||
case 4 -> failedFeatured4ItemPulls;
|
||||
default -> failedFeaturedItemPulls; // 5
|
||||
};
|
||||
}
|
||||
|
||||
public void setFailedFeaturedItemPulls(int failedEventCharacterPulls) {
|
||||
this.failedFeaturedItemPulls = failedEventCharacterPulls;
|
||||
public void setFailedFeaturedItemPulls(int rarity, int amount) {
|
||||
switch (rarity) {
|
||||
case 4 -> failedFeatured4ItemPulls = amount;
|
||||
default -> failedFeaturedItemPulls = amount; // 5
|
||||
};
|
||||
}
|
||||
|
||||
public void addFailedFeaturedItemPulls(int amount) {
|
||||
failedFeaturedItemPulls += amount;
|
||||
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++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user