Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Grasscutter
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
ziqian zhang
Grasscutter
Commits
1586bab5
Commit
1586bab5
authored
3 years ago
by
Melledy
Browse files
Options
Downloads
Patches
Plain Diff
Gacha banner tweaks
Removed min/maxItemType Added configurable base weight values for banners
parent
1130138a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/emu/grasscutter/game/gacha/GachaBanner.java
+10
-10
10 additions, 10 deletions
src/main/java/emu/grasscutter/game/gacha/GachaBanner.java
src/main/java/emu/grasscutter/game/gacha/GachaManager.java
+5
-4
5 additions, 4 deletions
src/main/java/emu/grasscutter/game/gacha/GachaManager.java
with
15 additions
and
14 deletions
src/main/java/emu/grasscutter/game/gacha/GachaBanner.java
+
10
−
10
View file @
1586bab5
...
...
@@ -16,8 +16,8 @@ public class GachaBanner {
private
int
sortId
;
private
int
[]
rateUpItems1
;
private
int
[]
rateUpItems2
;
private
int
minItemType
=
1
;
private
int
maxItemType
=
2
;
private
int
baseYellowWeight
=
60
;
// Max 10000
private
int
basePurpleWeight
=
510
;
// Max 10000
private
int
eventChance
=
50
;
// Chance to win a featured event item
private
int
softPity
=
75
;
private
int
hardPity
=
90
;
...
...
@@ -63,20 +63,20 @@ public class GachaBanner {
return
sortId
;
}
public
int
[]
get
RateUpItems1
()
{
return
rateUpItems1
;
public
int
get
BaseYellowWeight
()
{
return
baseYellowWeight
;
}
public
int
[]
get
RateUpItems2
()
{
return
rateUpItems2
;
public
int
get
BasePurpleWeight
()
{
return
basePurpleWeight
;
}
public
int
get
MinItemType
()
{
return
minItemType
;
public
int
[]
get
RateUpItems1
()
{
return
rateUpItems1
;
}
public
int
get
MaxItemType
()
{
return
maxItemType
;
public
int
[]
get
RateUpItems2
()
{
return
rateUpItems2
;
}
public
int
getSoftPity
()
{
...
...
This diff is collapsed.
Click to expand it.
src/main/java/emu/grasscutter/game/gacha/GachaManager.java
+
5
−
4
View file @
1586bab5
...
...
@@ -15,6 +15,7 @@ import emu.grasscutter.Grasscutter;
import
emu.grasscutter.data.GameData
;
import
emu.grasscutter.data.def.ItemData
;
import
emu.grasscutter.game.avatar.Avatar
;
import
emu.grasscutter.game.gacha.GachaBanner.BannerType
;
import
emu.grasscutter.game.inventory.GameItem
;
import
emu.grasscutter.game.inventory.ItemType
;
import
emu.grasscutter.game.inventory.MaterialType
;
...
...
@@ -125,8 +126,8 @@ public class GachaManager {
int
itemId
=
0
;
int
bonusYellowChance
=
gachaInfo
.
getPity5
()
>=
banner
.
getSoftPity
()
?
100
*
(
gachaInfo
.
getPity5
()
-
banner
.
getSoftPity
()
-
1
):
0
;
int
yellowChance
=
60
+
(
int
)
Math
.
floor
(
100
f
*
(
gachaInfo
.
getPity5
()
/
(
banner
.
getSoftPity
()
-
1
D
)))
+
bonusYellowChance
;
int
purpleChance
=
10000
-
(
510
+
(
int
)
Math
.
floor
(
790
f
*
(
gachaInfo
.
getPity4
()
/
8
f
)));
int
yellowChance
=
banner
.
getBaseYellowWeight
()
+
(
int
)
Math
.
floor
(
100
f
*
(
gachaInfo
.
getPity5
()
/
(
banner
.
getSoftPity
()
-
1
D
)))
+
bonusYellowChance
;
int
purpleChance
=
10000
-
(
banner
.
getBasePurpleWeight
()
+
(
int
)
Math
.
floor
(
790
f
*
(
gachaInfo
.
getPity4
()
/
8
f
)));
if
(
random
<=
yellowChance
||
gachaInfo
.
getPity5
()
>=
banner
.
getHardPity
())
{
if
(
banner
.
getRateUpItems1
().
length
>
0
)
{
...
...
@@ -142,7 +143,7 @@ public class GachaManager {
}
if
(
itemId
==
0
)
{
int
typeChance
=
this
.
randomRange
(
banner
.
get
MinItemType
(),
banner
.
getMaxItemType
()
);
int
typeChance
=
this
.
randomRange
(
banner
.
get
BannerType
()
==
BannerType
.
WEAPON
?
2
:
1
,
banner
.
getBannerType
()
==
BannerType
.
EVENT
?
1
:
2
);
if
(
typeChance
==
1
)
{
itemId
=
getRandom
(
this
.
yellowAvatars
);
}
else
{
...
...
@@ -163,7 +164,7 @@ public class GachaManager {
}
if
(
itemId
==
0
)
{
int
typeChance
=
this
.
randomRange
(
banner
.
get
MinItemType
(),
banner
.
getMaxItemType
()
);
int
typeChance
=
this
.
randomRange
(
banner
.
get
BannerType
()
==
BannerType
.
WEAPON
?
2
:
1
,
banner
.
getBannerType
()
==
BannerType
.
EVENT
?
1
:
2
);
if
(
typeChance
==
1
)
{
itemId
=
getRandom
(
this
.
purpleAvatars
);
}
else
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment