95 lines
2.5 KiB
Go
95 lines
2.5 KiB
Go
package cashmania
|
|
|
|
import (
|
|
"mongo.games.com/game/gamesrv/slotspkg/internal/generic/key"
|
|
"mongo.games.com/game/gamesrv/slotspkg/slots/intf"
|
|
"mongo.games.com/game/gamesrv/slotspkg/slots/plugin/generic"
|
|
)
|
|
|
|
type PluginSpecial struct {
|
|
generic.PluginBase
|
|
}
|
|
|
|
// Theme implements generic.PluginBase.Theme
|
|
func (p *PluginSpecial) Theme() string {
|
|
return key.CashMania
|
|
}
|
|
|
|
// Special
|
|
type Special struct {
|
|
FreeStatus int `json:"fs"`
|
|
FreeSpinNum int64 `json:"fsn"` //剩余freespin
|
|
FreeNumMax int64 `json:"fnm"` //总次数
|
|
FreeNumTrigger int64 `json:"fnt"` //新增freespin
|
|
|
|
FeatureType int `json:"feature_type"` //0.无特性 1.nudge 2.respin
|
|
NudgeDirection int `json:"nudge_direction"` //1.上 2.下
|
|
FreeSpinItemId int64 `json:"free_item_id"`
|
|
Multiple int64 `json:"multiple"` //倍乘倍数
|
|
Irv [][]float64 `json:"irv"`
|
|
Frv [][]float64 `json:"frv"`
|
|
}
|
|
|
|
// 获取特性数据
|
|
func (p *PluginSpecial) getCustomSpecial(m intf.Master) *Special {
|
|
customSpecial := new(Special)
|
|
if len(m.CursorCustoms(customSpecial)) == 0 {
|
|
m.AddCursorFeature(customSpecial)
|
|
}
|
|
return m.CursorCustom(customSpecial).(*Special)
|
|
}
|
|
func (p *PluginSpecial) AfterSpin(m intf.Master) {
|
|
Fortune := getCustomFortune(m)
|
|
sp := p.getCustomSpecial(m)
|
|
sp.FeatureType = Fortune.FeatureType
|
|
sp.NudgeDirection = Fortune.NudgeDirection
|
|
sp.FreeStatus = Fortune.FreeStatus
|
|
sp.FreeSpinNum = Fortune.FreeSpinNum
|
|
sp.FreeNumMax = Fortune.FreeNumMax
|
|
sp.FreeNumTrigger = Fortune.FreeNumTrigger
|
|
sp.FreeSpinItemId = Fortune.FreeSpinItemId
|
|
sp.Multiple = Fortune.Multiple
|
|
|
|
itemInfo := Descx(m).GetItemInfo()
|
|
displaySymbols := m.CursorFormation().GetReelFormattedDisplaySymbols()
|
|
var irv = copyMatrix(displaySymbols)
|
|
for i, symbol := range displaySymbols {
|
|
for i2, i3 := range symbol {
|
|
if itemInfo[i3].IsMid {
|
|
irv[i][i2] = itemInfo[i3].Value
|
|
} else {
|
|
irv[i][i2] = itemInfo[i3].Value * float64(m.Bet()) / 10000
|
|
}
|
|
}
|
|
}
|
|
sp.Irv = irv
|
|
|
|
finalSymbols := m.CursorFormation().GetMatrixFormattedFinalSymbols()
|
|
var frv = copyMatrix(finalSymbols)
|
|
for i, symbol := range finalSymbols {
|
|
for i2, i3 := range symbol {
|
|
if itemInfo[i3].IsMid {
|
|
frv[i][i2] = itemInfo[i3].Value
|
|
} else {
|
|
frv[i][i2] = itemInfo[i3].Value * float64(m.Bet()) / 10000
|
|
}
|
|
}
|
|
}
|
|
sp.Frv = frv
|
|
|
|
}
|
|
func copyMatrix(mat [][]int64) [][]float64 {
|
|
if mat == nil {
|
|
return nil
|
|
}
|
|
var newMat [][]float64
|
|
for _, row := range mat {
|
|
var r []float64
|
|
for _, val := range row {
|
|
r = append(r, 0*float64(val))
|
|
}
|
|
newMat = append(newMat, r)
|
|
}
|
|
return newMat
|
|
}
|