Ogłoszenie 

Uwaga! To forum jest w trybie offline.
Wszelką pomoc uzyskasz pod adresem
forum.ultimateam.pl


Administracja Forum


Poprzedni temat «» Następny temat
KaiMonkey's MP types
Autor Wiadomość
Domilos 




Preferowany:
RPG Maker VXAce

Pomógł: 2 razy
Dołączył: 16 Cze 2011
Posty: 62
Wysłany: Sob 03 Mar, 2012 16:12
KaiMonkey's MP types
~ KaiMonkey's MP types 5.0 ~


Krótki opis:
Skrypt pozwala ustawić dla każdej klasy, własną manę. Dodatkowo można ustawić wzrost lub spadek many kiedy atakujemy/bronimy się + możemy przypasować itemki tylko dla danej klasy (np. jeśli chcemy miksturę many dla magów i miksturę energii dla wojowników).

Autor:
KaiMonkey

Tłumaczenie:
Domilos

Kompatybilność:
RPG Maker VX

Skrypt:
Spoiler:

Kod:
=begin
KaiMonkey's MP types 5.0
by KaiMonkey

Introduction
This template will help you to make a better presentation for your script. This is purely optional but will help to create a standard which in return will help user to quickly find the required info on your script.

Features
- Change the name of each classes MP
- Change the colour to make MP represent
anything from stamina to ammo!
- Can be diffenrent for every class
- Have in increase or decrease on attack or block
- Make only the right potions and items regain the right MP (no more gunners getting ammo from potions and mages from clips!)
=end

MP_Types = ["RAGE","N/A","HOLY","MP","","DARK","EG","EG"] # Inne nazwy many. Klasa o ID 1 ma "RAGE", o ID 3 "HOLY" itd
MP_Colour = [[18,0],[18,10],[6,14],[22,23],[22,23],[15,19],[18,10],[18,10]] # Kolor paska many

=begin
Przykładowe kolory:

Niebieski [22,23]
Czerwony [18,10]
Czarny [15,19]
Zielony [3,11]
Biały / szary [0,8]
Różowy / fioletowy [30,31]
=end

Dont_Have = [2,5] #Klasy, bez many (klasa z id 2 będzie miała N/A bez paska many, a klasa z id 5 nie będzie miała niczego).
MP_TO_DECREASE_Attacking = [0,0,5,2,0,0,0,0] # spadek many z atakiem. np. klasa o ID 3 straci 5 many, kiedy zaatakuje
MP_TO_DECREASE_Blocking= [15,0,0,0,0,0,0,0] # spadek many z blokiem np. klasa o ID 1 straci 15 many, kiedy będzie się bronił
MP_TO_INCREASE_Attacking = [5,0,0,0,0,0,0,0] # wzrost many z atakiem np. klasa o ID 3 dostanie 5 many, kiedy zaatakuje
MP_TO_INCREASE_Blocking= [0,0,5,0,0,0,0,0] # wzrost many z blokiem np. klasa o ID 3 dostanie 5 many, kiedy będzie się bronił
#####Potion config#############
$Potions_effect ={
#  id itemu => [lista "klas many", które mogą użyć]
# więc 5 => [1,3] ci, którzy mają klasę o id 1 i 3 mogą użyć item o id 5
1 => [1,2],
4 => [4],
21 => [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


Screeny:
Spoiler:




Dodatkowe informacje:
Skrypt wklejamy nad "Main".
 
 
Wyświetl posty z ostatnich:   
Odpowiedz do tematu
Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Nie możesz załączać plików na tym forum
Możesz ściągać załączniki na tym forum
Dodaj temat do Ulubionych
Wersja do druku

Skocz do:  

Powered by phpBB modified by Przemo © 2003 phpBB Group | Template Klam by Ayene