Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #-------------------------------------------------------------------------------
- # Don't remove this header!
- #-------------------------------------------------------------------------------
- # Victory Aftermath extension
- # by Trihan
- #
- # Version : 1.2
- #
- # This script is commissioned by Batworks Software.
- #-------------------------------------------------------------------------------
- #-------------------------------------------------------------------------------
- # Version History
- #-------------------------------------------------------------------------------
- # 1.2 - Fixed a bug where new abilities weren't appearing in the correct column.
- # 1.1 - Fixed a bug where the new abilities display was incorrectly positioned
- # for 1-3 party members.
- # 1.0 - Initial script.
- #-------------------------------------------------------------------------------
- #-------------------------------------------------------------------------------
- # This script modifies the victory aftermath screen to show a unified exp
- # gain/percentage for the party as a whole, and removes the individual level
- # up screens and replaces them with a party-wide display of new skills.
- #
- # Plug and play, no configuration required.
- #-------------------------------------------------------------------------------
- module BattleManager
- def self.gain_exp
- actor = $game_party.random_target
- temp_actor = Marshal.load(Marshal.dump(actor))
- temp_party = $game_party.battle_members.map { |member| Marshal.load(Marshal.dump(member)) }
- $game_party.all_members.each do |actor|
- actor.gain_exp($game_troop.exp_total)
- end
- if $game_party.leader.level > temp_actor.level
- SceneManager.scene.show_victory_level_up(actor, temp_party)
- set_victory_text(actor, :level)
- wait_for_message
- end
- end
- end
- class Window_VictoryEXP_Back < Window_Selectable
- def draw_item(index)
- actor = $game_party.battle_members[index]
- return if actor.nil?
- rect = item_rect(index)
- reset_font_settings
- draw_actor_name(actor, rect)
- change_color(system_color)
- contents.font.size -= 6
- rw = [rect.width, 96].min
- rx = (rect.width - rw) / 2 + rect.x
- draw_text(rx, rect.y + line_height * 2, rect.width, rect.height, "New Abilities") if !SceneManager.scene.victory_exp_window_front.visible
- draw_actor_face(actor, rect)
- end
- alias :tlb_victoryexp_refresh :refresh
- def refresh
- tlb_victoryexp_refresh
- fmt = YEA::VICTORY_AFTERMATH::VICTORY_EXP
- text = sprintf(fmt, actor_exp_gain($game_party.leader).group)
- rect = Rect.new(0, item_height, contents.width, contents.height)
- draw_exp_gain($game_party.leader, rect) if SceneManager.scene.victory_exp_window_front.visible
- end
- end
- class Window_VictoryEXP_Front < Window_VictoryEXP_Back
- def refresh
- contents.clear
- rect = Rect.new(0, item_height, contents.width, contents.height)
- draw_actor_exp($game_party.leader, rect)
- end
- end
- class Window_VictoryLevelUp < Window_Base
- alias :tlb_victorylevelup_initialize :initialize
- def initialize
- tlb_victorylevelup_initialize
- self.back_opacity = 0
- end
- def refresh
- contents.clear
- reset_font_settings
- YEA::VICTORY_AFTERMATH::LEVEL_SOUND.play
- text = "LEVEL #{$game_party.leader.level}"
- change_color(text_color(0))
- draw_text(0, contents.height - line_height, contents.width, line_height, text, 1)
- end
- end
- class Window_VictorySkills < Window_Selectable
- def initialize
- dy = fitting_height(1) + 14 + line_height * 6
- dh = Graphics.height - fitting_height(4) - fitting_height(1)
- super(0, dy, Graphics.width, dh)
- self.opacity = 0
- self.z = 200
- hide
- end
- def item_max; return $game_party.members.size; end
- def col_max; return item_max; end
- def refresh(temp_party)
- contents.clear
- create_contents
- $game_party.battle_members.each_with_index do |actor, index|
- @data = actor.skills - temp_party[index].skills
- @data.each_with_index do |skill, idx|
- draw_item(idx, index)
- end
- end
- end
- def draw_item(index, column)
- rect = item_rect(1)
- skill = @data[index]
- return if skill.nil?
- rect.width -= 4
- self.contents.font.size -= 8
- rw = [rect.width, 96].min
- if $game_party.members.size == 3
- rx = rect.x * column + 25 - 8 * column
- elsif $game_party.members.size == 2
- rx = rect.x * column + 70 - 10 * column
- else
- rx = rect.x * column + 200
- rect.y -= line_height
- end
- draw_item_name(skill, rx, rect.y + line_height * index - 5 * index, true)
- self.contents.font.size += 8
- end
- end
- class Scene_Battle < Scene_Base
- attr_reader :victory_exp_window_front
- def show_victory_level_up(actor, temp_party)
- @victory_exp_window_front.hide
- @victory_exp_window_back.refresh
- #---
- fmt = YEA::VICTORY_AFTERMATH::TOP_LEVEL_UP
- text = sprintf(fmt, $game_party.name)
- @victory_title_window.refresh(text)
- #---
- @victory_level_window.show
- @victory_level_window.refresh
- @victory_level_skills.show
- @victory_level_skills.refresh(temp_party)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement