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


3 participantes

    Aumentar HP e SP no Status[4.9.2]

    Thrain
    Thrain
    Ocasional
    Ocasional


    Medalhas : Aumentar HP e SP no Status[4.9.2] 1add79
    Mensagens : 186
    Créditos : 21

    Aumentar HP e SP no Status[4.9.2] Empty Aumentar HP e SP no Status[4.9.2]

    Mensagem por Thrain Qua Set 09, 2015 11:51 pm

    O script é bastante simples, apenas fiz algumas alterações no original.
    Com esse script é possível criar muitas builds diferentes para cada personagem, como:
    FULL HP: Possuem muita vida e muita defesa
    FULL ATK: Deixam o HP de lado para causar um dano devastador.
    [...]



    Script
    Código:
    #==============================================================================
    # ** Window_Status
    #------------------------------------------------------------------------------
    # By Valentine
    # Edited: 09/09/2015
    #==============================================================================
     
    class Window_Status < Window_Base
      #--------------------------------------------------------------------------
      # * Inicialização dos Objetos
      #--------------------------------------------------------------------------
      def initialize
        super(25, 35, 210, 280)
        $game_temp.windows << self
        self.contents = Bitmap.new(width - 32, height - 32)
        self.back_opacity = 200
        self.visible = false
        self.active = false
        self.z = 999999
        if Config::POINTS
          @str_button = Button.new(self, 160, 103, " + ") {add_str}
          @dex_button = Button.new(self, 160, 123, " + ") {add_dex}
          @agi_button = Button.new(self, 160, 143, " + ") {add_agi}
          @int_button = Button.new(self, 160, 163, " + ") {add_int}
          @hp_button = Button.new(self, 160, 43, " + ") {add_hp}
          @sp_button = Button.new(self, 160, 63, " + ") {add_sp}
        end
        @title = Sprite_Title.new(self, Vocab::TITLE9)
        @actor = $game_party.actors[0]
        @dragable = true
        @closable = true
      end
      #--------------------------------------------------------------------------
      # * Atualização do Frame
      #--------------------------------------------------------------------------
      def update
        super
        @title.update
        refresh if something_changed?
      end
      #--------------------------------------------------------------------------
      # * Verificação das Variáveis
      #--------------------------------------------------------------------------
      def something_changed?
        return true if @old_lvl != @actor.level
        #return true if @old_gold != $game_party.item_number(Config::GOLD_ID)
        return true if @old_exp != @actor.now_exp
        return true if @old_hp != @actor.hp
        return true if @old_sp != @actor.sp
        return true if @old_maxhp != @actor.maxhp
        return true if @old_maxsp != @actor.maxsp
        return true if @old_str != @actor.str
        return true if @old_dex != @actor.dex
        return true if @old_int != @actor.int
        return true if @old_agi != @actor.agi
        return true if @old_atk != @actor.atk
        return true if @old_pdef != @actor.pdef
        return true if @old_mdef != @actor.mdef
        #-------------------------------------------
        #HP #actor.hp
        return true if @old_hp != @actor.hp
        #SP #actor.sp
        return true if @old_sp != @actor.sp
        #-------------------------------------------
        return true if @old_points != @actor.points
        return false
      end
      #--------------------------------------------------------------------------
      # * Atualização
      #--------------------------------------------------------------------------
      def refresh
        @old_lvl = @actor.level
        #@old_gold = $game_party.item_number(Config::GOLD_ID)
        @old_hp = @actor.hp
        @old_sp = @actor.sp
        @old_exp = @actor.now_exp
        @old_maxhp = @actor.maxhp
        @old_maxsp = @actor.maxsp
        @old_points = @actor.points
        @old_str = @actor.str
        @old_dex = @actor.dex
        @old_int = @actor.int
        @old_agi = @actor.agi
        @old_atk = @actor.atk
        @old_pdef = @actor.pdef
        @old_mdef = @actor.mdef
        self.contents.clear
        # Nível
        self.contents.draw_text(0, 0, 62, 32, Vocab::CHAR_LEVEL)
        self.contents.draw_text(100, 0, 100, 32, "#{@actor.level}")
        # Ouro
        #self.contents.draw_text(0, 20, 32, 32, Vocab::CHAR_GOLD)
        #self.contents.draw_text(100, 20, 100, 32, @old_gold.to_s)
        # HP\MaxHP
        self.contents.draw_text(0, 20, 100, 32, Vocab::CHAR_HP)
        self.contents.draw_text(100, 20, 200, 32, "#{@actor.hp}/#{@actor.maxhp}")
        # SP\MaxSP
        self.contents.draw_text(0, 40, 100, 32, Vocab::CHAR_SP)
        self.contents.draw_text(100, 40, 200, 32, "#{@actor.sp}/#{@actor.maxsp}")
        # Experiência atual\Experiência necessária para o próximo nível
        self.contents.draw_text(0, 60, 72, 32, Vocab::CHAR_EXP)
        self.contents.draw_text(100, 60, 200, 32, "#{@actor.now_exp}/#{@actor.next_exp}")
        # Força
        self.contents.draw_text(0, 80, 100, 32, $data_system.words.str)
        self.contents.draw_text(100, 80, 100, 32, @actor.str.to_s)
        # Destreza
        self.contents.draw_text(0, 100, 100, 32, $data_system.words.dex)
        self.contents.draw_text(100, 100, 100, 32, @actor.dex.to_s)
        # Agilidade
        self.contents.draw_text(0, 120, 100, 32, $data_system.words.agi)
        self.contents.draw_text(100, 120, 100, 32, @actor.agi.to_s)
        # Inteligência
        self.contents.draw_text(0, 140, 100, 32, $data_system.words.int)
        self.contents.draw_text(100, 140, 100, 32, @actor.int.to_s)
        # Ataque
        self.contents.draw_text(0, 160, 100, 32, $data_system.words.atk)
        self.contents.draw_text(100, 160, 100, 32, @actor.atk.to_s)
        # Defesa Física
        self.contents.draw_text(0, 180, 100, 32, $data_system.words.pdef)
        self.contents.draw_text(100, 180, 100, 32, @actor.pdef.to_s)
        # Defesa Mágica
        self.contents.draw_text(0, 200, 100, 32, $data_system.words.mdef)
        self.contents.draw_text(100, 200, 100, 32, @actor.mdef.to_s)
        # Pontos
        self.contents.draw_text(0, 220, 62, 32, Vocab::CHAR_POINTS)
        points = @actor.points < 0 ? 0 : @actor.points
        self.contents.draw_text(100, 220, 32, 32, points.to_s, 0)
      end
      #--------------------------------------------------------------------------
      # * Aumentar Ataque
      #--------------------------------------------------------------------------
      def add_str(value = 1)
        if $game_party.actors[0].points >= value and $game_actors[1].str < Config::MAX_STR
          $game_party.actors[0].points -= value
          $game_actors[1].str += value
        end
      end
      #--------------------------------------------------------------------------
      # * Aumentar Defesa
      #--------------------------------------------------------------------------
      def add_dex(value = 1)
        if $game_party.actors[0].points >= value and $game_actors[1].dex < Config::MAX_DEX
          $game_party.actors[0].points -= value
          $game_actors[1].dex += value
        end
      end
      #--------------------------------------------------------------------------
      # * Aumentar Agilidade
      #--------------------------------------------------------------------------
      def add_agi(value = 1)
        if $game_party.actors[0].points >= value and $game_actors[1].agi < Config::MAX_AGI
          $game_party.actors[0].points -= value
          $game_actors[1].agi += value
        end
      end
      #--------------------------------------------------------------------------
      # * Aumentar Inteligência
      #--------------------------------------------------------------------------
      def add_int(value = 1)
        if $game_party.actors[0].points >= value and $game_actors[1].int < Config::MAX_INT
          $game_party.actors[0].points -= value
          $game_actors[1].int += value
        end
      end
      #----------------------------------------------------
      # * Aumentar HP
      #----------------------------------------------------
      def add_hp(value = 1)
        if $game_party.actors[0].points >= value
          $game_party.actors[0].points -= value
          $game_actors[1].maxhp += 20
        end
      end
      #----------------------------------------------------
      # * Aumentar SP
      #----------------------------------------------------
      def add_sp(value = 1)
        if $game_party.actors[0].points >= value
          $game_party.actors[0].points -= value
          $game_actors[1].maxsp += 20
        end
      end
      
    end

    **Lembrem-se de fazer backup do projeto antes de instalar qualquer script


    Screens

    Aumentar HP e SP no Status[4.9.2] HdJLooR

    Aumentar HP e SP no Status[4.9.2] Lvs715U
    OBS
    Eu coloque que para cada ponto em HP ou SP aumentasse em 20 o valor máximo, ou seja caso tenha 500 de HP quando use seu novo HP será 520.
    Para alterar o valor aumentado vá:

    Na linha 171 para alterar o HP
    Código:
    $game_actors[1].maxhp += X

    Na linha 180 para alterar o SP
    Código:
    $game_actors[1].maxsp += X

    X= Valor ganho a cada ponto.




    Última edição por Thrain em Qui Set 10, 2015 9:43 am, editado 2 vez(es)


    _________________
    Conheça o Ninja World
    Aumentar HP e SP no Status[4.9.2] 14292475_1767622010160526_5962674817086196917_n
    ...
    thiagus
    thiagus
    Semi-Experiente
    Semi-Experiente


    Mensagens : 144
    Créditos : 9

    Aumentar HP e SP no Status[4.9.2] Empty Re: Aumentar HP e SP no Status[4.9.2]

    Mensagem por thiagus Qui Set 10, 2015 8:58 am

    aeeee valeu, muito util esse script! 
    cred!
    GallighanMaker
    GallighanMaker
    Colaborador
    Colaborador


    Medalhas : Aumentar HP e SP no Status[4.9.2] ZgLkiRU
    Mensagens : 985
    Créditos : 102

    Ficha do personagem
    Nível: 1
    Experiência:
    Aumentar HP e SP no Status[4.9.2] Left_bar_bleue0/0Aumentar HP e SP no Status[4.9.2] Empty_bar_bleue  (0/0)
    Vida:
    Aumentar HP e SP no Status[4.9.2] Left_bar_bleue30/30Aumentar HP e SP no Status[4.9.2] Empty_bar_bleue  (30/30)

    Aumentar HP e SP no Status[4.9.2] Empty Re: Aumentar HP e SP no Status[4.9.2]

    Mensagem por GallighanMaker Qui Set 10, 2015 1:44 pm

    Acho legal a ideia de você poder distribuir pontos em HP e MP porém é realmente a critério do desenvolvedor, no meu caso eu sempre utilizo outros status que fornecem mais pontos em HP e MP como resistência e força de vontade ou inteligencia, podendo utilizar essa mesma lógica.


    _________________
    Aumentar HP e SP no Status[4.9.2] 8dVK0ku
    using C# and import Python developer || Expert in Unity Engine IDE. || Aumentar HP e SP no Status[4.9.2] 769_heart 2D pixel games.

    Conteúdo patrocinado


    Aumentar HP e SP no Status[4.9.2] Empty Re: Aumentar HP e SP no Status[4.9.2]

    Mensagem por Conteúdo patrocinado


      Data/hora atual: Sex Abr 26, 2024 6:24 am