Aldeia RPG

Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

Suporte ao desenvolvimento de jogos


2 participantes

    Scene Items com icones grandes

    Makisso
    Makisso
    Novato
    Novato


    Mensagens : 9
    Créditos : 6

    Scene Items com icones grandes Empty Scene Items com icones grandes

    Mensagem por Makisso Sáb Mar 01, 2014 12:19 am

    Scene Items com icones grandes
    por arevulopapo
    Traduzido por Ogrim_Dooh

    Introdução 

    Este script habilita a possibilidade de usar ícones grandes (no tamanho 192x192) e mostrar alguns detalhes sobre o item.

    Características 


    • Mostra informação dos itens e icones grandes


    Screenshots
    Scene Items com icones grandes Th_icon-2

    Como usar

    Cole o script Acima do Main

    Demo

    Não possui demo, mas possui este pacote de ícones:
    Icones

    Script
    Código:
    #==============================================================================
    # ** Itens Detalhados
    # Criado por arevulopapo (13.11.2006)
    # Traduzido por ogrim_dooh (17.11.2006)
    #==============================================================================
    class Window_Selectable < Window_Base

      def details_window=(details_window)
        @details_window = details_window
        if self.active and @details_window != nil
          update_details
        end
      end

    end
    #==============================================================================
    class Window_Details < Window_Base
      def initialize
        super(416, 64, 224, 416)
        self.contents = Bitmap.new(width - 32, height - 32)
      end
      def set_details(item)
        if icon != @icon
          self.contents.clear
          self.contents.font.color = normal_color
          bitmap = RPG::Cache.icon(icon)
          self.contents.blt(96 - bitmap.width/2 ,96 - bitmap.height/2, bitmap, Rect.new(0,0,192,192))
          @icon = icon
        end
        self.visible = true
      end
      def set_price(price)
        if price != @price
          self.contents.clear
          self.contents.font.color = normal_color
          self.contents.draw_text(0,192,192,32,"Preço  : ",0)
          self.contents.draw_text(0,192,192,32,price.to_s,2)
          @price = price
        end
        self.visible = true
      end
      def set_details(item)
        if item != nil
          self.contents.clear
          #ICONE
          bitmap = RPG::Cache.icon(item.icon_name)
          self.contents.blt(96 - bitmap.width/2 ,96 - bitmap.height/2, bitmap, Rect.new(0,0,192,192))
          #QUANTIDADE
          self.contents.font.color = normal_color
          self.contents.draw_text(0,192,192,32,"Quantity : ",0)
          case item
          when RPG::Item
            number = $game_party.item_number(item.id)
          when RPG::Weapon
            number = $game_party.weapon_number(item.id)
          when RPG::Armor
            number = $game_party.armor_number(item.id)
          end
          self.contents.draw_text(0,192,192,32,number.to_s,2)
          #PREÇO
          self.contents.font.color = normal_color
          self.contents.draw_text(0,224,192,32,"Preço : ",0)
          self.contents.draw_text(0,224,192,32,item.price.to_s,2)
          #DETALHE
          y = 256
          case item
          when RPG::Item
            #ALVO
            case item.scope
            when 0
              scope = "-"
            when 1
              scope = "Inimigo"
            when 2
              scope = "Todos os Inimigos"
            when 3
              scope = "Um Aliado"
            when 4
              scope = "Todos os Aliados"
            when 5
              scope = "Um Aliado (hp0)"
            when 6
              scope = "Todos os Aliados (hp0)"
            when 7
              scope = "Usuário"
            end
            if item.parameter_type == 0
              self.contents.draw_text(0,y,192,32,"Alvo :",0)
              self.contents.draw_text(0,y,192,32,scope,2)
            else
              self.contents.draw_text(0,y,192,32,"Alvo :",0)
              self.contents.draw_text(0,y,192,32,scope,2)
            end
            case item.parameter_type
            when 1
              parameter = "HPmax"
              parameter_color = Color.new(224,64,64)
              self.contents.font.color = parameter_color
              self.contents.draw_text(0,y+96,192,32,parameter + "+ :",0)
              self.contents.font.color = normal_color
              self.contents.draw_text(0,y+96,192,32,item.parameter_points.to_s,2)
            when 2
              parameter = "SPmax"
              parameter_color = Color.new(64,64,224)
              self.contents.font.color = parameter_color
              self.contents.draw_text(0,y+96,192,32,parameter + "+ :",0)
              self.contents.font.color = normal_color
              self.contents.draw_text(0,y+96,192,32,item.parameter_points.to_s,2)
            when 3
              parameter = "Força"
              parameter_color = Color.new(64,224,64)
              self.contents.font.color = parameter_color
              self.contents.draw_text(0,y+96,192,32,parameter + "+ :",0)
              self.contents.font.color = normal_color
              self.contents.draw_text(0,y+96,192,32,item.parameter_points.to_s,2)
            when 4
              parameter = "Destresa"
              parameter_color = Color.new(224,64,224)
              self.contents.font.color = parameter_color
              self.contents.draw_text(0,y+96,192,32,parameter + "+ :",0)
              self.contents.font.color = normal_color
              self.contents.draw_text(0,y+96,192,32,item.parameter_points.to_s,2)
            when 5
              parameter = "Agilidade"
              parameter_color = Color.new(160,160,160)
              self.contents.font.color = parameter_color
              self.contents.draw_text(0,y+96,192,32,parameter + "+ :",0)
              self.contents.font.color = normal_color
              self.contents.draw_text(0,y+96,192,32,item.parameter_points.to_s,2)
            when 6
              parameter = "Inteligência"
              parameter_color = Color.new(224,224,64)
              self.contents.font.color = parameter_color
              self.contents.draw_text(0,y+96,192,32,parameter + "+ :",0)
              self.contents.font.color = normal_color
              self.contents.draw_text(0,y+96,192,32,item.parameter_points.to_s,2)
            end
            self.contents.font.color = Color.new(224,64,64)
            self.contents.draw_text(0,y+32,192,32,"HP recovery :",0)
            self.contents.font.color = Color.new(64,64,224)
            self.contents.draw_text(0,y+64,192,32,"SP recovery :",0)
            self.contents.font.color = normal_color
            self.contents.draw_text(0,y+32,192,32,item.recover_hp.to_s,2)
            self.contents.draw_text(0,y+64,192,32,item.recover_sp.to_s,2)
          when RPG::Weapon
            self.contents.draw_text(0,y,192,32,"Ataque :",0)
            self.contents.draw_text(0,y,192,32,item.atk.to_s,2)
            self.contents.draw_text(0,y+32,192,32,"Defesa Fis. :",0)
            self.contents.draw_text(0,y+32,192,32,item.pdef.to_s,2)
            self.contents.draw_text(0,y+64,192,32,"Defesa Mag. :",0)
            self.contents.draw_text(0,y+64,192,32,item.mdef.to_s,2)
          when RPG::Armor
            case item.kind
            when 0
              kind = "Escudo"
            when 1
              kind = "Elmo"
            when 2
              kind = "Armadura"
            when 3
              kind = "Acessório"
            end
            self.contents.draw_text(0,y,192,32,"Tipo :",0)
            self.contents.draw_text(0,y,192,32,kind,2)
            self.contents.draw_text(0,y+32,192,32," Defesa Fis.:",0)
            self.contents.draw_text(0,y+32,192,32,item.pdef.to_s,2)
            self.contents.draw_text(0,y+64,192,32," Defesa Mag.:",0)
            self.contents.draw_text(0,y+64,192,32,item.mdef.to_s,2)
            self.contents.draw_text(0,y+96,192,32,"Fuga :",0)
            self.contents.draw_text(0,y+96,192,32,item.eva.to_s,2)
          end
        end
      end
      
    end
    #==============================================================================
    class Window_Item2 < Window_Selectable
      def initialize
        super(0, 64, 416, 416)
        @column_max = 1
        refresh
        self.index = 0
      end
      def item
        return @data[self.index]
      end
      def refresh
        if self.contents != nil
          self.contents.dispose
          self.contents = nil
        end
        @data = []
        for i in 1...$data_items.size
          if $game_party.item_number(i) > 0
            @data.push($data_items[i])
          end
        end
        unless $game_temp.in_battle
          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
        end
        @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
      def draw_item(index)
        item = @data[index]
        case item
        when RPG::Item
          number = $game_party.item_number(item.id)
        when RPG::Weapon
          number = $game_party.weapon_number(item.id)
        when RPG::Armor
          number = $game_party.armor_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
        y = index * 32
        self.contents.draw_text(x,y,376,32, item.name, 0)
      end
      def update_help
        @help_window.set_text(self.item == nil ? "" : self.item.description)
      end
      
      def update_details
        @details_window.set_details(self.item)
      end
      
    end
    #==============================================================================
    class Scene_Item
      def main
        @help_window = Window_Help.new
        @item_window = Window_Item2.new
        @details_window = Window_Details.new
        @item_window.help_window = @help_window
        @item_window.details_window = @details_window
        @target_window = Window_Target.new
        @target_window.visible = false
        @target_window.active = false
        Graphics.transition
        loop do
          Graphics.update
          Input.update
          update
          if $scene != self
            break
          end
        end
        Graphics.freeze
        @help_window.dispose
        @item_window.dispose
        @target_window.dispose
        @details_window.dispose
      end
      def update
        @help_window.update
        @item_window.update
        @target_window.update
        @item_window.update_details
        if @item_window.active
          update_item
          return
        end
        if @target_window.active
          update_target
          return
        end
      end
      def update_item
        if Input.trigger?(Input::B)
          $game_system.se_play($data_system.cancel_se)
          $scene = Scene_Menu.new(0)
          return
        end
        if Input.trigger?(Input::C)
          @item = @item_window.item
          unless @item.is_a?(RPG::Item)
            $game_system.se_play($data_system.buzzer_se)
            return
          end
          unless $game_party.item_can_use?(@item.id)
            $game_system.se_play($data_system.buzzer_se)
            return
          end
          $game_system.se_play($data_system.decision_se)
          if @item.scope >= 3
            @item_window.active = false
            @target_window.x = 304
            @target_window.visible = true
            @target_window.active = true
            if @item.scope == 4 || @item.scope == 6
              @target_window.index = -1
            else
              @target_window.index = 0
            end
          else
            if @item.common_event_id > 0
              $game_temp.common_event_id = @item.common_event_id
              $game_system.se_play(@item.menu_se)
              if @item.consumable
                $game_party.lose_item(@item.id, 1)
                @item_window.draw_item(@item_window.index)
              end
              $scene = Scene_Map.new
              return
            end
          end
          return
        end
      end
      def update_target
        if Input.trigger?(Input::B)
          $game_system.se_play($data_system.cancel_se)
          unless $game_party.item_can_use?(@item.id)
            @item_window.refresh
          end
          @item_window.active = true
          @target_window.visible = false
          @target_window.active = false
          return
        end
        if Input.trigger?(Input::C)
          if $game_party.item_number(@item.id) == 0
            $game_system.se_play($data_system.buzzer_se)
            return
          end
          if @target_window.index == -1
            used = false
            for i in $game_party.actors
              used |= i.item_effect(@item)
            end
          end
          if @target_window.index >= 0
            target = $game_party.actors[@target_window.index]
            used = target.item_effect(@item)
          end
          if used
            $game_system.se_play(@item.menu_se)
            if @item.consumable
              $game_party.lose_item(@item.id, 1)
              @item_window.draw_item(@item_window.index)
            end
            @target_window.refresh
            if $game_party.all_dead?
              $scene = Scene_Gameover.new
              return
            end
            if @item.common_event_id > 0
              $game_temp.common_event_id = @item.common_event_id
              $scene = Scene_Map.new
              return
            end
          end
          unless used
            $game_system.se_play($data_system.buzzer_se)
          end
          return
        end
      end
    end
    yunn
    yunn
    Experiente
    Experiente


    Mensagens : 455
    Créditos : 39

    Scene Items com icones grandes Empty Re: Scene Items com icones grandes

    Mensagem por yunn Sáb Mar 01, 2014 9:00 am

    Bem legal e interessante .Mais não darei +1 pq não gostei tanto assim e nem irei usar mais ficou bem legal. Vc que o fez?


    _________________
    Scene Items com icones grandes 3ydkF3a

      Data/hora atual: Ter Mar 19, 2024 3:17 am