refactor: 重构 Prop 字段位置至 baseplayer
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
This commit is contained in:
@@ -4,5 +4,5 @@ type AI_player struct {
|
|||||||
baseplayer
|
baseplayer
|
||||||
|
|
||||||
CanCapture int
|
CanCapture int
|
||||||
Prop [6]int8
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,17 +15,13 @@ type baseplayer struct {
|
|||||||
//canFight uint32
|
//canFight uint32
|
||||||
FightC common.FightI //绑定战斗标识 替代本身的是否战斗标记 //IsFighting bool
|
FightC common.FightI //绑定战斗标识 替代本身的是否战斗标记 //IsFighting bool
|
||||||
*info.PlayerCaptureContext
|
*info.PlayerCaptureContext
|
||||||
|
Prop [6]int8
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewPlayerCaptureContext 创建用户捕捉上下文(每次登录调用)
|
// NewPlayerCaptureContext 创建用户捕捉上下文(每次登录调用)
|
||||||
func newbaseplayer() baseplayer {
|
func newbaseplayer() baseplayer {
|
||||||
ret := baseplayer{}
|
ret := baseplayer{}
|
||||||
ret.PlayerCaptureContext = &info.PlayerCaptureContext{
|
|
||||||
Denominator: 1000,
|
|
||||||
DecayFactor: 0.10, // 15%衰减率
|
|
||||||
MinDecayNum: 1,
|
|
||||||
Guarantees: make(map[int]int),
|
|
||||||
}
|
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package player
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"blazing/logic/service/common"
|
"blazing/logic/service/common"
|
||||||
|
"blazing/logic/service/fight/info"
|
||||||
"blazing/modules/base/service"
|
"blazing/modules/base/service"
|
||||||
"blazing/modules/player/model"
|
"blazing/modules/player/model"
|
||||||
"time"
|
"time"
|
||||||
@@ -22,7 +23,12 @@ func NewPlayer(opts gnet.Conn) *Player {
|
|||||||
HavePVPinfo: make([]common.PlayerI, 0),
|
HavePVPinfo: make([]common.PlayerI, 0),
|
||||||
baseplayer: newbaseplayer(),
|
baseplayer: newbaseplayer(),
|
||||||
}
|
}
|
||||||
|
p.PlayerCaptureContext = &info.PlayerCaptureContext{
|
||||||
|
Denominator: 1000,
|
||||||
|
DecayFactor: 0.10, // 15%衰减率
|
||||||
|
MinDecayNum: 1,
|
||||||
|
Guarantees: make(map[int]int),
|
||||||
|
}
|
||||||
p.User = service.NewBaseSysUserService()
|
p.User = service.NewBaseSysUserService()
|
||||||
p.monsters = generateThreeUniqueNumbers()
|
p.monsters = generateThreeUniqueNumbers()
|
||||||
p.Done = NewDone(p) //发布订阅事件
|
p.Done = NewDone(p) //发布订阅事件
|
||||||
|
|||||||
Reference in New Issue
Block a user