Jump to content
Rpg²S Forum

Nuovo Bestiario Vx


Lusianl
 Share

Recommended Posts

Bestiario per Vx

 

 

Autore

Dargor

 

 

Istruzioni per l'uso

Creare un call script con scritto:"$scene = Scene_Bestiary.new"

 

 

#		   ---- www.reinorpg.com.br -----
# ** Bestiário** [Versão traduzida para o Português por Genesis/Bahaman
# Para chamar o Bestiário: $scene = Scene_Bestiary.new
#------------------------------------------------------------------------------
# Créditos Originais:
# © Dargor, 2008
#  24/05/08
#  Versão 1.3
#------------------------------------------------------------------------------
#  História das Versões
#   - 1.0 (21/05/08), Primeira Liberação.
#   - 1.1 (21/05/08), Primeiros Bugs corrigidos.
#   - 1.2 (24/05/08), Bestiário reiniciado e Bugs corrigidos.
#   - 1.3 (03/06/08), Tradução para o Português feita por Bahaman.
#   - 1.4 (04/06/08), Tradução para o Português Completa !
#------------------------------------------------------------------------------
#  Instruções
#   1) Cole o Script acima do Main
#   2) Edit as Variáveis de Vocabulário.
#   2) Edite as Constantes no Modulo do Bestiário
#==============================================================================

#==============================================================================
#  ** Configuração do Bestiário.
#==============================================================================

module Bestiary
 # Inimigos que não aparecerão no Bestiário
 Excluded_Enemies = [31]
 # Atributos "Reais" Mostrados no Bestiário
 Elements = [9,10,11,12,13,14,15,16]
 # Ícone dos Elementos Reais 
 Element_Icons = { 9  => 104,
				10 => 105,
				11 => 106,
				12 => 107,
				13 => 108,
				14 => 109,
				15 => 110,
				16 => 111,
			  }
 # Tocar uma Música no Bestiário
 Play_BGM = true
 # Lista de Músicas Baseadas no Id de cada inimigo.
 BGM = { 19 => 'Battle7',
	  20 => 'Battle7',
	  21 => 'Battle7',
	  22 => 'Battle7',
	  23 => 'Battle7',
	  24 => 'Battle7',
	  25 => 'Battle8',
	  26 => 'Battle8',
	  27 => 'Battle8',
	  28 => 'Battle8',
	  29 => 'Battle8',
	  30 => 'Battle8'
	}
 # Música Padrão
 BGM.default = 'Battle1'
end

# Vocabulário
Vocab::Hit = 'Hit'
Vocab::Eva = 'Evasão'
Vocab::Exp = 'EXP'
Vocab::UnknownEnemy = '??????'
Vocab::UnknownDrop  = '??????'

#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
#  Essa classe cuida do Sistema relacionado a Data. Também de veículos, Músicas e etc.
# A Instância dessa classe se chama:  $game_system.
#==============================================================================

class Game_System
 #--------------------------------------------------------------------------
 # * Variáveis de instância Pública
 #--------------------------------------------------------------------------
 attr_accessor :new_enemy
 attr_accessor :enemy_encountered
 attr_accessor :enemy_defeated
 attr_accessor :enemy_drops
 #--------------------------------------------------------------------------
 # * Lista de Alias
 #--------------------------------------------------------------------------
 alias dargor_vx_bestiary_system_initialize initialize
 #--------------------------------------------------------------------------
 # * Inicialização de objetos
 #--------------------------------------------------------------------------
 def initialize
@new_enemy = []
@enemy_encountered = []
@enemy_defeated = []
@enemy_drops = []
for i in 1...$data_enemies.size
  @new_enemy[i] = true
  @enemy_encountered[i] = 0
  @enemy_defeated[i] = 0
  @enemy_drops[i] = [false, false]
end
dargor_vx_bestiary_system_initialize
 end
end

#==============================================================================
# ** Game_Troop
#------------------------------------------------------------------------------
#  Essa classe é compreendida pelo Grupo de monstros e também a Data relacionada a Batalha
# E Também Administra os Eventos da Batalha. A Instância dessa classe é referenciada por: $game_troop.
#==============================================================================

class Game_Troop < Game_Unit
 #--------------------------------------------------------------------------
 # * Lista de Alias
 #--------------------------------------------------------------------------
 alias dargor_vx_bestiary_troop_setup setup
 alias dargor_vx_bestiary_troop_make_drop_items make_drop_items
 #--------------------------------------------------------------------------
 # * Menu
 #	 Id do Grupo : troop ID
 #--------------------------------------------------------------------------
 def setup(troop_id)
dargor_vx_bestiary_troop_setup(troop_id)
for member in troop.members
  next if $data_enemies[member.enemy_id] == nil
  enemy = Game_Enemy.new(@enemies.size, member.enemy_id)
  $game_system.enemy_encountered[member.enemy_id] += 1
end
 end
 #--------------------------------------------------------------------------
 # * Criar a Array dos Itens Deixados pelo inimigo.
 #--------------------------------------------------------------------------
 def make_drop_items
drop_items = []
for enemy in dead_members
  for di in [enemy.drop_item1, enemy.drop_item2]
	next if di.kind == 0
	next if rand(di.denominator) != 0
	index = [enemy.drop_item1, enemy.drop_item2].index(di)
	$game_system.enemy_drops[enemy.enemy_id][index] = true
	if di.kind == 1
	  drop_items.push($data_items[di.item_id])
	elsif di.kind == 2
	  drop_items.push($data_weapons[di.weapon_id])
	elsif di.kind == 3
	  drop_items.push($data_armors[di.armor_id])
	end
  end
end
return drop_items
 end
end

#==============================================================================
# ** Game_Enemy
#------------------------------------------------------------------------------
#  Essa Classe cuida dos Personagens inimigos. É usada pela Classe de Grupo de Inimigos
# ($game_troop).
#==============================================================================

class Game_Enemy < Game_Battler
 #--------------------------------------------------------------------------
 # * Lista de Alias
 #--------------------------------------------------------------------------
 alias dargor_vx_bestiary_enemy_perform_collapse perform_collapse
 #--------------------------------------------------------------------------
 # * Colapsos
 #--------------------------------------------------------------------------
 def perform_collapse
dargor_vx_bestiary_enemy_perform_collapse
if $game_temp.in_battle and dead?
  $game_system.enemy_defeated[@enemy_id] += 1 
end
 end
end

#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
#  Essa é Superclasse de todas as janelas do jogo.
#==============================================================================

class Window_Base < Window
 #--------------------------------------------------------------------------
 # * Configurar a Cor do Texto do HP
 #	 Inimigo: enemy
 #--------------------------------------------------------------------------
 def hp_color(actor)
return normal_color if actor.is_a?(RPG::Enemy)
return knockout_color if actor.hp == 0
return crisis_color if actor.hp < actor.maxhp / 4
return normal_color
 end
 #--------------------------------------------------------------------------
 # * Ler o Máximo de HP do inimigo: MAXHP
 #	 Inimigo : enemy
 #	 X   : Referente a Coordenada X
 #	 Y	 : Referente a Cordenada Y
 #	 Largura : Width
 #--------------------------------------------------------------------------
 def draw_enemy_maxhp(enemy, x, y, width = 120)
draw_enemy_hp_gauge(enemy, x, y, width)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 30, WLH, Vocab::hp)
self.contents.font.color = hp_color(enemy)
last_font_size = self.contents.font.size
xr = x + width
self.contents.font.color = normal_color
self.contents.draw_text(xr - 80, y, 80, WLH, enemy.maxhp, 2)
 end
 #--------------------------------------------------------------------------
 # * Ler a barra de HP do inimigo: HP gauge
 #	 Inimigo : enemy
 #	 X   : Referente a Coordenada X
 #	 Y	 : Referente a Cordenada Y
 #	 Largura : Width
 #--------------------------------------------------------------------------
 def draw_enemy_hp_gauge(enemy, x, y, width = 120)
gw = width
gc1 = hp_gauge_color1
gc2 = hp_gauge_color2
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
 #--------------------------------------------------------------------------
 # * Ler o MP do inimigo
 #	 Inimigo : enemy
 #	 X   : Referente a Coordenada X
 #	 Y	 : Referente a Cordenada Y
 #	 Largura : Width
 #--------------------------------------------------------------------------
 def draw_enemy_maxmp(enemy, x, y, width = 120)
draw_enemy_mp_gauge(enemy, x, y, width)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 30, WLH, Vocab::mp)
self.contents.font.color = hp_color(enemy)
last_font_size = self.contents.font.size
xr = x + width
self.contents.font.color = normal_color
self.contents.draw_text(xr - 80, y, 80, WLH, enemy.maxmp, 2)
 end
 #--------------------------------------------------------------------------
 # * Ler a Barra de HP do inimigo.
 #	 Inimigo : enemy
 #	 X   : Referente a Coordenada X
 #	 Y	 : Referente a Cordenada Y
 #	 Largura : Width
 #--------------------------------------------------------------------------
 def draw_enemy_mp_gauge(enemy, x, y, width = 120)
gw = width
gc1 = mp_gauge_color1
gc2 = mp_gauge_color2
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
 #--------------------------------------------------------------------------
 # * Ler os Parâmetros inimigos
 #	 Inimigo : enemy
 #	 X   : Referente a Coordenada X
 #	 Y	 : Referente a Cordenada Y
 #	 type  : Type of parameters (0-7)
 #--------------------------------------------------------------------------
 def draw_enemy_parameter(enemy, x, y, type)
case type
when 0
  parameter_name = Vocab::atk
  parameter_value = enemy.atk
when 1
  parameter_name = Vocab::def
  parameter_value = enemy.def
when 2
  parameter_name = Vocab::spi
  parameter_value = enemy.spi
when 3
  parameter_name = Vocab::agi
  parameter_value = enemy.agi
when 4
  parameter_name = Vocab::Hit
  parameter_value = enemy.hit
when 5
  parameter_name = Vocab::Eva
  parameter_value = enemy.eva
when 6
  parameter_name = Vocab::Exp
  parameter_value = enemy.exp
when 7
  parameter_name = Vocab::gold
  parameter_value = enemy.gold
end
self.contents.font.color = system_color
self.contents.draw_text(x, y, 120, WLH, parameter_name)
self.contents.font.color = normal_color
parameter_value = "#{parameter_value}%" if [4,5].include?(type)
self.contents.draw_text(x + 100, y, 56, WLH, parameter_value, 2)
 end
 #--------------------------------------------------------------------------
 # * Ler os Itens deixados pelo inimigo.
 #	 Inimigo : enemy
 #	 X   : Referente a Coordenada X
 #	 Y	 : Referente a Cordenada Y
 #--------------------------------------------------------------------------
 def draw_enemy_drop(enemy,x,y)
self.contents.font.color = system_color
self.contents.draw_text(x,y,220,WLH,'Itens Deixados:')
drops = []
drops_index = []
drops << enemy.drop_item1 unless enemy.drop_item1.kind == 0
drops << enemy.drop_item2 unless enemy.drop_item2.kind == 0
drops_index << 0 unless enemy.drop_item1.kind == 0
drops_index << 1 unless enemy.drop_item2.kind == 0
for i in 0...drops.size
  drop = drops[i]
  index = drops_index[i]
  case drop.kind
  when 1
	item = $data_items[drop.item_id]
  when 2
	item = $data_weapons[drop.weapon_id]
  when 3
	item = $data_armors[drop.armor_id]
  end
  if $game_system.enemy_drops[enemy.id][index]
	draw_item_name(item,x,y + (i+1) * WLH)
	probability = 100 / drop.denominator
	self.contents.draw_text(x,y + (i+1) * WLH,220,WLH, "#{probability}%",2)
  else
	self.contents.font.color = normal_color
	self.contents.draw_text(x+26,y + (i+1) * WLH,220,WLH,Vocab::UnknownDrop)
  end
end
 end
 #--------------------------------------------------------------------------
 # * Ler oo número de vezes que o inimigo foi encontrado.
 #	 Inimigo : enemy
 #	 X   : Referente a Coordenada X
 #	 Y	 : Referente a Cordenada Y
 #--------------------------------------------------------------------------
 def draw_enemy_encountered(enemy,x,y)
self.contents.font.color = system_color
self.contents.draw_text(x,y,120,WLH,'Encontrados:')
times = $game_system.enemy_encountered[enemy.id]
self.contents.font.color = normal_color
self.contents.draw_text(x + 120,y,36,WLH,times,2)
 end
 #--------------------------------------------------------------------------
 # * Ler o Número de Vezes que o inimigo foi derrotado.
 #	 Inimigo : enemy
 #	 X   : Referente a Coordenada X
 #	 Y	 : Referente a Cordenada Y
 #--------------------------------------------------------------------------
 def draw_enemy_defeated(enemy,x,y)
self.contents.font.color = system_color
self.contents.draw_text(x,y,120,WLH,'Derrotado:')
times = $game_system.enemy_defeated[enemy.id]
self.contents.font.color = normal_color
self.contents.draw_text(x + 120,y,36,WLH,times,2)
 end
 #--------------------------------------------------------------------------
 # * Lê as Fraquezas do Inimigo.
 #	 Inimigo : enemy
 #	 X   : Referente a Coordenada X
 #	 Y	 : Referente a Cordenada Y
 #--------------------------------------------------------------------------
 def draw_enemy_weakness(enemy,x,y)
enemy = Game_Enemy.new(0, enemy.id)
self.contents.font.color = system_color
self.contents.draw_text(x,y,120,WLH,'Fraquezas')
weakness = []
for element_id in Bestiary::Elements
  weakness << element_id if enemy.element_rate(element_id) > 100
end
for i in 0...weakness.size
  element_id = weakness[i]
  x = 144 * (i % 2)
  y2 = WLH * (i / 2)
  icon_index = Bestiary::Element_Icons[element_id]
  draw_icon(icon_index,x,y2 + (y + WLH))
  element = $data_system.elements[element_id]
  self.contents.font.color = normal_color
  self.contents.draw_text(x+26,y2 + (y + WLH),120,WLH,element)
end
 end
end

#==============================================================================
# ** Window_EnemyStatus
#------------------------------------------------------------------------------
#  Essa Janela mostra todos os parâmetros de Status do Inimigo.
#==============================================================================

class Window_EnemyStatus < Window_Base
 #--------------------------------------------------------------------------
 # * Inicialização de Objeto.
 #--------------------------------------------------------------------------
 def initialize
super(0,0,544,416)
 end
 #--------------------------------------------------------------------------
 # * Menu
 #	 Inimigo : enemy
 #	 Id   : id
 #--------------------------------------------------------------------------
 def setup(enemy, id)
@enemy = enemy
@id = id
$game_system.new_enemy[enemy.id] = false
refresh
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
self.contents.clear
bitmap = Cache.battler(@enemy.battler_name, @enemy.battler_hue)
self.contents.blt(0,32,bitmap,bitmap.rect)
self.contents.font.color = normal_color
self.contents.draw_text(0,0,272,WLH,"#{@id}: #{@enemy.name}")
draw_enemy_maxhp(@enemy,272,WLH * 1,156)
draw_enemy_maxmp(@enemy,272,WLH * 2,156)
for i in 0..7
  draw_enemy_parameter(@enemy, 304, WLH * 3 + (WLH * i), i)
end
draw_enemy_drop(@enemy,272,WLH * 11)
draw_enemy_encountered(@enemy,272,WLH * 14)
draw_enemy_defeated(@enemy,272,WLH * 15)
draw_enemy_weakness(@enemy,0,WLH * 11)
 end
end

#==============================================================================
# ** Window_EnemyList
#------------------------------------------------------------------------------
# Essa Janela mostra todos os parâmetros da Janela de bestiário
#==============================================================================

class Window_EnemyList < Window_Selectable
 #--------------------------------------------------------------------------
 # * Inicialização do Objeto.
 #	 X   : Referente a Coordenada X
 #	 Y	 : Referente a Cordenada Y
 #--------------------------------------------------------------------------
 def initialize(x,y)
super(x,y,544,360)
self.index = 0
@column_max = 2
refresh
 end
 #--------------------------------------------------------------------------
 # * Inimigo
 #--------------------------------------------------------------------------
 def enemy
return @data[self.index]
 end
 #--------------------------------------------------------------------------
 # * Inimigos
 #--------------------------------------------------------------------------
 def enemies
return @data
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
self.contents.clear
@data = []
for item in $data_enemies
  next if Bestiary::Excluded_Enemies.include?(item.id)
  @data << item
end
@data.compact!
@item_max = @data.size
create_contents
for i in 0...@item_max
  draw_item(i)
end
 end
 #--------------------------------------------------------------------------
 # * Ler o Item
 #	 index : index
 #--------------------------------------------------------------------------
 def draw_item(index)
rect = item_rect(index)
self.contents.clear_rect(rect)
item = @data[index]
if item != nil
  rect.width -= 4
  if $game_system.enemy_encountered[item.id] > 0
	if $game_system.new_enemy[item.id]
	  self.contents.font.color = power_up_color
	else
	  self.contents.font.color = normal_color
	end
	self.contents.draw_text(rect, "#{index+1}:#{item.name}")
  else
	self.contents.font.color = normal_color
	self.contents.draw_text(rect, "#{index+1}:#{Vocab::UnknownEnemy}")
  end
end
 end
end
#==============================================================================
# ** Scene_Bestiary
#------------------------------------------------------------------------------
#  Essa Classe lê os processos da Janela de Bestiário
#==============================================================================

class Scene_Bestiary < Scene_Base
 #--------------------------------------------------------------------------
 # * Inicio do Processo
 #--------------------------------------------------------------------------
 def start
super
create_menu_background
@last_bgm = RPG::BGM.last
@help_window = Window_Help.new
@list_window = Window_EnemyList.new(0,56)
@status_window = Window_EnemyStatus.new
@status_window.visible = false
@status_window.back_opacity = 255
encountered = 0
for enemy in @list_window.enemies
  if $game_system.enemy_encountered[enemy.id] > 0
	encountered += 1
  end
end
completion1 = "#{encountered}/#{@list_window.enemies.size}"
completion2 = (encountered * 100) / @list_window.enemies.size
@help_window.set_text("Completado: #{completion1}(#{completion2}%)")
 end
 #--------------------------------------------------------------------------
 # * Término do Processo
 #--------------------------------------------------------------------------
 def terminate
super
dispose_menu_background
@help_window.dispose
@list_window.dispose
@status_window.dispose
 end
 #--------------------------------------------------------------------------
 # *atualização do Tempo do Processo
 #--------------------------------------------------------------------------
 def update
super
if @status_window.visible
  update_status_selection
  return
end
if @list_window.active
  @list_window.update
  update_list_selection
  return
end
 end
 #--------------------------------------------------------------------------
 # * Atalização do Processo de Status
 #--------------------------------------------------------------------------
 def update_status_selection
if Input.trigger?(Input::B)
  Sound.play_cancel
  @status_window.visible = false
  @last_bgm.play
  return
end
if Input.trigger?(Input::L) or Input.repeat?(Input::L)
  Sound.play_cursor
  loop do
	@list_window.index = (@list_window.index + 1) 
	@list_window.index %= @list_window.enemies.size
	break if $game_system.enemy_encountered[@list_window.index+1] > 0
  end
  process_status_window(@list_window.enemy, @list_window.index+1)
end
if Input.trigger?(Input::R) or Input.repeat?(Input::R)
  Sound.play_cursor
  loop do
	@list_window.index = (@list_window.index - 1) % @list_window.enemies.size
	break if $game_system.enemy_encountered[@list_window.index+1] > 0
  end
  process_status_window(@list_window.enemy, @list_window.index+1)
end
 end
 #--------------------------------------------------------------------------
 # * Atualização da Lista de Processo
 #--------------------------------------------------------------------------
 def update_list_selection
if Input.trigger?(Input::B)
  Sound.play_cancel
  $scene = Scene_Map.new
  return
end
if Input.trigger?(Input::C)
  unless $game_system.enemy_encountered[@list_window.enemy.id] > 0
	Sound.play_buzzer
	return
  end
  process_status_window(@list_window.enemy, @list_window.index+1)
end
 end
 #--------------------------------------------------------------------------
 # *Processar a Janela.
 #--------------------------------------------------------------------------
 def process_status_window(enemy, index)
if Bestiary::Play_BGM
  bgm_name = Bestiary::BGM[enemy.id]
  if bgm_name.nil?
	bgm = RPG::BGM.new(Bestiary::BGM.default)
	bgm.play
  else
	bgm = RPG::BGM.new(bgm_name)
	bgm.play
  end
end
@status_window.setup(enemy, index)
@status_window.visible = true
@list_window.draw_item(index-1)
 end
end

 

 

Screen:

http://img135.imageshack.us/img135/4213/immnh5.jpg

 

Bug

N/a

 

Demo:

http://www.mediafire.com/?fwhceuttpx2

http://www.freankexpo.net/signature/1129.png

2986.png

BIM_Banner3.png

Premi RpgMaker

 


http://www.rpg2s.net/forum/uploads/monthly_01_2017/msg-293-0-48316500-1483794996.jpghttp://www.rpg2s.net/dax_games/r2s_regali2.pngContesthttp://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gif http://rpg2s.net/gif/SCContest1Oct.gif http://rpg2s.net/gif/SCContest2Oct.gif http://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest1Oct.gifhttp://www.rpg2s.net/awards/bestpixel2.jpghttp://www.rpg2s.net/awards/bestresourCSist2.jpghttp://www.rpg2s.net/awards/mostproductive1.jpghttp://i42.servimg.com/u/f42/13/12/87/37/iconap13.pnghttp://i42.servimg.com/u/f42/13/12/87/37/iconap14.pnghttp://i42.servimg.com/u/f42/13/12/87/37/iconap15.pnghttp://i42.servimg.com/u/f42/13/12/87/37/iconap16.pnghttp://i42.servimg.com/u/f42/13/12/87/37/screen10.pnghttp://www.rpgmkr.net/contest/screen-contest-primo.pnghttp://www.makerando.com/forum/uploads/jawards/iconawards3.png

Link to comment
Share on other sites

  • 9 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...