refactor(common/cool/coolconfig): 修改RPC配置字段类型 将RPC字段从uint16类型更改为string类型的Address字段, 以支持更灵活的地址配置。同时更新了配置初始化逻辑, 从server.rpc改为server.address作为配置键。 ```
43 lines
753 B
Go
43 lines
753 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/info"
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
|
|
"github.com/alpacahq/alpacadecimal"
|
|
)
|
|
|
|
// 可以抵挡n点伤害
|
|
// ---- Effect49 ----
|
|
type Effect49 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect49) DamageSubEx(t *info.DamageZone) bool {
|
|
|
|
if e.Ctx().SkillEntity == nil {
|
|
return true
|
|
}
|
|
if e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
|
return true
|
|
}
|
|
if t.Type != info.DamageType.Red {
|
|
return true
|
|
|
|
}
|
|
|
|
if t.Damage.Cmp(e.Args()[0]) > -1 {
|
|
t.Damage = t.Damage.Sub(e.Args()[0])
|
|
} else {
|
|
t.Damage = alpacadecimal.Zero
|
|
}
|
|
|
|
return true
|
|
}
|
|
|
|
// ---- 注册所有效果 ----
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 49, &Effect49{})
|
|
}
|