Ogłoszenie 

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


Administracja Forum


Poprzedni temat «» Następny temat
Zamknięty przez: Ayene
Sro 18 Kwi, 2012 10:52
Limit użyć
Autor Wiadomość
Ziolus 



Pomógł: 6 razy
Dołączył: 20 Kwi 2011
Posty: 30
Wysłany: Nie 15 Kwi, 2012 13:59
Limit użyć
Witam!
Poszukuję skryptu który ograniczył by ilość użyć przedmiotów i czarów podczas walki.
Standardowo podczas walki można użyć przedmioty tyle razy ile się ich ma, a czary nieskończoność, a ja chciałbym by wybrany przedmiot można by było użyć np.10 razy, a czar np.3 razy.
Jeśli taki skrypt istnieje poproszę o link :-P
 
 
Ayene 




Ranga RM:
4 gry

Pomogła: 232 razy
Dołączyła: 18 Wrz 2007
Posty: 2424
Wysłany: Wto 17 Kwi, 2012 18:30
Sprawdź to:
Spoiler:

Kod:
#==============================================================================
# by Ayene
#==============================================================================
module AYE
  MAX_ITEM_USED = 1   # Maksymalna liczba użyć jednego przedmiotu
  MAX_SKILL_USED = 4  # Maksymalna liczba użyć jednej umiejętności
end

#==============================================================================
# ** Game_Temp
#==============================================================================
class Game_Temp
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :battle_item_used
  attr_accessor :battle_skill_used
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  alias aye_gamtemp_ini initialize
  def initialize
    aye_gamtemp_ini
    @battle_item_used = {}
    @battle_skill_used = {}
  end
end

#==============================================================================
# ** Window_Skill
#==============================================================================
class Window_Skill < Window_Selectable
  #--------------------------------------------------------------------------
  # * Draw Item
  #     index : item number
  #--------------------------------------------------------------------------
  def draw_item(index)
    skill = @data[index]
    if @actor.skill_can_use?(skill.id)
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end
    if $game_temp.battle_skill_used.include?(skill.id)
      if $game_temp.battle_skill_used[skill.id] >= AYE::MAX_SKILL_USED
        self.contents.font.color = disabled_color
      end
    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(skill.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, 204, 32, skill.name, 0)
    self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
  end
end

#==============================================================================
# ** Window_Item
#==============================================================================
class Window_Item < Window_Selectable
  #--------------------------------------------------------------------------
  # * Draw Item
  #     index : item number
  #--------------------------------------------------------------------------
  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
    if $game_temp.battle_item_used.include?(item.id)
      if $game_temp.battle_item_used[item.id] >= AYE::MAX_ITEM_USED
        self.contents.font.color = disabled_color
      end
    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 + 240, y, 16, 32, ":", 1)
    self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  end
end

#==============================================================================
# ** Scene_Battle
#==============================================================================
class Scene_Battle
  #--------------------------------------------------------------------------
  # * Frame Update (actor command phase : skill selection)
  #--------------------------------------------------------------------------
  alias aye_scbat_update_phase3_skill_select update_phase3_skill_select
  def update_phase3_skill_select
    if Input.trigger?(Input::C)
      @skill = @skill_window.skill
      if $game_temp.battle_skill_used.include?(@skill.id)
        if $game_temp.battle_skill_used[@skill.id] >= AYE::MAX_SKILL_USED
          $game_system.se_play($data_system.buzzer_se)
          return
        end
      end
    end
    aye_scbat_update_phase3_skill_select
  end
  #--------------------------------------------------------------------------
  # * Frame Update (actor command phase : item selection)
  #--------------------------------------------------------------------------
  alias aye_scbat_update_phase3_item_select update_phase3_item_select
  def update_phase3_item_select
    if Input.trigger?(Input::C)
      @item = @item_window.item
      if $game_temp.battle_item_used.include?(@item.id)
        if $game_temp.battle_item_used[@item.id] >= AYE::MAX_ITEM_USED
          $game_system.se_play($data_system.buzzer_se)
          return
        end
      end
    end   
    aye_scbat_update_phase3_item_select
  end
  #--------------------------------------------------------------------------
  # * Make Skill Action Results
  #--------------------------------------------------------------------------
  alias aye_scbat_make_skill_action_result make_skill_action_result
  def make_skill_action_result   
    @skill = $data_skills[@active_battler.current_action.skill_id]
    skill_number = $game_temp.battle_skill_used.include?(@skill.id) ?
                  $game_temp.battle_skill_used[@skill.id] : 0
    $game_temp.battle_skill_used[@skill.id] = skill_number + 1
    aye_scbat_make_skill_action_result
  end
  #--------------------------------------------------------------------------
  # * Make Item Action Results
  #--------------------------------------------------------------------------
  alias aye_scbat_make_item_action_result make_item_action_result
  def make_item_action_result
    @item = $data_items[@active_battler.current_action.item_id]
    item_number = $game_temp.battle_item_used.include?(@iteml.id) ?
                  $game_temp.battle_item_used[@iteml.id] : 0
    $game_temp.battle_item_used[@item.id] = item_number + 1
    aye_scbat_make_item_action_result
  end
  #--------------------------------------------------------------------------
  # * Battle Ends
  #     result : results (0:win 1:lose 2:escape)
  #--------------------------------------------------------------------------
  alias aye_scbat_battle_end battle_end
  def battle_end(result)
    $game_temp.battle_skill_used.clear
    $game_temp.battle_item_used.clear
    aye_scbat_battle_end(result)
  end
end

________________________


 
 
 
Ziolus 



Pomógł: 6 razy
Dołączył: 20 Kwi 2011
Posty: 30
Wysłany: Wto 17 Kwi, 2012 21:20
Jesteś supcio! 8-) Kolejny raz wielkie dzięki i pozdrawiam :papa:
 
 
Wyświetl posty z ostatnich:   
Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi
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