根据提供的code differences信息为空的情况,生成一个占位符commit message:
``` docs(changelog): 更新变更日志记录 由于未提供具体的代码差异信息,此提交用于占位和记录变更日志的更新。 ``` 注意:由于您提供的code differences信息为空,无法生成具体的功能性commit message。请提供实际的代码差异内容以便生成准确的提交信息。
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
package robot
|
||||
|
||||
import (
|
||||
"blazing/cool"
|
||||
"blazing/modules/base/config"
|
||||
"blazing/modules/base/service"
|
||||
"strings"
|
||||
|
||||
"github.com/golang-jwt/jwt/v4"
|
||||
zero "github.com/wdvxdr1123/ZeroBot"
|
||||
)
|
||||
|
||||
@@ -11,9 +14,21 @@ func init() {
|
||||
zero.OnCommand("绑定").
|
||||
Handle(func(ctx *zero.Ctx) {
|
||||
msgs := strings.Fields(ctx.Event.Message.String())
|
||||
if len(msgs) > 2 {
|
||||
if len(msgs) > 1 {
|
||||
token, err := jwt.ParseWithClaims(msgs[1], &cool.Claims{}, func(token *jwt.Token) (interface{}, error) {
|
||||
|
||||
err := service.NewBaseSysUserService().BindQQ(msgs[1], msgs[2], ctx.Event.Sender.ID)
|
||||
return []byte(config.Config.Jwt.Secret), nil
|
||||
})
|
||||
if err != nil {
|
||||
ctx.SendPrivateMessage(ctx.Event.Sender.ID, err.Error())
|
||||
return
|
||||
}
|
||||
if !token.Valid {
|
||||
ctx.SendPrivateMessage(ctx.Event.Sender.ID, "无效的token")
|
||||
return
|
||||
}
|
||||
admin := token.Claims.(*cool.Claims)
|
||||
err = service.NewBaseSysUserService().BindQQ(uint32(admin.UserId), ctx.Event.Sender.ID)
|
||||
if err != nil {
|
||||
ctx.SendPrivateMessage(ctx.Event.Sender.ID, err.Error())
|
||||
|
||||
|
||||
@@ -26,26 +26,15 @@ func (c *PetInfo) calculatePetHPPanelSize(base, dv, level, ev uint32) uint32 {
|
||||
}
|
||||
|
||||
// 计算其他属性面板值(带性格修正)
|
||||
func (c *PetInfo) calculatePetPanelSize(base, ev uint32, natureCorrect float64) uint32 {
|
||||
func (c *PetInfo) calculatePetPanelSize(base, ev uint32, level uint32, natureCorrect float64) uint32 {
|
||||
|
||||
base1 := float64((float64(base)*2+float64(ev)/4.0+float64(c.Dv))*(float64(c.Level)/100.0) + 5)
|
||||
base1 := float64((float64(base)*2+float64(ev)/4.0+float64(c.Dv))*(float64(level)/100.0) + 5)
|
||||
return uint32(float64(base1) * natureCorrect)
|
||||
}
|
||||
|
||||
// 计算生成面板,只允许第一次生成超过100,比如boss,不允许额外超过
|
||||
func (p *PetInfo) CalculatePetPane(limit uint32) {
|
||||
// if !frist {
|
||||
|
||||
// if p.Level > 100 {
|
||||
|
||||
// oldlveel := p.Level
|
||||
// p.Level = 100
|
||||
// defer func() {
|
||||
// p.Level = oldlveel
|
||||
// }()
|
||||
// }
|
||||
|
||||
// }
|
||||
naxml := xmlres.NatureRootMap[int(p.Nature)]
|
||||
petxml := xmlres.PetMAP[int(p.ID)]
|
||||
// 计算各项属性
|
||||
@@ -65,6 +54,7 @@ func (p *PetInfo) CalculatePetPane(limit uint32) {
|
||||
uint32(petxml.Atk),
|
||||
|
||||
p.Ev[1],
|
||||
level,
|
||||
naxml.AttackCorrect,
|
||||
)
|
||||
|
||||
@@ -72,6 +62,7 @@ func (p *PetInfo) CalculatePetPane(limit uint32) {
|
||||
uint32(petxml.Def),
|
||||
|
||||
p.Ev[2],
|
||||
level,
|
||||
naxml.DefenseCorrect,
|
||||
)
|
||||
|
||||
@@ -79,6 +70,7 @@ func (p *PetInfo) CalculatePetPane(limit uint32) {
|
||||
uint32(petxml.SpAtk),
|
||||
|
||||
p.Ev[3],
|
||||
level,
|
||||
naxml.SaCorrect,
|
||||
)
|
||||
|
||||
@@ -86,6 +78,7 @@ func (p *PetInfo) CalculatePetPane(limit uint32) {
|
||||
uint32(petxml.SpDef),
|
||||
|
||||
p.Ev[4],
|
||||
level,
|
||||
naxml.SdCorrect,
|
||||
)
|
||||
|
||||
@@ -93,6 +86,7 @@ func (p *PetInfo) CalculatePetPane(limit uint32) {
|
||||
uint32(petxml.Spd),
|
||||
|
||||
p.Ev[5],
|
||||
level,
|
||||
naxml.SpeedCorrect,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user