Scene Zoolab
Descrizione
Eccomi tornato dopo tanto tempo! XD.
Questo script emula lo Zoolab di FF X, per chi non sapesse cosè è una specie di zoo appunto XD, dove si
tengono i mostri sconfitti e catturati. È possibile ribattere i mostri catturati pagando ed è possibile sbloccare campioni di zona e di specie (configurabili).I campioni di zona si sbloccano avendo tutti i mostri di una zona, invece quello di specie avendo un determinato numero per specie, ad esempio 3 budini gialli, 3 budini rossi => campione di specie Budino Nero.
Autore
Avon Valentino (Io)
Allegati
Screenshots:
Demo Link: (Versione Migliorata)
http://www.mediafire...xeva66oulfmlv3l
Script:
PARTE 1:
#Script creato da Valentino Avon se lo usate creditatemi ;) ########################## Scene Zoolab ############################ #-------------------------CONFIGURAZIONE----------------------- SFONDO_ZOOLAB = "Sfondo" #immagine da inserire in Graphics/Titles WEAPON_CATT = [1,5,25,29]#ID armi che catturano i mostri NUMERO_MAX_MOSTRI = 10 #numero massimo di mostri per specie MOSTRI_NO_CATTURA = [7]#ID mostri che non possono essere catturati (i boss ad esempio) #ENEMY_ID => TROOP_ID BATTAGLIE = { 1=>1, 2=>3, 3=>5, 5=>9, 6=>11, 8=>15, 14=>27, 22=>34, 30=>33 } DEFAULT_PREZZO = 100 #prezzo per i mostri non assegnati #ENEMY_ID => PREZZO PREZZO = { 1=> 5, 2=> 7, } #ID => [NOME ZONA, MOSTRI] #LA PRIMA ZONA HA ID = 0 DETT = { 0=> ["Piana Verdeggiante",1,2], 1=> ["Montagna Sacra",6,14,22], 2=> ["Campioni Di Zona",5], 3=> ["Campioni Di Specie",30,26] } #NOME_SPECIE => [[ENEMY_ID], NUMERO_MOSTRI,CAMPIONE_DI_SPECIE] SPECIE = { "Uccello" => [[6,14,22],3,30], "Bestia" => [[2,10,18],3,26] } ZONA_CAMPIONI_ZONA = 2 #id zona dei campioni di zona nella lista ZONA_CAMPIONI_SPECIE = 3 #id zona dei campioni di specie nella lista #ID ZONA => ENEMY_ID CAMPIONI_DI_ZONA = { 0 => 5, 1 => 7, } #----------------------FINE CONFIGURAZIONE---------------------- class Game_System attr_accessor :zone_attive attr_accessor :nemici_sbl attr_accessor :numeri alias vale_initialize initialize def initialize vale_initialize @zone_attive = [] @nemici_sbl = [] @numeri = {} end end class Game_Zona attr_accessor :id attr_accessor :nome attr_accessor :attiva attr_accessor :mostri def initialize(id) @id = id @nome = DETT[@id][0] @attiva = true if $game_system.zone_attive.include?(@id) @mostri = [] for i in 1..DETT[@id].size-1 @mostri.push(DETT[@id][i]) end end end class Game_Zone attr_accessor :data def initialize @data = [] for i in DETT.keys @data[i] = (Game_Zona.new(i)) end end end class Game_Player def add_zone(zone_id) $game_system.zone_attive.push(zone_id) end end class Window_Zone < Window_Selectable def initialize super(0, 64, 640, 352+64) @column_max = 2 self.back_opacity = 160 @zone = Game_Zone.new refresh self.index = 0 end def zona return @zone.data[self.index] end def refresh if self.contents != nil self.contents.dispose self.contents = nil end @data = [] for i in [email protected] if i != nil @data.push(i) end end @item_max = @data.size if @item_max > 0 self.contents = Bitmap.new(width - 32, row_max * 32) for i in 0..@item_max-1 draw_item(i) end end end def draw_item(index) zona = @zone.data[index] x = 4+index % 2 * (288 + 32) y = index / 2 * 32 if zona != nil and zona.attiva self.contents.draw_text(x, y, 204, 32, zona.nome, 0) else self.contents.draw_text(x, y, 204, 32, "???", 0) end end end class Window_Mostri < Window_Selectable def initialize(zona) super(0, 128, 640, 352+64) @column_max = 2 self.back_opacity = 160 @zona = zona refresh self.index = 0 end def mostro return @zona.mostri[self.index] end def refresh if self.contents != nil self.contents.dispose self.contents = nil end @data = [] for i in @zona.mostri if i != nil @data.push(i) end end @item_max = @data.size if @item_max > 0 self.contents = Bitmap.new(width - 32, row_max * 32) for i in 0..@item_max-1 draw_item(i) end end end def draw_item(index) enemy = $data_enemies[@zona.mostri[index]] x = 4+index % 2 * (288 + 32) y = index / 2 * 32 if $game_system.nemici_sbl.include?(enemy.id) self.contents.draw_text(x, y, 204, 32, enemy.name, 0) unless @zona.id == ZONA_CAMPIONI_ZONA self.contents.draw_text(x+260, y, 204, 32, $game_system.numeri[enemy.id].to_s, 0) end else self.contents.draw_text(x, y, 204, 32, "???", 0) end end end class Window_Testo < Window_Base def initialize(prezzo, tipo=0) super(160, 80, 320, 64) @prezzo = prezzo @tipo = tipo self.contents = Bitmap.new(width - 32, height - 32) self.z = 500 self.back_opacity = 120 refresh(tipo) end def refresh(tipo) self.contents.clear if tipo == 0 cx = contents.text_size("Il costo è di "[email protected]_s+" "+$data_system.words.gold).width self.contents.draw_text(self.width/2-cx/2-16,0,320,32,"Il costo è di "[email protected]_s+" "+$data_system.words.gold+".") elsif tipo == 1 cx = contents.text_size("Non hai abbastanza soldi!").width self.contents.draw_text(self.width/2-cx/2-16,0,320,32,"Non hai abbastanza soldi!") end end end
PARTE 2:
class Scene_Zoolab def main $game_temp.in_zoolab = true @fase = 0 @command_window = Window_Zone.new @scelta = Window_Command.new(160,["Sì","No"]) @scelta.visible = false @scelta.x = 240 @scelta.y = [email protected] @scelta.z = 500 @scelta.back_opacity = 120 @help_window = Window_Help.new @help_window.set_text("Scegli il settore.",1) @help_window.back_opacity = 160 @sfondo = Sprite.new @sfondo.bitmap = RPG::Cache.title(SFONDO_ZOOLAB) Graphics.transition loop do Graphics.update Input.update case @fase when 0 update when 1 update_scelta when 2 update_mess end if $scene != self break end end Graphics.freeze @command_window.dispose @scelta.dispose @help_window.dispose @mostri.dispose if @mostri != nil @testo.dispose if @testo != nil @sfondo.dispose end def update @command_window.update @mostri.update if @mostri != nil if @command_window.active update_command return end if @mostri != nil and @mostri.active update_selezione return end end def update_mess if Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) @scelta.visible = false @testo.visible = false @scelta.index = 0 @fase = 0 return end end def update_scelta @scelta.update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @scelta.visible = false @testo.visible = false @scelta.index = 0 @fase = 0 end if Input.trigger?(Input::C) if @scelta.index == 0 enemy = $data_enemies[@mostri.mostro] $game_temp.battle_troop_id = BATTAGLIE[enemy.id] prezzo = PREZZO[enemy.id] prezzo = DEFAULT_PREZZO if prezzo == nil if $game_party.gold >= prezzo $game_party.lose_gold(prezzo) call_battle else $game_system.se_play($data_system.buzzer_se) @scelta.visible = false @testo.dispose @testo = Window_Testo.new(prezzo,1) @fase = 2 end else $game_system.se_play($data_system.decision_se) @scelta.visible = false @testo.visible = false @scelta.index = 0 @fase = 0 end end end def update_command if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $game_temp.in_zoolab = false $scene = Scene_Map.new return end if Input.trigger?(Input::C) if @command_window.zona.attiva $game_system.se_play($data_system.decision_se) @mostri = Window_Mostri.new(@command_window.zona) @mostri.x = 0 @mostri.y = 64 @help_window.set_text("Scegli il mostro.",1) @command_window.active = false @command_window.visible = false else $game_system.se_play($data_system.buzzer_se) end end end def update_selezione if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @command_window.active = true @command_window.visible = true @mostri.visible = false @help_window.set_text("Scegli il settore.",1) return end if Input.trigger?(Input::C) enemy = $data_enemies[@mostri.mostro] prezzo = PREZZO[enemy.id] prezzo = DEFAULT_PREZZO if prezzo == nil unless $game_system.nemici_sbl.include?(enemy.id) $game_system.se_play($data_system.buzzer_se) else $game_system.se_play($data_system.decision_se) @fase = 1 @scelta.visible = true @testo = Window_Testo.new(prezzo) end end return end def call_battle $game_temp.battle_calling = true $game_temp.battle_can_escape = true $game_temp.battle_can_lose = false $game_temp.battle_proc = nil $game_temp.battle_calling = false $game_temp.menu_calling = false $game_temp.menu_beep = false $game_player.make_encounter_count $game_temp.map_bgm = $game_system.playing_bgm $game_system.bgm_stop $game_system.se_play($data_system.battle_start_se) $game_system.bgm_play($game_system.battle_bgm) $game_player.straighten $scene = Scene_Battle.new end end
PARTE 3:
class Game_Battler alias cat_att attack_effect def attack_effect(attacker) cat_att(attacker) if self.is_a?(Game_Enemy) and WEAPON_CATT.include?(attacker.weapon_id) and self.dead? unless $game_temp.in_zoolab unless MOSTRI_NO_CATTURA.include?(@enemy_id) g = $game_system.numeri[@enemy_id] if g != nil and $game_system.numeri[@enemy_id] < NUMERO_MAX_MOSTRI $game_system.numeri[@enemy_id] += 1 end $game_system.numeri[@enemy_id] = 1 if g == nil self.damage = "Catturato!" add_zone verifica_campione_zona verifica_campione_specie end end end end def verifica_campione_zona for zona in Game_Zone.new.data if zona != nil @conto = 0 for i in zona.mostri @conto += 1 if $game_system.nemici_sbl.include?($data_enemies[i].id) end if @conto == zona.mostri.size if CAMPIONI_DI_ZONA[zona.id] != nil $game_system.nemici_sbl.push(CAMPIONI_DI_ZONA[zona.id]) unless $game_system.nemici_sbl.include?(CAMPIONI_DI_ZONA[zona.id]) end $game_player.add_zone(ZONA_CAMPIONI_ZONA) unless $game_system.zone_attive.include?(ZONA_CAMPIONI_ZONA) end end end end def verifica_campione_specie for i in SPECIE.values @conto = 0 for enemy in i[0] @conto += 1 if $game_system.numeri[enemy] != nil and $game_system.numeri[enemy] >= i[1] end if @conto == i[0].size $game_system.nemici_sbl.push(i[2]) unless $game_system.nemici_sbl.include?(i[2]) $game_player.add_zone(ZONA_CAMPIONI_SPECIE) unless $game_system.zone_attive.include?(ZONA_CAMPIONI_SPECIE) end end end def add_zone $game_system.nemici_sbl.push(@enemy_id) for zona in Game_Zone.new.data if zona != nil if zona.mostri.include?(@enemy_id) $game_system.zone_attive.push(zona.id) unless $game_system.zone_attive.include?(zona.id) end end end end end class Game_Temp attr_accessor :in_zoolab alias vale_in initialize def initialize vale_in @in_zoolab = false end end class Scene_Battle alias vale_end battle_end def battle_end(result) vale_end(result) $game_temp.in_zoolab = false end end module RPG class Sprite < ::Sprite def damage(value, critical, preso=false) dispose_damage if value.is_a?(Numeric) damage_string = value.abs.to_s else damage_string = value.to_s end bitmap = Bitmap.new(160, 64) bitmap.font.name = "Arial Black" bitmap.font.size = 32 bitmap.font.color.set(0, 0, 0) bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1) bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1) bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1) bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1) if value.is_a?(Numeric) and value < 0 bitmap.font.color.set(176, 255, 144) else bitmap.font.color.set(255, 255, 255) end bitmap.draw_text(0, 12, 160, 36, damage_string, 1) if critical bitmap.font.size = 20 bitmap.font.color.set(0, 0, 0) bitmap.draw_text(-1, -1, 160, 20, "CRITICAL", 1) bitmap.draw_text(+1, -1, 160, 20, "CRITICAL", 1) bitmap.draw_text(-1, +1, 160, 20, "CRITICAL", 1) bitmap.draw_text(+1, +1, 160, 20, "CRITICAL", 1) bitmap.font.color.set(255, 255, 255) bitmap.draw_text(0, 0, 160, 20, "CRITICAL", 1) end if preso bitmap.font.size = 20 bitmap.font.color.set(0, 0, 0) bitmap.draw_text(-1, 39, 160, 20, "PRESO!", 1) bitmap.draw_text(+1, 39, 160, 20, "PRESO!", 1) bitmap.draw_text(-1, +41, 160, 20, "PRESO!", 1) bitmap.draw_text(+1, +41, 160, 20, "PRESO!", 1) bitmap.font.color.set(255, 255, 255) bitmap.draw_text(0, 40, 160, 20, "PRESO!", 1) end @_damage_sprite = ::Sprite.new(self.viewport) @_damage_sprite.bitmap = bitmap @_damage_sprite.ox = 80 @_damage_sprite.oy = 20 @_damage_sprite.x = self.x @_damage_sprite.y = self.y - self.oy / 2 @_damage_sprite.z = 3000 @_damage_duration = 40 end end end class Sprite_Battler < RPG::Sprite #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- alias damage_update update def update if @battler.damage_pop @preso = false @preso = true if @battler.is_a?(Game_Enemy) and @battler.preso damage(@battler.damage, @battler.critical, @preso) @battler.preso = false if @battler.is_a?(Game_Enemy) @battler.damage = nil @battler.critical = false @battler.damage_pop = false end damage_update end end
Istruzioni per l'uso
Trovate tutto all'interno dello script, se lo usate creditatemi
Spero vi piaccia! :D
Bugs e Conflitti Noti
N/A
Modificato da Dilos, 27 April 2013 - 14:16 PM.
Script monoriga sistemato.