Minor tweaks to compiling item data

This commit is contained in:
Maruno17
2022-02-15 19:16:55 +00:00
parent f322b234c6
commit dd78075657
2 changed files with 4 additions and 5 deletions

View File

@@ -24,11 +24,9 @@ module GameData
"SellPrice" => [:sell_price, "u"], "SellPrice" => [:sell_price, "u"],
"Description" => [:description, "q"], "Description" => [:description, "q"],
"FieldUse" => [:field_use, "e", { "OnPokemon" => 1, "Direct" => 2, "TM" => 3, "FieldUse" => [:field_use, "e", { "OnPokemon" => 1, "Direct" => 2, "TM" => 3,
"HM" => 4, "OnPokemonReusable" => 1, "TR" => 6 }], "HM" => 4, "TR" => 5 }],
"BattleUse" => [:battle_use, "e", { "OnPokemon" => 1, "OnMove" => 2, "OnBattler" => 3, "BattleUse" => [:battle_use, "e", { "OnPokemon" => 1, "OnMove" => 2, "OnBattler" => 3,
"OnFoe" => 4, "Direct" => 5, "OnPokemonReusable" => 1, "OnFoe" => 4, "Direct" => 5 }],
"OnMoveReusable" => 2, "OnBattlerReusable" => 3,
"OnFoeReusable" => 4, "DirectReusable" => 5 }],
"Consumable" => [:consumable, "b"], "Consumable" => [:consumable, "b"],
"Flags" => [:flags, "*s"], "Flags" => [:flags, "*s"],
"Move" => [:move, "e", :Move] "Move" => [:move, "e", :Move]
@@ -119,7 +117,7 @@ module GameData
def is_TM?; return @field_use == 3; end def is_TM?; return @field_use == 3; end
def is_HM?; return @field_use == 4; end def is_HM?; return @field_use == 4; end
def is_TR?; return @field_use == 6; end def is_TR?; return @field_use == 5; end
def is_machine?; return is_TM? || is_HM? || is_TR?; end def is_machine?; return is_TM? || is_HM? || is_TR?; end
def is_mail?; return has_flag?("Mail") || has_flag?("IconMail"); end def is_mail?; return has_flag?("Mail") || has_flag?("IconMail"); end
def is_icon_mail?; return has_flag?("IconMail"); end def is_icon_mail?; return has_flag?("IconMail"); end

View File

@@ -478,6 +478,7 @@ module Compiler
end end
consumable = !([3, 4, 5].include?(line[7]) || line[8] >= 6) consumable = !([3, 4, 5].include?(line[7]) || line[8] >= 6)
line[7] = 1 if line[7] == 5 line[7] = 1 if line[7] == 5
line[7] = 5 if line[7] == 6
line[8] -= 5 if line[8] > 5 line[8] -= 5 if line[8] > 5
flags = [] flags = []
flags.push(line[9]) if !nil_or_empty?(line[9]) flags.push(line[9]) if !nil_or_empty?(line[9])