style: 清理代码注释和格式
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/modules/player/model"
|
||||
|
||||
|
||||
"github.com/jinzhu/copier"
|
||||
)
|
||||
@@ -40,7 +39,7 @@ func (f *FightC) closeActionWindow() {
|
||||
f.pendingActions = f.pendingActions[:0]
|
||||
f.actionRound.Store(0)
|
||||
f.actionMu.Unlock()
|
||||
|
||||
|
||||
}
|
||||
|
||||
func (f *FightC) submitAction(act action.BattleActionI) {
|
||||
@@ -225,6 +224,10 @@ func (f *FightC) Capture(c common.PlayerI, id uint32) {
|
||||
|
||||
}
|
||||
|
||||
func (f *FightC) c(c common.PlayerI, cacthid, itemid uint32) {
|
||||
f.UseItemAt(c, cacthid, itemid, 0, 0)
|
||||
}
|
||||
|
||||
func (f *FightC) UseItem(c common.PlayerI, cacthid, itemid uint32) {
|
||||
f.UseItemAt(c, cacthid, itemid, 0, 0)
|
||||
}
|
||||
|
||||
@@ -64,8 +64,8 @@ type ARENA_OWENR_ACCE struct {
|
||||
// 表示"宠物王加入"的入站消息数据
|
||||
type PetKingJoinInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2413" struc:"skip"`
|
||||
Type uint32 // 战斗类型:5=单精灵,6=多精灵,11=精灵大师赛 (对应Java的@UInt long type)
|
||||
FightType uint32 // 仅当Type为11时有效 (对应Java的@UInt long fightType)
|
||||
Type uint32 // 战斗类型:5=单精灵,6=多精灵,11=精灵大师赛
|
||||
FightType uint32 // 仅当Type为11时有效
|
||||
}
|
||||
|
||||
// HandleFightInviteInboundInfo 处理战斗邀请的入站消息
|
||||
@@ -122,13 +122,13 @@ type LoadPercentInboundInfo struct {
|
||||
type UsePetItemInboundInfo struct {
|
||||
Head common.TomeeHeader `cmd:"2406" struc:"skip"`
|
||||
// 字段首字母大写以导出(对应Java的可访问性,配合@Data的getter/setter)
|
||||
CatchTime uint32 `description:"精灵捕获时间" codec:"catchTime"` // @UInt long 对应Go的uint32(无符号64位)
|
||||
CatchTime uint32 `description:"精灵捕获时间" codec:"catchTime"`
|
||||
ItemId uint32 `description:"使用的物品ID" codec:"itemId"` // 结构体标签模拟@FieldDescription和@AutoCodec注解
|
||||
Reversed1 uint32 `description:"填充字段 0" codec:"reversed1"` // reversed1对应原Java的填充字段
|
||||
}
|
||||
type ChatInfo struct {
|
||||
Head common.TomeeHeader `cmd:"50002" struc:"skip"`
|
||||
Reserve uint32 `json:"reserve" fieldDescription:"填充 默认值为0" uint:"true"` // @UInt long reserve,无符号长整数
|
||||
Reserve uint32 `json:"reserve" fieldDescription:"填充 默认值为0" uint:"true"`
|
||||
MessageLen uint32 `struc:"sizeof=Message"`
|
||||
Message string `json:"message" fieldDescription:"消息内容, 结束符为utf-8的数字0"` // 消息内容,包含utf-8空字符('\x00')作为结束符
|
||||
}
|
||||
|
||||
@@ -98,6 +98,7 @@ func (e *Effect1610Sub) SkillHit_ex() bool {
|
||||
return true
|
||||
}
|
||||
e.Ctx().SkillEntity.SetNoSide()
|
||||
e.Ctx().SkillEntity.AttackTime = 0
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
211
logic/service/fight/effect/1614_1619.go
Normal file
211
logic/service/fight/effect/1614_1619.go
Normal file
@@ -0,0 +1,211 @@
|
||||
package effect
|
||||
|
||||
import (
|
||||
element "blazing/common/data/Element"
|
||||
"blazing/logic/service/fight/action"
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// Effect 1614: {0}回合内对手使用攻击技能后{1}%令对手{2},未触发则令对手全属性-{3}
|
||||
type Effect1614 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1614) Skill_Use() bool {
|
||||
if len(e.Args()) < 4 || e.Ctx().Opp == nil {
|
||||
return true
|
||||
}
|
||||
sub := e.Ctx().Opp.InitEffect(input.EffectType.Sub, 1614, e.SideEffectArgs...)
|
||||
if sub != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1614Sub struct {
|
||||
RoundEffectSideArg0Base
|
||||
attempted bool
|
||||
triggered bool
|
||||
}
|
||||
|
||||
func (e *Effect1614Sub) Skill_Use() bool {
|
||||
if e.triggered || e.attempted || len(e.Args()) < 4 {
|
||||
return true
|
||||
}
|
||||
skill := e.Ctx().SkillEntity
|
||||
if skill == nil || skill.Category() == info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
e.attempted = true
|
||||
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100); ok {
|
||||
if addStatusByID(e.Ctx().Opp, e.Ctx().Our, int(e.Args()[2].IntPart())) {
|
||||
e.triggered = true
|
||||
e.Alive(false)
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect1614Sub) TurnEnd() {
|
||||
if e.Duration() == 1 && !e.triggered && len(e.Args()) >= 4 {
|
||||
applyAllPropDown(e.Ctx().Opp, e.Ctx().Our, int8(e.Args()[3].IntPart()))
|
||||
}
|
||||
e.EffectNode.TurnEnd()
|
||||
}
|
||||
|
||||
// Effect 1616: 当回合使用的技能克制对手时获得本系属性加成
|
||||
type Effect1616 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1616) Damage_Mul(zone *info.DamageZone) bool {
|
||||
if zone == nil || zone.Type != info.DamageType.Red || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().Opp == nil || e.Ctx().Opp.CurPet[0] == nil {
|
||||
return true
|
||||
}
|
||||
mul, err := element.Calculator.GetOffensiveMultiplier(e.Ctx().SkillEntity.GetType().ID, e.Ctx().Opp.CurPet[0].GetType().ID)
|
||||
if err != nil || mul <= 1 {
|
||||
return true
|
||||
}
|
||||
zone.Damage = zone.Damage.Mul(hundred.Add(alpacadecimal.NewFromInt(20))).Div(hundred)
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1617: {0}回合内受到攻击后{1}%使对手{2},未触发则自身全属性+{3}
|
||||
type Effect1617 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1617) Skill_Use() bool {
|
||||
if len(e.Args()) < 4 || e.Ctx().Opp == nil {
|
||||
return true
|
||||
}
|
||||
sub := e.Ctx().Opp.InitEffect(input.EffectType.Sub, 1617, e.SideEffectArgs...)
|
||||
if sub != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1617Sub struct {
|
||||
RoundEffectSideArg0Base
|
||||
attempted bool
|
||||
triggered bool
|
||||
}
|
||||
|
||||
func (e *Effect1617Sub) Skill_Use() bool {
|
||||
if e.triggered || e.attempted || len(e.Args()) < 4 {
|
||||
return true
|
||||
}
|
||||
skill := e.Ctx().SkillEntity
|
||||
if skill == nil || skill.Category() == info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
e.attempted = true
|
||||
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100); ok {
|
||||
if addStatusByID(e.Ctx().Opp, e.Ctx().Our, int(e.Args()[2].IntPart())) {
|
||||
e.triggered = true
|
||||
e.Alive(false)
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect1617Sub) TurnEnd() {
|
||||
if e.Duration() == 1 && !e.triggered && len(e.Args()) >= 4 {
|
||||
applyAllPropUp(e.Ctx().Opp, int8(e.Args()[3].IntPart()))
|
||||
}
|
||||
e.EffectNode.TurnEnd()
|
||||
}
|
||||
|
||||
// Effect 1618: {0}回合内每回合结束时令对手随机{1}个技能PP值归零
|
||||
type Effect1618 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1618) Skill_Use() bool {
|
||||
if len(e.Args()) < 2 || e.Ctx().Opp == nil {
|
||||
return true
|
||||
}
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1618, e.SideEffectArgs...)
|
||||
if sub != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1618Sub struct{ RoundEffectArg0Base }
|
||||
|
||||
func (e *Effect1618Sub) TurnEnd() {
|
||||
if e.Duration() > 0 && len(e.Args()) >= 2 && e.Ctx().Opp != nil {
|
||||
count := int(e.Args()[1].IntPart())
|
||||
zeroRandomSkillPP(e.Ctx().Opp, count)
|
||||
}
|
||||
e.EffectNode.TurnEnd()
|
||||
}
|
||||
|
||||
// Effect 1619: 50%复制对手当回合释放的技能,未触发则恢复自身最大体力的1/2且令对手全属性-1
|
||||
type Effect1619 struct {
|
||||
node.EffectNode
|
||||
copyAttempted bool
|
||||
copySucceeded bool
|
||||
fallbackApplied bool
|
||||
}
|
||||
|
||||
func (e *Effect1619) ActionStart(fattack, sattack *action.SelectSkillAction) bool {
|
||||
if e.copyAttempted || e.Ctx().Opp == nil {
|
||||
return true
|
||||
}
|
||||
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
|
||||
if current == nil || current.SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
opponent := actionByPlayer(fattack, sattack, e.Ctx().Opp.UserID)
|
||||
if opponent == nil || opponent.SkillEntity == nil || opponent.SkillEntity.Category() == info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
e.copyAttempted = true
|
||||
if ok, _, _ := e.Input.Player.Roll(50, 100); !ok {
|
||||
return true
|
||||
}
|
||||
clone := cloneSkillEntity(opponent.SkillEntity)
|
||||
if clone == nil {
|
||||
return true
|
||||
}
|
||||
current.SkillEntity = clone
|
||||
e.copySucceeded = true
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect1619) Skill_Use() bool {
|
||||
if !e.copyAttempted || e.copySucceeded || e.fallbackApplied || e.Ctx().Opp == nil || e.Ctx().Our == nil || e.Ctx().Our.CurPet[0] == nil {
|
||||
return true
|
||||
}
|
||||
heal := e.Ctx().Our.CurPet[0].GetMaxHP().Div(alpacadecimal.NewFromInt(2))
|
||||
if heal.Cmp(alpacadecimal.Zero) > 0 {
|
||||
e.Ctx().Our.Heal(
|
||||
e.Ctx().Our,
|
||||
&action.SelectSkillAction{BaseAction: action.BaseAction{PlayerID: e.Ctx().Our.UserID}},
|
||||
heal,
|
||||
)
|
||||
}
|
||||
applyAllPropDown(e.Ctx().Opp, e.Ctx().Our, 1)
|
||||
e.fallbackApplied = true
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect1619) TurnEnd() {
|
||||
e.copyAttempted = false
|
||||
e.copySucceeded = false
|
||||
e.fallbackApplied = false
|
||||
e.EffectNode.TurnEnd()
|
||||
}
|
||||
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.Skill, 1614, &Effect1614{})
|
||||
input.InitEffect(input.EffectType.Sub, 1614, &Effect1614Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1616, &Effect1616{})
|
||||
input.InitEffect(input.EffectType.Skill, 1617, &Effect1617{})
|
||||
input.InitEffect(input.EffectType.Sub, 1617, &Effect1617Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1618, &Effect1618{})
|
||||
input.InitEffect(input.EffectType.Sub, 1618, &Effect1618Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1619, &Effect1619{})
|
||||
}
|
||||
@@ -110,9 +110,9 @@ func (e *Effect1622Sub) SkillHit_ex() bool {
|
||||
if count <= 0 || percent <= 0 {
|
||||
return true
|
||||
}
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 16221, count, percent)
|
||||
sub := e.Ctx().Opp.InitEffect(input.EffectType.Sub, 16221, count, percent)
|
||||
if sub != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Opp, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
267
logic/service/fight/effect/1625_1629.go
Normal file
267
logic/service/fight/effect/1625_1629.go
Normal file
@@ -0,0 +1,267 @@
|
||||
package effect
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/action"
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
"github.com/gogf/gf/v2/util/grand"
|
||||
)
|
||||
|
||||
// Effect 1625: 造成的伤害高于{0}则{1}%令自身全属性+{2}
|
||||
type Effect1625 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1625) Skill_Use() bool {
|
||||
if len(e.Args()) < 3 || e.Ctx().Our.SumDamage.Cmp(e.Args()[0]) <= 0 {
|
||||
return true
|
||||
}
|
||||
if ok, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100); ok {
|
||||
applyAllPropUp(e.Ctx().Our, int8(e.Args()[2].IntPart()))
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1626: 后出手时将当回合护盾所承受的伤害值以百分比伤害的形式{0}%反弹给对手
|
||||
type Effect1626 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1626) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
||||
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
|
||||
if current == nil || fattack == nil || fattack.PlayerID == e.Ctx().Our.UserID || len(e.Args()) == 0 {
|
||||
return true
|
||||
}
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1626, int(e.Args()[0].IntPart()))
|
||||
if sub != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1626Sub struct {
|
||||
FixedDuration1Base
|
||||
absorbed alpacadecimal.Decimal
|
||||
}
|
||||
|
||||
func (e *Effect1626Sub) Damage_Shield(zone *info.DamageZone) bool {
|
||||
if zone == nil || zone.Damage.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
absorbed := alpacadecimal.Min(e.Ctx().Our.CurrentShield(), zone.Damage)
|
||||
if absorbed.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
e.absorbed = e.absorbed.Add(absorbed)
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect1626Sub) TurnEnd() {
|
||||
if len(e.Args()) > 0 && e.absorbed.Cmp(alpacadecimal.Zero) > 0 {
|
||||
damage := e.absorbed.Mul(e.Args()[0]).Div(hundred)
|
||||
if damage.Cmp(alpacadecimal.Zero) > 0 {
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Percent, Damage: damage})
|
||||
}
|
||||
}
|
||||
e.EffectNode.TurnEnd()
|
||||
}
|
||||
|
||||
// Effect 1627: {0}回合做{1}-{2}次攻击,若本回合攻击次数达到最大则必定秒杀对手
|
||||
type Effect1627 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1627) Skill_Use() bool {
|
||||
if len(e.Args()) < 3 {
|
||||
return true
|
||||
}
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1627, e.SideEffectArgs...)
|
||||
if sub != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1627Sub struct {
|
||||
RoundEffectArg0Base
|
||||
ohko bool
|
||||
}
|
||||
|
||||
func (e *Effect1627Sub) SkillHit() bool {
|
||||
e.ohko = false
|
||||
if len(e.Args()) < 3 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS || e.Ctx().SkillEntity.AttackTime == 0 {
|
||||
return true
|
||||
}
|
||||
minHits := int(e.Args()[1].IntPart())
|
||||
maxHits := int(e.Args()[2].IntPart())
|
||||
if minHits <= 0 {
|
||||
minHits = 1
|
||||
}
|
||||
if maxHits < minHits {
|
||||
maxHits = minHits
|
||||
}
|
||||
|
||||
hits := minHits
|
||||
if maxHits > minHits {
|
||||
hits += grand.Intn(maxHits - minHits + 1)
|
||||
}
|
||||
if hits > 1 {
|
||||
e.Ctx().SkillEntity.AttackTime += uint32(hits - 1)
|
||||
}
|
||||
e.ohko = hits == maxHits
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect1627Sub) OnSkill() bool {
|
||||
if !e.ohko || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.AttackTime == 0 || e.Ctx().Opp == nil || e.Ctx().Opp.CurPet[0] == nil || e.Ctx().Opp.CurPet[0].Info.Hp == 0 {
|
||||
return true
|
||||
}
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: e.Ctx().Opp.CurPet[0].GetHP(),
|
||||
})
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1628: 每次使用该技能击败对手则恢复自身全部体力,同时重置该技能使用次数并使该技能攻击威力提升{0}点,未击败对手时令自身下回合攻击技能先制+{1}
|
||||
type Effect1628 struct {
|
||||
node.EffectNode
|
||||
bonusPower int
|
||||
}
|
||||
|
||||
func (e *Effect1628) SetArgs(t *input.Input, a ...int) {
|
||||
e.EffectNode.SetArgs(t, a...)
|
||||
if old := t.GetEffect(input.EffectType.Skill, 1628); old != nil {
|
||||
if prev, ok := old.(*Effect1628); ok {
|
||||
e.bonusPower = prev.bonusPower
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (e *Effect1628) SkillHit() bool {
|
||||
if e.bonusPower == 0 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
e.Ctx().SkillEntity.XML.Power += e.bonusPower
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect1628) Skill_Use() bool {
|
||||
if len(e.Args()) < 2 || e.Ctx().Our == nil || e.Ctx().Our.CurPet[0] == nil || e.Ctx().Opp == nil || e.Ctx().Opp.CurPet[0] == nil {
|
||||
return true
|
||||
}
|
||||
if e.Ctx().Opp.CurPet[0].Info.Hp == 0 {
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.CurPet[0].GetMaxHP())
|
||||
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Info != nil {
|
||||
e.Ctx().SkillEntity.Info.PP = uint32(e.Ctx().SkillEntity.XML.MaxPP)
|
||||
}
|
||||
e.bonusPower += int(e.Args()[0].IntPart())
|
||||
return true
|
||||
}
|
||||
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1628, int(e.Args()[1].IntPart()))
|
||||
if sub != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1628Sub struct {
|
||||
node.EffectNode
|
||||
remaining int
|
||||
priority int
|
||||
}
|
||||
|
||||
func (e *Effect1628Sub) SetArgs(t *input.Input, a ...int) {
|
||||
e.EffectNode.SetArgs(t, a...)
|
||||
e.Duration(-1)
|
||||
e.CanStack(false)
|
||||
e.remaining = 1
|
||||
if len(a) > 0 {
|
||||
e.priority = a[0]
|
||||
}
|
||||
}
|
||||
|
||||
func (e *Effect1628Sub) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
||||
if e.remaining <= 0 {
|
||||
e.Alive(false)
|
||||
return true
|
||||
}
|
||||
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
|
||||
if current == nil || current.SkillEntity == nil || current.SkillEntity.Category() == info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
current.SkillEntity.XML.Priority += e.priority
|
||||
e.remaining--
|
||||
if e.remaining <= 0 {
|
||||
e.Alive(false)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Effect 1629: {0}基础速度值{1}{2}则自身下回合先制+{3}
|
||||
type Effect1629 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1629) Skill_Use() bool {
|
||||
if len(e.Args()) < 4 {
|
||||
return true
|
||||
}
|
||||
compareTarget := e.Ctx().Our
|
||||
if int(e.Args()[1].IntPart()) != 0 {
|
||||
compareTarget = e.Ctx().Opp
|
||||
}
|
||||
if compareTarget == nil || compareTarget.CurPet[0] == nil {
|
||||
return true
|
||||
}
|
||||
speed := alpacadecimal.NewFromInt(int64(compareTarget.CurPet[0].PetInfo.Spd))
|
||||
if !effectCompareByMode(int(e.Args()[2].IntPart()), speed, e.Args()[0]) {
|
||||
return true
|
||||
}
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1629, int(e.Args()[3].IntPart()))
|
||||
if sub != nil {
|
||||
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Effect1629Sub struct {
|
||||
node.EffectNode
|
||||
remaining int
|
||||
priority int
|
||||
}
|
||||
|
||||
func (e *Effect1629Sub) SetArgs(t *input.Input, a ...int) {
|
||||
e.EffectNode.SetArgs(t, a...)
|
||||
e.Duration(-1)
|
||||
e.CanStack(false)
|
||||
e.remaining = 1
|
||||
if len(a) > 0 {
|
||||
e.priority = a[0]
|
||||
}
|
||||
}
|
||||
|
||||
func (e *Effect1629Sub) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
||||
if e.remaining <= 0 {
|
||||
e.Alive(false)
|
||||
return true
|
||||
}
|
||||
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
|
||||
if current == nil || current.SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
current.SkillEntity.XML.Priority += e.priority
|
||||
e.remaining--
|
||||
if e.remaining <= 0 {
|
||||
e.Alive(false)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.Skill, 1625, &Effect1625{})
|
||||
input.InitEffect(input.EffectType.Skill, 1626, &Effect1626{})
|
||||
input.InitEffect(input.EffectType.Sub, 1626, &Effect1626Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1627, &Effect1627{})
|
||||
input.InitEffect(input.EffectType.Sub, 1627, &Effect1627Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1628, &Effect1628{})
|
||||
input.InitEffect(input.EffectType.Sub, 1628, &Effect1628Sub{})
|
||||
input.InitEffect(input.EffectType.Skill, 1629, &Effect1629{})
|
||||
input.InitEffect(input.EffectType.Sub, 1629, &Effect1629Sub{})
|
||||
}
|
||||
@@ -27,7 +27,7 @@ func (e *Effect1630) ComparePre(fattack, sattack *action.SelectSkillAction) bool
|
||||
if current == nil || current.SkillEntity == nil || oppAction == nil || oppAction.SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
if oppAction.SkillEntity.Category() == info.Category.STATUS || current.SkillEntity.Category() == info.Category.STATUS {
|
||||
if oppAction.SkillEntity.Category() == info.Category.STATUS {
|
||||
return true
|
||||
}
|
||||
current.SkillEntity.XML.Priority = math.MaxInt
|
||||
@@ -36,7 +36,7 @@ func (e *Effect1630) ComparePre(fattack, sattack *action.SelectSkillAction) bool
|
||||
}
|
||||
|
||||
func (e *Effect1630) OnSkill() bool {
|
||||
if !e.armed || len(e.Args()) < 2 || e.Ctx().Opp == nil {
|
||||
if !e.armed || len(e.Args()) < 2 || e.Ctx().Opp == nil || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.AttackTime == 0 {
|
||||
return true
|
||||
}
|
||||
chance := int(e.Args()[0].IntPart())
|
||||
@@ -181,7 +181,7 @@ func (e *Effect1634) ComparePre(fattack, sattack *action.SelectSkillAction) bool
|
||||
return true
|
||||
}
|
||||
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
|
||||
if current == nil || current.SkillEntity == nil || current.SkillEntity.Category() == info.Category.STATUS {
|
||||
if current == nil || current.SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
current.SkillEntity.XML.Priority = math.MaxInt
|
||||
|
||||
@@ -1073,11 +1073,21 @@ var effectInfoByID = map[int]string{
|
||||
1611: "攻击命中后5%的概率汲取泰坦源脉的力量,本次攻击造成5倍伤害且战斗结束后获得5000泰坦之灵(每日上限50000)",
|
||||
1612: "{0}回合内受到的伤害低于{1}时{2}%令对手{3},未触发则附加{4}点固定伤害",
|
||||
1613: "自身不处于能力提升状态则吸取对手{0}点体力,若先出手则额外吸取{1}点体力",
|
||||
1614: "{0}回合内对手使用攻击技能后{1}%令对手{2},未触发则令对手全属性-{3}",
|
||||
1616: "当回合使用的技能克制对手时获得本系属性加成",
|
||||
1617: "{0}回合内受到攻击后{1}%使对手{2},未触发则自身全属性+{3}",
|
||||
1618: "{0}回合内每回合结束时令对手随机{1}个技能PP值归零",
|
||||
1619: "50%复制对手当回合释放的技能,未触发则恢复自身最大体力的1/2且令对手全属性-1",
|
||||
1620: "对手基础速度值高于{0}则下回合先制-1",
|
||||
1621: "{0}%令对手所有技能PP值-{1},自身满体力时效果翻倍",
|
||||
1622: "{0}回合内每回合{1}%对手属性技能无效,未触发则下{2}次受到的攻击伤害减少{3}%",
|
||||
1623: "若对手是{0}精灵则下{1}回合对手受到的伤害提高{2}%",
|
||||
1624: "对手不处于异常状态时随机附加{0}种异常状态",
|
||||
1625: "造成的伤害高于{0}则{1}%令自身全属性+{2}",
|
||||
1626: "后出手时将当回合护盾所承受的伤害值以百分比伤害的形式{0}%反弹给对手",
|
||||
1627: "{0}回合做{1}-{2}次攻击,若本回合攻击次数达到最大则必定秒杀对手",
|
||||
1628: "每次使用该技能击败对手则恢复自身全部体力,同时重置该技能使用次数并使该技能攻击威力提升{0}点,未击败对手时令自身下回合攻击技能先制+{1}",
|
||||
1629: "{0}基础速度值{1}{2}则自身下回合先制+{3}",
|
||||
1670: "{0}%令对手{1},对手为自身天敌时概率提升{2}%,未触发则消除对手回合类效果",
|
||||
1671: "造成的攻击伤害不低于{0},若对手处于能力提升状态则造成的攻击伤害不低于{1}",
|
||||
1672: "出手时若自身未满体力则吸取对手{0}点体力",
|
||||
|
||||
@@ -73,23 +73,23 @@ type RPCFightStartinfo struct {
|
||||
|
||||
// FightPetInfo 战斗精灵信息结构体,FightPetInfo类
|
||||
type FightPetInfo struct {
|
||||
// 用户ID(野怪为0),@UInt long
|
||||
// 用户ID(野怪为0)
|
||||
UserID uint32 `fieldDesc:"用户ID 野怪为0" `
|
||||
|
||||
// 当前对战精灵ID,@UInt long
|
||||
// 当前对战精灵ID
|
||||
ID uint32 `fieldDesc:"当前对战精灵ID" `
|
||||
|
||||
Name string `struc:"[16]byte"`
|
||||
// 精灵的捕获时间,@UInt long
|
||||
// 精灵的捕获时间
|
||||
CatchTime uint32 `fieldDesc:"精灵的捕获时间" `
|
||||
|
||||
// 当前HP,@UInt long
|
||||
// 当前HP
|
||||
Hp uint32 `fieldDesc:"当前HP" `
|
||||
|
||||
// 最大HP,@UInt long
|
||||
// 最大HP
|
||||
MaxHp uint32 `fieldDesc:"最大HP" `
|
||||
|
||||
// 当前等级,@UInt long
|
||||
// 当前等级
|
||||
Level uint32 `fieldDesc:"当前等级" `
|
||||
|
||||
// 精灵是否能捕捉(1为能捕捉,0为不能捕捉),
|
||||
@@ -180,18 +180,12 @@ type EnumPetStatus = byte
|
||||
|
||||
// 精灵的能力提升
|
||||
type PropDict struct {
|
||||
// 攻击(@UInt long → uint32)
|
||||
Attack int8
|
||||
// 防御(@UInt long → uint32)
|
||||
Defence int8
|
||||
// 特攻(@UInt long → uint32)
|
||||
SpecialAttack int8
|
||||
// 特防(@UInt long → uint32)
|
||||
Attack int8
|
||||
Defence int8
|
||||
SpecialAttack int8
|
||||
SpecialDefence int8
|
||||
|
||||
// 速度(@UInt long → uint32)
|
||||
Speed int8
|
||||
// 命中(@UInt long → uint32)
|
||||
Speed int8
|
||||
Accuracy int8
|
||||
}
|
||||
|
||||
@@ -204,7 +198,6 @@ type NoteUseSkillOutboundInfo struct {
|
||||
}
|
||||
|
||||
type FightStartOutboundInfo struct {
|
||||
// @UInt long类型
|
||||
IsCanAuto uint32 `fieldDesc:"是否自动 默认给0 怀疑是自动战斗器使用的" `
|
||||
|
||||
// 当前战斗精灵信息1(前端通过userid判断是否为我方)
|
||||
@@ -215,7 +208,7 @@ type FightStartOutboundInfo struct {
|
||||
}
|
||||
|
||||
type S2C_2404 struct {
|
||||
// 用户ID(野怪为0),@UInt long
|
||||
// 用户ID(野怪为0)
|
||||
UserID uint32 `fieldDesc:"userID 如果为野怪则为0" `
|
||||
}
|
||||
type S2C_50005 struct {
|
||||
|
||||
@@ -2,7 +2,7 @@ package info
|
||||
|
||||
// UsePetIteminfo 对应Java的UsePetIteminfo,实现OutboundMessage接口
|
||||
type UsePetIteminfo struct {
|
||||
UserID uint32 `description:"玩家ID" codec:"userId"` // @UInt long 对应Go的uint32(无符号64位)
|
||||
UserID uint32 `description:"玩家ID" codec:"userId"`
|
||||
ItemID uint32 `description:"使用的物品ID" codec:"itemId"` // 结构体标签模拟@FieldDescription和@AutoCodec注解
|
||||
UserHp uint32 `description:"用户血量 这里是原始HP+药剂回复的HP总和 比如我只有20血使用了150药剂 这里应该是170 使用PP药剂 这里为原始HP" codec:"userHp"`
|
||||
//这里实现是int, 可以+血
|
||||
|
||||
@@ -2,49 +2,35 @@ package info
|
||||
|
||||
// UpdatePropInfo 对应Java的UpdatePropInfo类,用于精灵属性更新信息(所有数值类型改为uint32)
|
||||
type UpdatePropInfo struct {
|
||||
// CatchTime 精灵的捕获时间,对应Java的@UInt long(改为uint32)
|
||||
CatchTime uint32 `fieldDescription:"精灵的捕获时间" uint:"true" autoCodec:"true"`
|
||||
|
||||
// 精灵编号(@UInt long → uint32)
|
||||
ID uint32 `fieldDesc:"精灵编号" `
|
||||
|
||||
// Level 精灵等级,对应Java的@UInt long(改为uint32)
|
||||
Level uint32 `fieldDescription:"精灵等级" uint:"true" autoCodec:"true"`
|
||||
// 当前等级已获得经验(@UInt long → uint32)
|
||||
Exp uint32 `fieldDesc:"当前等级已经获得的经验 2538" `
|
||||
Exp uint32 `fieldDesc:"当前等级已经获得的经验 2538" `
|
||||
|
||||
// 当前等级所需经验(@UInt long → uint32)
|
||||
LvExp uint32 `fieldDesc:"当前等级所需的经验" `
|
||||
|
||||
// 升到下一级的经验(@UInt long → uint32)
|
||||
NextLvExp uint32 `fieldDesc:"升到下一级的经验" `
|
||||
|
||||
// MaxHp 最大血量,对应Java的@UInt long(改为uint32)
|
||||
MaxHp uint32 `fieldDescription:"最大血量" uint:"true" autoCodec:"true"`
|
||||
|
||||
Prop [5]uint32 `fieldDesc:"属性" `
|
||||
|
||||
// 生命学习力(@UInt long → uint32)
|
||||
EvHp uint32 `fieldDesc:"生命学习力" `
|
||||
|
||||
// 攻击学习力(@UInt long → uint32)
|
||||
EvAttack uint32 `fieldDesc:"攻击学习力" `
|
||||
|
||||
// 防御学习力(@UInt long → uint32)
|
||||
EvDefence uint32 `fieldDesc:"防御学习力" `
|
||||
|
||||
// 特攻学习力(@UInt long → uint32)
|
||||
EvSpecialAttack uint32 `fieldDesc:"特攻学习力" `
|
||||
|
||||
// 特防学习力(@UInt long → uint32,注意原Java拼写:evSpecialDefense)
|
||||
EvSpecialDefense uint32 `fieldDesc:"特防学习力" `
|
||||
|
||||
// 速度学习力(@UInt long → uint32)
|
||||
EvSpeed uint32 `fieldDesc:"速度学习力" `
|
||||
}
|
||||
type PetUpdateOutboundInfo struct {
|
||||
// Addition 超No加成,数值固定为20,若此字段为0则为普通经验分配
|
||||
// 对应Java的@UInt long,使用uint32(参考历史转换习惯)
|
||||
Addition uint32 `fieldDescription:"超No加成,数值固定为20,若此字段为0则为普通经验分配" uint:"true" autoCodec:"true"`
|
||||
DataLen uint32 `struc:"sizeof=Data"`
|
||||
// Data 更新数据,对应Java的List<UpdatePropInfo>
|
||||
|
||||
Reference in New Issue
Block a user