Battle Maker

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

Suporte para criação de Jogos


2 participantes

    (Script) Tipos de MP

    Vejeta
    Vejeta
    Membro
    Membro


    Mensagens : 7
    Credibilidade : 3

    (Script) Tipos de MP Empty (Script) Tipos de MP

    Mensagem por Vejeta Dom Jun 20, 2010 1:26 am

    Tipos de MP

    Introdução

    Esse script permite tipos diferentes de MP,bom explicação meio confusa não é,veja as screenhots para entender melhor.E pra quem newbie e não sabe MP é a quantidade gasta para se efetuar uma magia em batalha.

    Como usar
    Abra o Editor de Scripts (F11), é cole o script em um slot vazio a cima de Main

    Instruções
    Altere as 7 primeiras linhas do script ao seu gosto,nelas se encontra a parte configurável
    Código:
    MP_Types = ["RAGE","N/A","HOLY","MP","","DARK","EG","EG"]
    MP_Colour = [[18,0],[18,10],[6,14],[22,23],[22,23],[15,19],[18,10],[18,10]]
    Dont_Have = [2,5]
    MP_TO_DECREASE_Attacking = [0,0,5,2,0,0,0,0]
    MP_TO_DECREASE_Blocking= [15,0,0,0,0,0,0,0]
    MP_TO_INCREASE_Attacking = [5,0,0,0,0,0,0,0]
    MP_TO_INCREASE_Blocking= [0,0,5,0,0,0,0,0]

    Script
    Código:
    MP_Types = ["RAGE","N/A","HOLY","MP","","DARK","EG","EG"]
    MP_Colour = [[18,0],[18,10],[6,14],[22,23],[22,23],[15,19],[18,10],[18,10]]
    Dont_Have = [2,5]
    MP_TO_DECREASE_Attacking = [0,0,5,2,0,0,0,0]
    MP_TO_DECREASE_Blocking= [15,0,0,0,0,0,0,0]
    MP_TO_INCREASE_Attacking = [5,0,0,0,0,0,0,0]
    MP_TO_INCREASE_Blocking= [0,0,5,0,0,0,0,0]
    #####Potion config#############
    $Potions_effect ={
    #  item id => [list of classes]
    # so 5 => [1,3] means class 1 and 3 can use item 5
    4 => [4],
    21 => [1,7,8],
    22 => [3],
    23 => [6]
    }
    class Window_Base < Window
      #--------------------------------------------------------------------------
      # * Draw MP
      #    actor : actor
      #    x    : draw spot x-coordinate
      #    y    : draw spot y-coordinate
      #    width : Width
      #--------------------------------------------------------------------------
      def draw_actor_mp(actor, x, y, width = 120)
        have_or_not = 0
        work = 0
        while have_or_not == 0
          if actor.class.id == Dont_Have[work] 
            have_or_not = 1
            break
          else
            work += 1
            if work == Dont_Have.size
              break
            end
          end
        end
       
        if have_or_not == 1
          final_word = MP_Types[actor.class.id - 1]
          self.contents.draw_text(x, y, 30, WLH, final_word) 
        else
          draw_actor_mp_gauge(actor, x, y, width)
          self.contents.font.color = system_color
          final_word = MP_Types[actor.class.id - 1]
          self.contents.draw_text(x, y, 30, WLH, final_word)
          self.contents.font.color = mp_color(actor)
          last_font_size = self.contents.font.size
          xr = x + width
          if width < 120
            self.contents.draw_text(xr - 44, y, 44, WLH, actor.mp, 2)
          else
            self.contents.draw_text(xr - 99, y, 44, WLH, actor.mp, 2)
            self.contents.font.color = normal_color
            self.contents.draw_text(xr - 55, y, 11, WLH, "/", 2)
            self.contents.draw_text(xr - 44, y, 44, WLH, actor.maxmp, 2)
          end
        end
      end
      #~ #--------------------------------------------------------------------------
      #~ # * Draw MP Gauge
      #~ #    actor : actor
      #~ #    x    : draw spot x-coordinate
      #~ #    y    : draw spot y-coordinate
      #~ #    width : Width
      #~ #--------------------------------------------------------------------------
      def draw_actor_mp_gauge(actor, x, y, width = 120)
        gw = width * actor.mp / [actor.maxmp, 1].max
        gc1 = mp_gauge_color1(actor)
        gc2 = mp_gauge_color2(actor)
        self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
        self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
      end
      #--------------------------------------------------------------------------
      # * Get MP Gauge Color 1
      #--------------------------------------------------------------------------
      def mp_gauge_color1(actor)
        return text_color(MP_Colour[actor.class.id - 1][0])
      end
      #--------------------------------------------------------------------------
      # * Get MP Gauge Color 2
      #--------------------------------------------------------------------------
      def mp_gauge_color2(actor)
        return text_color(MP_Colour[actor.class.id - 1][1])
      end
      end
      #######################
      # CREDIT TO KAIMONKEY #
      #######################

    class Scene_Battle < Scene_Base
        def update_item_selection
        @item_window.active = true
        @item_window.update
        @help_window.update
        if Input.trigger?(Input::B)
          Sound.play_cancel
          end_item_selection
        elsif Input.trigger?(Input::C)
          @item = @item_window.item
          if @item != nil
            $game_party.last_item_id = @item.id
          end
          if $Potions_effect[@item.id] != nil
            if $game_party.item_can_use?(@item)&& $Potions_effect[@item.id].include?(@active_battler.class.id)
              Sound.play_decision
              determine_item
            else
              Sound.play_buzzer
            end
          else
            if $game_party.item_can_use?(@item)
              Sound.play_decision
              determine_item
            else
              Sound.play_buzzer
            end
          end
        end
      end 
       
        def execute_action_attack
          if MP_TO_DECREASE_Attacking[@active_battler.id - 1] != nil
            if @active_battler.mp >= MP_TO_DECREASE_Attacking[@active_battler.class.id - 1]
                text = sprintf(Vocab::DoAttack, @active_battler.name)
                @message_window.add_instant_text(text)
                targets = @active_battler.action.make_targets
                display_attack_animation(targets)
                wait(20)
                for target in targets
                  target.attack_effect(@active_battler)
                  display_action_effects(target)
                end
                @active_battler.mp -= MP_TO_DECREASE_Attacking[@active_battler.class.id - 1]
              else
                text1= " hasn't enough "
                text = @active_battler.name + text1 + MP_Types[@active_battler.class.id - 1] + " to attack!"
                @message_window.add_instant_text(text)
                wait(200)
              end
          if MP_TO_INCREASE_Attacking[@active_battler.class.id - 1] != nil
      #~        p @active_battler.name
      #~        p @active_battler.mp
      #~      p MP_TO_INCREASE_Attacking[@active_battler.class.id - 1]
                text = sprintf(Vocab::DoAttack, @active_battler.name)
                @message_window.add_instant_text(text)
                targets = @active_battler.action.make_targets
                display_attack_animation(targets)
                wait(20)
                for target in targets
                  target.attack_effect(@active_battler)
                  display_action_effects(target)
                end
                @active_battler.mp += MP_TO_INCREASE_Attacking[@active_battler.class.id - 1]
      #~        p @active_battler.mp
      #~        p MP_TO_INCREASE_Attacking[@active_battler.id - 1]
            end
          else
          text = sprintf(Vocab::DoAttack, @active_battler.name)
            @message_window.add_instant_text(text)
            targets = @active_battler.action.make_targets
            display_attack_animation(targets)
            wait(20)
            for target in targets
              target.attack_effect(@active_battler)
              display_action_effects(target)
            end
          end
        end
       
      #~ 
        def execute_action_guard
          if MP_TO_INCREASE_Blocking[@active_battler.class.id - 1] != nil
            if MP_TO_INCREASE_Blocking[@active_battler.class.id - 1] != 0
                @active_battler.mp += MP_TO_INCREASE_Blocking[@active_battler.class.id - 1]
                text = sprintf(Vocab::DoGuard, @active_battler.name)
                @message_window.add_instant_text(text)
                wait(45)
                text = "So " + @active_battler.name + "'s " + MP_Types[@active_battler.class.id - 1] + " increased!"
                @message_window.add_instant_text(text)
                wait(45)
            elsif MP_TO_INCREASE_Blocking[@active_battler.id - 1] != 0
                @active_battler.mp -= MP_TO_DECREASE_Blocking[@active_battler.class.id - 1]
                text = sprintf(Vocab::DoGuard, @active_battler.name)
                @message_window.add_instant_text(text)
                wait(45)
                text = "So " + @active_battler.name + "'s " + MP_Types[@active_battler.class.id - 1] + " was Lost!"
                @message_window.add_instant_text(text)
                wait(45)
            end
        else
          text = sprintf(Vocab::DoGuard, @active_battler.name)
          @message_window.add_instant_text(text)
          wait(45)
        end
      end
       
    end


    #~ #=============================================================================
    #~ # ** Scene_Item
    #~ #------------------------------------------------------------------------------
    #~ #  This class performs the item screen processing.
    #~ #==============================================================================

    class Scene_Item < Scene_Base
      def determine_target
        used = false
        if @item.for_all?
          for target in $game_party.members
            target.item_effect(target, @item)
            used = true unless target.skipped
          end
        else
          $game_party.last_target_index = @target_window.index
          target = $game_party.members[@target_window.index]
          class_needed = $Potions_effect[@item.id]
        if class_needed.include?(target.class.id)
            target.item_effect(target, @item)
              used = true unless target.skipped
          end
        end
        if used
          use_item_nontarget
        else
          Sound.play_buzzer
        end
      end
    end

    Screen
    (Script) Tipos de MP MEGASCREEN

    Créditos
    BigEd
    Kai monkey

    OBBBS:é uns créditos ao Contium por postar na MRM é eu peguei dele lá

    Se tiverém erro ao copiar o script me avisem que eu colocarei a demo
    bruce-lee
    bruce-lee
    Membro Experiente
    Membro Experiente


    Mensagens : 84
    Credibilidade : 2

    (Script) Tipos de MP Empty Re: (Script) Tipos de MP

    Mensagem por bruce-lee Sáb Jul 10, 2010 2:53 pm

    legal essa opção, por que não posta uma demo?

      Data/hora atual: Sex Abr 26, 2024 12:25 pm