Merge branch 'develop' of git.mango-gm.com:mango-games/server/game into develop
This commit is contained in:
commit
8471e1ef6b
|
@ -32,6 +32,7 @@ type SpinReq struct {
|
|||
BetSizeIndex int64 `json:"bsi"` //选中的单注下标
|
||||
BetLevelIndex int64 `json:"bli"` //选中的等级下标
|
||||
BetLineIndex int64 `json:"bii"` //选中的线数下标
|
||||
Stay bool `json:"stay"`
|
||||
Platform string `json:"plf"`
|
||||
BetMode int64 `json:"bm,optional"` //0.常规 1.必中
|
||||
Ts int64 `json:"ts"`
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -3832,11 +3832,24 @@ func init() {
|
|||
},
|
||||
}
|
||||
|
||||
MatrixMatchForm5X5TypeA = []*structs.MatrixMatchForm5X5TypeA{
|
||||
{
|
||||
Type: "MatchForm5X5",
|
||||
LinkType: 4,
|
||||
Direction: 4,
|
||||
LineCount: 10,
|
||||
Lines: [][]int64{
|
||||
{4, 4, 4},
|
||||
},
|
||||
Form: []int64{5, 5, 5, 5, 5},
|
||||
},
|
||||
}
|
||||
|
||||
MatrixMatchForm7X7TypeA = []*structs.MatrixMatchForm7X7TypeA{
|
||||
{
|
||||
Type: "MatchForm7X7",
|
||||
LinkType: 4,
|
||||
Direction: 0,
|
||||
Direction: 5,
|
||||
LineCount: 20,
|
||||
Lines: [][]int64{
|
||||
{0, 0, 0},
|
||||
|
@ -3923,6 +3936,19 @@ func init() {
|
|||
},
|
||||
}
|
||||
|
||||
MatrixWaysForm3X5TypeB = []*structs.MatrixWaysForm3X5TypeB{
|
||||
{
|
||||
Type: "WaysForm3X5TypeB",
|
||||
LinkType: 1,
|
||||
Direction: 0,
|
||||
LineCount: 30,
|
||||
Lines: [][]int64{
|
||||
{0, 0, 0},
|
||||
},
|
||||
Form: []int64{3, 3, 3, 3, 3},
|
||||
},
|
||||
}
|
||||
|
||||
MatrixWaysForm44668 = []*structs.MatrixWaysForm44668{
|
||||
{
|
||||
Type: "WaysForm44668",
|
||||
|
|
|
@ -7,20 +7,20 @@ package base
|
|||
import "mongo.games.com/game/gamesrv/slotspkg/internal/exported/excel2go/structs"
|
||||
|
||||
func init() {
|
||||
PrizeModelPrizeModelTypeA = map[int64]*structs.PrizeModelPrizeModelTypeA{
|
||||
1: {
|
||||
PrizeModelPrizeModelTypeA = []*structs.PrizeModelPrizeModelTypeA{
|
||||
{
|
||||
ID: 1,
|
||||
AniType: "big_win",
|
||||
MinMultiple: 10,
|
||||
MaxMultiple: 25,
|
||||
},
|
||||
2: {
|
||||
{
|
||||
ID: 2,
|
||||
AniType: "mega_win",
|
||||
MinMultiple: 25,
|
||||
MaxMultiple: 50,
|
||||
},
|
||||
3: {
|
||||
{
|
||||
ID: 3,
|
||||
AniType: "epic_win",
|
||||
MinMultiple: 50,
|
||||
|
@ -28,26 +28,26 @@ func init() {
|
|||
},
|
||||
}
|
||||
|
||||
PrizeModelPrizeModelTypeB = map[int64]*structs.PrizeModelPrizeModelTypeB{
|
||||
1: {
|
||||
PrizeModelPrizeModelTypeB = []*structs.PrizeModelPrizeModelTypeB{
|
||||
{
|
||||
ID: 1,
|
||||
AniType: "big_win",
|
||||
MinMultiple: 15,
|
||||
MaxMultiple: 30,
|
||||
},
|
||||
2: {
|
||||
{
|
||||
ID: 2,
|
||||
AniType: "mega_win",
|
||||
MinMultiple: 30,
|
||||
MaxMultiple: 45,
|
||||
},
|
||||
3: {
|
||||
{
|
||||
ID: 3,
|
||||
AniType: "epic_win",
|
||||
MinMultiple: 45,
|
||||
MaxMultiple: 60,
|
||||
},
|
||||
4: {
|
||||
{
|
||||
ID: 4,
|
||||
AniType: "epic_win",
|
||||
MinMultiple: 60,
|
||||
|
@ -55,4 +55,37 @@ func init() {
|
|||
},
|
||||
}
|
||||
|
||||
PrizeModelPrizeModelTypeC = []*structs.PrizeModelPrizeModelTypeC{
|
||||
{
|
||||
ID: -1,
|
||||
AniType: "small_win",
|
||||
MinMultiple: 0,
|
||||
MaxMultiple: 3,
|
||||
},
|
||||
{
|
||||
ID: 1,
|
||||
AniType: "middle_win",
|
||||
MinMultiple: 3,
|
||||
MaxMultiple: 5,
|
||||
},
|
||||
{
|
||||
ID: 2,
|
||||
AniType: "big_win",
|
||||
MinMultiple: 5,
|
||||
MaxMultiple: 15,
|
||||
},
|
||||
{
|
||||
ID: 3,
|
||||
AniType: "mega_win",
|
||||
MinMultiple: 15,
|
||||
MaxMultiple: 35,
|
||||
},
|
||||
{
|
||||
ID: 4,
|
||||
AniType: "supermega_win",
|
||||
MinMultiple: 35,
|
||||
MaxMultiple: -1,
|
||||
},
|
||||
}
|
||||
|
||||
}
|
|
@ -235,6 +235,7 @@ var (
|
|||
MatrixLine80Form7X5TypeA = []*structs.MatrixLine80Form7X5TypeA{}
|
||||
MatrixLine90Form11X5TypeA = []*structs.MatrixLine90Form11X5TypeA{}
|
||||
MatrixLine95Form8X5TypeA = []*structs.MatrixLine95Form8X5TypeA{}
|
||||
MatrixMatchForm5X5TypeA = []*structs.MatrixMatchForm5X5TypeA{}
|
||||
MatrixMatchForm7X7TypeA = []*structs.MatrixMatchForm7X7TypeA{}
|
||||
MatrixSameForm5X6TypeA = []*structs.MatrixSameForm5X6TypeA{}
|
||||
MatrixSameForm5X6TypeB = []*structs.MatrixSameForm5X6TypeB{}
|
||||
|
@ -242,12 +243,14 @@ var (
|
|||
MatrixWaysForm33555 = []*structs.MatrixWaysForm33555{}
|
||||
MatrixWaysForm344444 = []*structs.MatrixWaysForm344444{}
|
||||
MatrixWaysForm3X5TypeA = []*structs.MatrixWaysForm3X5TypeA{}
|
||||
MatrixWaysForm3X5TypeB = []*structs.MatrixWaysForm3X5TypeB{}
|
||||
MatrixWaysForm44668 = []*structs.MatrixWaysForm44668{}
|
||||
MatrixWaysForm4X5TypeA = []*structs.MatrixWaysForm4X5TypeA{}
|
||||
MatrixWaysForm4X5TypeB = []*structs.MatrixWaysForm4X5TypeB{}
|
||||
OptGroup = []*structs.OptGroup{}
|
||||
PrizeModelPrizeModelTypeA = map[int64]*structs.PrizeModelPrizeModelTypeA{}
|
||||
PrizeModelPrizeModelTypeB = map[int64]*structs.PrizeModelPrizeModelTypeB{}
|
||||
PrizeModelPrizeModelTypeA = []*structs.PrizeModelPrizeModelTypeA{}
|
||||
PrizeModelPrizeModelTypeB = []*structs.PrizeModelPrizeModelTypeB{}
|
||||
PrizeModelPrizeModelTypeC = []*structs.PrizeModelPrizeModelTypeC{}
|
||||
SimulatorFSMultiLevel = []*structs.SimulatorFSMultiLevel{}
|
||||
SimulatorMultiLevel = []*structs.SimulatorMultiLevel{}
|
||||
SugarRushBaseSymbolShowWeight = []*structs.SugarRushBaseSymbolShowWeight{}
|
||||
|
|
|
@ -294,6 +294,7 @@ func StoragesLoading(data map[string]string) {
|
|||
Load(data, "Base.Matrix/Line80Form7X5TypeA.Default", &base.MatrixLine80Form7X5TypeA)
|
||||
Load(data, "Base.Matrix/Line90Form11X5TypeA.Default", &base.MatrixLine90Form11X5TypeA)
|
||||
Load(data, "Base.Matrix/Line95Form8X5TypeA.Default", &base.MatrixLine95Form8X5TypeA)
|
||||
Load(data, "Base.Matrix/MatchForm5X5TypeA.Default", &base.MatrixMatchForm5X5TypeA)
|
||||
Load(data, "Base.Matrix/MatchForm7X7TypeA.Default", &base.MatrixMatchForm7X7TypeA)
|
||||
Load(data, "Base.Matrix/SameForm5X6TypeA.Default", &base.MatrixSameForm5X6TypeA)
|
||||
Load(data, "Base.Matrix/SameForm5X6TypeB.Default", &base.MatrixSameForm5X6TypeB)
|
||||
|
@ -301,12 +302,14 @@ func StoragesLoading(data map[string]string) {
|
|||
Load(data, "Base.Matrix/WaysForm33555.Default", &base.MatrixWaysForm33555)
|
||||
Load(data, "Base.Matrix/WaysForm344444.Default", &base.MatrixWaysForm344444)
|
||||
Load(data, "Base.Matrix/WaysForm3X5TypeA.Default", &base.MatrixWaysForm3X5TypeA)
|
||||
Load(data, "Base.Matrix/WaysForm3X5TypeB.Default", &base.MatrixWaysForm3X5TypeB)
|
||||
Load(data, "Base.Matrix/WaysForm44668.Default", &base.MatrixWaysForm44668)
|
||||
Load(data, "Base.Matrix/WaysForm4X5TypeA.Default", &base.MatrixWaysForm4X5TypeA)
|
||||
Load(data, "Base.Matrix/WaysForm4X5TypeB.Default", &base.MatrixWaysForm4X5TypeB)
|
||||
Load(data, "Base.OptGroup.Default", &base.OptGroup)
|
||||
Load(data, "Base.PrizeModel/PrizeModelTypeA.Default", &base.PrizeModelPrizeModelTypeA)
|
||||
Load(data, "Base.PrizeModel/PrizeModelTypeB.Default", &base.PrizeModelPrizeModelTypeB)
|
||||
Load(data, "Base.PrizeModel/PrizeModelTypeC.Default", &base.PrizeModelPrizeModelTypeC)
|
||||
Load(data, "Base.Simulator.FSMultiLevel", &base.SimulatorFSMultiLevel)
|
||||
Load(data, "Base.Simulator.MultiLevel", &base.SimulatorMultiLevel)
|
||||
Load(data, "Base.SugarRush/BaseSymbolShow.Weight", &base.SugarRushBaseSymbolShowWeight)
|
||||
|
@ -578,6 +581,7 @@ func StoragesMapping() {
|
|||
Set("Base", "Matrix/Line80Form7X5TypeA", "Default", base.MatrixLine80Form7X5TypeA)
|
||||
Set("Base", "Matrix/Line90Form11X5TypeA", "Default", base.MatrixLine90Form11X5TypeA)
|
||||
Set("Base", "Matrix/Line95Form8X5TypeA", "Default", base.MatrixLine95Form8X5TypeA)
|
||||
Set("Base", "Matrix/MatchForm5X5TypeA", "Default", base.MatrixMatchForm5X5TypeA)
|
||||
Set("Base", "Matrix/MatchForm7X7TypeA", "Default", base.MatrixMatchForm7X7TypeA)
|
||||
Set("Base", "Matrix/SameForm5X6TypeA", "Default", base.MatrixSameForm5X6TypeA)
|
||||
Set("Base", "Matrix/SameForm5X6TypeB", "Default", base.MatrixSameForm5X6TypeB)
|
||||
|
@ -585,12 +589,14 @@ func StoragesMapping() {
|
|||
Set("Base", "Matrix/WaysForm33555", "Default", base.MatrixWaysForm33555)
|
||||
Set("Base", "Matrix/WaysForm344444", "Default", base.MatrixWaysForm344444)
|
||||
Set("Base", "Matrix/WaysForm3X5TypeA", "Default", base.MatrixWaysForm3X5TypeA)
|
||||
Set("Base", "Matrix/WaysForm3X5TypeB", "Default", base.MatrixWaysForm3X5TypeB)
|
||||
Set("Base", "Matrix/WaysForm44668", "Default", base.MatrixWaysForm44668)
|
||||
Set("Base", "Matrix/WaysForm4X5TypeA", "Default", base.MatrixWaysForm4X5TypeA)
|
||||
Set("Base", "Matrix/WaysForm4X5TypeB", "Default", base.MatrixWaysForm4X5TypeB)
|
||||
Set("Base", "OptGroup", "Default", base.OptGroup)
|
||||
Set("Base", "PrizeModel/PrizeModelTypeA", "Default", base.PrizeModelPrizeModelTypeA)
|
||||
Set("Base", "PrizeModel/PrizeModelTypeB", "Default", base.PrizeModelPrizeModelTypeB)
|
||||
Set("Base", "PrizeModel/PrizeModelTypeC", "Default", base.PrizeModelPrizeModelTypeC)
|
||||
Set("Base", "Simulator", "FSMultiLevel", base.SimulatorFSMultiLevel)
|
||||
Set("Base", "Simulator", "MultiLevel", base.SimulatorMultiLevel)
|
||||
Set("Base", "SugarRush/BaseSymbolShow", "Weight", base.SugarRushBaseSymbolShowWeight)
|
||||
|
|
|
@ -821,6 +821,9 @@ type (
|
|||
// MatrixLine95Form8X5TypeA comment
|
||||
MatrixLine95Form8X5TypeA = Matrix
|
||||
|
||||
// MatrixMatchForm5X5TypeA comment
|
||||
MatrixMatchForm5X5TypeA = Matrix
|
||||
|
||||
// MatrixMatchForm7X7TypeA comment
|
||||
MatrixMatchForm7X7TypeA = Matrix
|
||||
|
||||
|
@ -842,6 +845,9 @@ type (
|
|||
// MatrixWaysForm3X5TypeA comment
|
||||
MatrixWaysForm3X5TypeA = Matrix
|
||||
|
||||
// MatrixWaysForm3X5TypeB comment
|
||||
MatrixWaysForm3X5TypeB = Matrix
|
||||
|
||||
// MatrixWaysForm44668 comment
|
||||
MatrixWaysForm44668 = Matrix
|
||||
|
||||
|
@ -857,6 +863,9 @@ type (
|
|||
// PrizeModelPrizeModelTypeB comment
|
||||
PrizeModelPrizeModelTypeB = PrizeModel
|
||||
|
||||
// PrizeModelPrizeModelTypeC comment
|
||||
PrizeModelPrizeModelTypeC = PrizeModel
|
||||
|
||||
// SimulatorMultiLevel comment
|
||||
SimulatorMultiLevel = SimulatorFSMultiLevel
|
||||
|
||||
|
|
|
@ -1067,6 +1067,8 @@ type Formation struct {
|
|||
ID int64
|
||||
NodeType string
|
||||
SeqID int64
|
||||
SymbolsAbove []int64
|
||||
SymbolsBelow []int64
|
||||
InitSymbols []int64
|
||||
DisplaySymbols []int64
|
||||
FinalSymbols []int64
|
||||
|
@ -1782,11 +1784,14 @@ type LiteFormation struct {
|
|||
SpinType int64
|
||||
NodeType string
|
||||
NodeID int64
|
||||
SymbolsAbove []int64
|
||||
SymbolsBelow []int64
|
||||
InitSymbols []int64
|
||||
DisplaySymbols []int64
|
||||
FinalSymbols []int64
|
||||
LinkPositions []*LinkPositions
|
||||
Win int64
|
||||
WinType int64
|
||||
RandPositions []int64
|
||||
MatrixForm []int64
|
||||
RewardInfo []*RewardInfo
|
||||
|
|
|
@ -65,7 +65,6 @@ func (n *MachineDesc) GetLineBet(betSizeIndex, betLevelIndex, betLineIndex int64
|
|||
if !ok {
|
||||
panic(errors.ConfigRowNoMatch.ErrorWith(n.Theme, "BetLine", betLineIndex))
|
||||
}
|
||||
|
||||
return betSizeRow.BetSize * betLevelRow.BetLevel * betLineRow.BaseBet
|
||||
}
|
||||
func (n *MachineDesc) BetSizes() []int64 {
|
||||
|
@ -221,9 +220,9 @@ func (n *MachineDesc) GetSpinType(typ string) int64 {
|
|||
panic(errors.ConfigRowNoMatch.ErrorWith(n.Theme, "Formation", typ))
|
||||
}
|
||||
|
||||
func (n *MachineDesc) GetPrizeModel() map[int64]*structs.PrizeModel {
|
||||
func (n *MachineDesc) GetPrizeModel() []*structs.PrizeModel {
|
||||
v := n.DefaultSheet("PrizeModel")
|
||||
rows, ok := v.(map[int64]*structs.PrizeModel)
|
||||
rows, ok := v.([]*structs.PrizeModel)
|
||||
if !ok {
|
||||
panic(errors.ConfigTypeError.ErrorWith(n.Theme, "PrizeModel"))
|
||||
}
|
||||
|
|
|
@ -33,6 +33,11 @@ func (e *Entity) GetFeature(featureID int64) *shared.Feature {
|
|||
return nil
|
||||
}
|
||||
|
||||
// RemoveFeatures by node
|
||||
func (e *Entity) RemoveFeatures(node *shared.Node) {
|
||||
node.Features = make([]*shared.Feature, 0)
|
||||
}
|
||||
|
||||
// GetTypeFeatures finds features by walking all nodes in node tree
|
||||
func (e *Entity) GetTypeFeatures(node *shared.Node, typ string) []*shared.Feature {
|
||||
features := make([]*shared.Feature, 0)
|
||||
|
|
|
@ -49,6 +49,8 @@ func (e *Entity) ConvertFormations() {
|
|||
|
||||
cliFormation := e.CursorNode().Formations[idx]
|
||||
cliFormation.SeqID = originFormation.SeqID
|
||||
cliFormation.SymbolsAbove = originFormation.SymbolsAbove
|
||||
cliFormation.SymbolsBelow = originFormation.SymbolsBelow
|
||||
cliFormation.DisplaySymbols = originFormation.DisplaySymbols
|
||||
cliFormation.FinalSymbols = finalSymbols
|
||||
cliFormation.LinkPositions = linkPositions
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
package entity
|
||||
|
||||
// Init inits entity
|
||||
func (e *Entity) Init() {
|
||||
e.Deserialize()
|
||||
func (e *Entity) Init(init ...int) {
|
||||
if len(init) == 0 {
|
||||
e.Deserialize()
|
||||
}
|
||||
|
||||
// In case of Revert, check empty every time when doing `Deserialize`
|
||||
if e.IsEmpty() {
|
||||
|
|
|
@ -250,34 +250,19 @@ func (e *Entity) ActualWinType() int64 {
|
|||
if e.NextNode().Type != key.BaseSpin {
|
||||
return key.WinTypeNil
|
||||
}
|
||||
|
||||
actualWin := e.TotalWin()
|
||||
|
||||
multi := mathx.SafeDiv(actualWin, e.CursorNode().Bet)
|
||||
|
||||
return e.CalcWinType(multi)
|
||||
}
|
||||
|
||||
func (e *Entity) CalcWinType(multi float64) int64 {
|
||||
prizeModels := e.MachineDesc.GetPrizeModel()
|
||||
|
||||
for winType, prizeModel := range prizeModels {
|
||||
if (prizeModel.MinMultiple < 0 || multi >= float64(prizeModel.MinMultiple)) &&
|
||||
(prizeModel.MaxMultiple < 0 || multi < float64(prizeModel.MaxMultiple)) {
|
||||
switch winType {
|
||||
case 1:
|
||||
return key.WinTypeBig
|
||||
case 2:
|
||||
return key.WinTypeMega
|
||||
case 3:
|
||||
return key.WinTypeEpic
|
||||
}
|
||||
for _, prizeModel := range prizeModels {
|
||||
if multi >= float64(prizeModel.MinMultiple) && multi < float64(prizeModel.MaxMultiple) {
|
||||
return prizeModel.ID
|
||||
}
|
||||
}
|
||||
if multi > 0 {
|
||||
return key.WinTypeNormal
|
||||
}
|
||||
return key.WinTypeNil
|
||||
return -1
|
||||
}
|
||||
|
||||
func (e *Entity) GetLineBetByType(nodeType string) int64 {
|
||||
|
@ -297,7 +282,6 @@ func (e *Entity) GetBetCoin() player.DecCoin {
|
|||
Coin: e.NodeTree.BetCoin.Coin,
|
||||
}
|
||||
}
|
||||
|
||||
func (e *Entity) SetWinCoin(winCoin player.IncCoin) {
|
||||
e.NodeTree.WinCoin.Coin = winCoin.Coin
|
||||
}
|
||||
|
|
|
@ -137,7 +137,7 @@ func (f *Formation) ResetRandSymbolsByIndex(r *randx.Randx) {
|
|||
symbol := reelDesc.Reel[symbolIdx%length]
|
||||
f.Symbols = append(f.Symbols, symbol)
|
||||
}
|
||||
f.SymbolsAbove = append(f.SymbolsAbove, reelDesc.Reel[(startIdx-1+length)%length])
|
||||
f.SymbolsAbove = append(f.SymbolsAbove, reelDesc.Reel[(startIdx+length-1)%length])
|
||||
f.SymbolsBelow = append(f.SymbolsBelow, reelDesc.Reel[(startIdx+reelDesc.Range)%length])
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,9 @@ package formation
|
|||
|
||||
import (
|
||||
"mongo.games.com/game/gamesrv/slotspkg/internal/generic/errors"
|
||||
"mongo.games.com/game/gamesrv/slotspkg/internal/module/shared"
|
||||
"mongo.games.com/game/gamesrv/slotspkg/slots/desc"
|
||||
"mongo.games.com/game/gamesrv/slotspkg/slots/types/cli"
|
||||
)
|
||||
|
||||
type SymbolMatch struct {
|
||||
|
@ -85,7 +87,6 @@ func symbolUpgrade(itemID int64, symbols [][]int64, rowSize int64, colSize int64
|
|||
|
||||
func calcWin(f *Formation, itemID int64, symbols [][]int64, records [][]int64, rowSize int64, colSize int64, count int64) {
|
||||
positions := make([]int64, 0)
|
||||
|
||||
for i := int64(0); i < colSize; i++ {
|
||||
for j := int64(0); j < rowSize; j++ {
|
||||
if symbols[i][j] == 1000+itemID && records[i][j] == 0 {
|
||||
|
@ -105,6 +106,13 @@ func calcWin(f *Formation, itemID int64, symbols [][]int64, records [][]int64, r
|
|||
f.LinePays = append(f.LinePays, winPay)
|
||||
link := int64(len(positions))
|
||||
f.addSymbolPay(itemID, link, winPay)
|
||||
f.RewardInfo = append(f.RewardInfo, &shared.RewardInfo{
|
||||
Type: 3,
|
||||
Index: int(link),
|
||||
Item: itemID,
|
||||
Reward: winPay,
|
||||
Pos: cli.ToPoss(f.MatrixForm, positions),
|
||||
})
|
||||
}
|
||||
|
||||
func (f *Formation) IsWild(itemID int64) bool {
|
||||
|
@ -156,14 +164,15 @@ func (f *Formation) GenerateSymbolMatch() {
|
|||
f.searchSymbols(i, j, itemID, symbols, rowSize, colSize)
|
||||
count := getSymbolMatch(symbols, rowSize, colSize)
|
||||
|
||||
if count >= 5 {
|
||||
//Direction在match中表示链接的个数
|
||||
if count >= f.FormationDesc.MatrixDesc.Direction {
|
||||
// 存在5个相同元素
|
||||
symbolUpgrade(itemID, symbols, rowSize, colSize, rawSymbols)
|
||||
calcWin(f, itemID, symbols, records, rowSize, colSize, count)
|
||||
symbolRevert(itemID, symbols, rowSize, colSize, rawSymbols)
|
||||
f.Symbols = DeformatSymbols(symbols)
|
||||
} else {
|
||||
// 不存在5个相同元素,恢复原始轴
|
||||
// 不存在n个相同元素,恢复原始轴
|
||||
symbolRevert(itemID, symbols, rowSize, colSize, rawSymbols)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -100,6 +100,7 @@ func (sm *SlotsMgr) Play(s *base.SlotsSession, req *base.SpinReq) (*cli.SlotsPla
|
|||
BetLevelIndex: req.BetLevelIndex,
|
||||
BetLineIndex: req.BetLineIndex,
|
||||
Ratio: 1,
|
||||
Stay: req.Stay,
|
||||
Mode: key.MachineModePlayer,
|
||||
Vector: recorderResult.Vector,
|
||||
//ExpectedWinCoin: recorderResult.ExpectedWinCoin,
|
||||
|
@ -112,6 +113,7 @@ func (sm *SlotsMgr) Play(s *base.SlotsSession, req *base.SpinReq) (*cli.SlotsPla
|
|||
BetLevelIndex: req.BetLevelIndex,
|
||||
BetLineIndex: req.BetLineIndex,
|
||||
Ratio: 1,
|
||||
Stay: req.Stay,
|
||||
Mode: key.MachineModePlayer,
|
||||
Choice: req.BetMode,
|
||||
})
|
||||
|
@ -170,3 +172,9 @@ func (sm *SlotsMgr) PPGetBetIndex(s *base.SlotsSession, theme string, val float6
|
|||
m := machine.NewMachine(s, theme, DataSet(s).Shell, false)
|
||||
return m.GetBetIndexByVal(val)
|
||||
}
|
||||
|
||||
// pg
|
||||
func (sm *SlotsMgr) PGGetBetIndex(s *base.SlotsSession, theme string, betSizeVal float64, betLevelVal int64) []int64 {
|
||||
m := machine.NewMachine(s, theme, DataSet(s).Shell, false)
|
||||
return m.GetBetIndexByTwoVal(betSizeVal, betLevelVal)
|
||||
}
|
||||
|
|
|
@ -13,8 +13,8 @@ type Master interface {
|
|||
UID() int64
|
||||
SetRatio(int64, float64)
|
||||
SetSummary(s string)
|
||||
TryLink(seqID int64, symbols []int64) ([]*shared.LinkPositions, [][]int64, []float64) // 返回linkPositions, LineSymbols, LinePays
|
||||
TryLinkMatrixSymbols(seqID int64, matSymbols [][]int64) ([]*shared.LinkPositions, [][]int64, []float64) // 返回linkPositions, LineSymbols, LinePays
|
||||
TryLink(seqID int64, symbols []int64) ([]*shared.LinkPositions, [][]int64, []float64, []*shared.RewardInfo) // 返回linkPositions, LineSymbols, LinePays
|
||||
TryLinkMatrixSymbols(seqID int64, matSymbols [][]int64) ([]*shared.LinkPositions, [][]int64, []float64, []*shared.RewardInfo) // 返回linkPositions, LineSymbols, LinePays
|
||||
TryRand(nodeType string, seqID int64) []int64
|
||||
SkipBaseSpin(nodeID int64)
|
||||
SkipBaseSpinWithBet(nodeID int64)
|
||||
|
@ -110,6 +110,7 @@ type Master interface {
|
|||
CursorFormationCustoms(seqID int64, v interface{}) []interface{}
|
||||
RootCustom(v interface{}) interface{}
|
||||
RootCustoms(v interface{}) []interface{}
|
||||
RootRemoveCustoms()
|
||||
NodeCustom(nodeID int64, v interface{}) interface{}
|
||||
NodeCustoms(nodeID int64, v interface{}) []interface{}
|
||||
NodeFormationCustom(nodeID int64, seqID int64, v interface{}) interface{}
|
||||
|
|
|
@ -9,6 +9,7 @@ import (
|
|||
// Spinner is the interface for dispatching entity
|
||||
type Spinner interface {
|
||||
Close() *shared.NodeTree
|
||||
Delete()
|
||||
PlayClose() *shared.NodeTree
|
||||
SyncLiteClose() *shared.LiteNodeTree
|
||||
PlayLiteClose() *shared.LiteNodeTree
|
||||
|
@ -45,6 +46,7 @@ type Spinner interface {
|
|||
BaseBets() []int64
|
||||
BetChangeList() []float64
|
||||
GetBetIndexByVal(val float64) []int64
|
||||
GetBetIndexByTwoVal(betSizeVal float64, betLevelVal int64) []int64
|
||||
|
||||
Choice() int64
|
||||
Stay() bool
|
||||
|
|
|
@ -71,6 +71,12 @@ func (m *Machine) RootCustoms(v interface{}) []interface{} {
|
|||
return r
|
||||
}
|
||||
|
||||
// RootRemoveCustoms
|
||||
// on root node
|
||||
func (m *Machine) RootRemoveCustoms() {
|
||||
m.RemoveFeatures(m.RootNode())
|
||||
}
|
||||
|
||||
// NodeCustom gets the first feature's custom in specific type
|
||||
// on specific node
|
||||
func (m *Machine) NodeCustom(nodeID int64, v interface{}) interface{} {
|
||||
|
|
|
@ -48,6 +48,9 @@ func (m *Machine) BetChangeList() []float64 {
|
|||
func (m *Machine) GetBetIndexByVal(val float64) []int64 {
|
||||
return m.MachineDesc.GetBetIndexByVal(val)
|
||||
}
|
||||
func (m *Machine) GetBetIndexByTwoVal(betSizeVal float64, betLevelVal int64) []int64 {
|
||||
return m.MachineDesc.GetBetIndexByTwoVal(betSizeVal, betLevelVal)
|
||||
}
|
||||
func (m *Machine) Choice() int64 {
|
||||
if m.UserData().ForceChoice > 0 {
|
||||
return m.UserData().ForceChoice
|
||||
|
@ -89,12 +92,12 @@ func (m *Machine) SetSummary(s string) {
|
|||
m.Set("Summary", s)
|
||||
}
|
||||
|
||||
func (m *Machine) TryLinkMatrixSymbols(seqID int64, matSymbols [][]int64) ([]*shared.LinkPositions, [][]int64, []float64) {
|
||||
func (m *Machine) TryLinkMatrixSymbols(seqID int64, matSymbols [][]int64) ([]*shared.LinkPositions, [][]int64, []float64, []*shared.RewardInfo) {
|
||||
symbols := formation.DeformatSymbols(matSymbols)
|
||||
return m.TryLink(seqID, symbols)
|
||||
}
|
||||
|
||||
func (m *Machine) TryLink(seqID int64, symbols []int64) ([]*shared.LinkPositions, [][]int64, []float64) {
|
||||
func (m *Machine) TryLink(seqID int64, symbols []int64) ([]*shared.LinkPositions, [][]int64, []float64, []*shared.RewardInfo) {
|
||||
f, err := formation.NewFormation(m.NodeDesc, seqID)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
@ -109,7 +112,7 @@ func (m *Machine) TryLink(seqID int64, symbols []int64) ([]*shared.LinkPositions
|
|||
})
|
||||
}
|
||||
|
||||
return linkPositions, f.LineSymbols, f.LinePays
|
||||
return linkPositions, f.LineSymbols, f.LinePays, f.RewardInfo
|
||||
}
|
||||
|
||||
func (m *Machine) TryRand(nodeType string, seqID int64) []int64 {
|
||||
|
|
|
@ -13,12 +13,20 @@ import (
|
|||
|
||||
// Close serialize the machine
|
||||
func (m *Machine) Close() *shared.NodeTree {
|
||||
m.Data = make(map[string]interface{})
|
||||
m.RootRemoveCustoms()
|
||||
m.Serialize()
|
||||
m.Session.Remove(key.SessionMachine)
|
||||
return m.NodeTree
|
||||
}
|
||||
|
||||
// Close serialize the machine
|
||||
// Delete serialize the machine
|
||||
func (m *Machine) Delete() {
|
||||
m.Serialize()
|
||||
m.Session.Remove(key.SessionMachine)
|
||||
}
|
||||
|
||||
// PlayClose serialize the machine
|
||||
func (m *Machine) PlayClose() *shared.NodeTree {
|
||||
m.Serialize()
|
||||
m.Session.Remove(key.SessionMachine)
|
||||
|
@ -68,10 +76,13 @@ func (m *Machine) SyncLiteClose() *shared.LiteNodeTree {
|
|||
SpinType: formation.SpinType,
|
||||
NodeType: formation.NodeType,
|
||||
NodeID: formation.NodeID,
|
||||
SymbolsAbove: formation.SymbolsAbove,
|
||||
SymbolsBelow: formation.SymbolsBelow,
|
||||
InitSymbols: formation.InitSymbols,
|
||||
LinkPositions: formation.LinkPositions,
|
||||
FinalSymbols: formation.FinalSymbols,
|
||||
Win: formation.Win,
|
||||
WinType: m.CalcWinType(float64(formation.Win) / float64(m.NodeTree.BetCoin.Coin)),
|
||||
RandPositions: formation.RandPositions,
|
||||
MatrixForm: formation.MatrixForm,
|
||||
NewNodeType: formation.NewNodeType,
|
||||
|
@ -87,9 +98,12 @@ func (m *Machine) SyncLiteClose() *shared.LiteNodeTree {
|
|||
SpinType: formation.SpinType,
|
||||
NodeType: formation.NodeType,
|
||||
NodeID: formation.NodeID,
|
||||
SymbolsAbove: formation.SymbolsAbove,
|
||||
SymbolsBelow: formation.SymbolsBelow,
|
||||
FinalSymbols: formation.FinalSymbols,
|
||||
LinkPositions: formation.LinkPositions,
|
||||
Win: formation.Win,
|
||||
WinType: m.CalcWinType(float64(formation.Win) / float64(m.NodeTree.BetCoin.Coin)),
|
||||
RandPositions: formation.RandPositions,
|
||||
MatrixForm: formation.MatrixForm,
|
||||
NewNodeType: formation.NewNodeType,
|
||||
|
@ -165,10 +179,13 @@ func (m *Machine) PlayLiteClose() *shared.LiteNodeTree {
|
|||
SpinType: formation.SpinType,
|
||||
NodeType: formation.NodeType,
|
||||
NodeID: formation.NodeID,
|
||||
SymbolsAbove: formation.SymbolsAbove,
|
||||
SymbolsBelow: formation.SymbolsBelow,
|
||||
DisplaySymbols: formation.DisplaySymbols,
|
||||
FinalSymbols: formation.FinalSymbols,
|
||||
LinkPositions: formation.LinkPositions,
|
||||
Win: formation.Win,
|
||||
WinType: m.CalcWinType(float64(formation.Win) / float64(m.NodeTree.BetCoin.Coin)),
|
||||
RandPositions: formation.RandPositions,
|
||||
MatrixForm: formation.MatrixForm,
|
||||
RewardInfo: formation.RewardInfo,
|
||||
|
@ -185,10 +202,13 @@ func (m *Machine) PlayLiteClose() *shared.LiteNodeTree {
|
|||
SpinType: formation.SpinType,
|
||||
NodeType: formation.NodeType,
|
||||
NodeID: formation.NodeID,
|
||||
SymbolsAbove: formation.SymbolsAbove,
|
||||
SymbolsBelow: formation.SymbolsBelow,
|
||||
InitSymbols: formation.InitSymbols,
|
||||
LinkPositions: formation.LinkPositions,
|
||||
FinalSymbols: formation.FinalSymbols,
|
||||
Win: formation.Win,
|
||||
WinType: m.CalcWinType(float64(formation.Win) / float64(m.NodeTree.BetCoin.Coin)),
|
||||
RandPositions: formation.RandPositions,
|
||||
MatrixForm: formation.MatrixForm,
|
||||
RewardInfo: formation.RewardInfo,
|
||||
|
@ -268,6 +288,7 @@ func (m *Machine) QuitLiteClose() *shared.LiteNodeTree {
|
|||
LinkPositions: formation.LinkPositions,
|
||||
FinalSymbols: formation.FinalSymbols,
|
||||
Win: formation.Win,
|
||||
WinType: m.CalcWinType(float64(formation.Win) / float64(m.NodeTree.BetCoin.Coin)),
|
||||
RandPositions: formation.RandPositions,
|
||||
NewNodeType: formation.NewNodeType,
|
||||
})
|
||||
|
@ -285,6 +306,7 @@ func (m *Machine) QuitLiteClose() *shared.LiteNodeTree {
|
|||
FinalSymbols: formation.FinalSymbols,
|
||||
LinkPositions: formation.LinkPositions,
|
||||
Win: formation.Win,
|
||||
WinType: m.CalcWinType(float64(formation.Win) / float64(m.NodeTree.BetCoin.Coin)),
|
||||
RandPositions: formation.RandPositions,
|
||||
NewNodeType: formation.NewNodeType,
|
||||
})
|
||||
|
|
|
@ -99,7 +99,7 @@ func (p *PluginEliminate) AfterSpin(m intf.Master) {
|
|||
customPay := m.CursorCustom(&CustomPay{}).(*CustomPay)
|
||||
|
||||
// 根据赔付计算multi type
|
||||
linkPositions, _, linePays := m.TryLinkMatrixSymbols(1, formattedSymbols)
|
||||
linkPositions, _, linePays, _ := m.TryLinkMatrixSymbols(1, formattedSymbols)
|
||||
|
||||
var multiType int64
|
||||
if mathx.Sum(linePays) == 0 {
|
||||
|
@ -191,7 +191,7 @@ func (p *PluginEliminate) AfterSpin(m intf.Master) {
|
|||
customPay.Pay += mathx.Sum(linePays)
|
||||
|
||||
// 连线
|
||||
linkPositions, _, linePays = m.TryLinkMatrixSymbols(1, formattedSymbols)
|
||||
linkPositions, _, linePays, _ = m.TryLinkMatrixSymbols(1, formattedSymbols)
|
||||
}
|
||||
|
||||
// 增加multi
|
||||
|
|
|
@ -269,7 +269,7 @@ func (p *PluginBaseSpin) Eliminate(m intf.Master, customPay *CustomPay, multiTab
|
|||
cursorFormation.SetWin(0)
|
||||
|
||||
// 根据赔付计算multi type
|
||||
linkPositions, _, linePays := m.TryLinkMatrixSymbols(1, formattedSymbols)
|
||||
linkPositions, _, linePays, _ := m.TryLinkMatrixSymbols(1, formattedSymbols)
|
||||
DumpReel(multiTable.Multi)
|
||||
lineMultis := make([]int64, len(linePays))
|
||||
|
||||
|
|
Loading…
Reference in New Issue