Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- #
- # Project YERD + Tankentai Compatibility Patch
- #
- # This is a compatibility patch to make the Yanfly Engine ReDux battle scripts
- # work with Tankentai. This patch is plug and play but both Yanfly's scripts and
- # Tankentai aren't. This is only for the non ATB version.
- #
- #===============================================================================
- # Instructions
- # -----------------------------------------------------------------------------
- # Place the scripts in this order from top to bottom. If you don't, you'll
- # never get these scripts working together.
- # Default Scripts
- #
- # YERD Battler Stat: Aggro
- # YERD Battler Stat: Barehand
- # YERD Battler Stat: Morale
- # YERD Bestiary + Display Scanned Enemy
- # YERD Display Item Query
- # YERD Display Skill Query
- # Tankentai
- # This script: Project YERD + Tankentai Compatibility Patch
- #
- # Main
- #===============================================================================
- $imported = {} if $imported == nil
- #===============================================================================
- # class Scene Battle
- #===============================================================================
- class Scene_Battle < Scene_Base
- #--------------------------------------------------------------------------
- # update
- # compatibility for Bestiary + Display Scanned Enemy
- #--------------------------------------------------------------------------
- alias update_yerdtankentai update
- def update
- if $imported["DisplayScannedEnemy"] and @enemy_scan_window.visible
- update_scan_enemy_windows
- else
- update_yerdtankentai
- end
- end
- #--------------------------------------------------------------------------
- # select member
- # compatibility for Bestiary + Display Scanned Enemy
- #--------------------------------------------------------------------------
- def select_member(actor = false)
- members = $game_party.members if actor
- members = $game_troop.members unless actor
- loop do
- update_basic
- @cursor_flame = 0 if @cursor_flame == 30
- @cursor.src_rect.set(0, 0, 32, 32) if @cursor_flame == 29
- @cursor.src_rect.set(0, 32, 32, 32) if @cursor_flame == 15
- point = @spriteset.set_cursor(actor, @index)
- @cursor.x = point[0]
- @cursor.y = point[1]
- @cursor_flame += 1
- if Input.trigger?(Input::B)
- Sound.play_cancel
- end_target_selection
- break
- elsif Input.trigger?(Input::C)
- Sound.play_decision
- @active_battler.action.target_index = @index
- end_target_selection
- end_skill_selection
- end_item_selection
- next_actor
- break
- elsif $imported["DisplayScannedEnemy"] and !actor and Input.trigger?(YE::MENU::MONSTER::ENEMY_SCAN_BUTTON)
- Sound.play_decision
- enemy = $game_troop.members[@index]
- @enemy_scan_window.appear(enemy, nil)
- @enemy_image_window.appear(enemy, nil)
- @enemy_name_window.appear(enemy, nil)
- $yerdtkt_actor = actor
- break
- end
- if Input.repeat?(Input::LEFT)
- if actor
- cursor_down(members, actor) if $back_attack
- cursor_up(members, actor) unless $back_attack
- else
- cursor_up(members, actor) if $back_attack
- cursor_down(members, actor) unless $back_attack
- end
- end
- if Input.repeat?(Input::RIGHT)
- if actor
- cursor_up(members, actor) if $back_attack
- cursor_down(members, actor) unless $back_attack
- else
- cursor_down(members, actor) if $back_attack
- cursor_up(members, actor) unless $back_attack
- end
- end
- cursor_up(members, actor) if Input.repeat?(Input::UP)
- cursor_down(members, actor) if Input.repeat?(Input::DOWN)
- end
- end
- #--------------------------------------------------------------------------
- # update scan enemy windows
- # compatibility for Bestiary + Display Scanned Enemy
- #--------------------------------------------------------------------------
- def update_scan_enemy_windows
- return unless $imported["DisplayScannedEnemy"]
- @enemy_scan_window.update
- @enemy_image_window.update
- @enemy_name_window.update
- if Input.trigger?(Input::B)
- Sound.play_cancel
- @enemy_scan_window.disappear
- @enemy_image_window.disappear
- @enemy_name_window.visible = false
- select_member($yerdtkt_actor)
- elsif Input.trigger?(Input::LEFT) or Input.trigger?(Input::UP)
- @enemy_scan_window.previous_page
- elsif Input.trigger?(Input::RIGHT) or Input.trigger?(Input::DOWN)
- @enemy_scan_window.next_page
- elsif Input.trigger?(Input::L)
- @enemy_scan_window.top_page
- elsif Input.trigger?(Input::R)
- @enemy_scan_window.bottom_page
- end
- end
- #--------------------------------------------------------------------------
- # target decision
- # compatibility for Battler Stat: Morale
- #--------------------------------------------------------------------------
- def target_decision(obj = nil)
- @targets = @active_battler.action.make_targets
- if $imported["BattlerStatMorale"] and obj != nil
- @active_battler.boost_morale(obj.change_morale)
- for target in @targets
- target.boost_morale(obj.boost_morale) unless target.dead?
- end
- end
- if @targets.size == 0
- action = @active_battler.recover_action
- @spriteset.set_action(@active_battler.actor?, @active_battler.index, action)
- end
- if obj != nil
- if obj.for_two? or obj.for_three? or obj.dual?
- @targets = [@targets[0]]
- end
- if obj.extension.include?("RANDOMTARGET")
- randum_targets = @targets.dup
- @targets = [randum_targets[rand(randum_targets.size)]]
- end
- end
- @spriteset.set_target(@active_battler.actor?, @active_battler.index, @targets)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement