Added Setting SHOW_MODIFIED_MOVE_PROPERTIES, other minor tweaks and fixes

This commit is contained in:
Maruno17
2024-10-29 22:14:36 +00:00
parent 35be8fcf67
commit 210cfc654f
9 changed files with 144 additions and 146 deletions

View File

@@ -10,13 +10,10 @@ SaveData.register(:player) do
end
SaveData.register(:game_system) do
# TODO: Am I sure this doesn't need to be loaded in bootup?
# load_in_bootup
ensure_class :Game_System
save_value { $game_system }
load_value { |value| $game_system = value }
new_game_value { Game_System.new }
# reset_on_new_game
end
SaveData.register(:pokemon_system) do

View File

@@ -37,6 +37,13 @@ module Settings
"Pt park", "Pt route", "Pt sea", "Pt town"]
}
# Whether a move's power/type/category/etc. as shown in battle, the summary
# screen and the Move Reminder screen will appear as their calculated values
# (true) or their values from the PBS file moves.txt (false). For example, if
# this is true, Judgment's displayed type will depend on the Plate being held
# by the Pokémon that knows it.
SHOW_MODIFIED_MOVE_PROPERTIES = false
# TODO: Allow renaming a Pokémon from the party screen/summary screen (not
# sure which). Gen 9 feature.
# TODO: Allow forgetting/remembering moves from the summary screen. Gen 9

View File

@@ -102,9 +102,8 @@ module GameData
return false
end
# TODO: Make the below depend on a Setting rather than quoting it out.
def display_type(pkmn, move = nil)
=begin
if Settings::SHOW_MODIFIED_MOVE_PROPERTIES
case @function_code
when "TypeDependsOnUserIVs"
return pbHiddenPower(pkmn)[0]
@@ -184,13 +183,12 @@ module GameData
when "TypeIsUserFirstType"
return pkmn.types[0]
end
=end
end
return @type
end
# TODO: Make the below depend on a Setting rather than quoting it out.
def display_damage(pkmn, move = nil)
=begin
def display_power(pkmn, move = nil)
if Settings::SHOW_MODIFIED_MOVE_PROPERTIES
case @function_code
when "TypeDependsOnUserIVs"
return pbHiddenPower(pkmn)[1]
@@ -230,7 +228,7 @@ module GameData
ppLeft = [[(move&.pp || @total_pp) - 1, 0].max, dmgs.length - 1].min
return dmgs[ppLeft]
end
=end
end
return @power
end

View File

@@ -159,21 +159,17 @@ class Battle::Move
if battler.isSpecies?(:MORPEKO) || battler.effects[PBEffects::TransformSpecies] == :MORPEKO
return pbBaseType(battler)
end
# TODO: Make the below depend on a Setting rather than quoting it out.
=begin
when "TypeDependsOnUserPlate", "TypeDependsOnUserMemory",
"TypeDependsOnUserDrive", "TypeAndPowerDependOnUserBerry",
"TypeIsUserFirstType", "TypeAndPowerDependOnWeather",
"TypeAndPowerDependOnTerrain"
return pbBaseType(battler)
=end
return pbBaseType(battler) if Settings::SHOW_MODIFIED_MOVE_PROPERTIES
end
return @realMove.display_type(battler.pokemon)
end
# TODO: Make the below depend on a Setting rather than quoting it out.
def display_damage(battler)
=begin
def display_power(battler)
if Settings::SHOW_MODIFIED_MOVE_PROPERTIES
case @function_code
when "TypeAndPowerDependOnUserBerry"
return pbNaturalGiftBaseDamage(battler.item_id)
@@ -183,19 +179,18 @@ class Battle::Move
"PowerHigherWithUserPositiveStatStages", "PowerDependsOnUserStockpile"
return pbBaseType(@power, battler, nil)
end
=end
return @realMove.display_damage(battler.pokemon)
end
return @realMove.display_power(battler.pokemon)
end
# TODO: Make the below depend on a Setting rather than quoting it out.
def display_category(battler)
=begin
if Settings::SHOW_MODIFIED_MOVE_PROPERTIES
case @function_code
when "CategoryDependsOnHigherDamageIgnoreTargetAbility"
pbOnStartUse(user, nil)
return @calcCategory
end
=end
end
return @realMove.display_category(battler.pokemon)
end

View File

@@ -65,7 +65,7 @@ class Pokemon
def display_type(pkmn); return GameData::Move.get(@id).display_type(pkmn, self); end
def display_category(pkmn); return GameData::Move.get(@id).display_category(pkmn, self); end
def display_damage(pkmn); return GameData::Move.get(@id).display_damage(pkmn, self); end
def display_power(pkmn); return GameData::Move.get(@id).display_power(pkmn, self); end
def display_accuracy(pkmn); return GameData::Move.get(@id).display_accuracy(pkmn, self); end
end
end

View File

@@ -84,7 +84,7 @@ class MoveRelearner_Scene
0, 78 + ((@sprites["commands"].index - @sprites["commands"].top_item) * 64),
0, 0, 258, 72])
selMoveData = GameData::Move.get(@moves[@sprites["commands"].index])
power = selMoveData.display_damage(@pokemon)
power = selMoveData.display_power(@pokemon)
category = selMoveData.display_category(@pokemon)
accuracy = selMoveData.display_accuracy(@pokemon)
textpos.push([_INTL("CATEGORY"), 272, 120, :left, Color.new(248, 248, 248), Color.black])

View File

@@ -588,7 +588,7 @@ module UI
def choose_number_as_money_multiplier(help_text, money_per_unit, maximum, init_value = 1)
@sprites[:speech_box].visible = true
@sprites[:speech_box].text = help_text
position_speech_box(text)
position_speech_box(help_text)
# Show the help text
loop do
Graphics.update

View File

@@ -780,7 +780,7 @@ class UI::PokemonSummaryVisuals < UI::BaseVisuals
selected_move = ((@move_index || 0) == Pokemon::MAX_MOVES) ? @new_move : @pokemon.moves[@move_index || 0]
# Power
draw_text(_INTL("POWER"), 20, 128)
power_text = selected_move.display_damage(@pokemon)
power_text = selected_move.display_power(@pokemon)
power_text = "---" if power_text == 0 # Status move
power_text = "???" if power_text == 1 # Variable power move
draw_text(power_text, 222, 128, align: :right, theme: :black)

View File

@@ -465,6 +465,7 @@ class UI::BagSellVisuals < UI::BagVisuals
end
def refresh_on_index_changed(old_index)
super
refresh_unit_price_window
end
end