fix: 修正技能效果索引与实现逻辑
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:
@@ -33,5 +33,5 @@ func (e *NewSel113) DamageLockEx(t *info.DamageZone) bool {
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 113, &NewSel113{})
|
||||
input.InitEffect(input.EffectType.NewSel, 213, &NewSel113{})
|
||||
}
|
||||
|
||||
@@ -33,5 +33,5 @@ func (e *NewSel144) Action_end_ex() bool {
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 144, &NewSel144{})
|
||||
input.InitEffect(input.EffectType.NewSel, 244, &NewSel144{})
|
||||
}
|
||||
|
||||
@@ -40,5 +40,5 @@ func (e *NewSel224) Skill_Use() bool {
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 224, &NewSel224{})
|
||||
input.InitEffect(input.EffectType.NewSel, 324, &NewSel224{})
|
||||
}
|
||||
|
||||
@@ -22,5 +22,5 @@ func (e *NewSel41) Skill_Use_ex() bool {
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 41, &NewSel41{})
|
||||
input.InitEffect(input.EffectType.NewSel, 141, &NewSel41{})
|
||||
}
|
||||
|
||||
327
logic/service/fight/boss/json_eid_advanced.go
Normal file
327
logic/service/fight/boss/json_eid_advanced.go
Normal file
@@ -0,0 +1,327 @@
|
||||
package effect
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/action"
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
"github.com/gogf/gf/v2/util/grand"
|
||||
)
|
||||
|
||||
func bossJsonTransferPositive(from, to *input.Input) bool {
|
||||
changed := false
|
||||
for i := 0; i < 6; i++ {
|
||||
if from.AttackValue.Prop[i] <= 0 {
|
||||
continue
|
||||
}
|
||||
changed = true
|
||||
stage := from.AttackValue.Prop[i]
|
||||
from.AttackValue.Prop[i] = 0
|
||||
to.AttackValue.Prop[i] += stage
|
||||
if to.AttackValue.Prop[i] > 6 {
|
||||
to.AttackValue.Prop[i] = 6
|
||||
}
|
||||
}
|
||||
return changed
|
||||
}
|
||||
|
||||
func bossJsonActionMatches(skill *info.SkillEntity, act *action.SelectSkillAction, userID uint32) bool {
|
||||
if skill == nil || act == nil || act.SkillEntity == nil || act.PlayerID != userID {
|
||||
return false
|
||||
}
|
||||
return act.SkillEntity.XML.ID == skill.XML.ID
|
||||
}
|
||||
|
||||
// 41: 每回合恢复固定体力
|
||||
type BossJsonEid41 struct{ BossJsonEid0 }
|
||||
|
||||
func (e *BossJsonEid41) TurnStart(fattack, sattack *action.SelectSkillAction) {
|
||||
if !e.ownerActive() {
|
||||
return
|
||||
}
|
||||
heal := bossJsonFirstPositiveArg(e.Args(), 0)
|
||||
if heal > 0 {
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, nil, alpacadecimal.NewFromInt(int64(heal)))
|
||||
}
|
||||
}
|
||||
|
||||
// 113: 对手使用技能后全属性-1
|
||||
type BossJsonEid113 struct{ BossJsonEid0 }
|
||||
|
||||
func (e *BossJsonEid113) Action_end_ex() bool {
|
||||
if !e.ownerActive() || e.Ctx().SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
stage := int8(bossJsonFirstPositiveArg(e.Args(), 1))
|
||||
bossJsonBoostAll(e.Ctx().Opp, e.Ctx().Our, -stage)
|
||||
return true
|
||||
}
|
||||
|
||||
// 144: 对手技能结束时,消除对手的能力提升
|
||||
type BossJsonEid144 struct{ BossJsonEid0 }
|
||||
|
||||
func (e *BossJsonEid144) Action_end_ex() bool {
|
||||
if !e.ownerActive() || e.Ctx().SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
bossJsonClearPositive(e.Ctx().Opp)
|
||||
return true
|
||||
}
|
||||
|
||||
// 224: 首次死亡后恢复全部体力,并使全能力等级等于指定值
|
||||
type BossJsonEid224 struct {
|
||||
BossJsonEid0
|
||||
used bool
|
||||
}
|
||||
|
||||
func (e *BossJsonEid224) revive() bool {
|
||||
if !e.ownerActive() || e.used || e.Ctx().Our.CurrentPet.Info.Hp != 0 {
|
||||
return true
|
||||
}
|
||||
e.used = true
|
||||
e.Ctx().Our.CurrentPet.Info.Hp = e.Ctx().Our.CurrentPet.Info.MaxHp
|
||||
e.Ctx().Our.HealPP(-1)
|
||||
stageSeed := bossJsonIntArg(e.Args(), len(e.Args())-1, 6)
|
||||
stage := int8(stageSeed - 6)
|
||||
if stage < 0 {
|
||||
stage = 0
|
||||
}
|
||||
if stage > 6 {
|
||||
stage = 6
|
||||
}
|
||||
bossJsonSetAll(e.Ctx().Our, stage)
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *BossJsonEid224) Action_end() bool { return e.revive() }
|
||||
func (e *BossJsonEid224) Action_end_ex() bool { return e.revive() }
|
||||
|
||||
// 2095: 对手存在能力提升或回合类效果时伤害提升
|
||||
type BossJsonEid2095 struct{ BossJsonEid0 }
|
||||
|
||||
func (e *BossJsonEid2095) Damage_Mul(zone *info.DamageZone) bool {
|
||||
if !e.ownerActive() || zone.Type != info.DamageType.Red {
|
||||
return true
|
||||
}
|
||||
if !bossJsonHasPositive(e.Ctx().Opp) && !bossJsonAnyTurnEffect(e.Ctx().Opp) {
|
||||
return true
|
||||
}
|
||||
bonus := bossJsonFirstPositiveArg(e.Args(), 0)
|
||||
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(int64(100 + bonus))).Div(alpacadecimal.NewFromInt(100))
|
||||
return true
|
||||
}
|
||||
|
||||
// 2104: 回合开始提升体力上限;回合结束恢复已损失体力的一定比例
|
||||
type BossJsonEid2104 struct{ BossJsonEid0 }
|
||||
|
||||
func (e *BossJsonEid2104) TurnStart(fattack, sattack *action.SelectSkillAction) {
|
||||
if !e.ownerActive() {
|
||||
return
|
||||
}
|
||||
growPercent := bossJsonIntArg(e.Args(), 1, 0)
|
||||
if growPercent <= 0 {
|
||||
return
|
||||
}
|
||||
add := int(e.Ctx().Our.CurrentPet.Info.MaxHp) * growPercent / 100
|
||||
if add <= 0 {
|
||||
return
|
||||
}
|
||||
e.Ctx().Our.CurrentPet.Info.MaxHp += uint32(add)
|
||||
e.Ctx().Our.CurrentPet.Info.Hp += uint32(add)
|
||||
}
|
||||
|
||||
func (e *BossJsonEid2104) TurnEnd() {
|
||||
if !e.ownerActive() {
|
||||
return
|
||||
}
|
||||
recoverPercent := bossJsonIntArg(e.Args(), 0, 0)
|
||||
if recoverPercent <= 0 || e.Ctx().Our.CurrentPet.Info.MaxHp <= e.Ctx().Our.CurrentPet.Info.Hp {
|
||||
return
|
||||
}
|
||||
missing := int(e.Ctx().Our.CurrentPet.Info.MaxHp - e.Ctx().Our.CurrentPet.Info.Hp)
|
||||
heal := missing * recoverPercent / 100
|
||||
if heal > 0 {
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, nil, alpacadecimal.NewFromInt(int64(heal)))
|
||||
}
|
||||
}
|
||||
|
||||
// 2103: 吸取对手能力提升,否则随机削弱并附加给自身;回合结束吸取固定体力
|
||||
type BossJsonEid2103 struct{ BossJsonEid0 }
|
||||
|
||||
func (e *BossJsonEid2103) TurnStart(fattack, sattack *action.SelectSkillAction) {
|
||||
if !e.ownerActive() {
|
||||
return
|
||||
}
|
||||
if bossJsonTransferPositive(e.Ctx().Opp, e.Ctx().Our) {
|
||||
return
|
||||
}
|
||||
count := bossJsonIntArg(e.Args(), 0, 0)
|
||||
stage := int8(bossJsonIntArg(e.Args(), 1, 0))
|
||||
if count <= 0 || stage <= 0 {
|
||||
return
|
||||
}
|
||||
used := map[int]struct{}{}
|
||||
for len(used) < count && len(used) < 6 {
|
||||
used[grand.Intn(6)] = struct{}{}
|
||||
}
|
||||
for idx := range used {
|
||||
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(idx), -stage)
|
||||
e.Ctx().Our.SetProp(e.Ctx().Our, int8(idx), stage)
|
||||
}
|
||||
}
|
||||
|
||||
func (e *BossJsonEid2103) TurnEnd() {
|
||||
if !e.ownerActive() {
|
||||
return
|
||||
}
|
||||
value := bossJsonIntArg(e.Args(), 2, 0)
|
||||
if value <= 0 {
|
||||
return
|
||||
}
|
||||
damage := alpacadecimal.NewFromInt(int64(value))
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: damage})
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, nil, damage)
|
||||
}
|
||||
|
||||
// 2105: 低血量时获得若干回合力量(这里按伤害翻倍处理)
|
||||
type BossJsonEid2105 struct {
|
||||
BossJsonEid0
|
||||
rounds int
|
||||
}
|
||||
|
||||
func (e *BossJsonEid2105) Damage_Mul(zone *info.DamageZone) bool {
|
||||
if !e.ownerActive() || e.rounds <= 0 || zone.Type != info.DamageType.Red {
|
||||
return true
|
||||
}
|
||||
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(2))
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *BossJsonEid2105) TurnEnd() {
|
||||
if !e.ownerActive() {
|
||||
return
|
||||
}
|
||||
if e.rounds > 0 {
|
||||
e.rounds--
|
||||
}
|
||||
threshold := bossJsonIntArg(e.Args(), 0, 0)
|
||||
grant := bossJsonIntArg(e.Args(), 1, 0)
|
||||
if threshold <= 0 || grant <= 0 || e.Ctx().Our.CurrentPet.Info.MaxHp == 0 {
|
||||
return
|
||||
}
|
||||
if int(e.Ctx().Our.CurrentPet.Info.Hp)*100 < int(e.Ctx().Our.CurrentPet.Info.MaxHp)*threshold && e.rounds < grant {
|
||||
e.rounds = grant
|
||||
}
|
||||
}
|
||||
|
||||
// 2137: 恢复效果逐回合衰减,衰减前自身增伤并附加固伤
|
||||
type BossJsonEid2137 struct {
|
||||
BossJsonEid0
|
||||
healRate int
|
||||
}
|
||||
|
||||
func (e *BossJsonEid2137) TurnStart(fattack, sattack *action.SelectSkillAction) {
|
||||
if !e.ownerActive() {
|
||||
return
|
||||
}
|
||||
if e.healRate == 0 {
|
||||
e.healRate = 100
|
||||
}
|
||||
dec := bossJsonIntArg(e.Args(), 0, 0)
|
||||
if dec > 0 {
|
||||
e.healRate -= dec
|
||||
if e.healRate < 0 {
|
||||
e.healRate = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (e *BossJsonEid2137) Heal_Pre(_ action.BattleActionI, amount *int) bool {
|
||||
if !e.ownerActive() || e.healRate >= 100 {
|
||||
return true
|
||||
}
|
||||
*amount = *amount * e.healRate / 100
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *BossJsonEid2137) DamageAdd(zone *info.DamageZone) bool {
|
||||
if !e.ownerActive() || e.healRate <= 0 || zone.Type != info.DamageType.Red {
|
||||
return true
|
||||
}
|
||||
fixed := bossJsonIntArg(e.Args(), 2, 0)
|
||||
if fixed > 0 {
|
||||
zone.Damage = zone.Damage.Add(alpacadecimal.NewFromInt(int64(fixed)))
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *BossJsonEid2137) Damage_Mul(zone *info.DamageZone) bool {
|
||||
if !e.ownerActive() || e.healRate <= 0 || zone.Type != info.DamageType.Red {
|
||||
return true
|
||||
}
|
||||
bonus := bossJsonIntArg(e.Args(), 1, 0)
|
||||
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(int64(100 + bonus))).Div(alpacadecimal.NewFromInt(100))
|
||||
return true
|
||||
}
|
||||
|
||||
// 1621: 对手攻击技能后出手则无效
|
||||
type BossJsonEid1621 struct{ BossJsonEid0 }
|
||||
|
||||
func (e *BossJsonEid1621) ActionStart(firstAttack, secondAttack *action.SelectSkillAction) bool {
|
||||
if !e.ownerActive() || !bossJsonIsAttackSkill(e.Ctx().SkillEntity) {
|
||||
return true
|
||||
}
|
||||
userID := e.Ctx().Our.Player.GetInfo().UserID
|
||||
if !bossJsonActionMatches(e.Ctx().SkillEntity, secondAttack, userID) {
|
||||
return true
|
||||
}
|
||||
if firstAttack == nil || !bossJsonIsAttackSkill(firstAttack.SkillEntity) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// 1254: 先出手则当回合免疫受到的攻击伤害
|
||||
type BossJsonEid1254 struct {
|
||||
BossJsonEid0
|
||||
immuneThisTurn bool
|
||||
}
|
||||
|
||||
func (e *BossJsonEid1254) ActionStart(firstAttack, secondAttack *action.SelectSkillAction) bool {
|
||||
e.immuneThisTurn = false
|
||||
if !e.ownerActive() || !bossJsonIsAttackSkill(e.Ctx().SkillEntity) {
|
||||
return true
|
||||
}
|
||||
userID := e.Ctx().Our.Player.GetInfo().UserID
|
||||
e.immuneThisTurn = bossJsonActionMatches(e.Ctx().SkillEntity, firstAttack, userID)
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *BossJsonEid1254) DamageLockEx(zone *info.DamageZone) bool {
|
||||
if !e.ownerActive() || !e.immuneThisTurn || zone.Type != info.DamageType.Red || e.Ctx().SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
if bossJsonIsAttackSkill(e.Ctx().SkillEntity) {
|
||||
zone.Damage = alpacadecimal.Zero
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *BossJsonEid1254) TurnEnd() {
|
||||
e.immuneThisTurn = false
|
||||
}
|
||||
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 41, &BossJsonEid41{})
|
||||
input.InitEffect(input.EffectType.NewSel, 113, &BossJsonEid113{})
|
||||
input.InitEffect(input.EffectType.NewSel, 144, &BossJsonEid144{})
|
||||
input.InitEffect(input.EffectType.NewSel, 224, &BossJsonEid224{})
|
||||
input.InitEffect(input.EffectType.NewSel, 2095, &BossJsonEid2095{})
|
||||
input.InitEffect(input.EffectType.NewSel, 2104, &BossJsonEid2104{})
|
||||
input.InitEffect(input.EffectType.NewSel, 2103, &BossJsonEid2103{})
|
||||
input.InitEffect(input.EffectType.NewSel, 2105, &BossJsonEid2105{})
|
||||
input.InitEffect(input.EffectType.NewSel, 2137, &BossJsonEid2137{})
|
||||
input.InitEffect(input.EffectType.NewSel, 1621, &BossJsonEid1621{})
|
||||
input.InitEffect(input.EffectType.NewSel, 1254, &BossJsonEid1254{})
|
||||
}
|
||||
379
logic/service/fight/boss/json_eid_basic.go
Normal file
379
logic/service/fight/boss/json_eid_basic.go
Normal file
@@ -0,0 +1,379 @@
|
||||
package effect
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/action"
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
"github.com/gogf/gf/v2/util/grand"
|
||||
)
|
||||
|
||||
type BossJsonEid0 struct {
|
||||
NewSel0
|
||||
}
|
||||
|
||||
func (e *BossJsonEid0) ownerActive() bool {
|
||||
return e.IsOwner()
|
||||
}
|
||||
|
||||
func bossJsonIntArg(args []alpacadecimal.Decimal, idx int, def int) int {
|
||||
if idx >= 0 && idx < len(args) {
|
||||
return int(args[idx].IntPart())
|
||||
}
|
||||
return def
|
||||
}
|
||||
|
||||
func bossJsonFirstPositiveArg(args []alpacadecimal.Decimal, def int) int {
|
||||
for _, arg := range args {
|
||||
if arg.IntPart() > 0 {
|
||||
return int(arg.IntPart())
|
||||
}
|
||||
}
|
||||
return def
|
||||
}
|
||||
|
||||
func bossJsonIsAttackSkill(skill *info.SkillEntity) bool {
|
||||
return skill != nil && skill.Category() != info.Category.STATUS
|
||||
}
|
||||
|
||||
func bossJsonBoostAll(target, source *input.Input, delta int8) {
|
||||
for i := 0; i < 6; i++ {
|
||||
target.SetProp(source, int8(i), delta)
|
||||
}
|
||||
}
|
||||
|
||||
func bossJsonSetAll(target *input.Input, value int8) {
|
||||
for i := 0; i < 6; i++ {
|
||||
target.AttackValue.Prop[i] = value
|
||||
}
|
||||
}
|
||||
|
||||
func bossJsonClearPositive(target *input.Input) bool {
|
||||
changed := false
|
||||
for i := 0; i < 6; i++ {
|
||||
if target.AttackValue.Prop[i] > 0 {
|
||||
target.AttackValue.Prop[i] = 0
|
||||
changed = true
|
||||
}
|
||||
}
|
||||
return changed
|
||||
}
|
||||
|
||||
func bossJsonHasPositive(target *input.Input) bool {
|
||||
for i := 0; i < 6; i++ {
|
||||
if target.AttackValue.Prop[i] > 0 {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func bossJsonAnyTurnEffect(target *input.Input) bool {
|
||||
for _, effect := range target.Effects {
|
||||
if effect.Alive() && effect.Duration() > 0 {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// 1261/2346: 神话
|
||||
// 免疫异常状态和能力下降状态,所有技能必中且PP值无限
|
||||
type BossJsonEidMyth struct{ BossJsonEid0 }
|
||||
|
||||
func (e *BossJsonEidMyth) PropBefer(in *input.Input, prop int8, level int8) bool {
|
||||
if !e.ownerActive() || in == e.Ctx().Our {
|
||||
return true
|
||||
}
|
||||
return level >= 0
|
||||
}
|
||||
|
||||
func (e *BossJsonEidMyth) EFFect_Befer(in *input.Input, effEffect input.Effect) bool {
|
||||
if !e.ownerActive() || in != e.Ctx().Opp {
|
||||
return true
|
||||
}
|
||||
return !input.IS_Stat(effEffect)
|
||||
}
|
||||
|
||||
func (e *BossJsonEidMyth) ActionStart(a, b *action.SelectSkillAction) bool {
|
||||
if !e.ownerActive() || e.Ctx().SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
e.Ctx().SkillEntity.XML.MustHit = 1
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *BossJsonEidMyth) HookPP(count *int) bool {
|
||||
if !e.ownerActive() {
|
||||
return true
|
||||
}
|
||||
*count = 0
|
||||
return true
|
||||
}
|
||||
|
||||
// 600: 所有技能必定先手
|
||||
type BossJsonEid600 struct{ BossJsonEid0 }
|
||||
|
||||
func (e *BossJsonEid600) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
||||
if !e.ownerActive() {
|
||||
return true
|
||||
}
|
||||
userID := e.Ctx().Our.Player.GetInfo().UserID
|
||||
if fattack != nil && fattack.PlayerID == userID && fattack.SkillEntity != nil {
|
||||
fattack.SkillEntity.XML.Priority += 1000
|
||||
}
|
||||
if sattack != nil && sattack.PlayerID == userID && sattack.SkillEntity != nil {
|
||||
sattack.SkillEntity.XML.Priority += 1000
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// 390: 自身使用技能后全属性+1
|
||||
type BossJsonEid390 struct{ BossJsonEid0 }
|
||||
|
||||
func (e *BossJsonEid390) Action_end() bool {
|
||||
if !e.ownerActive() || e.Ctx().SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
bossJsonBoostAll(e.Ctx().Our, e.Ctx().Our, int8(bossJsonFirstPositiveArg(e.Args(), 1)))
|
||||
return true
|
||||
}
|
||||
|
||||
// 792: 格挡物攻/特攻
|
||||
type BossJsonEid792 struct{ BossJsonEid0 }
|
||||
|
||||
func (e *BossJsonEid792) DamageLockEx(zone *info.DamageZone) bool {
|
||||
if !e.ownerActive() || zone.Type != info.DamageType.Red || e.Ctx().SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
mode := bossJsonIntArg(e.Args(), 0, 0)
|
||||
if mode == 1 && e.Ctx().SkillEntity.Category() == info.Category.PHYSICAL {
|
||||
zone.Damage = alpacadecimal.Zero
|
||||
}
|
||||
if mode == 2 && e.Ctx().SkillEntity.Category() == info.Category.SPECIAL {
|
||||
zone.Damage = alpacadecimal.Zero
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// 219: 抵挡未打出致命一击的攻击
|
||||
type BossJsonEid219 struct{ BossJsonEid0 }
|
||||
|
||||
func (e *BossJsonEid219) DamageLockEx(zone *info.DamageZone) bool {
|
||||
if !e.ownerActive() || zone.Type != info.DamageType.Red || e.Ctx().SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().SkillEntity.Crit == 0 {
|
||||
zone.Damage = alpacadecimal.Zero
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// 208: 抵挡非先制攻击
|
||||
type BossJsonEid208 struct{ BossJsonEid0 }
|
||||
|
||||
func (e *BossJsonEid208) DamageLockEx(zone *info.DamageZone) bool {
|
||||
if !e.ownerActive() || zone.Type != info.DamageType.Red || e.Ctx().SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().SkillEntity.XML.Priority <= 0 {
|
||||
zone.Damage = alpacadecimal.Zero
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// 1216: 免疫固定伤害、百分比伤害
|
||||
type BossJsonEid1216 struct{ BossJsonEid0 }
|
||||
|
||||
func (e *BossJsonEid1216) DamageLockEx(zone *info.DamageZone) bool {
|
||||
if !e.ownerActive() {
|
||||
return true
|
||||
}
|
||||
if zone.Type == info.DamageType.Fixed || zone.Type == info.DamageType.Percent {
|
||||
zone.Damage = alpacadecimal.Zero
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// 805: 死亡后概率满血复活
|
||||
type BossJsonEid805 struct {
|
||||
BossJsonEid0
|
||||
used bool
|
||||
}
|
||||
|
||||
func (e *BossJsonEid805) revive() bool {
|
||||
if !e.ownerActive() || e.used || e.Ctx().Our.CurrentPet.Info.Hp != 0 {
|
||||
return true
|
||||
}
|
||||
e.used = true
|
||||
if !grand.Meet(bossJsonFirstPositiveArg(e.Args(), 0), 100) {
|
||||
return true
|
||||
}
|
||||
e.Ctx().Our.CurrentPet.Info.Hp = e.Ctx().Our.CurrentPet.Info.MaxHp
|
||||
e.Ctx().Our.HealPP(-1)
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *BossJsonEid805) Action_end() bool { return e.revive() }
|
||||
func (e *BossJsonEid805) Action_end_ex() bool { return e.revive() }
|
||||
|
||||
// 1215: 攻击技能概率造成倍数伤害
|
||||
type BossJsonEid1215 struct{ BossJsonEid0 }
|
||||
|
||||
func (e *BossJsonEid1215) Damage_Mul(zone *info.DamageZone) bool {
|
||||
if !e.ownerActive() || zone.Type != info.DamageType.Red || !bossJsonIsAttackSkill(e.Ctx().SkillEntity) {
|
||||
return true
|
||||
}
|
||||
chance := bossJsonIntArg(e.Args(), 0, 0)
|
||||
multiple := bossJsonIntArg(e.Args(), 1, 1)
|
||||
if chance > 0 && multiple > 1 && grand.Meet(chance, 100) {
|
||||
zone.Damage = zone.Damage.Mul(alpacadecimal.NewFromInt(int64(multiple)))
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// 280: 闪避率提升n%
|
||||
type BossJsonEid280 struct{ BossJsonEid0 }
|
||||
|
||||
func (e *BossJsonEid280) SkillHit_ex() bool {
|
||||
if !e.ownerActive() || e.Ctx().SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().SkillEntity.AttackTime == 2 {
|
||||
return true
|
||||
}
|
||||
hit, _, _ := e.Input.Player.Roll(bossJsonFirstPositiveArg(e.Args(), 0), 100)
|
||||
if hit {
|
||||
e.Ctx().SkillEntity.SetMiss()
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// 377: 与对手精灵互换属性
|
||||
type BossJsonEid377 struct {
|
||||
BossJsonEid0
|
||||
used bool
|
||||
}
|
||||
|
||||
func (e *BossJsonEid377) Fight_Start() bool {
|
||||
if !e.ownerActive() || e.used || e.Ctx().Our.CurrentPet == nil || e.Ctx().Opp.CurrentPet == nil {
|
||||
return true
|
||||
}
|
||||
e.used = true
|
||||
e.Ctx().Our.CurrentPet.Type, e.Ctx().Opp.CurrentPet.Type = e.Ctx().Opp.CurrentPet.Type, e.Ctx().Our.CurrentPet.Type
|
||||
return true
|
||||
}
|
||||
|
||||
// 121: 概率令对手属性技能失效
|
||||
type BossJsonEid121 struct{ BossJsonEid0 }
|
||||
|
||||
func (e *BossJsonEid121) SkillHit_ex() bool {
|
||||
if !e.ownerActive() || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() != info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
hit, _, _ := e.Input.Player.Roll(bossJsonFirstPositiveArg(e.Args(), 0), 100)
|
||||
if hit {
|
||||
e.Ctx().SkillEntity.SetMiss()
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// 735: 每回合吸取固定体力
|
||||
type BossJsonEid735 struct{ BossJsonEid0 }
|
||||
|
||||
func (e *BossJsonEid735) TurnStart(fattack, sattack *action.SelectSkillAction) {
|
||||
if !e.ownerActive() {
|
||||
return
|
||||
}
|
||||
value := alpacadecimal.NewFromInt(int64(bossJsonFirstPositiveArg(e.Args(), 0)))
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: value})
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, nil, value)
|
||||
}
|
||||
|
||||
// 261: 每回合按最大体力比例恢复
|
||||
type BossJsonEid261 struct{ BossJsonEid0 }
|
||||
|
||||
func (e *BossJsonEid261) TurnStart(fattack, sattack *action.SelectSkillAction) {
|
||||
if !e.ownerActive() {
|
||||
return
|
||||
}
|
||||
num := bossJsonIntArg(e.Args(), 0, 0)
|
||||
den := bossJsonIntArg(e.Args(), 1, 1)
|
||||
if num <= 0 || den <= 0 {
|
||||
return
|
||||
}
|
||||
heal := e.Ctx().Our.CurrentPet.GetMaxHP().Mul(alpacadecimal.NewFromInt(int64(num))).Div(alpacadecimal.NewFromInt(int64(den)))
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, nil, heal)
|
||||
}
|
||||
|
||||
// 209: 每n回合恢复固定体力
|
||||
type BossJsonEid209 struct {
|
||||
BossJsonEid0
|
||||
turns int
|
||||
}
|
||||
|
||||
func (e *BossJsonEid209) TurnEnd() {
|
||||
if !e.ownerActive() {
|
||||
return
|
||||
}
|
||||
e.turns++
|
||||
interval := bossJsonIntArg(e.Args(), 0, 0)
|
||||
value := bossJsonIntArg(e.Args(), 1, 0)
|
||||
if interval > 0 && value > 0 && e.turns%interval == 0 {
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, nil, alpacadecimal.NewFromInt(int64(value)))
|
||||
}
|
||||
}
|
||||
|
||||
// 342: 免疫低于/高于阈值的伤害
|
||||
type BossJsonEid342 struct{ BossJsonEid0 }
|
||||
|
||||
func (e *BossJsonEid342) DamageLockEx(zone *info.DamageZone) bool {
|
||||
if !e.ownerActive() {
|
||||
return true
|
||||
}
|
||||
mode := bossJsonIntArg(e.Args(), 0, 0)
|
||||
limit := bossJsonIntArg(e.Args(), 1, 0)
|
||||
dmg := int(zone.Damage.IntPart())
|
||||
if mode == 1 && dmg < limit {
|
||||
zone.Damage = alpacadecimal.Zero
|
||||
}
|
||||
if mode == 2 && dmg > limit {
|
||||
zone.Damage = alpacadecimal.Zero
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// 1233: 免疫并反弹致命一击伤害
|
||||
type BossJsonEid1233 struct{ BossJsonEid0 }
|
||||
|
||||
func (e *BossJsonEid1233) DamageLockEx(zone *info.DamageZone) bool {
|
||||
if !e.ownerActive() || zone.Type != info.DamageType.Red || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Crit == 0 {
|
||||
return true
|
||||
}
|
||||
reflectDamage := zone.Damage
|
||||
zone.Damage = alpacadecimal.Zero
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: reflectDamage})
|
||||
return true
|
||||
}
|
||||
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 1261, &BossJsonEidMyth{})
|
||||
input.InitEffect(input.EffectType.NewSel, 2346, &BossJsonEidMyth{})
|
||||
input.InitEffect(input.EffectType.NewSel, 600, &BossJsonEid600{})
|
||||
input.InitEffect(input.EffectType.NewSel, 390, &BossJsonEid390{})
|
||||
input.InitEffect(input.EffectType.NewSel, 792, &BossJsonEid792{})
|
||||
input.InitEffect(input.EffectType.NewSel, 219, &BossJsonEid219{})
|
||||
input.InitEffect(input.EffectType.NewSel, 208, &BossJsonEid208{})
|
||||
input.InitEffect(input.EffectType.NewSel, 1216, &BossJsonEid1216{})
|
||||
input.InitEffect(input.EffectType.NewSel, 805, &BossJsonEid805{})
|
||||
input.InitEffect(input.EffectType.NewSel, 1215, &BossJsonEid1215{})
|
||||
input.InitEffect(input.EffectType.NewSel, 280, &BossJsonEid280{})
|
||||
input.InitEffect(input.EffectType.NewSel, 377, &BossJsonEid377{})
|
||||
input.InitEffect(input.EffectType.NewSel, 121, &BossJsonEid121{})
|
||||
input.InitEffect(input.EffectType.NewSel, 735, &BossJsonEid735{})
|
||||
input.InitEffect(input.EffectType.NewSel, 261, &BossJsonEid261{})
|
||||
input.InitEffect(input.EffectType.NewSel, 209, &BossJsonEid209{})
|
||||
input.InitEffect(input.EffectType.NewSel, 342, &BossJsonEid342{})
|
||||
input.InitEffect(input.EffectType.NewSel, 1233, &BossJsonEid1233{})
|
||||
}
|
||||
@@ -493,8 +493,8 @@ func (e *Effect2244Sub) EFFect_Befer(in *input.Input, effEffect input.Effect) bo
|
||||
// Effect 2240: 解除自身异常状态,解除成功则本次攻击威力提高{0}%
|
||||
type Effect2240 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect2240) Skill_Use() bool {
|
||||
if len(e.Args()) == 0 {
|
||||
func (e *Effect2240) SkillHit() bool {
|
||||
if len(e.Args()) == 0 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -513,10 +513,7 @@ func (e *Effect2240) Skill_Use() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 2240, int(e.Args()[0].IntPart()))
|
||||
if sub != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
e.Ctx().SkillEntity.XML.Power = e.Ctx().SkillEntity.XML.Power * (100 + int(e.Args()[0].IntPart())) / 100
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -540,18 +537,7 @@ func (e *Effect2241) Skill_Use() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
cleared := false
|
||||
for _, eff := range e.Ctx().Opp.Effects {
|
||||
if eff == nil || !eff.Alive() {
|
||||
continue
|
||||
}
|
||||
if eff.ID().GetEffectType() != input.EffectType.Status {
|
||||
continue
|
||||
}
|
||||
eff.Alive(false)
|
||||
cleared = true
|
||||
}
|
||||
if !cleared {
|
||||
if !clearPositiveProps(e.Ctx().Opp, e.Ctx().Our) {
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user