mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-18 20:50:12 +08:00
chore(lint): 改进代码样式 (#968)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
7b45374310
commit
ff62723e91
2
main.go
2
main.go
@ -113,10 +113,10 @@ import (
|
||||
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/nativesetu" // 本地涩图
|
||||
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/nbnhhsh" // 拼音首字母缩写释义工具
|
||||
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/nihongo" // 日语语法学习
|
||||
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/niuniu" // 牛牛大作战
|
||||
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/novel" // 铅笔小说网搜索
|
||||
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/nsfw" // nsfw图片识别
|
||||
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/nwife" // 本地老婆
|
||||
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/niuniu" // 牛牛大作战
|
||||
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/omikuji" // 浅草寺求签
|
||||
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/poker" // 抽扑克
|
||||
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/qqwife" // 一群一天一夫一妻制群老婆
|
||||
|
||||
@ -3,16 +3,17 @@ package niuniu
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
ctrl "github.com/FloatTech/zbpctrl"
|
||||
"github.com/FloatTech/zbputils/control"
|
||||
"github.com/FloatTech/zbputils/ctxext"
|
||||
zero "github.com/wdvxdr1123/ZeroBot"
|
||||
"github.com/wdvxdr1123/ZeroBot/extension/rate"
|
||||
"github.com/wdvxdr1123/ZeroBot/message"
|
||||
"math/rand"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -145,14 +146,14 @@ func init() {
|
||||
ctx.SendChain(message.Text("你已经注册过了"))
|
||||
return
|
||||
}
|
||||
//获取初始长度
|
||||
// 获取初始长度
|
||||
long := db.randLength()
|
||||
u := userInfo{
|
||||
UID: uid,
|
||||
Length: long,
|
||||
UserCount: 0,
|
||||
}
|
||||
//添加数据进入表
|
||||
// 添加数据进入表
|
||||
err := db.insertniuniu(&u, gid)
|
||||
if err != nil {
|
||||
err = db.createGIDTable(gid)
|
||||
@ -241,4 +242,3 @@ func init() {
|
||||
func randomChoice(options []string) string {
|
||||
return options[rand.Intn(len(options))]
|
||||
}
|
||||
|
||||
|
||||
@ -2,15 +2,16 @@
|
||||
package niuniu
|
||||
|
||||
import (
|
||||
fcext "github.com/FloatTech/floatbox/ctxext"
|
||||
sql "github.com/FloatTech/sqlite"
|
||||
zero "github.com/wdvxdr1123/ZeroBot"
|
||||
"github.com/wdvxdr1123/ZeroBot/message"
|
||||
"math/rand"
|
||||
"sort"
|
||||
"strconv"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
fcext "github.com/FloatTech/floatbox/ctxext"
|
||||
sql "github.com/FloatTech/sqlite"
|
||||
zero "github.com/wdvxdr1123/ZeroBot"
|
||||
"github.com/wdvxdr1123/ZeroBot/message"
|
||||
)
|
||||
|
||||
type model struct {
|
||||
|
||||
@ -166,7 +166,6 @@ func applySkill(myLength, oppoLength float64, increaseLength1 bool) (string, flo
|
||||
return fmt.Sprintf("哦吼!?你的牛牛在长大欸!长大了%.2fcm!", reduce), myLength, oppoLength
|
||||
}
|
||||
return fmt.Sprintf("你以绝对的长度让对方屈服了呢!你的长度增加%.2fcm,当前长度%.2fcm!", reduce, myLength), myLength, oppoLength
|
||||
|
||||
}
|
||||
myLength -= reduce
|
||||
oppoLength += 0.8 * reduce
|
||||
@ -174,7 +173,6 @@ func applySkill(myLength, oppoLength float64, increaseLength1 bool) (string, flo
|
||||
return fmt.Sprintf("哦吼!?看来你的牛牛因为击剑而凹进去了呢🤣🤣🤣!凹进去了%.2fcm!", reduce), myLength, oppoLength
|
||||
}
|
||||
return fmt.Sprintf("对方以绝对的长度让你屈服了呢!你的长度减少%.2fcm,当前长度%.2fcm!", reduce, myLength), myLength, oppoLength
|
||||
|
||||
}
|
||||
|
||||
// fence
|
||||
@ -189,4 +187,3 @@ func fence(rd float64) float64 {
|
||||
func hitGlue(l float64) float64 {
|
||||
return rand.Float64() * math.Log2(l) / 2
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user