🤔 Para Refletir :
"As memórias, os sussurros, tudo vem da floresta, ela faz parte de você. E você faz parte dela."
- Yonori Akari

Bob's Item menu [XP]

Galactic_Heart

Cidadão
Membro
Membro
Juntou-se
06 de Setembro de 2016
Postagens
59
Bravecoins
0
Bob's Item menu
Criado Por Bob423​

Características:Separa o item de menu em 3 categorias: utilizável, equipamentos e itens-chave
Imcopatiblidade:Desconhecida

OBS:Eu traduzi o início do script.

Código:
#===============================================================================
# Bob's Item menu
# -Bob423
# Seperates the item menu into 3 catagories: Useable, Equipment, and Key Items
#===============================================================================
     
#===============================================================================
# Config
     
# Names of catagories
    Bob_USE = "Utilizável"
    Bob_EQP = "Equipamento"
    Bob_KEY = "Item Chave"
     
# The ID of the first Key Item
# Everything above will be useable items, and everything below will be key items.
    First_Key = 30
   
# Set to 1 to make the quantity of an item change color if it is 1 or 99
# Set to 0 to make it not do that.
    $colored_numbers = 0
   
# The color when the player has 99 of an item
# (Red, Green, Blue, Grey) If grey is 0, the color will be black
# Default is the default system color (193, 224, 255, 255)
    def max_color # Don't touch this line!
      return Color.new(193, 224, 255, 255) # This is the line you should touch
    end # Don't touch this line!
   
# The color when the player has 1 of an item
# Default is yellow (255, 255, 0, 255)
    def low_color # Don't touch this line!
      return Color.new(255, 255, 0, 255) # This is the line you should touch
    end # Don't touch this line!
   
# End Config                                                                   #
#===============================================================================
 
#==============================================================================
# Normal item window
#==============================================================================
     
    class Window_Item < Window_Selectable
      #--------------------------------------------------------------------------
      # * Object Initialization
      #--------------------------------------------------------------------------
      def initialize
        super(0, 64, 640, 416)
        @column_max = 2
        refresh
        self.index = 0
        # If in battle, move window to center of screen
        # and make it semi-transparent
        if $game_temp.in_battle
          self.y = 64
          self.height = 256
          self.back_opacity = 160
        end
      end
      #--------------------------------------------------------------------------
      # * Get Item
      #--------------------------------------------------------------------------
      def item
        return @data[self.index]
      end
      #--------------------------------------------------------------------------
      # * Refresh
      #--------------------------------------------------------------------------
      def refresh
        if self.contents != nil
          self.contents.dispose
          self.contents = nil
        end
        @data = []
        # Add item
        for i in 1...First_Key
          if $game_party.item_number(i) > 0
            @data.push($data_items[i])
          end
        end
        # If item count is not 0, make a bit map and draw all items
        @item_max = @data.size
        if @item_max > 0
          self.contents = Bitmap.new(width - 32, row_max * 32)
          for i in 0...@item_max
            draw_item(i)
          end
        end
      end
      #--------------------------------------------------------------------------
      # * Draw Item
      #     index : item number
      #--------------------------------------------------------------------------
      def draw_item(index)
        item = @data[index]
        case item
        when RPG::Item
          number = $game_party.item_number(item.id)
        end
        if item.is_a?(RPG::Item) and
           $game_party.item_can_use?(item.id)
          self.contents.font.color = normal_color
        else
          self.contents.font.color = disabled_color
        end
        x = 4 + index % 2 * (288 + 32)
        y = index / 2 * 32
        rect = Rect.new(x, y, self.width / @column_max - 32, 32)
        self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
        bitmap = RPG::Cache.icon(item.icon_name)
        opacity = self.contents.font.color == normal_color ? 255 : 128
        self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
        self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
        self.contents.draw_text(x + 245, y, 16, 32, "x", 1)
       
        # Colored Numbers
        if number == 1 and $game_party.item_can_use?(item.id) and $colored_numbers == 1
          self.contents.font.color = low_color
        elsif number == 99 and $game_party.item_can_use?(item.id) and $colored_numbers == 1
          self.contents.font.color = max_color
        elsif number > 1 and number < 99 and $game_party.item_can_use?(item.id) and $colored_numbers == 1
          self.contents.font.color = normal_color
        end
       
        self.contents.draw_text(x + 258, y, 24, 32, number.to_s, 2)
      end
      #--------------------------------------------------------------------------
      # * Help Text Update
      #--------------------------------------------------------------------------
      def update_help
        @help_window.set_text(self.item == nil ? "" : self.item.description)
      end
    end
     
    #==============================================================================
    # This is where the window that lists equipment is made
    #==============================================================================
     
    class Window_EQUIP < Window_Selectable
      #--------------------------------------------------------------------------
      # * Object Initialization
      #--------------------------------------------------------------------------
      def initialize
        super(0, 64, 640, 416)
        @column_max = 2
        refresh
        self.index = 0
        # If in battle, move window to center of screen
        # and make it semi-transparent
        if $game_temp.in_battle
          self.y = 64
          self.height = 256
          self.back_opacity = 160
        end
      end
      #--------------------------------------------------------------------------
      # * Get Item
      #--------------------------------------------------------------------------
      def item
        return @data[self.index]
      end
      #--------------------------------------------------------------------------
      # * Refresh
      #--------------------------------------------------------------------------
      def refresh
        if self.contents != nil
          self.contents.dispose
          self.contents = nil
        end
        @data = []
        # Add item
          for i in 1...$data_weapons.size
            if $game_party.weapon_number(i) > 0
              @data.push($data_weapons[i])
            end
          end
          for i in 1...$data_armors.size
            if $game_party.armor_number(i) > 0
              @data.push($data_armors[i])
            end
          end
        # If item count is not 0, make a bit map and draw all items
        @item_max = @data.size
        if @item_max > 0
          self.contents = Bitmap.new(width - 32, row_max * 32)
          for i in 0...@item_max
            draw_item(i)
          end
        end
      end
      #--------------------------------------------------------------------------
      # * Draw Item
      #     index : item number
      #--------------------------------------------------------------------------
      def draw_item(index)
        item = @data[index]
        case item
        when RPG::Weapon
          number = $game_party.weapon_number(item.id)
        when RPG::Armor
          number = $game_party.armor_number(item.id)
        end
       
        self.contents.font.color = normal_color
       
        x = 4 + index % 2 * (288 + 32)
        y = index / 2 * 32
        rect = Rect.new(x, y, self.width / @column_max - 32, 32)
        self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
        bitmap = RPG::Cache.icon(item.icon_name)
        opacity = self.contents.font.color == normal_color ? 255 : 128
        self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
        self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
        self.contents.draw_text(x + 245, y, 16, 32, "x", 1)
        self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
      end
      #--------------------------------------------------------------------------
      # * Help Text Update
      #--------------------------------------------------------------------------
      def update_help
        @help_window.set_text(self.item == nil ? "" : self.item.description)
      end
    end
    #==============================================================================
    # Key Item Window
    #==============================================================================
     
    class Window_KEY < Window_Selectable
      #--------------------------------------------------------------------------
      # * Object Initialization
      #--------------------------------------------------------------------------
      def initialize
        super(0, 64, 640, 416)
        @column_max = 2
        refresh
        self.index = 0
        # If in battle, move window to center of screen
        # and make it semi-transparent
        if $game_temp.in_battle
          self.y = 64
          self.height = 256
          self.back_opacity = 160
        end
      end
      #--------------------------------------------------------------------------
      # * Get Item
      #--------------------------------------------------------------------------
      def item
        return @data[self.index]
      end
      #--------------------------------------------------------------------------
      # * Refresh
      #--------------------------------------------------------------------------
      def refresh
        if self.contents != nil
          self.contents.dispose
          self.contents = nil
        end
        @data = []
        # Add item
        for i in First_Key...$data_items.size
        if $game_party.item_number(i) > 0
            @data.push($data_items[i])
          end
        end
        # If item count is not 0, make a bit map and draw all items
        @item_max = @data.size
        if @item_max > 0
          self.contents = Bitmap.new(width - 32, row_max * 32)
          for i in 0...@item_max
            draw_item(i)
          end
        end
      end
      #--------------------------------------------------------------------------
      # * Draw Item
      #     index : item number
      #--------------------------------------------------------------------------
      def draw_item(index)
        item = @data[index]
        case item
        when RPG::Item
          number = $game_party.item_number(item.id)
        end
       
        self.contents.font.color = normal_color
       
        x = 4 + index % 2 * (288 + 32)
        y = index / 2 * 32
        rect = Rect.new(x, y, self.width / @column_max - 32, 32)
        self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
        bitmap = RPG::Cache.icon(item.icon_name)
        opacity = self.contents.font.color == normal_color ? 255 : 255
        self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
        self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
      end
      #--------------------------------------------------------------------------
      # * Help Text Update
      #--------------------------------------------------------------------------
      def update_help
        @help_window.set_text(self.item == nil ? "" : self.item.description)
      end
    end
    #==============================================================================
    # ** Window_Target
    #------------------------------------------------------------------------------
    #  This window selects a use target for the actor on item and skill screens.
    #==============================================================================
     
    class Window_Target < Window_Selectable
      #--------------------------------------------------------------------------
      # * Object Initialization
      #--------------------------------------------------------------------------
      def initialize
        party_size = $game_party.actors.size
        super(0, 0, 200, party_size * 120)
        if party_size < 3
          self.height = 5 + party_size * 120
        end
        self.contents = Bitmap.new(width - 32, height - 32)
        self.z += 10
        @item_max = $game_party.actors.size
        refresh
      end
      #--------------------------------------------------------------------------
      # * Refresh
      #--------------------------------------------------------------------------
      def refresh
        self.contents.clear
        party_size = $game_party.actors.size
        for i in 0...party_size
          actor_size = (self.height / party_size) - 5
          x = 4
          y = i * actor_size
          actor = $game_party.actors[i]
          draw_actor_graphic(actor, x +  9, y + 48)
          draw_actor_name(actor,    x + 26, y -  2)
          draw_actor_hp(actor,      x + 26, y + 18)
          draw_actor_sp(actor,      x + 26, y + 40)
          draw_actor_state(actor,   x + 23, y + 66)
        end
      end
      #--------------------------------------------------------------------------
      # * Cursor Rectangle Update
      #--------------------------------------------------------------------------
      def update_cursor_rect
        party_size = $game_party.actors.size
        actor_size = (self.height / party_size)
        case @index
          when 0
            rectY = @index * actor_size
          when 1
            rectY = (@index * actor_size) - 5
          when 2
            rectY = (@index * actor_size) - 10
          when 3
            rectY = (@index * actor_size) - 15
        end
        # Cursor position -1 = all choices, -2 or lower = independent choice
        # (meaning the user's own choice)
        if @index <= -2
          self.cursor_rect.set(0, rectY, self.width - 32,
          @item_max * actor_size - 32)
        elsif @index == -1
          self.cursor_rect.set(0, 0, self.width - 32, (@item_max * actor_size) - 32)
        else
          self.cursor_rect.set(0, rectY, self.width - 32, 96)
        end
      end
    end
     
    #==============================================================================
    # ** Dummy Window 1
    #------------------------------------------------------------------------------
    #  This window displays text over a dummy window so the window can be any size
    #  without text being cut off.
    #==============================================================================
     
    class Window_ITEM_DUMMY < Window_Base
      #--------------------------------------------------------------------------
      # * Object Initialization
      #--------------------------------------------------------------------------
      def initialize
        super(0, 0, 640, 416)
        self.contents = Bitmap.new(width - 32, height - 32)
        refresh
      end
      #--------------------------------------------------------------------------
      # * Refresh
      #--------------------------------------------------------------------------
      def refresh
       self.contents.clear
       end
    end
    #==============================================================================
    # ** Dummy Window 2
    #------------------------------------------------------------------------------
    #  This window displays text over a dummy window so the window can be any size
    #  without text being cut off.
    #==============================================================================
     
    class Window_HELP_DUMMY < Window_Base
      #--------------------------------------------------------------------------
      # * Object Initialization
      #--------------------------------------------------------------------------
      def initialize
        super(0, 0, 640, 64)
        self.contents = Bitmap.new(width - 32, height - 32)
        refresh
      end
      #--------------------------------------------------------------------------
      # * Refresh
      #--------------------------------------------------------------------------
      def refresh
       self.contents.clear
       end
    end
    #==============================================================================
    # Item menu
    #==============================================================================
     
    class Scene_Item
      #--------------------------------------------------------------------------
      # * Main Processing
      #--------------------------------------------------------------------------
      def main
        # Make command window
        s1 = Bob_USE
        s2 = Bob_EQP
        s3 = Bob_KEY
        @command_window = Window_Command.new(132, [s1, s2, s3])
        @command_window.x = 320 - @command_window.width / 2
        @command_window.y = 240 - @command_window.height / 2
        @command_window.z = 1000
        # Make Dummy Windows
        @dummy_window = Window_ITEM_DUMMY.new
        @dummy_window.y = 64
        @dummy_window2 = Window_HELP_DUMMY.new
        # Execute transition
        Graphics.transition
        # Main loop
        loop do
          # Update game screen
          Graphics.update
          # Update input information
          Input.update
          # Frame Update
          update
          # Abort loop if screen is changed
          if $scene != self
            break
          end
        end
        # Prepare for transition
        Graphics.freeze
        # Dispose of window
        @command_window.dispose
        @dummy_window.dispose
        @dummy_window2.dispose
      end
      #--------------------------------------------------------------------------
      # * Frame Update
      #--------------------------------------------------------------------------
      def update
        # Update command window
        @command_window.update
        # If B button was pressed
        if Input.trigger?(Input::B)
          # Switch to menu screen
          $scene = Scene_Menu.new
          return
        end
        # If C button was pressed
        if Input.trigger?(Input::C)
          # Branch by command window cursor position
          case @command_window.index
          when 0  # Useable
            cmd_USE
          when 1  # Equipment
            cmd_EQUIP
          when 2  # Key Items
            cmd_KEYITEM
          end
          return
        end
      end
    #-------------------------------------------------------------------------------
    # Useable
    #-------------------------------------------------------------------------------
      def cmd_USE
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_USE.new
      end
    #-------------------------------------------------------------------------------
    # Weapons
    #-------------------------------------------------------------------------------
      def cmd_EQUIP
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_EQUIP.new
      end
    #-------------------------------------------------------------------------------
    # Key Items
    #-------------------------------------------------------------------------------
      def cmd_KEYITEM
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_KEY.new
      end
    end
    #==============================================================================
    # ** Scene_Item
    #------------------------------------------------------------------------------
    #  This class performs item screen processing.
    #==============================================================================
     
    class Scene_USE
      #--------------------------------------------------------------------------
      # * Main Processing
      #--------------------------------------------------------------------------
      def main
        # Make help window, item window
        @help_window = Window_Help.new
        @item_window = Window_Item.new
        # Associate help window
        @item_window.help_window = @help_window
        # Make target window (set to invisible / inactive)
        @target_window = Window_Target.new
        @target_window.visible = false
        @target_window.active = false
        # Execute transition
        Graphics.transition
        # Main loop
        loop do
          # Update game screen
          Graphics.update
          # Update input information
          Input.update
          # Frame update
          update
          # Abort loop if screen is changed
          if $scene != self
            break
          end
        end
        # Prepare for transition
        Graphics.freeze
        # Dispose of windows
        @help_window.dispose
        @item_window.dispose
        @target_window.dispose
      end
      #--------------------------------------------------------------------------
      # * Frame Update
      #--------------------------------------------------------------------------
      def update
        # Update windows
        @help_window.update
        @item_window.update
        @target_window.update
        # If item window is active: call update_item
        if @item_window.active
          update_item
          return
        end
        # If target window is active: call update_target
        if @target_window.active
          update_target
          return
        end
      end
      #--------------------------------------------------------------------------
      # * Frame Update (when item window is active)
      #--------------------------------------------------------------------------
      def update_item
        # If B button was pressed
        if Input.trigger?(Input::B)
          # Play cancel SE
          $game_system.se_play($data_system.cancel_se)
          # Switch to menu screen
          $scene = Scene_Item.new
          return
        end
        # If C button was pressed
        if Input.trigger?(Input::C)
          # Get currently selected data on the item window
          @item = @item_window.item
          # If not a use item
          unless @item.is_a?(RPG::Item)
            # Play buzzer SE
            $game_system.se_play($data_system.buzzer_se)
            return
          end
          # If it can't be used
          unless $game_party.item_can_use?(@item.id)
            # Play buzzer SE
            $game_system.se_play($data_system.buzzer_se)
            return
          end
          # Play decision SE
          $game_system.se_play($data_system.decision_se)
          # If effect scope is an ally
          if @item.scope >= 3
            # Activate target window
            @item_window.active = false
    #        @target_window.x = (@item_window.index + 1) % 2 * 304
            @target_window.x = 320 - @target_window.width / 2
            @target_window.y = 240 - @target_window.height / 2
            @target_window.visible = true
            @target_window.active = true
            # Set cursor position to effect scope (single / all)
            if @item.scope == 4 || @item.scope == 6
              @target_window.index = -1
            else
              @target_window.index = 0
            end
          # If effect scope is other than an ally
          else
            # If command event ID is valid
            if @item.common_event_id > 0
              # Command event call reservation
              $game_temp.common_event_id = @item.common_event_id
              # Play item use SE
              $game_system.se_play(@item.menu_se)
              # If consumable
              if @item.consumable
                # Decrease used items by 1
                $game_party.lose_item(@item.id, 1)
                # Draw item window item
                @item_window.draw_item(@item_window.index)
              end
              # Switch to map screen
              $scene = Scene_Map.new
              return
            end
          end
          return
        end
      end
      #--------------------------------------------------------------------------
      # * Frame Update (when target window is active)
      #--------------------------------------------------------------------------
      def update_target
        # If B button was pressed
        if Input.trigger?(Input::B)
          # Play cancel SE
          $game_system.se_play($data_system.cancel_se)
          # If unable to use because items ran out
          unless $game_party.item_can_use?(@item.id)
            # Remake item window contents
            @item_window.refresh
          end
          # Erase target window
          @item_window.active = true
          @target_window.visible = false
          @target_window.active = false
          return
        end
        # If C button was pressed
        if Input.trigger?(Input::C)
          # If items are used up
          if $game_party.item_number(@item.id) == 0
            # Play buzzer SE
            $game_system.se_play($data_system.buzzer_se)
            return
          end
          # If target is all
          if @target_window.index == -1
            # Apply item effects to entire party
            used = false
            for i in $game_party.actors
              used |= i.item_effect(@item)
            end
          end
          # If single target
          if @target_window.index >= 0
            # Apply item use effects to target actor
            target = $game_party.actors[@target_window.index]
            used = target.item_effect(@item)
          end
          # If an item was used
          if used
            # Play item use SE
            $game_system.se_play(@item.menu_se)
            # If consumable
            if @item.consumable
              # Decrease used items by 1
              $game_party.lose_item(@item.id, 1)
              # Redraw item window item
              @item_window.draw_item(@item_window.index)
            end
            # Remake target window contents
            @target_window.refresh
            # If all party members are dead
            if $game_party.all_dead?
              # Switch to game over screen
              $scene = Scene_Gameover.new
              return
            end
            # If common event ID is valid
            if @item.common_event_id > 0
              # Common event call reservation
              $game_temp.common_event_id = @item.common_event_id
              # Switch to map screen
              $scene = Scene_Map.new
              return
            end
          end
          # If item wasn't used
          unless used
            # Play buzzer SE
            $game_system.se_play($data_system.buzzer_se)
          end
          return
        end
      end
    end
    #==============================================================================
    # ** Scene_Item
    #------------------------------------------------------------------------------
    #  This class performs item screen processing.
    #==============================================================================
     
    class Scene_EQUIP
      #--------------------------------------------------------------------------
      # * Main Processing
      #--------------------------------------------------------------------------
      def main
        # Make help window, item window
        @help_window = Window_Help.new
        @item_window = Window_EQUIP.new
        # Associate help window
        @item_window.help_window = @help_window
        # Make target window (set to invisible / inactive)
        @target_window = Window_Target.new
        @target_window.visible = false
        @target_window.active = false
        # Execute transition
        Graphics.transition
        # Main loop
        loop do
          # Update game screen
          Graphics.update
          # Update input information
          Input.update
          # Frame update
          update
          # Abort loop if screen is changed
          if $scene != self
            break
          end
        end
        # Prepare for transition
        Graphics.freeze
        # Dispose of windows
        @help_window.dispose
        @item_window.dispose
        @target_window.dispose
      end
      #--------------------------------------------------------------------------
      # * Frame Update
      #--------------------------------------------------------------------------
      def update
        # Update windows
        @help_window.update
        @item_window.update
        @target_window.update
        # If item window is active: call update_item
        if @item_window.active
          update_item
          return
        end
        # If target window is active: call update_target
        if @target_window.active
          update_target
          return
        end
      end
      #--------------------------------------------------------------------------
      # * Frame Update (when item window is active)
      #--------------------------------------------------------------------------
      def update_item
        # If B button was pressed
        if Input.trigger?(Input::B)
          # Play cancel SE
          $game_system.se_play($data_system.cancel_se)
          # Switch to menu screen
          $scene = Scene_Item.new
          return
        end
        # If C button was pressed
        if Input.trigger?(Input::C)
          # Get currently selected data on the item window
          @item = @item_window.item
          # If not a use item
          unless @item.is_a?(RPG::Item)
            # Play buzzer SE
            $game_system.se_play($data_system.buzzer_se)
            return
          end
          # If it can't be used
          unless $game_party.item_can_use?(@item.id)
            # Play buzzer SE
            $game_system.se_play($data_system.buzzer_se)
            return
          end
          # Play decision SE
          $game_system.se_play($data_system.decision_se)
          # If effect scope is an ally
          if @item.scope >= 3
            # Activate target window
            @item_window.active = false
    #        @target_window.x = (@item_window.index + 1) % 2 * 304
            @target_window.x = 320 - @target_window.width / 2
            @target_window.y = 240 - @target_window.height / 2
            @target_window.visible = true
            @target_window.active = true
            # Set cursor position to effect scope (single / all)
            if @item.scope == 4 || @item.scope == 6
              @target_window.index = -1
            else
              @target_window.index = 0
            end
          # If effect scope is other than an ally
          else
            # If command event ID is valid
            if @item.common_event_id > 0
              # Command event call reservation
              $game_temp.common_event_id = @item.common_event_id
              # Play item use SE
              $game_system.se_play(@item.menu_se)
              # If consumable
              if @item.consumable
                # Decrease used items by 1
                $game_party.lose_item(@item.id, 1)
                # Draw item window item
                @item_window.draw_item(@item_window.index)
              end
              # Switch to map screen
              $scene = Scene_Map.new
              return
            end
          end
          return
        end
      end
      #--------------------------------------------------------------------------
      # * Frame Update (when target window is active)
      #--------------------------------------------------------------------------
      def update_target
        # If B button was pressed
        if Input.trigger?(Input::B)
          # Play cancel SE
          $game_system.se_play($data_system.cancel_se)
          # If unable to use because items ran out
          unless $game_party.item_can_use?(@item.id)
            # Remake item window contents
            @item_window.refresh
          end
          # Erase target window
          @item_window.active = true
          @target_window.visible = false
          @target_window.active = false
          return
        end
        # If C button was pressed
        if Input.trigger?(Input::C)
          # If items are used up
          if $game_party.item_number(@item.id) == 0
            # Play buzzer SE
            $game_system.se_play($data_system.buzzer_se)
            return
          end
          # If target is all
          if @target_window.index == -1
            # Apply item effects to entire party
            used = false
            for i in $game_party.actors
              used |= i.item_effect(@item)
            end
          end
          # If single target
          if @target_window.index >= 0
            # Apply item use effects to target actor
            target = $game_party.actors[@target_window.index]
            used = target.item_effect(@item)
          end
          # If an item was used
          if used
            # Play item use SE
            $game_system.se_play(@item.menu_se)
            # If consumable
            if @item.consumable
              # Decrease used items by 1
              $game_party.lose_item(@item.id, 1)
              # Redraw item window item
              @item_window.draw_item(@item_window.index)
            end
            # Remake target window contents
            @target_window.refresh
            # If all party members are dead
            if $game_party.all_dead?
              # Switch to game over screen
              $scene = Scene_Gameover.new
              return
            end
            # If common event ID is valid
            if @item.common_event_id > 0
              # Common event call reservation
              $game_temp.common_event_id = @item.common_event_id
              # Switch to map screen
              $scene = Scene_Map.new
              return
            end
          end
          # If item wasn't used
          unless used
            # Play buzzer SE
            $game_system.se_play($data_system.buzzer_se)
          end
          return
        end
      end
    end
    #==============================================================================
    # ** Scene_Item
    #------------------------------------------------------------------------------
    #  This class performs item screen processing.
    #==============================================================================
     
    class Scene_KEY
      #--------------------------------------------------------------------------
      # * Main Processing
      #--------------------------------------------------------------------------
      def main
        # Make help window, item window
        @help_window = Window_Help.new
        @item_window = Window_KEY.new
        # Associate help window
        @item_window.help_window = @help_window
        # Make target window (set to invisible / inactive)
        @target_window = Window_Target.new
        @target_window.visible = false
        @target_window.active = false
        # Execute transition
        Graphics.transition
        # Main loop
        loop do
          # Update game screen
          Graphics.update
          # Update input information
          Input.update
          # Frame update
          update
          # Abort loop if screen is changed
          if $scene != self
            break
          end
        end
        # Prepare for transition
        Graphics.freeze
        # Dispose of windows
        @help_window.dispose
        @item_window.dispose
        @target_window.dispose
      end
      #--------------------------------------------------------------------------
      # * Frame Update
      #--------------------------------------------------------------------------
      def update
        # Update windows
        @help_window.update
        @item_window.update
        @target_window.update
        # If item window is active: call update_item
        if @item_window.active
          update_item
          return
        end
        # If target window is active: call update_target
        if @target_window.active
          update_target
          return
        end
      end
      #--------------------------------------------------------------------------
      # * Frame Update (when item window is active)
      #--------------------------------------------------------------------------
      def update_item
        # If B button was pressed
        if Input.trigger?(Input::B)
          # Play cancel SE
          $game_system.se_play($data_system.cancel_se)
          # Switch to menu screen
          $scene = Scene_Item.new
          return
        end
        # If C button was pressed
        if Input.trigger?(Input::C)
          # Get currently selected data on the item window
          @item = @item_window.item
          # If not a use item
          unless @item.is_a?(RPG::Item)
            # Play buzzer SE
            $game_system.se_play($data_system.buzzer_se)
            return
          end
          # If it can't be used
          unless $game_party.item_can_use?(@item.id)
            # Play buzzer SE
            $game_system.se_play($data_system.buzzer_se)
            return
          end
          # Play decision SE
          $game_system.se_play($data_system.decision_se)
          # If effect scope is an ally
          if @item.scope >= 3
            # Activate target window
            @item_window.active = false
    #        @target_window.x = (@item_window.index + 1) % 2 * 304
            @target_window.x = 320 - @target_window.width / 2
            @target_window.y = 240 - @target_window.height / 2
            @target_window.visible = true
            @target_window.active = tru
 

Anexos

Script bem interessante querido, mas peço que formate seu tópico para um modelo mais organizado. Você pode utilizar a tag
Código:
insira o código aqui XD
para deixar mais bonitinho. Busque usar alguma screen se "possível ". Agradeço a compreensão.  :Okay_fix:
 
Voltar
Topo Inferior