diff --git a/gamesrv/slotspkg/slots/desc/machine_desc.go b/gamesrv/slotspkg/slots/desc/machine_desc.go index 1ab0b43..0ef0437 100644 --- a/gamesrv/slotspkg/slots/desc/machine_desc.go +++ b/gamesrv/slotspkg/slots/desc/machine_desc.go @@ -122,6 +122,18 @@ func (n *MachineDesc) BetChangeList() []float64 { } return lists } +func (n *MachineDesc) GetBetIndexByVal(val float64) []int64 { + betChangeListRows, ok := n.Sheet("Bet", "BetChangeList").(map[int64]*structs.BetChangeList) + if !ok { + panic(errors.ConfigTypeError.ErrorWith(n.Theme, "BetChangeList")) + } + for _, list := range betChangeListRows { + if list.BetChangeList == val { + return []int64{list.BetSizeIndex, list.BetLevelIndex} + } + } + return nil +} func (n *MachineDesc) GetVector(choice int64, minRatio, maxRatio float64, isForceWin bool) (int64, []int64) { if vectorIndex := config.GetInt64("slots.vectorIndex"); vectorIndex > 0 { rows := n.DefaultSheet("Vector").([]*structs.Vector) diff --git a/gamesrv/slotspkg/slots/machine/machine_master_misc.go b/gamesrv/slotspkg/slots/machine/machine_master_misc.go index 2580bb4..94b7532 100644 --- a/gamesrv/slotspkg/slots/machine/machine_master_misc.go +++ b/gamesrv/slotspkg/slots/machine/machine_master_misc.go @@ -45,6 +45,9 @@ func (m *Machine) BaseBets() []int64 { func (m *Machine) BetChangeList() []float64 { return m.MachineDesc.BetChangeList() } +func (m *Machine) GetBetIndexByVal(val float64) []int64 { + return m.MachineDesc.GetBetIndexByVal(val) +} func (m *Machine) Choice() int64 { if m.UserData().ForceChoice > 0 { return m.UserData().ForceChoice