feat: 添加战胜规则配置模块
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:
@@ -8,6 +8,7 @@ import (
|
||||
|
||||
"blazing/logic/service/fight"
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
|
||||
"blazing/logic/service/player"
|
||||
configmodel "blazing/modules/config/model"
|
||||
@@ -97,12 +98,34 @@ func (Controller) PlayerFightBoss(data1 *fight.ChallengeBossInboundInfo, p *play
|
||||
}
|
||||
|
||||
ai.Prop[0] = 2
|
||||
fight.NewFight(p, ai, func(foi model.FightOverInfo) {
|
||||
var fighc *fight.FightC
|
||||
fighc, _ = fight.NewFight(p, ai, func(foi model.FightOverInfo) {
|
||||
if mdata.WinBonusID != 0 {
|
||||
if foi.Reason == 0 && foi.WinnerId == p.Info.UserID {
|
||||
p.SptCompletedTask(mdata.WinBonusID, 1)
|
||||
if len(mdata.Rule) == 0 {
|
||||
if foi.Reason == 0 && foi.WinnerId == p.Info.UserID {
|
||||
p.SptCompletedTask(mdata.WinBonusID, 1)
|
||||
|
||||
}
|
||||
} else {
|
||||
//说明是带规则的
|
||||
iswin := true
|
||||
for _, v := range service.NewFightRuleService().GetByRuleIdxs(mdata.Rule) {
|
||||
r := input.GetRule(int64(v.RuleIdx))
|
||||
if r != nil {
|
||||
r.SetArgs(v.Args...)
|
||||
|
||||
if !(r.Exec(fighc, &foi)) {
|
||||
iswin = false
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if iswin {
|
||||
p.SptCompletedTask(mdata.WinBonusID, 1)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//p.Done.Exec(model.MilestoneMode.BOSS, []uint32{p.Info.MapID, data.BossId, uint32(foi.Reason)}, nil)
|
||||
|
||||
Reference in New Issue
Block a user