Advertisement
Guest User

Shanghai

a guest
Jul 5th, 2009
2,017
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.96 KB | None | 0 0
  1. #===============================================================================
  2. #
  3. # Project YERD + Tankentai Compatibility Patch
  4. #
  5. # This is a compatibility patch to make the Yanfly Engine ReDux battle scripts
  6. # work with Tankentai. This patch is plug and play but both Yanfly's scripts and
  7. # Tankentai aren't. This is only for the non ATB version.
  8. #
  9. #===============================================================================
  10. # Instructions
  11. # -----------------------------------------------------------------------------
  12. # Place the scripts in this order from top to bottom. If you don't, you'll
  13. # never get these scripts working together.
  14. # Default Scripts
  15. #
  16. # YERD Battler Stat: Aggro
  17. # YERD Battler Stat: Barehand
  18. # YERD Battler Stat: Morale
  19. # YERD Bestiary + Display Scanned Enemy
  20. # YERD Display Item Query
  21. # YERD Display Skill Query
  22. # Tankentai
  23. # This script: Project YERD + Tankentai Compatibility Patch
  24. #
  25. # Main
  26. #===============================================================================
  27.  
  28. $imported = {} if $imported == nil
  29.  
  30. #===============================================================================
  31. # class Scene Battle
  32. #===============================================================================
  33. class Scene_Battle < Scene_Base
  34.  
  35. #--------------------------------------------------------------------------
  36. # update
  37. # compatibility for Bestiary + Display Scanned Enemy
  38. #--------------------------------------------------------------------------
  39. alias update_yerdtankentai update
  40. def update
  41. if $imported["DisplayScannedEnemy"] and @enemy_scan_window.visible
  42. update_scan_enemy_windows
  43. else
  44. update_yerdtankentai
  45. end
  46. end
  47.  
  48. #--------------------------------------------------------------------------
  49. # select member
  50. # compatibility for Bestiary + Display Scanned Enemy
  51. #--------------------------------------------------------------------------
  52. def select_member(actor = false)
  53. members = $game_party.members if actor
  54. members = $game_troop.members unless actor
  55. loop do
  56. update_basic
  57. @cursor_flame = 0 if @cursor_flame == 30
  58. @cursor.src_rect.set(0, 0, 32, 32) if @cursor_flame == 29
  59. @cursor.src_rect.set(0, 32, 32, 32) if @cursor_flame == 15
  60. point = @spriteset.set_cursor(actor, @index)
  61. @cursor.x = point[0]
  62. @cursor.y = point[1]
  63. @cursor_flame += 1
  64. if Input.trigger?(Input::B)
  65. Sound.play_cancel
  66. end_target_selection
  67. break
  68. elsif Input.trigger?(Input::C)
  69. Sound.play_decision
  70. @active_battler.action.target_index = @index
  71. end_target_selection
  72. end_skill_selection
  73. end_item_selection
  74. next_actor
  75. break
  76. elsif $imported["DisplayScannedEnemy"] and !actor and Input.trigger?(YE::MENU::MONSTER::ENEMY_SCAN_BUTTON)
  77. Sound.play_decision
  78. enemy = $game_troop.members[@index]
  79. @enemy_scan_window.appear(enemy, nil)
  80. @enemy_image_window.appear(enemy, nil)
  81. @enemy_name_window.appear(enemy, nil)
  82. $yerdtkt_actor = actor
  83. break
  84. end
  85. if Input.repeat?(Input::LEFT)
  86. if actor
  87. cursor_down(members, actor) if $back_attack
  88. cursor_up(members, actor) unless $back_attack
  89. else
  90. cursor_up(members, actor) if $back_attack
  91. cursor_down(members, actor) unless $back_attack
  92. end
  93. end
  94. if Input.repeat?(Input::RIGHT)
  95. if actor
  96. cursor_up(members, actor) if $back_attack
  97. cursor_down(members, actor) unless $back_attack
  98. else
  99. cursor_down(members, actor) if $back_attack
  100. cursor_up(members, actor) unless $back_attack
  101. end
  102. end
  103. cursor_up(members, actor) if Input.repeat?(Input::UP)
  104. cursor_down(members, actor) if Input.repeat?(Input::DOWN)
  105. end
  106. end
  107.  
  108. #--------------------------------------------------------------------------
  109. # update scan enemy windows
  110. # compatibility for Bestiary + Display Scanned Enemy
  111. #--------------------------------------------------------------------------
  112. def update_scan_enemy_windows
  113. return unless $imported["DisplayScannedEnemy"]
  114. @enemy_scan_window.update
  115. @enemy_image_window.update
  116. @enemy_name_window.update
  117. if Input.trigger?(Input::B)
  118. Sound.play_cancel
  119. @enemy_scan_window.disappear
  120. @enemy_image_window.disappear
  121. @enemy_name_window.visible = false
  122. select_member($yerdtkt_actor)
  123. elsif Input.trigger?(Input::LEFT) or Input.trigger?(Input::UP)
  124. @enemy_scan_window.previous_page
  125. elsif Input.trigger?(Input::RIGHT) or Input.trigger?(Input::DOWN)
  126. @enemy_scan_window.next_page
  127. elsif Input.trigger?(Input::L)
  128. @enemy_scan_window.top_page
  129. elsif Input.trigger?(Input::R)
  130. @enemy_scan_window.bottom_page
  131. end
  132. end
  133.  
  134. #--------------------------------------------------------------------------
  135. # target decision
  136. # compatibility for Battler Stat: Morale
  137. #--------------------------------------------------------------------------
  138. def target_decision(obj = nil)
  139. @targets = @active_battler.action.make_targets
  140. if $imported["BattlerStatMorale"] and obj != nil
  141. @active_battler.boost_morale(obj.change_morale)
  142. for target in @targets
  143. target.boost_morale(obj.boost_morale) unless target.dead?
  144. end
  145. end
  146. if @targets.size == 0
  147. action = @active_battler.recover_action
  148. @spriteset.set_action(@active_battler.actor?, @active_battler.index, action)
  149. end
  150. if obj != nil
  151. if obj.for_two? or obj.for_three? or obj.dual?
  152. @targets = [@targets[0]]
  153. end
  154. if obj.extension.include?("RANDOMTARGET")
  155. randum_targets = @targets.dup
  156. @targets = [randum_targets[rand(randum_targets.size)]]
  157. end
  158. end
  159. @spriteset.set_target(@active_battler.actor?, @active_battler.index, @targets)
  160. end
  161.  
  162. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement