Tweaks to comments, Destiny Knot no longer affects breeding in Gen 5 mechanics

This commit is contained in:
Maruno17
2022-05-17 23:52:53 +01:00
parent e12b6fde1d
commit 04f3b29fe3
14 changed files with 36 additions and 33 deletions

View File

@@ -20,8 +20,8 @@ class Battle
# battlers will move to the centre position at the end of a round, but
# because they cannot move into a position owned by a different
# trainer, it's possible that battlers will be unable to move close
# enough to hit each other if there are multiple trainers on each
# side.
# enough to hit each other if there are multiple trainers on both
# sides.
if trainerBattle? && (@sideSizes[0] > 2 || @sideSizes[1] > 2) &&
@player.length > 1 && @opponent.length > 1
raise _INTL("Can't have battles larger than 2v2 where both sides have multiple trainers")

View File

@@ -215,14 +215,12 @@ class Battle
@priority.each do |entry|
entry[0].effects[PBEffects::PriorityAbility] = false
entry[0].effects[PBEffects::PriorityItem] = false
# TODO: Set b.effects[PBEffects::PriorityAbility] and the other one depending
# on the sub-priorities. Calculate final sub-priorities for each battler.
subpri = entry[2] # Sub-priority from ability
if (subpri == 0 && entry[3] != 0) || # Ability has no effect, item has effect
(subpri < 0 && entry[3] >= 1) # Ability makes it slower, item makes it faster
subpri = entry[3] # Sub-priority from item
entry[0].effects[PBEffects::PriorityItem] = true
elsif subpri != 0 # Ability has effect, item had no/superfluous effect
elsif subpri != 0 # Ability has effect, item had superfluous/no effect
entry[0].effects[PBEffects::PriorityAbility] = true
end
entry[4] = subpri # Final sub-priority