架构优化
This commit is contained in:
parent
e59cbc9360
commit
8d496bfbda
@ -9,6 +9,7 @@ import (
|
||||
proto "server/msg"
|
||||
"server/pkg/github.com/name5566/leaf/log"
|
||||
"sort"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
@ -21,6 +22,7 @@ type ChampshipMgr struct {
|
||||
}
|
||||
|
||||
type ChampshipData struct {
|
||||
mu sync.RWMutex
|
||||
AutoId int
|
||||
RobotId int
|
||||
Rank map[int][]*ChampshipRank // 锦标赛排行榜
|
||||
|
||||
@ -1219,6 +1219,10 @@ func (p *Player) AddHighOrder() {
|
||||
}
|
||||
|
||||
// 高级产物订单
|
||||
/**
|
||||
当玩家生成了两个一样的最高等级产物,自动生成一个订单收掉它们。
|
||||
注意:当现有订单(无论是自动或固定订单)中已有两个或三个最高等级产物订单的时候,不执行此逻辑
|
||||
*/
|
||||
func (p *Player) AddHighOrder2() {
|
||||
OrderMod := p.PlayMod.getOrderMod()
|
||||
ChessMod := p.PlayMod.getChessMod()
|
||||
@ -1237,7 +1241,7 @@ func (p *Player) AddHighOrder2() {
|
||||
ChessMap[v]++
|
||||
}
|
||||
for ChessId, Num := range ChessMap {
|
||||
if Num < 3 {
|
||||
if Num < 2 {
|
||||
continue
|
||||
}
|
||||
add := true
|
||||
|
||||
@ -25,6 +25,7 @@ func InitReward(Diamond float64, Order, Lv int) []*item.Item {
|
||||
ItemDiamond := endlessCfg.GeDiamondByItemId(RandItem)
|
||||
LastDiamond := Diamond - ItemDiamond
|
||||
ItemNum := int(LastDiamond / PerDiamond)
|
||||
ItemNum = ItemNum / 5 * 5 // 道具数量为5的倍数
|
||||
return []*item.Item{item.NewItem(item.ITEM_ENERGY_ID, ItemNum), item.NewItem(RandItem, 1)}
|
||||
}
|
||||
if Num == 3 {
|
||||
@ -45,6 +46,7 @@ func InitReward(Diamond float64, Order, Lv int) []*item.Item {
|
||||
ItemDiamond = endlessCfg.GeDiamondByItemId(RandItem2)
|
||||
LastDiamond = LastDiamond - ItemDiamond
|
||||
ItemNum := int(LastDiamond / PerDiamond)
|
||||
ItemNum = ItemNum / 5 * 5 // 道具数量为5的倍数
|
||||
return []*item.Item{item.NewItem(item.ITEM_ENERGY_ID, ItemNum), item.NewItem(RandItem1, 1), item.NewItem(RandItem2, 1)}
|
||||
}
|
||||
|
||||
|
||||
BIN
src/server/test/__debug_bin.exe2315391482
Normal file
BIN
src/server/test/__debug_bin.exe2315391482
Normal file
Binary file not shown.
@ -23,7 +23,7 @@ func TestOrderStart(t *testing.T) {
|
||||
|
||||
func TestOrderFinish(t *testing.T) {
|
||||
p1 := new(game.Player)
|
||||
p1.InitPlayer("bbb004")
|
||||
p1.InitPlayer("3659896")
|
||||
game.G_GameLogicPtr.SetPlayer(p1)
|
||||
ChessMod := p1.GetChessMod()
|
||||
err := ChessMod.FinishOrder([]int{1, 2, 3})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user