This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/player"
|
||||
configmodel "blazing/modules/config/model"
|
||||
playermodel "blazing/modules/player/model"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v2/util/grand"
|
||||
@@ -146,6 +147,9 @@ func buildBossHookActionContext(our *Input, hookAction bool) *configmodel.BossHo
|
||||
}
|
||||
}
|
||||
|
||||
if our.AttackValue != nil {
|
||||
ctx.OurAttack = convertAttackValue(our.AttackValue)
|
||||
}
|
||||
if our.Opp != nil {
|
||||
if oppPet := our.Opp.CurrentPet(); oppPet != nil {
|
||||
ctx.Opp = &configmodel.BossHookPetContext{
|
||||
@@ -155,11 +159,42 @@ func buildBossHookActionContext(our *Input, hookAction bool) *configmodel.BossHo
|
||||
MaxHp: oppPet.Info.MaxHp,
|
||||
}
|
||||
}
|
||||
if our.Opp.AttackValue != nil {
|
||||
ctx.OppAttack = convertAttackValue(our.Opp.AttackValue)
|
||||
}
|
||||
}
|
||||
|
||||
return ctx
|
||||
}
|
||||
|
||||
func convertAttackValue(src *playermodel.AttackValue) *configmodel.BossHookAttackContext {
|
||||
if src == nil {
|
||||
return nil
|
||||
}
|
||||
status := make([]int8, len(src.Status))
|
||||
for i := range src.Status {
|
||||
status[i] = src.Status[i]
|
||||
}
|
||||
prop := make([]int8, len(src.Prop))
|
||||
for i := range src.Prop {
|
||||
prop[i] = src.Prop[i]
|
||||
}
|
||||
|
||||
return &configmodel.BossHookAttackContext{
|
||||
SkillID: src.SkillID,
|
||||
AttackTime: src.AttackTime,
|
||||
IsCritical: src.IsCritical,
|
||||
LostHp: src.LostHp,
|
||||
GainHp: src.GainHp,
|
||||
RemainHp: src.RemainHp,
|
||||
MaxHp: src.MaxHp,
|
||||
State: src.State,
|
||||
Offensive: src.Offensive,
|
||||
Status: status,
|
||||
Prop: prop,
|
||||
}
|
||||
}
|
||||
|
||||
func applyBossScriptAction(our *Input, ctx *configmodel.BossHookActionContext) bool {
|
||||
if our == nil || ctx == nil {
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user