Advertisement
mrbubble

Mouse System Tankentai Patch

Jun 6th, 2011
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 4.27 KB | None | 0 0
  1. #==============================================================================
  2. # Mouse System Tankentai Patch
  3. #==============================================================================
  4. # Author  : OriginalWij
  5. # Version : 1.2
  6. #==============================================================================
  7.  
  8. #==============================================================================
  9. # Changes:
  10. #
  11. # v1.0
  12. # - Initial release
  13. #
  14. # v1.1
  15. # - Fixed enemy selection bug
  16. # - Added support for enemy info add-on
  17. #
  18. # v1.2
  19. # - Fixed issue with being unable to select dead party members for
  20. #   things such as revival items/skills (added by Mr. Bubble)
  21. #==============================================================================
  22.  
  23. #==============================================================================
  24. # Insert this script BELOW "Sideview 2" script
  25. #
  26. # NOTE: You can delete this script if not useing Tankentai
  27. #==============================================================================
  28.  
  29. #==============================================================================
  30. # Scene_Battle (Overwrite)    
  31. #==============================================================================
  32. class Scene_Battle < Scene_Base
  33.   #--------------------------------------------------------------------------
  34.   # Select member
  35.   #--------------------------------------------------------------------------
  36.   def select_member(actor = false)
  37.     members = $game_party.members if actor
  38.     members = $game_troop.members unless actor
  39.     loop do
  40.       update_basic
  41.       @cursor_flame = 0 if @cursor_flame == 30
  42.       @cursor.src_rect.set(0,  0, 32, 32) if @cursor_flame == 29
  43.       @cursor.src_rect.set(0, 32, 32, 32) if @cursor_flame == 15
  44.       point = @spriteset.set_cursor(actor, @index)
  45.       @cursor.x = point[0]
  46.       @cursor.y = point[1]
  47.       @cursor_flame += 1
  48.       # Check for mouse-over target (added by OriginalWij)
  49.       for i in 0..members.size - 1
  50.         next unless members[i].exist? || (members[i].dead? && actor) # v1.2
  51.         point = @spriteset.set_cursor(actor, i)
  52.         mx = point[0] - (point[2] / 2)
  53.         my = point[1] - (point[3] / 2)
  54.         if Mouse.area?(mx, my, point[2], point[3])
  55.           Sound.play_cursor if @index != i
  56.           @index = i
  57.           @help_window2.set_text_n01add(members[@index]) if @help_window2 != nil
  58.         end
  59.       end
  60.       #------------------------------------------------------
  61.       if Input.trigger?(Input::B)
  62.         Sound.play_cancel
  63.         end_target_selection
  64.         break
  65.       elsif Input.trigger?(Input::C)
  66.         Sound.play_decision
  67.         @active_battler.action.target_index = @index
  68.         end_target_selection
  69.         end_skill_selection
  70.         end_item_selection
  71.         next_actor
  72.         break
  73.       end
  74.       if Input.repeat?(Input::LEFT)
  75.         if actor
  76.           cursor_down(members, actor) if $back_attack
  77.           cursor_up(members, actor) unless $back_attack
  78.         else
  79.           cursor_up(members, actor) if $back_attack
  80.           cursor_down(members, actor) unless $back_attack
  81.         end  
  82.       end
  83.       if Input.repeat?(Input::RIGHT)
  84.         if actor
  85.           cursor_up(members, actor) if $back_attack
  86.           cursor_down(members, actor) unless $back_attack
  87.         else
  88.           cursor_down(members, actor) if $back_attack
  89.           cursor_up(members, actor) unless $back_attack
  90.         end
  91.       end
  92.       cursor_up(members, actor) if Input.repeat?(Input::UP)
  93.       cursor_down(members, actor) if Input.repeat?(Input::DOWN)
  94.     end
  95.   end
  96. end
  97.  
  98. #==============================================================================
  99. # Spriteset_Battle (Overwrite)
  100. #==============================================================================
  101. class Spriteset_Battle
  102.   #--------------------------------------------------------------------------
  103.   # Set cursor
  104.   #--------------------------------------------------------------------------  
  105.   def set_cursor(actor, index)
  106.     return [@actor_sprites[index].x, @actor_sprites[index].y,
  107.             @actor_sprites[index].width, @actor_sprites[index].height] if actor
  108.     return [@enemy_sprites[index].x, @enemy_sprites[index].y,
  109.             @enemy_sprites[index].width, @enemy_sprites[index].height] unless actor
  110.   end
  111. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement