feat: 添加BossConfig战胜规则字段并移除MapNode冗余字段
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
This commit is contained in:
@@ -101,7 +101,7 @@ func (Controller) PlayerFightBoss(data1 *fight.ChallengeBossInboundInfo, p *play
|
|||||||
var fighc *fight.FightC
|
var fighc *fight.FightC
|
||||||
fighc, _ = fight.NewFight(p, ai, func(foi model.FightOverInfo) {
|
fighc, _ = fight.NewFight(p, ai, func(foi model.FightOverInfo) {
|
||||||
if mdata.WinBonusID != 0 {
|
if mdata.WinBonusID != 0 {
|
||||||
if len(mdata.Rule) == 0 {
|
if len(bosinfo[0].Rule) == 0 {
|
||||||
if foi.Reason == 0 && foi.WinnerId == p.Info.UserID {
|
if foi.Reason == 0 && foi.WinnerId == p.Info.UserID {
|
||||||
p.SptCompletedTask(mdata.WinBonusID, 1)
|
p.SptCompletedTask(mdata.WinBonusID, 1)
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@ func (Controller) PlayerFightBoss(data1 *fight.ChallengeBossInboundInfo, p *play
|
|||||||
} else {
|
} else {
|
||||||
//说明是带规则的
|
//说明是带规则的
|
||||||
iswin := true
|
iswin := true
|
||||||
for _, v := range service.NewFightRuleService().GetByRuleIdxs(mdata.Rule) {
|
for _, v := range service.NewFightRuleService().GetByRuleIdxs(bosinfo[0].Rule) {
|
||||||
r := input.GetRule(int64(v.RuleIdx))
|
r := input.GetRule(int64(v.RuleIdx))
|
||||||
if r != nil {
|
if r != nil {
|
||||||
r.SetArgs(v.Args...)
|
r.SetArgs(v.Args...)
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ type BossConfig struct {
|
|||||||
ParentID int32 `gorm:"not null;default:0;column:parentId;type:int" json:"parentId"` // 父ID
|
ParentID int32 `gorm:"not null;default:0;column:parentId;type:int" json:"parentId"` // 父ID
|
||||||
Remark string `gorm:"comment:'BOSS备注'" json:"remark"`
|
Remark string `gorm:"comment:'BOSS备注'" json:"remark"`
|
||||||
//是否可捕捉MapPit
|
//是否可捕捉MapPit
|
||||||
IsCapture int `gorm:"type:int;default:0;comment:'是否可捕捉'" json:"is_capture"`
|
IsCapture int `gorm:"type:int;default:0;comment:'是否可捕捉'" json:"is_capture"`
|
||||||
Script string `gorm:"size:1024;default:'';comment:'BOSS脚本'" json:"script"` //boss出招逻辑做成js脚本
|
Script string `gorm:"size:1024;default:'';comment:'BOSS脚本'" json:"script"` //boss出招逻辑做成js脚本
|
||||||
|
Rule []uint32 `gorm:"type:jsonb; ;comment:'战胜规则'" json:"rule"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// TableName 指定BossConfig对应的数据库表名
|
// TableName 指定BossConfig对应的数据库表名
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ type MapNode struct {
|
|||||||
//完成后的脚本回调,比如战胜和击败绑定不同的任务ID,以及剧情绑定不同的ID
|
//完成后的脚本回调,比如战胜和击败绑定不同的任务ID,以及剧情绑定不同的ID
|
||||||
//回调通boss打完给前端发送固定事件
|
//回调通boss打完给前端发送固定事件
|
||||||
//PlotFinishScript string `gorm:"type:text;comment:'剧情完成后脚本回调'" json:"plot_finish_script" description:"剧情完成后脚本回调"`
|
//PlotFinishScript string `gorm:"type:text;comment:'剧情完成后脚本回调'" json:"plot_finish_script" description:"剧情完成后脚本回调"`
|
||||||
Rule []uint32 `gorm:"type:jsonb; ;comment:'战胜规则'" json:"rule"`
|
|
||||||
BossIds []uint32 `gorm:"type:jsonb; ;comment:'塔层BOSS ID列表'" json:"boss_ids"`
|
BossIds []uint32 `gorm:"type:jsonb; ;comment:'塔层BOSS ID列表'" json:"boss_ids"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user