Removed all uses of ID numbers for types, Shape property in pokemon.txt must now be a name and not a number

This commit is contained in:
Maruno17
2021-06-16 20:32:30 +01:00
parent 0e8b1e70b1
commit 8c67127f06
15 changed files with 119 additions and 101 deletions

View File

@@ -262,8 +262,11 @@ def pbHiddenPower(pkmn)
iv = pkmn.iv
idxType = 0; power = 60
types = []
GameData::Type.each { |t| types.push(t.id) if !t.pseudo_type && ![:NORMAL, :SHADOW].include?(t.id)}
types.sort! { |a, b| GameData::Type.get(a).id_number <=> GameData::Type.get(b).id_number }
GameData::Type.each do |t|
types[t.icon_position] ||= []
types[t.icon_position].push(t.id) if !t.pseudo_type && ![:NORMAL, :SHADOW].include?(t.id)
end
types.flatten!.compact!
idxType |= (iv[:HP]&1)
idxType |= (iv[:ATTACK]&1)<<1
idxType |= (iv[:DEFENSE]&1)<<2