Battle::AbilityEffects::OnEndOfUsingMove.add(:STRONGELEC,
proc { |ability, user, targets, move, battle|
next if move.type != :ELECTRIC
next if !user.pbCanRaiseStatStage?(:ATTACK, user)
user.pbRaiseStatStageByAbility(:ATTACK, 1, user)
}
)
好的,谢谢大佬trigger下面的proc也要照抄。在这样的proc下判断属性用的是move.type。大概是这个样子(
Ruby:Battle::AbilityEffects::OnEndOfUsingMove.add(:STRONGELEC, proc { |ability, user, targets, move, battle| next if move.type != :ELECTRIC next if !user.pbCanRaiseStatStage?(:ATTACK, user) user.pbRaiseStatStageByAbility(:ATTACK, 1, user) } )
检查属性最好用calcType,而不是type。trigger下面的proc也要照抄。在这样的proc下判断属性用的是move.type。大概是这个样子(
Ruby:Battle::AbilityEffects::OnEndOfUsingMove.add(:STRONGELEC, proc { |ability, user, targets, move, battle| next if move.type != :ELECTRIC next if !user.pbCanRaiseStatStage?(:ATTACK, user) user.pbRaiseStatStageByAbility(:ATTACK, 1, user) } )