更新说明
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed

This commit is contained in:
xinian
2026-04-05 23:13:06 +08:00
committed by cnb
parent 24b463f0aa
commit d83cf365ac
39 changed files with 307 additions and 111 deletions

View File

@@ -43,6 +43,21 @@ type BossHookPetContext struct {
MaxHp uint32 `json:"max_hp"`
}
// BossHookAttackContext 参考 AttackValue为脚本暴露关键战斗面板/结果字段。
type BossHookAttackContext struct {
SkillID uint32 `json:"skill_id"`
AttackTime uint32 `json:"attack_time"`
IsCritical uint32 `json:"is_critical"`
LostHp uint32 `json:"lost_hp"`
GainHp int32 `json:"gain_hp"`
RemainHp int32 `json:"remain_hp"`
MaxHp uint32 `json:"max_hp"`
State uint32 `json:"state"`
Offensive float32 `json:"offensive"`
Status []int8 `json:"status"`
Prop []int8 `json:"prop"`
}
// BossHookActionContext 为 boss 脚本提供可读写的出手上下文。
type BossHookActionContext struct {
HookAction bool `json:"hookaction"` // effect 链原始 HookAction 判定
@@ -51,6 +66,8 @@ type BossHookActionContext struct {
Our *BossHookPetContext `json:"our"` // 我方当前精灵
Opp *BossHookPetContext `json:"opp"` // 对方当前精灵
Skills []BossHookSkillContext `json:"skills"` // 我方技能
OurAttack *BossHookAttackContext `json:"our_attack"` // 我方AttackValue快照
OppAttack *BossHookAttackContext `json:"opp_attack"` // 对方AttackValue快照
Action string `json:"action"` // auto/skill/switch
SkillID uint32 `json:"skill_id"` // action=skill
CatchTime uint32 `json:"catch_time"` // action=switch
@@ -59,22 +76,10 @@ type BossHookActionContext struct {
SwitchPetFn func(catchTime uint32) `json:"-"`
}
// TableName 指定BossConfig对应的数据库表名
func (*BossConfig) TableName() string {
return TableNameBossConfig
}
func (*BossConfig) TableName() string { return TableNameBossConfig }
func (*BossConfig) GroupName() string { return "default" }
func NewBossConfig() *BossConfig { return &BossConfig{Model: cool.NewModel()} }
// GroupName 指定表所属的分组(保持和怪物刷新表一致)
func (*BossConfig) GroupName() string {
return "default"
}
// NewBossConfig 创建一个新的BossConfig实例初始化通用Model字段+所有默认值)
func NewBossConfig() *BossConfig {
return &BossConfig{Model: cool.NewModel()}
}
// init 程序启动时自动创建/同步boss_config表结构
func init() {
cool.CreateTable(&BossConfig{})
}