mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-23 08:11:12 +00:00
Gacha banner tweaks
Removed min/maxItemType Added configurable base weight values for banners
This commit is contained in:
parent
1130138a4f
commit
1586bab5d7
@ -16,8 +16,8 @@ public class GachaBanner {
|
|||||||
private int sortId;
|
private int sortId;
|
||||||
private int[] rateUpItems1;
|
private int[] rateUpItems1;
|
||||||
private int[] rateUpItems2;
|
private int[] rateUpItems2;
|
||||||
private int minItemType = 1;
|
private int baseYellowWeight = 60; // Max 10000
|
||||||
private int maxItemType = 2;
|
private int basePurpleWeight = 510; // Max 10000
|
||||||
private int eventChance = 50; // Chance to win a featured event item
|
private int eventChance = 50; // Chance to win a featured event item
|
||||||
private int softPity = 75;
|
private int softPity = 75;
|
||||||
private int hardPity = 90;
|
private int hardPity = 90;
|
||||||
@ -63,6 +63,14 @@ public class GachaBanner {
|
|||||||
return sortId;
|
return sortId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getBaseYellowWeight() {
|
||||||
|
return baseYellowWeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getBasePurpleWeight() {
|
||||||
|
return basePurpleWeight;
|
||||||
|
}
|
||||||
|
|
||||||
public int[] getRateUpItems1() {
|
public int[] getRateUpItems1() {
|
||||||
return rateUpItems1;
|
return rateUpItems1;
|
||||||
}
|
}
|
||||||
@ -71,14 +79,6 @@ public class GachaBanner {
|
|||||||
return rateUpItems2;
|
return rateUpItems2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMinItemType() {
|
|
||||||
return minItemType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getMaxItemType() {
|
|
||||||
return maxItemType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getSoftPity() {
|
public int getSoftPity() {
|
||||||
return softPity - 1;
|
return softPity - 1;
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ import emu.grasscutter.Grasscutter;
|
|||||||
import emu.grasscutter.data.GameData;
|
import emu.grasscutter.data.GameData;
|
||||||
import emu.grasscutter.data.def.ItemData;
|
import emu.grasscutter.data.def.ItemData;
|
||||||
import emu.grasscutter.game.avatar.Avatar;
|
import emu.grasscutter.game.avatar.Avatar;
|
||||||
|
import emu.grasscutter.game.gacha.GachaBanner.BannerType;
|
||||||
import emu.grasscutter.game.inventory.GameItem;
|
import emu.grasscutter.game.inventory.GameItem;
|
||||||
import emu.grasscutter.game.inventory.ItemType;
|
import emu.grasscutter.game.inventory.ItemType;
|
||||||
import emu.grasscutter.game.inventory.MaterialType;
|
import emu.grasscutter.game.inventory.MaterialType;
|
||||||
@ -125,8 +126,8 @@ public class GachaManager {
|
|||||||
int itemId = 0;
|
int itemId = 0;
|
||||||
|
|
||||||
int bonusYellowChance = gachaInfo.getPity5() >= banner.getSoftPity() ? 100 * (gachaInfo.getPity5() - banner.getSoftPity() - 1): 0;
|
int bonusYellowChance = gachaInfo.getPity5() >= banner.getSoftPity() ? 100 * (gachaInfo.getPity5() - banner.getSoftPity() - 1): 0;
|
||||||
int yellowChance = 60 + (int) Math.floor(100f * (gachaInfo.getPity5() / (banner.getSoftPity() - 1D))) + bonusYellowChance;
|
int yellowChance = banner.getBaseYellowWeight() + (int) Math.floor(100f * (gachaInfo.getPity5() / (banner.getSoftPity() - 1D))) + bonusYellowChance;
|
||||||
int purpleChance = 10000 - (510 + (int) Math.floor(790f * (gachaInfo.getPity4() / 8f)));
|
int purpleChance = 10000 - (banner.getBasePurpleWeight() + (int) Math.floor(790f * (gachaInfo.getPity4() / 8f)));
|
||||||
|
|
||||||
if (random <= yellowChance || gachaInfo.getPity5() >= banner.getHardPity()) {
|
if (random <= yellowChance || gachaInfo.getPity5() >= banner.getHardPity()) {
|
||||||
if (banner.getRateUpItems1().length > 0) {
|
if (banner.getRateUpItems1().length > 0) {
|
||||||
@ -142,7 +143,7 @@ public class GachaManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (itemId == 0) {
|
if (itemId == 0) {
|
||||||
int typeChance = this.randomRange(banner.getMinItemType(), banner.getMaxItemType());
|
int typeChance = this.randomRange(banner.getBannerType() == BannerType.WEAPON ? 2 : 1, banner.getBannerType() == BannerType.EVENT ? 1 : 2);
|
||||||
if (typeChance == 1) {
|
if (typeChance == 1) {
|
||||||
itemId = getRandom(this.yellowAvatars);
|
itemId = getRandom(this.yellowAvatars);
|
||||||
} else {
|
} else {
|
||||||
@ -163,7 +164,7 @@ public class GachaManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (itemId == 0) {
|
if (itemId == 0) {
|
||||||
int typeChance = this.randomRange(banner.getMinItemType(), banner.getMaxItemType());
|
int typeChance = this.randomRange(banner.getBannerType() == BannerType.WEAPON ? 2 : 1, banner.getBannerType() == BannerType.EVENT ? 1 : 2);
|
||||||
if (typeChance == 1) {
|
if (typeChance == 1) {
|
||||||
itemId = getRandom(this.purpleAvatars);
|
itemId = getRandom(this.purpleAvatars);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user