Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ╔══════════════════════════════════════════════════════╤═══════╤════════════╗
- # ║ Battle Turn Indicator │ v1.00 │ 10/16/2020 ║
- # ╠══════════════════════════════════════════════════════╧═══════╧════════════╣
- # ║ Author : Coolie ║
- # ║ E-Mail : cooliebk18@yahoo.com ║
- # ║ Website : http://twitch.tv/CoolieBK18 ║
- # ╠═══════════════════════════════════════════════════════════════════════════╣
- # ║ ABOUT ║
- # ╠═══════════════════════════════════════════════════════════════════════════╣
- # ║ This script adds a battle turn indicator in battles. It starts at turn 1 ║
- # ║ even though a battle is actually at turn 0 when a battle begins. ║
- # ╠═══════════════════════════════════════════════════════════════════════════╣
- # ║ TERMS OF USE ║
- # ╠═══════════════════════════════════════════════════════════════════════════╣
- # ║ ► Do not edit the script's header or comments. ║
- # ║ ► Free to use in commercial projects as long as proper credit is given to ║
- # ║ ALL the names individually in the above header. ║
- # ╠═══════════════════════════════════════════════════════════════════════════╣
- # ║ FEATURES ║
- # ╠═══════════════════════════════════════════════════════════════════════════╣
- # ║ ► Adds a battle turn indicator in battle. ║
- # ╠═══════════════════════════════════════════════════════════════════════════╣
- # ║ KNOWN ISSUES ║
- # ╠═══════════════════════════════════════════════════════════════════════════╣
- # ║ ► None so far! ║
- # ╠═══════════════════════════════════════════════════════════════════════════╣
- # ║ CHANGE LOG ║
- # ╠═════════════════════════════════════════════════════════════════╤═════════╣
- # ║ ■ October 16, 2020 : Initial version │ (v1.00) ║
- # ╠═════════════════════════════════════════════════════════════════╧═════════╣
- # ║ NEXT VERSION ║
- # ╠═══════════════════════════════════════════════════════════════════════════╣
- # ║ ■ TBA ║
- # ╠═══════════════════════════════════════════════════════════════════════════╣
- # ║ NEW METHODS ║
- # ╠═══════════════════════════════════════════════════════════════════════════╣
- # ║ There is one new class and several new methods added. ║
- # ╟───────────────────────────────────────────────────────────────────────────╢
- # ║ ■ class Window_TurnCount < Window_Base ║
- # ║ ► def initialize ║
- # ║ ► def window_width ║
- # ║ ► def update ║
- # ║ ► def def refresh ║
- # ║ ■ class Scene_Battle < Scene_Base ║
- # ║ ► def create_all_windows [Alias] ║
- # ║ ► def create_turn_count_window ║
- # ║ ► def battle_start [Alias] ║
- # ║ ► def turn_start [Alias] ║
- # ║ ► def turn_end [Alias] ║
- # ╠═══════════════════════════════════════════════════════════════════════════╣
- # ║ INSTRUCTIONS ║
- # ╠═══════════════════════════════════════════════════════════════════════════╣
- # ║ Simply paste this script anywhere above the Main Process script and below ║
- # ║ the "Materials" section. ║
- # ╠═══════════════════════════════════════════════════════════════════════════╣
- # ║ IMPORT SETTING ║
- # ╚═══════════════════════════════════════════════════════════════════════════╝
- $imported = {} if $imported.nil? # Do not edit
- $imported["WC-BattleTurnIndicator_1.00"] = true # Do not edit
- # ╔═══════════════════════════════════════════════════════════════════════════╗
- # ║ NEW CLASS: Window_TurnCount ║
- # ╟───────────────────────────────────────────────────────────────────────────╢
- # ║ This window displays the turn count in battle ║
- # ╚═══════════════════════════════════════════════════════════════════════════╝
- class Window_TurnCount < Window_Base
- # ╔═════════════════════════════════════════════════════════════════════════╗
- # ║ Object Initialization ║
- # ╚═════════════════════════════════════════════════════════════════════════╝
- def initialize
- super(0, 0, window_width, fitting_height(1))
- self.opacity = 0
- self.back_opacity = 0
- self.contents_opacity = 255
- refresh
- end
- # ╔═════════════════════════════════════════════════════════════════════════╗
- # ║ Get Window Width ║
- # ╚═════════════════════════════════════════════════════════════════════════╝
- def window_width
- return 80
- end
- # ╔═════════════════════════════════════════════════════════════════════════╗
- # ║ Frame Update ║
- # ╚═════════════════════════════════════════════════════════════════════════╝
- def update
- super
- end
- # ╔═════════════════════════════════════════════════════════════════════════╗
- # ║ Refresh ║
- # ╚═════════════════════════════════════════════════════════════════════════╝
- def refresh
- contents.clear
- $turn_counter = 1 + $game_troop.turn_count
- change_color(system_color)
- # Change "Turn" to whatever text you want to display in battle
- draw_text(0, 0, 68, 24, "Turn ", 0)
- change_color(normal_color)
- draw_text(36, 0, 68, 24, $turn_counter.to_s, 0)
- end
- # ╔═════════════════════════════════════════════════════════════════════════╗
- # ║ End: Window_TurnCount ║
- # ╚═════════════════════════════════════════════════════════════════════════╝
- end
- # ╔═══════════════════════════════════════════════════════════════════════════╗
- # ║ Scene_Battle ║
- # ╟───────────────────────────────────────────────────────────────────────────╢
- # ║ This class performs battle screen processing. ║
- # ╚═══════════════════════════════════════════════════════════════════════════╝
- class Scene_Battle < Scene_Base
- # ╔═════════════════════════════════════════════════════════════════════════╗
- # ║ Alias: Create All Windows ║
- # ╚═════════════════════════════════════════════════════════════════════════╝
- alias coolie_create_all_windows create_all_windows
- def create_all_windows
- coolie_create_all_windows
- create_turn_count_window
- end
- # ╔═════════════════════════════════════════════════════════════════════════╗
- # ║ New: Create Turn Count Window ║
- # ╚═════════════════════════════════════════════════════════════════════════╝
- def create_turn_count_window
- @turn_count_window = Window_TurnCount.new
- @turn_count_window.x = Graphics.width - 96
- @turn_count_window.width = 80
- @turn_count_window.y = 60
- end
- # ╔═════════════════════════════════════════════════════════════════════════╗
- # ║ Alias: Battle Start ║
- # ╚═════════════════════════════════════════════════════════════════════════╝
- alias coolie_battle_start battle_start
- def battle_start
- coolie_battle_start
- @turn_count_window.show
- end
- # ╔═════════════════════════════════════════════════════════════════════════╗
- # ║ Alias: Start Turn ║
- # ╚═════════════════════════════════════════════════════════════════════════╝
- alias coolie_turn_start turn_start
- def turn_start
- coolie_turn_start
- @turn_count_window.refresh
- end
- # ╔═════════════════════════════════════════════════════════════════════════╗
- # ║ Alias: End Turn ║
- # ╚═════════════════════════════════════════════════════════════════════════╝
- alias coolie_turn_end turn_end
- def turn_end
- coolie_turn_end
- @turn_count_window.refresh
- end
- # ╔═════════════════════════════════════════════════════════════════════════╗
- # ║ End: Scene_Battle ║
- # ╚═════════════════════════════════════════════════════════════════════════╝
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement