Added def count to all GameData variants, and one that returns the number of species for Species, removed all uses of ID numbers for GameData::Status, made more use of GameData::X.keys

This commit is contained in:
Maruno17
2021-06-17 22:21:24 +01:00
parent 5358037986
commit eaa915878a
15 changed files with 86 additions and 72 deletions

View File

@@ -1665,7 +1665,7 @@ class PokeBattle_Move_0B6 < PokeBattle_Move
def pbMoveFailed?(user,targets)
@metronomeMove = nil
move_keys = GameData::Move::DATA.keys
move_keys = GameData::Move.keys
# NOTE: You could be really unlucky and roll blacklisted moves 1000 times in
# a row. This is too unlikely to care about, though.
1000.times do

View File

@@ -247,12 +247,13 @@ class PokemonDataBox < SpriteWrapper
end
# Draw status icon
if @battler.status != :NONE
s = GameData::Status.get(@battler.status).id_number
if s == :POISON && @battler.statusCount > 0 # Badly poisoned
s = GameData::Status::DATA.keys.length / 2
if @battler.status == :POISON && @battler.statusCount > 0 # Badly poisoned
s = GameData::Status.count
else
s = GameData::Status.get(@battler.status).icon_position
end
imagePos.push(["Graphics/Pictures/Battle/icon_statuses",@spriteBaseX+24,36,
0,(s-1)*STATUS_ICON_HEIGHT,-1,STATUS_ICON_HEIGHT])
0,(s-1)*STATUS_ICON_HEIGHT,-1,STATUS_ICON_HEIGHT]) if s >= 0
end
pbDrawImagePositions(self.bitmap,imagePos)
refreshHP