Shepher Admin
Número de Mensagens : 87 Idade : 28
| Assunto: [RGSS2]Sistema de Itens GuiRPG Seg Jun 07, 2010 2:15 pm | |
| Sistema de Itens GuiRPG por GuiRPG .: Introdução :. Esse script modifica o Sistema de Itens, deixando ele mais avançado e legal, com efeitos nas janelas e muito mais. Você pode configurar o script, não esqueça! Mais informações sobre a personalização estão no script. .: Características :.
- Modifica o Sistema de Itens.
.: Screenshots :..: Script :.- Spoiler:
- Código:
-
#=============================================================================== # Sistema de Itens GuiRPG 1.0 #------------------------------------------------------------------------------- # Versão 1.0 # Por: GuiRPG - [guirpg@gmail.com] # Data: 28/10/08 #------------------------------------------------------------------------------- # Modifica o Sistema de Itens, deixando ele mais legal e avançado! #===============================================================================
#=============================================================================== # Módulo GuiRPG #------------------------------------------------------------------------------- # Algumas Configurações do script! #------------------------------------------------------------------------------- # true = sim # false = não #=============================================================================== module GuiRPG
# Os Nomes dos seus personagens são grandes Nomes_Grandes = true
# Mensagem que aparecerá na janela de descrições quando não tiver nenhum item $Msg_GuiRPG = "Nenhum Item Encontrado!" # Você pode mudar a mensagem no meio do jogo, basta # usar o Chamar script e digitar: # $Msg_GuiRPG = "Aqui a mensagem"
# Ativar SE em alguns efeitos das windows A_SE = true
SE1 = "Jump1" SE2 = "Close1"
# Ativar Transição SI_TRANS = false
# Tempo de transição TEMPO_TRANS = 90
# Ativar texto "Descrição:" antes da descrição dos itens? A_Des = true # Aqui escolha o texto A_Des_T = "Descrição:"
end
class Scene_Item < Scene_Base
include GuiRPG
def start super create_menu_background @viewport = Viewport.new(0, 0, 544, 416) @help_window = Window_Help_GuiRPG.new @help_window.viewport = @viewport @item_window = Window_Item.new(-600, 100, 544, 180) @item_window.viewport = @viewport @item_window.help_window = @help_window @gold = Window_Gold.new(-200,360) @itens = Window_Tempo_GuiRPG.new(159,416) @target_window = Window_Target_GuiRPG.new(0, 232) @c_item = Window_Lu.new @actor_index = 0 hide_target_window if GuiRPG::SI_TRANS == true trans end
end
def trans Graphics.transition(GuiRPG::TEMPO_TRANS,"Graphics/System/BattleStart") end
def update super update_menu_background @help_window.update @item_window.update @target_window.update @itens.update @c_item.update if @item_window.active update_item_selection elsif @target_window.active if @actor_index != @target_window.index @actor_index = @target_window.index @target_window.refresh end update_target_selection end @help_window.y -= 8 if @help_window.y <= 0 @help_window.y = 0 end @item_window.x += 6 if @item_window.x >= 0 @item_window.x = 0 end @gold.x += 3 if @gold.x >= 0 @gold.x = 0 end @itens.y -= 1 if @itens.y <= 360 @itens.y = 360 end @c_item.x -= 3 if @c_item.x <= 348 @c_item.x = 348 end end
def pre_terminate super Graphics.transition(15) fechar_item_window Graphics.transition(15) fechar_gold_window Graphics.transition(15) fechar_c_item Graphics.transition(15) fechar_itens Graphics.transition(15) fechar_help end
def fechar_help @help_window.close begin @help_window.update Graphics.update end until @help_window.openness == 0 end
def fechar_itens @itens.close begin @itens.update Graphics.update end until @itens.openness == 0 end
def fechar_gold_window @gold.close begin @gold.update Graphics.update end until @gold.openness == 0 end
def fechar_c_item @c_item.close begin @c_item.update Graphics.update end until @c_item.openness == 0 end
def fechar_item_window @item_window.close begin @item_window.update Graphics.update end until @item_window.openness == 0 end
def determine_item if @item.for_friend? show_target_window if @item.for_all? @target_window.index = 99 else if $game_party.last_target_index < @target_window.item_max @target_window.index = $game_party.last_target_index else @target_window.index = 0 end end else use_item_nontarget end end
def show_target_window loop do @item_window.y -= 8 Graphics.update break if @item_window.y <= 56 end if GuiRPG::A_SE == true Audio.se_play("Audio/SE/" + GuiRPG::SE1, 70, 100) end @item_window.active = false @target_window.visible = true @target_window.active = true end
def hide_target_window @target_window.visible = false loop do @item_window.y += 8 Graphics.update if GuiRPG::A_SE == true Audio.se_play("Audio/SE/" + GuiRPG::SE2, 70, 100) end break if @item_window.y = 100 end @item_window.active = true @target_window.active = false @viewport.rect.set(0, 0, 544, 416) @viewport.ox = 0 end
def terminate @item_window.dispose @gold.dispose @itens.dispose @c_item.dispose end
end
class Window_Target_GuiRPG < Window_Selectable
def initialize(x, y) super(x, y, 544, 128)
refresh self.active = false end
def dispose super end
def refresh self.contents.clear @item_max = $game_party.members.size for i in 0...@item_max draw_item(i) end draw_face_e_grafico(@index) if @index >= 0 end
def draw_item(index) rect = item_rect(index) rect.x += 2 rect.width -= 8 self.contents.clear_rect(rect) self.contents.font.color = normal_color if GuiRPG::Nomes_Grandes == true self.contents.font.size = 16 end actor = $game_party.members[index] draw_actor_name(actor, 124, rect.y + 2) begin_x = self.contents.text_size(actor.name).width + 4 draw_actor_state(actor, begin_x, rect.y, 24) draw_actor_hp(actor, 230, rect.y, 65) draw_actor_mp(actor, 310, rect.y, 65) end
def draw_face_e_grafico(index) rect = Rect.new(0, 0, 96, 96) self.contents.clear_rect(rect) actor = $game_party.members[index] draw_actor_face(actor, 0, 0, 96) draw_actor_graphic(actor, 450, 60) end def index=(index) @index = index update_cursor refresh end
def item_rect(index) rect = Rect.new(0, 0, 0, 0) rect.width = contents.width - 200 rect.height = WLH rect.x = 100 rect.y = index / @column_max * WLH return rect end
def update_cursor if @index < 0 self.cursor_rect.empty else row = @index / @column_max if row < top_row self.top_row = row end if row > bottom_row self.bottom_row = row end rect = item_rect(@index) rect.y -= self.oy self.cursor_rect = rect end
end end
class Window_Help_GuiRPG < Window_Base
def initialize super(0, 800, 544, WLH + 28) end
def set_text(text, align = 0) if text != @text or align != @align self.contents.clear self.contents.font.size = 16 self.contents.font.color = normal_color self.contents.draw_text(4, 0, self.width - 50, WLH, text, align) @text = text @align = align end end end
class Window_Item < Window_Selectable
def initialize(x, y, width, height) super(x, y, width, height) @column_max = 2 self.index = 0 refresh
end
def item return @data[self.index] end
def include?(item) return false if item == nil if $game_temp.in_battle return false unless item.is_a?(RPG::Item) end return true end
def enable?(item) return $game_party.item_can_use?(item) end
def refresh @data = [] for item in $game_party.items next unless include?(item) @data.push(item) if item.is_a?(RPG::Item) and item.id == $game_party.last_item_id self.index = @data.size - 1 end end @data.push(nil) if include?(nil) @item_max = @data.size create_contents for i in 0...@item_max draw_item(i) end end
def draw_item(index) rect = item_rect(index) self.contents.clear_rect(rect) item = @data[index] if item != nil number = $game_party.item_number(item) enabled = enable?(item) rect.width -= 4 draw_item_name(item, rect.x, rect.y, enabled) self.contents.draw_text(rect, sprintf("%2d:", number),2) end end
def update_help espaço = " " sp = " " if GuiRPG::A_Des == true texg = GuiRPG::A_Des_T else texg = "" end @help_window.set_text(item == nil ? espaço + $Msg_GuiRPG : texg + sp + item.description)
end end
class Window_Tempo_GuiRPG < Window_Base
def initialize(x, y) super(x, y, 190, WLH + 32) refresh end
def refresh
self.contents.clear self.contents.font.color = system_color self.contents.draw_text(0, -8, 200, 40, "Tempo:") @tempot = Graphics.frame_count / Graphics.frame_rate hour = @tempot / 60 / 60 min = @tempot / 60 % 60 sec = @tempot % 60 tempo = sprintf("%02d:%02d:%02d", hour, min, sec) self.contents.font.color = normal_color self.contents.draw_text(69, -8, 200, 40, tempo) end
def update super if Graphics.frame_count / Graphics.frame_rate != @total_sec refresh end end end
class Window_Lu < Window_Base
def initialize super(544, 360, 196, WLH + 32) refresh end
def refresh self.contents.clear self.contents.font.color = normal_color self.contents.draw_text(55, -8, 210, 40, "Itens") end
end .: Créditos e Agradecimentos :.
- Feito por GuiRPG
- Disponibilizado por DarkLuar
| |
|