1
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
昔念
2026-04-25 15:08:40 +08:00
parent cd41b354b9
commit fe9c82fd2d
2 changed files with 64 additions and 7 deletions

View File

@@ -19,7 +19,7 @@ func (e *NewSel38) DamageAdd(t *info.DamageZone) bool {
return true
}
t.Damage = t.Damage.Add(t.Damage.Mul(alpacadecimal.NewFromInt(int64(e.Args()[0].IntPart()))))
t.Damage = t.Damage.Add(t.Damage.Mul(e.Args()[0].Div(alpacadecimal.NewFromInt(100))))
return true
}

View File

@@ -13,23 +13,80 @@ func init() {
t := &Effect91{}
input.InitEffect(input.EffectType.Skill, 91, t)
input.InitEffect(input.EffectType.Sub, 91, &Effect91Sub{})
}
// Effect 91: {0}回合内对手的状态变化会同时作用在自己身上
type Effect91 struct {
RoundEffectSideArg0Base
can bool
}
// 默认添加回合
func (e *Effect91) Skill_Use() bool {
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 91, e.SideEffectArgs...)
if sub != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
}
return true
}
func (e *Effect91) TurnStart(fattack *action.SelectSkillAction, sattack *action.SelectSkillAction) {
type Effect91Sub struct {
RoundEffectSideArg0Base
ready bool
}
for i, v := range e.Ctx().Opp.Prop[:] {
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), v)
func (e *Effect91Sub) TurnStart(_, _ *action.SelectSkillAction) {
e.ready = true
}
func (e *Effect91Sub) PropBefer(in *input.Input, prop int8, level int8) bool {
if !e.ready {
return true
}
if prop < 0 || int(prop) >= len(e.Ctx().Our.Prop) {
return true
}
// 当前效果挂在“对手”身上:当对手能力变化时,将实际变化量同步给来源方。
target := e.Ctx().Our
current := target.Prop[prop]
actualDelta := calcPropActualDelta(current, level)
if actualDelta == 0 {
return true
}
owner := e.SourceInput()
if owner == nil || owner == target {
return true
}
owner.SetProp(owner, prop, actualDelta)
return true
}
func calcPropActualDelta(current, change int8) int8 {
switch {
case change < 0:
if current <= -6 {
return 0
}
next := current + change
if next < -6 {
next = -6
}
return next - current
case change > 0:
if current >= 6 {
return 0
}
next := current + change
if next > 6 {
next = 6
}
return next - current
default:
if current == 0 {
return 0
}
return -current
}
}