Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
Sign in to follow this  
skullmaster

bastiary

Recommended Posts

You'd need a Switch and a Common Event. I'll just make a demo on calling the bestiary with a hotkey to make it easier.

-Download Link Removed-

You can press the A button to call it.

Share this post


Link to post
Share on other sites

Try putting the script below all other scripts and above Main.

 

If that don't work make a list so i can identify what script is causing problems.

Share this post


Link to post
Share on other sites

The best beastry script is here, period. Momo's beastry allows the use of descriptions to your monsters, to give them more character and feel.

Place them in the order shown, The main script at the top, comments in the middle, and the descriptor thingy at the below.

 

To call this script make a common event and use this script:

$scene = Scene_MonsterBook.new

 

Main Beastry Script

 

#魔物図鑑
#
#エネミーの遭遇情報は、戦闘終了時(経験値などを獲得する所)で追加されます。
#よって、敵から逃げた場合や負けイベントでの戦闘敗北などでは
#図鑑に登録されません。
#このタイミングを変えたい場合は各自書き換えて下さい。
#(class Scene_Battle の start_phase5 で追加してます。)
#
#また、所々「アナライズ」という単語がありますが、
#現在、この魔物辞典だけでは機能しておりません。(自ゲームでの名残)
#Window_MonsterBook_Info の DROP_ITEM_NEED_ANALYZE が true になっていると
#ドロップアイテムが表示されなくなりますので、通常は false にしておいて下さい。
#
#注意
#このまま使うと、データベースのトループの1番に
#何も設定していないと、エラー吐きます。
#対処策としては
#1.素直にデータベースのトループの1番に何でもいいから設定する。
#2.Game_Enemy_Book の 「super(1, 0)#ダミー」 の左側の数字の部分を
#  存在するトループIDに書き換える。
#のどちらかになります。
#
#2005.2.6 機能追加
#図鑑完成度の表示機能を追加
#SHOW_COMPLETE_TYPE で設定できます。
#イベントコマンドの「スクリプト」で
#$game_party.enemy_book_max で図鑑の総魔物数(最大数)
#$game_party.enemy_book_now で図鑑の現在登録数(現在数)
#$game_party.complete_percentage で図鑑の完成率(小数点切捨て)
#を取得できます。
#
#2005.2.17
#complete_percentageのメソッド名を
#enemy_book_complete_percentageに変更(他の図鑑と区別できるように)
#イベントコマンドの「スクリプト」で最大数等の取得を短縮できるようになりました。
#enemy_book_max で図鑑の総魔物数(最大数)
#enemy_book_now で図鑑の現在登録数(現在数)
#enemy_book_compで図鑑の完成率(小数点切捨て)
#
#2005.2.18 バグ修正
#complete_percentageのメソッド名を
#enemy_book_complete_percentageに変更したのに
#complete_percentageって呼び出してました。(単なる書き換え漏れですね)
#
#2005.7.4 機能追加
#コメント機能に対応。
#全体的に色々いじりました。
#
#2005.7.4 バグ修正
#細かいバグを修正。


module Enemy_Book_Config
 #ドロップアイテム表示にアナライズが必要かどうか
 DROP_ITEM_NEED_ANALYZE = false
 #回避修正の名前
 EVA_NAME = "回避"             
 #図鑑完成率の表示方法
 #0:表示なし 1:現在数/最大数 2:%表示 3:両方
 SHOW_COMPLETE_TYPE = 3         
 #コメント機能を使うかどうか(要・コメント追加スクリプト導入)
 COMMENT_SYSTEM = true
end

class Game_Temp
 attr_accessor :enemy_book_data
 alias temp_enemy_book_data_initialize initialize
 def initialize
   temp_enemy_book_data_initialize
   @enemy_book_data = Data_MonsterBook.new
 end
end

class Game_Party
 attr_accessor :enemy_info               # 出会った敵情報(図鑑用)
 #--------------------------------------------------------------------------
 # ● オブジェクト初期化
 #--------------------------------------------------------------------------
 alias book_info_initialize initialize
 def initialize
   book_info_initialize
   @enemy_info = {}
 end
 #--------------------------------------------------------------------------
 # ● エネミー情報の追加(図鑑用)
 #     type : 通常遭遇かアナライズか 0:通常 1:アナライズ -1:情報削除
 #     0:無遭遇 1:遭遇済 2:アナライズ済
 #--------------------------------------------------------------------------
 def add_enemy_info(enemy_id, type = 0)
   case type
   when 0
     if @enemy_info[enemy_id] == 2
       return false
     end
     @enemy_info[enemy_id] = 1
   when 1
     @enemy_info[enemy_id] = 2
   when -1
     @enemy_info[enemy_id] = 0
   end
 end
 #--------------------------------------------------------------------------
 # ● 魔物図鑑の最大登録数を取得
 #--------------------------------------------------------------------------
 def enemy_book_max
   return $game_temp.enemy_book_data.id_data.size - 1
 end
 #--------------------------------------------------------------------------
 # ● 魔物図鑑の現在登録数を取得
 #--------------------------------------------------------------------------
 def enemy_book_now
   now_enemy_info = @enemy_info.keys
   # 登録無視の属性IDを取得
   no_add = $game_temp.enemy_book_data.no_add_element
   new_enemy_info = []
   for i in now_enemy_info
     enemy = $data_enemies[i]
     next if enemy.name == ""
     if enemy.element_ranks[no_add] == 1
       next
     end
     new_enemy_info.push(enemy.id)
   end
   return new_enemy_info.size
 end
 #--------------------------------------------------------------------------
 # ● 魔物図鑑の完成率を取得
end

class Interpreter
 def enemy_book_max
   return $game_party.enemy_book_max
 end
 def enemy_book_now
   return $game_party.enemy_book_now
 end
 def enemy_book_comp
   return $game_party.enemy_book_complete_percentage
 end
end

class Scene_Battle
 alias add_enemy_info_start_phase5 start_phase5
 def start_phase5
   for enemy in $game_troop.enemies
     # エネミーが隠れ状態でない場合
     unless enemy.hidden
       # 敵遭遇情報追加
       $game_party.add_enemy_info(enemy.id, 0)
     end
   end
   add_enemy_info_start_phase5
 end
end

class Window_Base < Window
 #--------------------------------------------------------------------------
 # ● エネミーの戦闘後獲得アイテムの描画
 #--------------------------------------------------------------------------
 def draw_enemy_drop_item(enemy, x, y)
   self.contents.font.color = normal_color
   treasures = []
   if enemy.item_id > 0
     treasures.push($data_items[enemy.item_id])
   end
   if enemy.weapon_id > 0
     treasures.push($data_weapons[enemy.weapon_id])
   end
   if enemy.armor_id > 0
     treasures.push($data_armors[enemy.armor_id])
   end
   # 現状ではとりあえず1つのみ描画
   if treasures.size > 0
     item = treasures[0]
     bitmap = RPG::Cache.icon(item.icon_name)
     opacity = 255
     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
     name = treasures[0].name
   else
     self.contents.font.color = disabled_color
     name = "No Item"
   end
   self.contents.draw_text(x+28, y, 212, 32, name)
 end
 #--------------------------------------------------------------------------
 # ● エネミーの図鑑IDの描画
 #--------------------------------------------------------------------------
 def draw_enemy_book_id(enemy, x, y)
   self.contents.font.color = normal_color
   id = $game_temp.enemy_book_data.id_data.index(enemy.id)
   self.contents.draw_text(x, y, 32, 32, id.to_s)
 end
 #--------------------------------------------------------------------------
 # ● エネミーの名前の描画
 #     enemy : エネミー
 #     x     : 描画先 X 座標
 #     y     : 描画先 Y 座標
 #--------------------------------------------------------------------------
 def draw_enemy_name(enemy, x, y)
   self.contents.font.color = normal_color
   self.contents.draw_text(x, y, 152, 32, enemy.name)
 end
 #--------------------------------------------------------------------------
 # ● エネミーグラフィックの描画(アナライズ)
 #     enemy : エネミー
 #     x     : 描画先 X 座標
 #     y     : 描画先 Y 座標
 #--------------------------------------------------------------------------
 def draw_enemy_graphic(enemy, x, y, opacity = 255)
   bitmap = RPG::Cache.battler(enemy.battler_name, enemy.battler_hue)
   cw = bitmap.width
   ch = bitmap.height
   src_rect = Rect.new(0, 0, cw, ch)
   x = x + (cw / 2 - x) if cw / 2 > x
   self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect, opacity)
 end
 #--------------------------------------------------------------------------
 # ● エネミーの獲得EXPの描画
 #     enemy : エネミー
 #     x     : 描画先 X 座標
 #     y     : 描画先 Y 座標
 #--------------------------------------------------------------------------
 def draw_enemy_exp(enemy, x, y)
   self.contents.font.color = system_color
   self.contents.draw_text(x, y, 120, 32, "EXP")
   self.contents.font.color = normal_color
   self.contents.draw_text(x + 120, y, 36, 32, enemy.exp.to_s, 2)
 end
 #--------------------------------------------------------------------------
 # ● エネミーの獲得GOLDの描画
 #     enemy : エネミー
 #     x     : 描画先 X 座標
 #     y     : 描画先 Y 座標
 #--------------------------------------------------------------------------
 def draw_enemy_gold(enemy, x, y)
   self.contents.font.color = system_color
   self.contents.draw_text(x, y, 120, 32, $data_system.words.gold)
   self.contents.font.color = normal_color
   self.contents.draw_text(x + 120, y, 36, 32, enemy.gold.to_s, 2)
 end
end

class Game_Enemy_Book < Game_Enemy
 #--------------------------------------------------------------------------
 # ● オブジェクト初期化
 #--------------------------------------------------------------------------
 def initialize(enemy_id)
   super(1, 0)#ダミー
   @enemy_id = enemy_id
   enemy = $data_enemies[@enemy_id]
   @battler_name = enemy.battler_name
   @battler_hue = enemy.battler_hue
   @hp = maxhp
   @sp = maxsp
 end
end

class Data_MonsterBook
 attr_reader :id_data
 #--------------------------------------------------------------------------
 # ● オブジェクト初期化
 #--------------------------------------------------------------------------
 def initialize
   @id_data = enemy_book_id_set
 end
 #--------------------------------------------------------------------------
 # ● 図鑑用登録無視属性取得
 #--------------------------------------------------------------------------
 def no_add_element
   no_add = 0
   # 登録無視の属性IDを取得
   for i in 1...$data_system.elements.size
     if $data_system.elements[i] =~ /図鑑登録無効/
       no_add = i
       break
     end
   end
   return no_add
 end
 #--------------------------------------------------------------------------
 # ● 図鑑用敵ID設定
 #--------------------------------------------------------------------------
 def enemy_book_id_set
   data = [0]
   no_add = no_add_element
   # 登録無視の属性IDを取得
   for i in 1...$data_enemies.size
     enemy = $data_enemies[i]
     next if enemy.name == ""
     if enemy.element_ranks[no_add] == 1
       next
     end
     data.push(enemy.id)
   end
   return data
 end
end


class Window_MonsterBook < Window_Selectable
 attr_reader   :data
 #--------------------------------------------------------------------------
 # ● オブジェクト初期化
 #--------------------------------------------------------------------------
 def initialize(index=0)
   super(0, 64, 640, 416)
   @column_max = 2
   @book_data = $game_temp.enemy_book_data
   @data = @book_data.id_data.dup
   @data.shift
   #@data.sort!
   @item_max = @data.size
   self.index = 0
   refresh if @item_max > 0
 end
 #--------------------------------------------------------------------------
 # ● 遭遇データを取得
 #--------------------------------------------------------------------------
 def data_set
   data = $game_party.enemy_info.keys
   data.sort!
   newdata = []
   for i in data
     next if $game_party.enemy_info[i] == 0
     # 図鑑登録無視を考慮
     if book_id(i) != nil
       newdata.push(i)
     end
   end
   return newdata
 end
 #--------------------------------------------------------------------------
 # ● 表示許可取得
 #--------------------------------------------------------------------------
 def show?(id)
   if $game_party.enemy_info[id] == 0 or $game_party.enemy_info[id] == nil
     return false
   else
     return true
   end
 end
 #--------------------------------------------------------------------------
 # ● 図鑑用ID取得
 #--------------------------------------------------------------------------
 def book_id(id)
   return @book_data.index(id)
 end
 #--------------------------------------------------------------------------
 # ● エネミー取得
 #--------------------------------------------------------------------------
 def item
   return @data[self.index]
 end
 #--------------------------------------------------------------------------
 # ● リフレッシュ
 #--------------------------------------------------------------------------
 def refresh
   if self.contents != nil
     self.contents.dispose
     self.contents = nil
   end
   self.contents = Bitmap.new(width - 32, row_max * 32)
   #項目数が 0 でなければビットマップを作成し、全項目を描画
   if @item_max > 0
     for i in 0...@item_max
      draw_item(i)
     end
   end
 end
 #--------------------------------------------------------------------------
 # ● 項目の描画
 #     index : 項目番号
 #--------------------------------------------------------------------------
 def draw_item(index)
   enemy = $data_enemies[@data[index]]
   return if enemy == nil
   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))
   self.contents.font.color = normal_color
   draw_enemy_book_id(enemy, x, y)
   if show?(enemy.id)
     self.contents.draw_text(x + 28+16, y, 212, 32, enemy.name, 0)
   else
     self.contents.draw_text(x + 28+16, y, 212, 32, "-----", 0)
     return
   end
   if analyze?(@data[index])
     self.contents.font.color = text_color(3)
     self.contents.draw_text(x + 256, y, 24, 32, "済", 2)
   end
 end
 #--------------------------------------------------------------------------
 # ● アナライズ済かどうか
 #--------------------------------------------------------------------------
 def analyze?(enemy_id)
   if $game_party.enemy_info[enemy_id] == 2
     return true
   else
     return false
   end
 end
end


class Window_MonsterBook_Info < Window_Base
 #--------------------------------------------------------------------------
 # ● オブジェクト初期化
 #--------------------------------------------------------------------------
 def initialize
   super(0, 0+64, 640, 480-64)
   self.contents = Bitmap.new(width - 32, height - 32)
 end
 #--------------------------------------------------------------------------
 # ● リフレッシュ
 #--------------------------------------------------------------------------
 def refresh(enemy_id)
   self.contents.clear
   self.contents.font.size = 22
   enemy = Game_Enemy_Book.new(enemy_id)
   draw_enemy_graphic(enemy, 96, 240+48+64, 200)
   draw_enemy_book_id(enemy, 4, 0)
   draw_enemy_name(enemy, 48, 0)
   draw_actor_hp(enemy, 288, 0)
   draw_actor_sp(enemy, 288+160, 0)
   draw_actor_parameter(enemy, 288    ,  32, 0)
   self.contents.font.color = system_color
   self.contents.draw_text(288+160, 32, 120, 32, Enemy_Book_Config::EVA_NAME)
   self.contents.font.color = normal_color
   self.contents.draw_text(288+160 + 120, 32, 36, 32, enemy.eva.to_s, 2)
   draw_actor_parameter(enemy, 288    ,  64, 3)
   draw_actor_parameter(enemy, 288+160,  64, 4)
   draw_actor_parameter(enemy, 288    ,  96, 5)
   draw_actor_parameter(enemy, 288+160,  96, 6)
   draw_actor_parameter(enemy, 288    , 128, 1)
   draw_actor_parameter(enemy, 288+160, 128, 2)
   draw_enemy_exp(enemy, 288, 160)
   draw_enemy_gold(enemy, 288+160, 160)
   if analyze?(enemy.id) or !Enemy_Book_Config::DROP_ITEM_NEED_ANALYZE
     self.contents.draw_text(288, 192, 96, 32, "Drop Item")
     draw_enemy_drop_item(enemy, 288+96+4, 192)
     self.contents.font.color = normal_color
     #draw_element_guard(enemy, 320-32, 160-16+96)
   end
 end
 #--------------------------------------------------------------------------
 # ● アナライズ済かどうか
 #--------------------------------------------------------------------------
 def analyze?(enemy_id)
   if $game_party.enemy_info[enemy_id] == 2
     return true
   else
     return false
   end
 end
end


class Scene_MonsterBook
 #--------------------------------------------------------------------------
 # ● メイン処理
 #--------------------------------------------------------------------------
 def main
   $game_temp.enemy_book_data = Data_MonsterBook.new
   # ウィンドウを作成
   @title_window = Window_Base.new(0, 0, 640, 64)
   @title_window.contents = Bitmap.new(640 - 32, 64 - 32)
   @title_window.contents.draw_text(4, 0, 320, 32, "Monster Information", 0)
   @main_window = Window_MonsterBook.new
   @main_window.active = true
   # インフォウィンドウを作成 (不可視・非アクティブに設定)
   @info_window = Window_MonsterBook_Info.new
   @info_window.z = 110
   @info_window.visible = false
   @info_window.active = false
   @visible_index = 0
   if Enemy_Book_Config::COMMENT_SYSTEM
     # コメントウィンドウを作成 (不可視・非アクティブに設定)
     @comment_window = Window_Monster_Book_Comment.new
     @comment_window.z = 120
     @comment_window.visible = false
     @comment_on = false # コメントフラグ
   end
   # トランジション実行
   Graphics.transition
   # メインループ
   loop do
     # ゲーム画面を更新
     Graphics.update
     # 入力情報を更新
     Input.update
     # フレーム更新
     update
     # 画面が切り替わったらループを中断
     if $scene != self
       break
     end
   end
   # トランジション準備
   Graphics.freeze
   # ウィンドウを解放
   @main_window.dispose
   @info_window.dispose
   @title_window.dispose
   @comment_window.dispose if @comment_window != nil
 end
 #--------------------------------------------------------------------------
 # ● フレーム更新
 #--------------------------------------------------------------------------
 def update
   # ウィンドウを更新
   @main_window.update
   @info_window.update
   if @info_window.active
     update_info
     return
   end
   # メインウィンドウがアクティブの場合: update_target を呼ぶ
   if @main_window.active
     update_main
     return
   end
 end
 #--------------------------------------------------------------------------
 # ● フレーム更新 (メインウィンドウがアクティブの場合)
 #--------------------------------------------------------------------------
 def update_main
   # B ボタンが押された場合
   if Input.trigger?(Input::B)
     # キャンセル SE を演奏
     $game_system.se_play($data_system.cancel_se)
     $scene = Scene_Map.new
     return
   end
   # C ボタンが押された場合
   if Input.trigger?(Input::C)
     if @main_window.item == nil or @main_window.show?(@main_window.item) == false
       # ブザー SE を演奏
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     # 決定 SE を演奏
     $game_system.se_play($data_system.decision_se)
     @main_window.active = false
     @info_window.active = true
     @info_window.visible = true
     @visible_index = @main_window.index
     @info_window.refresh(@main_window.item)
     if @comment_window != nil
       @comment_window.refresh(@main_window.item)
       if @comment_on
         @comment_window.visible = true
       else
         @comment_window.visible = false
       end
     end
     return
   end
 end
 #--------------------------------------------------------------------------
 # ● フレーム更新 (インフォウィンドウがアクティブの場合)
 #--------------------------------------------------------------------------
 def update_info
   # B ボタンが押された場合
   if Input.trigger?(Input::B)
     # キャンセル SE を演奏
     $game_system.se_play($data_system.cancel_se)
     @main_window.active = true
     @info_window.active = false
     @info_window.visible = false
     @comment_window.visible = false if @comment_window != nil
     return
   end
   # C ボタンが押された場合
   if Input.trigger?(Input::C)
     if @comment_window != nil
       # 決定 SE を演奏
       $game_system.se_play($data_system.decision_se)
       if @comment_on
         @comment_on = false
         @comment_window.visible = false
       else
         @comment_on = true
         @comment_window.visible = true
       end
       return
     end
   end
   if Input.trigger?(Input::L)
     # 決定 SE を演奏
     $game_system.se_play($data_system.decision_se)
     loop_end = false
     while loop_end == false
       if @visible_index != 0
         @visible_index -= 1
       else
         @visible_index = @main_window.data.size - 1
       end
       loop_end = true if @main_window.show?(@main_window.data[@visible_index])
     end
     id = @main_window.data[@visible_index]
     @info_window.refresh(id)
     @comment_window.refresh(id) if @comment_window != nil
     return
   end
   if Input.trigger?(Input::R)
     # 決定 SE を演奏
     $game_system.se_play($data_system.decision_se)
     loop_end = false
     while loop_end == false
       if @visible_index != @main_window.data.size - 1
         @visible_index += 1
       else
         @visible_index = 0
       end
       loop_end = true if @main_window.show?(@main_window.data[@visible_index])
     end
     id = @main_window.data[@visible_index]
     @info_window.refresh(id)
     @comment_window.refresh(id) if @comment_window != nil
     return
   end
 end
end

 

 

Additonal Script (Needs this to run)

 

 # 図鑑コメント機能追加(基本)
#
# 図鑑にコメント機能を使いするのに必須です。
#
# 2005.9.19
# ウィンドウの不透明度、フォントと文字色を指定可能に。

class Window_Book_Comment < Window_Base
 #--------------------------------------------------------------------------
 # ● オブジェクト初期化
 #--------------------------------------------------------------------------
 def initialize(x, y, width, height)
   super(x, y, width, height)
   self.contents = Bitmap.new(width - 32, height - 32)
   self.opacity = self.window_opa
   self.contents.font.name = self.font_name
   self.contents.font.color = self.font_color
 end
 #--------------------------------------------------------------------------
 # ● 文字列変換
 #--------------------------------------------------------------------------
 def transfer(str)
   text = str.clone
   # 制御文字処理
   begin
   text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
   end
   text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
     $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
   end
   # 便宜上、"\\\\" を "\000" に変換
   text.gsub!(/\\\\/) { "\000" }
   # "\\C" を "\001" に、"\\G" を "\002" に変換
   text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
   text.gsub!(/\\[Gg]/) { "\002" }
   # 不透明度
   text.gsub!(/\\[Oo]\[([0-9]+)\]/) { "\200[#{$1}]" }
   # 文字サイズ
   text.gsub!(/\\[Hh]\[([0-9]+)\]/) { "\201[#{$1}]" }
   # ルビ
   text.gsub!(/\\[Rr]\[(.+?),(.+?)\]/) { "\202[#{$1},#{$2}]" }
   # ピクチャ表示
   text.gsub!(/\\[Pp]ic\[([0-9]+),([0-9]+),([^,\]]+)\]/) { "\250[#{$1},#{$2},#{$3}]" }
   # バトラー表示
   text.gsub!(/\\[bb]at\[([0-9]+),([0-9]+),([^,\]]+),([0-9]+)\]/) { "\251[#{$1},#{$2},#{$3},#{$4}]" }
   # キャラグラフィック表示
   text.gsub!(/\\[Cc]ha\[([0-9]+),([0-9]+),([^,\]]+),([0-9]+),([0-9]+),([0-9]+)\]/) { "\252[#{$1},#{$2},#{$3},#{$4},#{$5},#{$6}]" }

   return text
 end
 #--------------------------------------------------------------------------
 # ● 変換した文字列を描画
 #--------------------------------------------------------------------------
 def draw_ex_text(ox, oy, str, align=0)
   text = str.clone
   x = 0
   y = 0
   # c に 1 文字を取得 (文字が取得できなくなるまでループ)
   while ((c = text.slice!(/./m)) != nil)
     # \\ の場合
     if c == "\000"
       # 本来の文字に戻す
       c = "\\"
     end
     # \C[n] の場合
     if c == "\001"
       # 文字色を変更
       text.sub!(/\[([0-9]+)\]/, "")
       color = $1.to_i
       if color >= 0 and color <= 7
         self.contents.font.color = text_color(color)
       end
       # 次の文字へ
       next
     end
     # \G の場合
     if c == "\002"
       # 所持ゴールドに変換
       c = $game_party.gold.to_s
       # 文字を描画
       self.contents.draw_text(ox+4+x, oy+4+ 32 * y, self.contents.text_size(c).width, 32, c)
       # x に描画した文字の幅を加算
       x += self.contents.text_size(c).width
       # 次の文字へ
       next
     end

     # \O の場合
     if c == "\200"
       text.sub!(/\[([0-9]+)\]/, "")
       opacity = $1.to_i
       temp = self.contents.font.color
       self.contents.font.color = Color.new(temp.red, temp.green, temp.blue, opacity)
       # 次の文字へ
       next
     end
     # \H の場合
     if c == "\201"
       text.sub!(/\[([0-9]+)\]/, "")
       self.contents.font.size = [[$1.to_i, 6].max, 32].min
       # 次の文字へ
       next
     end
     # \R の場合
     if c == "\202"
       text.sub!(/\[(.+?),(.+?)\]/, "")
       x += ruby_set(ox+x,oy+(y*32),$1,$2)
       # 次の文字へ
       next
     end
     # \Pic の場合
     if c == "\250"
       text.sub!(/\[([0-9]+),([0-9]+),([^,\]]+)\]/, "")
       ope = self.contents.font.color.alpha
       set_picture($1.to_i, $2.to_i, $3, ope)
       # 次の文字へ
       next
     end
     # \Bat の場合
     if c == "\251"
       text.sub!(/\[([0-9]+),([0-9]+),([^,\]]+),([0-9]+)\]/, "")
       ope = self.contents.font.color.alpha
       set_battler($1.to_i, $2.to_i, $3, $4.to_i, ope)
       # 次の文字へ
       next
     end
     # \Cha の場合
     if c == "\252"
       text.sub!(/\[([0-9]+),([0-9]+),([^,\]]+),([0-9]+),([0-9]+),([0-9]+)\]/, "")
       ope = self.contents.font.color.alpha
       set_character($1.to_i, $2.to_i, $3, $4.to_i, $5.to_i, $6.to_i, ope)
       # 次の文字へ
       next
     end
     # 改行文字の場合
     if c == "\n"
       # y に 1 を加算
       y += 1
       x = 0
       # 次の文字へ
       next
     end
     # 文字を描画
     self.contents.draw_text(ox+4+x, 4+oy+ 32 * y, 40, 32, c)
     # x に描画した文字の幅を加算
     x += self.contents.text_size(c).width
   end
 end
 #--------------------------------------------------------------------------
 # ● ルビ描画
 #--------------------------------------------------------------------------
 def ruby_set(x,y,str,ruby)
   text_w = self.contents.text_size(str).width
   text_h = self.contents.text_size(str).height
   f_size_back = self.contents.font.size
   ruby_size = 10
   self.contents.font.size = ruby_size
   ruby_w = self.contents.text_size(ruby).width
   self.contents.draw_text(4+x, 4+4+y-ruby_size+1, text_w, ruby_size, ruby, 1)
   self.contents.font.size = f_size_back
   self.contents.draw_text(4+x, 4+4+y, text_w, text_h, str)
   return text_w
 end
 #--------------------------------------------------------------------------
 # ● ピクチャー描画
 #--------------------------------------------------------------------------
 def set_picture(x, y, filename, opacity=255)
   bitmap = RPG::Cache.picture(filename)
   self.contents.blt(x, y, bitmap, bitmap.rect, opacity)
 end
 #--------------------------------------------------------------------------
 # ● バトラー描画
 #--------------------------------------------------------------------------
 def set_battler(x, y, filename, hue, opacity=255)
   bitmap =RPG::Cache.battler(filename, hue)
   self.contents.blt(x, y, bitmap, bitmap.rect, opacity)
 end
 #--------------------------------------------------------------------------
 # ● キャラクター描画
 #--------------------------------------------------------------------------
 def set_character(x, y, filename, hue, dir, pat, opacity=255)
   bitmap = RPG::Cache.character(filename, hue)
   cw = bitmap.width / 4
   ch = bitmap.height / 4
   cy = ch * (dir / 2 - 1)
   cx = cw * (pat - 1)
   src_rect = Rect.new(cx, cy, cw, ch)
   self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect, opacity)
 end
 def window_opa
 end
 def font_name
 end
 def font_color
 end
end

 

 

Description: Allows you to add monsters descriptions, I added a few custom lines as an example with monster descriptions as an example.

 

# 図鑑コメント機能追加(魔物図鑑)
#
# コメントには冒険日記と同様の制御文字が使用可能です。
# 詳しくは冒険日記の方をご覧下さい。
#
# 2005.9.19
# ウィンドウの不透明度、フォントと文字色を指定可能に。

module MoMo_M_Book_Comment
 # コメントウィンドウの横幅
 C_WINDOW_WIDTH = 640
 # コメントウィンドウの縦幅
 C_WINDOW_HEIGHT = 128
 # コメントウィンドウのX座標
 C_WINDOW_X = 0
 # コメントウィンドウのY座標
 C_WINDOW_Y = 200
 # コメントウィンドウの不透明度
 C_WINDOW_OPA = 255
 # 使用するフォント名(希望順に配列に追加してください)
 C_WINDOW_FONT_NAME = ["Tahoma"]
 # 使用する文字色
 # Color.new(赤の値, 緑の値, 青の値, 不透明度) ※0~255まで
 C_WINDOW_FONT_COLOR = Color.new(255, 255, 255, 255)
end

class Window_Monster_Book_Comment < Window_Book_Comment
 def initialize
   x = MoMo_M_Book_Comment::C_WINDOW_X
   y = MoMo_M_Book_Comment::C_WINDOW_Y
   width = MoMo_M_Book_Comment::C_WINDOW_WIDTH
   height = MoMo_M_Book_Comment::C_WINDOW_HEIGHT
   super(x, y, width, height)
 end
 def draw_comment(id)
   self.contents.clear
   comment = get_comment(id)
   draw_ex_text(0, 0, transfer(comment))
 end
 def get_comment(id)
   return comment_set[0] if comment_set[id] == nil
   return comment_set[id]
 end
 def comment_set
   return MoMo_M_Book_Comment::M_BOOK_COMMENT
 end
 def refresh(id)
   draw_comment(id)
 end
 def window_opa
   return MoMo_M_Book_Comment::C_WINDOW_OPA
 end
 def font_name
   return MoMo_M_Book_Comment::C_WINDOW_FONT_NAME
 end
 def font_color
   return MoMo_M_Book_Comment::C_WINDOW_FONT_COLOR
 end
end

module MoMo_M_Book_Comment
 str = []
   # str[エネミーID]
   str[0] = <<-EOS #デフォ(コメント未設定時用、通常は使用しない)
コメントな~し!
   EOS
   str[1] = <<-EOS #ゴースト
A rooster, originally bred at the farms, that had fled into the wild through
errors in the past. They became exposed to hex magic and developed a wild
behaviour that meant they had to be exterminated.
   EOS
   str[2] = <<-EOS #ゴースト
A cult who developed a craving for the theivery of ones possessions
meant trouble for travellers. Proceed with caution through mountainous 
regieons for these ruffians are most like to carry out their deeds here.
   EOS
   str[3] = <<-EOS #ゴースト
It is unsure whether these beasts belong to the feline or canine species. 
They are a manifestation of magic, within the ranks of fairies and unicorns 
of myth.
   EOS
   str[4] = <<-EOS #ゴースト
Aquatic beasts with a taste for the entoxicated Hex-Fish Pirahn gave Drench 
Beasts a similar narcotic behaviour. They can only focus on one prey at a 
time, entangling the victim in its knarled tentacles.
   EOS
   str[5] = <<-EOS #ゴースト
A wild canine that always travels in packs, it will attempt to hunt and kill
as a team rather than alone. Humans have underestimated the Wargs smarts and
has became its food as a concequence.
   EOS
   str[6] = <<-EOS #ゴースト
A woman with a sharp tounge and a fitting blade that possesses strange 
fire-like attributes.
   EOS
   str[7] = <<-EOS #ゴースト
Eyerus are extremely dangerous large forms of virus that attack and sap 
its target, corrupting the host and allowing Eyerus to take a larger form.
Any seen targets or those infected by the Eyerus have been ordered executed.
   EOS
   str[8] = <<-EOS #ゴースト
As the name says, it is a venomous species of snake. Handle with care, as if
you are to be bitten, curative resources for this particular poison are hard
to come by.
   EOS
   str[9] = <<-EOS #ゴースト
Rejects from experiments that allow humans to transform into alternate beings.
No successful method has yet been developed. 
   EOS
   str[10] = <<-EOS #ゴースト
Another type of parasite, not as potentially dangerous as Iris, but is armed 
with a set of venomous tentacles. It was originally a standard caterpillar,
but grew and mutated due to high hex exposure.
   EOS
   str[11] = <<-EOS #ゴースト
Another victim of the deadly hex, fallen commanders who have either been taken
over by an Iris or fallen into dangerous territory, these fallen beings now
only seek death of others. Some have even tried killing each other.
   EOS
   str[12] = <<-EOS #ゴースト
Grifferon are very protective over territory, despite their size they are not
overly powerful. They reside mainly in the exotic jungle of Utocrush as the
climate is warm.
   EOS
   str[13] = <<-EOS #ゴースト
Another beast that basks in the jungle of Utocrush, and many other large 
forests. It is nowhere near as dangerous as Poison in terms of venom 
and there are many kinds of cures and ailments.
   EOS
   str[14] = <<-EOS #ゴースト
Nightwinger are the second most common beasts that reside in the world, 
next to the Invader. Like Invaders, Nightwingers are seen as pests. People 
tend to also call them 'Pidgeons of the Night'.
   EOS
   str[15] = <<-EOS #ゴースト
Invader are the most common creatures in the world. They are seen nothing 
more than pests. Soldiers are assigned to shoot them as a part of basic 
training.
   EOS

   M_BOOK_COMMENT = str
end

 

 

str[n] relates to the ID number of the monster in the beastry. For my sake, come up with your own descriptions or I will come at you with a flaming mace :)

Share this post


Link to post
Share on other sites

The best beastry script is here, period. Momo's beastry allows the use of descriptions to your monsters, to give them more character and feel.

Place them in the order shown, The main script at the top, comments in the middle, and the descriptor thingy at the below.

 

To call this script make a common event and use this script:

$scene = Scene_MonsterBook.new

 

Main Beastry Script

 

#魔物図鑑
#
#エネミーの遭遇情報は、戦闘終了時(経験値などを獲得する所)で追加されます。
#よって、敵から逃げた場合や負けイベントでの戦闘敗北などでは
#図鑑に登録されません。
#このタイミングを変えたい場合は各自書き換えて下さい。
#(class Scene_Battle の start_phase5 で追加してます。)
#
#また、所々「アナライズ」という単語がありますが、
#現在、この魔物辞典だけでは機能しておりません。(自ゲームでの名残)
#Window_MonsterBook_Info の DROP_ITEM_NEED_ANALYZE が true になっていると
#ドロップアイテムが表示されなくなりますので、通常は false にしておいて下さい。
#
#注意
#このまま使うと、データベースのトループの1番に
#何も設定していないと、エラー吐きます。
#対処策としては
#1.素直にデータベースのトループの1番に何でもいいから設定する。
#2.Game_Enemy_Book の 「super(1, 0)#ダミー」 の左側の数字の部分を
#  存在するトループIDに書き換える。
#のどちらかになります。
#
#2005.2.6 機能追加
#図鑑完成度の表示機能を追加
#SHOW_COMPLETE_TYPE で設定できます。
#イベントコマンドの「スクリプト」で
#$game_party.enemy_book_max で図鑑の総魔物数(最大数)
#$game_party.enemy_book_now で図鑑の現在登録数(現在数)
#$game_party.complete_percentage で図鑑の完成率(小数点切捨て)
#を取得できます。
#
#2005.2.17
#complete_percentageのメソッド名を
#enemy_book_complete_percentageに変更(他の図鑑と区別できるように)
#イベントコマンドの「スクリプト」で最大数等の取得を短縮できるようになりました。
#enemy_book_max で図鑑の総魔物数(最大数)
#enemy_book_now で図鑑の現在登録数(現在数)
#enemy_book_compで図鑑の完成率(小数点切捨て)
#
#2005.2.18 バグ修正
#complete_percentageのメソッド名を
#enemy_book_complete_percentageに変更したのに
#complete_percentageって呼び出してました。(単なる書き換え漏れですね)
#
#2005.7.4 機能追加
#コメント機能に対応。
#全体的に色々いじりました。
#
#2005.7.4 バグ修正
#細かいバグを修正。


module Enemy_Book_Config
 #ドロップアイテム表示にアナライズが必要かどうか
 DROP_ITEM_NEED_ANALYZE = false
 #回避修正の名前
 EVA_NAME = "回避"             
 #図鑑完成率の表示方法
 #0:表示なし 1:現在数/最大数 2:%表示 3:両方
 SHOW_COMPLETE_TYPE = 3         
 #コメント機能を使うかどうか(要・コメント追加スクリプト導入)
 COMMENT_SYSTEM = true
end

class Game_Temp
 attr_accessor :enemy_book_data
 alias temp_enemy_book_data_initialize initialize
 def initialize
   temp_enemy_book_data_initialize
   @enemy_book_data = Data_MonsterBook.new
 end
end

class Game_Party
 attr_accessor :enemy_info               # 出会った敵情報(図鑑用)
 #--------------------------------------------------------------------------
 # ● オブジェクト初期化
 #--------------------------------------------------------------------------
 alias book_info_initialize initialize
 def initialize
   book_info_initialize
   @enemy_info = {}
 end
 #--------------------------------------------------------------------------
 # ● エネミー情報の追加(図鑑用)
 #     type : 通常遭遇かアナライズか 0:通常 1:アナライズ -1:情報削除
 #     0:無遭遇 1:遭遇済 2:アナライズ済
 #--------------------------------------------------------------------------
 def add_enemy_info(enemy_id, type = 0)
   case type
   when 0
     if @enemy_info[enemy_id] == 2
       return false
     end
     @enemy_info[enemy_id] = 1
   when 1
     @enemy_info[enemy_id] = 2
   when -1
     @enemy_info[enemy_id] = 0
   end
 end
 #--------------------------------------------------------------------------
 # ● 魔物図鑑の最大登録数を取得
 #--------------------------------------------------------------------------
 def enemy_book_max
   return $game_temp.enemy_book_data.id_data.size - 1
 end
 #--------------------------------------------------------------------------
 # ● 魔物図鑑の現在登録数を取得
 #--------------------------------------------------------------------------
 def enemy_book_now
   now_enemy_info = @enemy_info.keys
   # 登録無視の属性IDを取得
   no_add = $game_temp.enemy_book_data.no_add_element
   new_enemy_info = []
   for i in now_enemy_info
     enemy = $data_enemies[i]
     next if enemy.name == ""
     if enemy.element_ranks[no_add] == 1
       next
     end
     new_enemy_info.push(enemy.id)
   end
   return new_enemy_info.size
 end
 #--------------------------------------------------------------------------
 # ● 魔物図鑑の完成率を取得
end

class Interpreter
 def enemy_book_max
   return $game_party.enemy_book_max
 end
 def enemy_book_now
   return $game_party.enemy_book_now
 end
 def enemy_book_comp
   return $game_party.enemy_book_complete_percentage
 end
end

class Scene_Battle
 alias add_enemy_info_start_phase5 start_phase5
 def start_phase5
   for enemy in $game_troop.enemies
     # エネミーが隠れ状態でない場合
     unless enemy.hidden
       # 敵遭遇情報追加
       $game_party.add_enemy_info(enemy.id, 0)
     end
   end
   add_enemy_info_start_phase5
 end
end

class Window_Base < Window
 #--------------------------------------------------------------------------
 # ● エネミーの戦闘後獲得アイテムの描画
 #--------------------------------------------------------------------------
 def draw_enemy_drop_item(enemy, x, y)
   self.contents.font.color = normal_color
   treasures = []
   if enemy.item_id > 0
     treasures.push($data_items[enemy.item_id])
   end
   if enemy.weapon_id > 0
     treasures.push($data_weapons[enemy.weapon_id])
   end
   if enemy.armor_id > 0
     treasures.push($data_armors[enemy.armor_id])
   end
   # 現状ではとりあえず1つのみ描画
   if treasures.size > 0
     item = treasures[0]
     bitmap = RPG::Cache.icon(item.icon_name)
     opacity = 255
     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
     name = treasures[0].name
   else
     self.contents.font.color = disabled_color
     name = "No Item"
   end
   self.contents.draw_text(x+28, y, 212, 32, name)
 end
 #--------------------------------------------------------------------------
 # ● エネミーの図鑑IDの描画
 #--------------------------------------------------------------------------
 def draw_enemy_book_id(enemy, x, y)
   self.contents.font.color = normal_color
   id = $game_temp.enemy_book_data.id_data.index(enemy.id)
   self.contents.draw_text(x, y, 32, 32, id.to_s)
 end
 #--------------------------------------------------------------------------
 # ● エネミーの名前の描画
 #     enemy : エネミー
 #     x     : 描画先 X 座標
 #     y     : 描画先 Y 座標
 #--------------------------------------------------------------------------
 def draw_enemy_name(enemy, x, y)
   self.contents.font.color = normal_color
   self.contents.draw_text(x, y, 152, 32, enemy.name)
 end
 #--------------------------------------------------------------------------
 # ● エネミーグラフィックの描画(アナライズ)
 #     enemy : エネミー
 #     x     : 描画先 X 座標
 #     y     : 描画先 Y 座標
 #--------------------------------------------------------------------------
 def draw_enemy_graphic(enemy, x, y, opacity = 255)
   bitmap = RPG::Cache.battler(enemy.battler_name, enemy.battler_hue)
   cw = bitmap.width
   ch = bitmap.height
   src_rect = Rect.new(0, 0, cw, ch)
   x = x + (cw / 2 - x) if cw / 2 > x
   self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect, opacity)
 end
 #--------------------------------------------------------------------------
 # ● エネミーの獲得EXPの描画
 #     enemy : エネミー
 #     x     : 描画先 X 座標
 #     y     : 描画先 Y 座標
 #--------------------------------------------------------------------------
 def draw_enemy_exp(enemy, x, y)
   self.contents.font.color = system_color
   self.contents.draw_text(x, y, 120, 32, "EXP")
   self.contents.font.color = normal_color
   self.contents.draw_text(x + 120, y, 36, 32, enemy.exp.to_s, 2)
 end
 #--------------------------------------------------------------------------
 # ● エネミーの獲得GOLDの描画
 #     enemy : エネミー
 #     x     : 描画先 X 座標
 #     y     : 描画先 Y 座標
 #--------------------------------------------------------------------------
 def draw_enemy_gold(enemy, x, y)
   self.contents.font.color = system_color
   self.contents.draw_text(x, y, 120, 32, $data_system.words.gold)
   self.contents.font.color = normal_color
   self.contents.draw_text(x + 120, y, 36, 32, enemy.gold.to_s, 2)
 end
end

class Game_Enemy_Book < Game_Enemy
 #--------------------------------------------------------------------------
 # ● オブジェクト初期化
 #--------------------------------------------------------------------------
 def initialize(enemy_id)
   super(1, 0)#ダミー
   @enemy_id = enemy_id
   enemy = $data_enemies[@enemy_id]
   @battler_name = enemy.battler_name
   @battler_hue = enemy.battler_hue
   @hp = maxhp
   @sp = maxsp
 end
end

class Data_MonsterBook
 attr_reader :id_data
 #--------------------------------------------------------------------------
 # ● オブジェクト初期化
 #--------------------------------------------------------------------------
 def initialize
   @id_data = enemy_book_id_set
 end
 #--------------------------------------------------------------------------
 # ● 図鑑用登録無視属性取得
 #--------------------------------------------------------------------------
 def no_add_element
   no_add = 0
   # 登録無視の属性IDを取得
   for i in 1...$data_system.elements.size
     if $data_system.elements[i] =~ /図鑑登録無効/
       no_add = i
       break
     end
   end
   return no_add
 end
 #--------------------------------------------------------------------------
 # ● 図鑑用敵ID設定
 #--------------------------------------------------------------------------
 def enemy_book_id_set
   data = [0]
   no_add = no_add_element
   # 登録無視の属性IDを取得
   for i in 1...$data_enemies.size
     enemy = $data_enemies[i]
     next if enemy.name == ""
     if enemy.element_ranks[no_add] == 1
       next
     end
     data.push(enemy.id)
   end
   return data
 end
end


class Window_MonsterBook < Window_Selectable
 attr_reader   :data
 #--------------------------------------------------------------------------
 # ● オブジェクト初期化
 #--------------------------------------------------------------------------
 def initialize(index=0)
   super(0, 64, 640, 416)
   @column_max = 2
   @book_data = $game_temp.enemy_book_data
   @data = @book_data.id_data.dup
   @data.shift
   #@data.sort!
   @item_max = @data.size
   self.index = 0
   refresh if @item_max > 0
 end
 #--------------------------------------------------------------------------
 # ● 遭遇データを取得
 #--------------------------------------------------------------------------
 def data_set
   data = $game_party.enemy_info.keys
   data.sort!
   newdata = []
   for i in data
     next if $game_party.enemy_info[i] == 0
     # 図鑑登録無視を考慮
     if book_id(i) != nil
       newdata.push(i)
     end
   end
   return newdata
 end
 #--------------------------------------------------------------------------
 # ● 表示許可取得
 #--------------------------------------------------------------------------
 def show?(id)
   if $game_party.enemy_info[id] == 0 or $game_party.enemy_info[id] == nil
     return false
   else
     return true
   end
 end
 #--------------------------------------------------------------------------
 # ● 図鑑用ID取得
 #--------------------------------------------------------------------------
 def book_id(id)
   return @book_data.index(id)
 end
 #--------------------------------------------------------------------------
 # ● エネミー取得
 #--------------------------------------------------------------------------
 def item
   return @data[self.index]
 end
 #--------------------------------------------------------------------------
 # ● リフレッシュ
 #--------------------------------------------------------------------------
 def refresh
   if self.contents != nil
     self.contents.dispose
     self.contents = nil
   end
   self.contents = Bitmap.new(width - 32, row_max * 32)
   #項目数が 0 でなければビットマップを作成し、全項目を描画
   if @item_max > 0
     for i in 0...@item_max
      draw_item(i)
     end
   end
 end
 #--------------------------------------------------------------------------
 # ● 項目の描画
 #     index : 項目番号
 #--------------------------------------------------------------------------
 def draw_item(index)
   enemy = $data_enemies[@data[index]]
   return if enemy == nil
   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))
   self.contents.font.color = normal_color
   draw_enemy_book_id(enemy, x, y)
   if show?(enemy.id)
     self.contents.draw_text(x + 28+16, y, 212, 32, enemy.name, 0)
   else
     self.contents.draw_text(x + 28+16, y, 212, 32, "-----", 0)
     return
   end
   if analyze?(@data[index])
     self.contents.font.color = text_color(3)
     self.contents.draw_text(x + 256, y, 24, 32, "済", 2)
   end
 end
 #--------------------------------------------------------------------------
 # ● アナライズ済かどうか
 #--------------------------------------------------------------------------
 def analyze?(enemy_id)
   if $game_party.enemy_info[enemy_id] == 2
     return true
   else
     return false
   end
 end
end


class Window_MonsterBook_Info < Window_Base
 #--------------------------------------------------------------------------
 # ● オブジェクト初期化
 #--------------------------------------------------------------------------
 def initialize
   super(0, 0+64, 640, 480-64)
   self.contents = Bitmap.new(width - 32, height - 32)
 end
 #--------------------------------------------------------------------------
 # ● リフレッシュ
 #--------------------------------------------------------------------------
 def refresh(enemy_id)
   self.contents.clear
   self.contents.font.size = 22
   enemy = Game_Enemy_Book.new(enemy_id)
   draw_enemy_graphic(enemy, 96, 240+48+64, 200)
   draw_enemy_book_id(enemy, 4, 0)
   draw_enemy_name(enemy, 48, 0)
   draw_actor_hp(enemy, 288, 0)
   draw_actor_sp(enemy, 288+160, 0)
   draw_actor_parameter(enemy, 288    ,  32, 0)
   self.contents.font.color = system_color
   self.contents.draw_text(288+160, 32, 120, 32, Enemy_Book_Config::EVA_NAME)
   self.contents.font.color = normal_color
   self.contents.draw_text(288+160 + 120, 32, 36, 32, enemy.eva.to_s, 2)
   draw_actor_parameter(enemy, 288    ,  64, 3)
   draw_actor_parameter(enemy, 288+160,  64, 4)
   draw_actor_parameter(enemy, 288    ,  96, 5)
   draw_actor_parameter(enemy, 288+160,  96, 6)
   draw_actor_parameter(enemy, 288    , 128, 1)
   draw_actor_parameter(enemy, 288+160, 128, 2)
   draw_enemy_exp(enemy, 288, 160)
   draw_enemy_gold(enemy, 288+160, 160)
   if analyze?(enemy.id) or !Enemy_Book_Config::DROP_ITEM_NEED_ANALYZE
     self.contents.draw_text(288, 192, 96, 32, "Drop Item")
     draw_enemy_drop_item(enemy, 288+96+4, 192)
     self.contents.font.color = normal_color
     #draw_element_guard(enemy, 320-32, 160-16+96)
   end
 end
 #--------------------------------------------------------------------------
 # ● アナライズ済かどうか
 #--------------------------------------------------------------------------
 def analyze?(enemy_id)
   if $game_party.enemy_info[enemy_id] == 2
     return true
   else
     return false
   end
 end
end


class Scene_MonsterBook
 #--------------------------------------------------------------------------
 # ● メイン処理
 #--------------------------------------------------------------------------
 def main
   $game_temp.enemy_book_data = Data_MonsterBook.new
   # ウィンドウを作成
   @title_window = Window_Base.new(0, 0, 640, 64)
   @title_window.contents = Bitmap.new(640 - 32, 64 - 32)
   @title_window.contents.draw_text(4, 0, 320, 32, "Monster Information", 0)
   @main_window = Window_MonsterBook.new
   @main_window.active = true
   # インフォウィンドウを作成 (不可視・非アクティブに設定)
   @info_window = Window_MonsterBook_Info.new
   @info_window.z = 110
   @info_window.visible = false
   @info_window.active = false
   @visible_index = 0
   if Enemy_Book_Config::COMMENT_SYSTEM
     # コメントウィンドウを作成 (不可視・非アクティブに設定)
     @comment_window = Window_Monster_Book_Comment.new
     @comment_window.z = 120
     @comment_window.visible = false
     @comment_on = false # コメントフラグ
   end
   # トランジション実行
   Graphics.transition
   # メインループ
   loop do
     # ゲーム画面を更新
     Graphics.update
     # 入力情報を更新
     Input.update
     # フレーム更新
     update
     # 画面が切り替わったらループを中断
     if $scene != self
       break
     end
   end
   # トランジション準備
   Graphics.freeze
   # ウィンドウを解放
   @main_window.dispose
   @info_window.dispose
   @title_window.dispose
   @comment_window.dispose if @comment_window != nil
 end
 #--------------------------------------------------------------------------
 # ● フレーム更新
 #--------------------------------------------------------------------------
 def update
   # ウィンドウを更新
   @main_window.update
   @info_window.update
   if @info_window.active
     update_info
     return
   end
   # メインウィンドウがアクティブの場合: update_target を呼ぶ
   if @main_window.active
     update_main
     return
   end
 end
 #--------------------------------------------------------------------------
 # ● フレーム更新 (メインウィンドウがアクティブの場合)
 #--------------------------------------------------------------------------
 def update_main
   # B ボタンが押された場合
   if Input.trigger?(Input::B)
     # キャンセル SE を演奏
     $game_system.se_play($data_system.cancel_se)
     $scene = Scene_Map.new
     return
   end
   # C ボタンが押された場合
   if Input.trigger?(Input::C)
     if @main_window.item == nil or @main_window.show?(@main_window.item) == false
       # ブザー SE を演奏
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     # 決定 SE を演奏
     $game_system.se_play($data_system.decision_se)
     @main_window.active = false
     @info_window.active = true
     @info_window.visible = true
     @visible_index = @main_window.index
     @info_window.refresh(@main_window.item)
     if @comment_window != nil
       @comment_window.refresh(@main_window.item)
       if @comment_on
         @comment_window.visible = true
       else
         @comment_window.visible = false
       end
     end
     return
   end
 end
 #--------------------------------------------------------------------------
 # ● フレーム更新 (インフォウィンドウがアクティブの場合)
 #--------------------------------------------------------------------------
 def update_info
   # B ボタンが押された場合
   if Input.trigger?(Input::B)
     # キャンセル SE を演奏
     $game_system.se_play($data_system.cancel_se)
     @main_window.active = true
     @info_window.active = false
     @info_window.visible = false
     @comment_window.visible = false if @comment_window != nil
     return
   end
   # C ボタンが押された場合
   if Input.trigger?(Input::C)
     if @comment_window != nil
       # 決定 SE を演奏
       $game_system.se_play($data_system.decision_se)
       if @comment_on
         @comment_on = false
         @comment_window.visible = false
       else
         @comment_on = true
         @comment_window.visible = true
       end
       return
     end
   end
   if Input.trigger?(Input::L)
     # 決定 SE を演奏
     $game_system.se_play($data_system.decision_se)
     loop_end = false
     while loop_end == false
       if @visible_index != 0
         @visible_index -= 1
       else
         @visible_index = @main_window.data.size - 1
       end
       loop_end = true if @main_window.show?(@main_window.data[@visible_index])
     end
     id = @main_window.data[@visible_index]
     @info_window.refresh(id)
     @comment_window.refresh(id) if @comment_window != nil
     return
   end
   if Input.trigger?(Input::R)
     # 決定 SE を演奏
     $game_system.se_play($data_system.decision_se)
     loop_end = false
     while loop_end == false
       if @visible_index != @main_window.data.size - 1
         @visible_index += 1
       else
         @visible_index = 0
       end
       loop_end = true if @main_window.show?(@main_window.data[@visible_index])
     end
     id = @main_window.data[@visible_index]
     @info_window.refresh(id)
     @comment_window.refresh(id) if @comment_window != nil
     return
   end
 end
end

 

 

Additonal Script (Needs this to run)

 

 # 図鑑コメント機能追加(基本)
#
# 図鑑にコメント機能を使いするのに必須です。
#
# 2005.9.19
# ウィンドウの不透明度、フォントと文字色を指定可能に。

class Window_Book_Comment < Window_Base
 #--------------------------------------------------------------------------
 # ● オブジェクト初期化
 #--------------------------------------------------------------------------
 def initialize(x, y, width, height)
   super(x, y, width, height)
   self.contents = Bitmap.new(width - 32, height - 32)
   self.opacity = self.window_opa
   self.contents.font.name = self.font_name
   self.contents.font.color = self.font_color
 end
 #--------------------------------------------------------------------------
 # ● 文字列変換
 #--------------------------------------------------------------------------
 def transfer(str)
   text = str.clone
   # 制御文字処理
   begin
   text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
   end
   text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
     $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
   end
   # 便宜上、"\\\\" を "\000" に変換
   text.gsub!(/\\\\/) { "\000" }
   # "\\C" を "\001" に、"\\G" を "\002" に変換
   text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
   text.gsub!(/\\[Gg]/) { "\002" }
   # 不透明度
   text.gsub!(/\\[Oo]\[([0-9]+)\]/) { "\200[#{$1}]" }
   # 文字サイズ
   text.gsub!(/\\[Hh]\[([0-9]+)\]/) { "\201[#{$1}]" }
   # ルビ
   text.gsub!(/\\[Rr]\[(.+?),(.+?)\]/) { "\202[#{$1},#{$2}]" }
   # ピクチャ表示
   text.gsub!(/\\[Pp]ic\[([0-9]+),([0-9]+),([^,\]]+)\]/) { "\250[#{$1},#{$2},#{$3}]" }
   # バトラー表示
   text.gsub!(/\\[bb]at\[([0-9]+),([0-9]+),([^,\]]+),([0-9]+)\]/) { "\251[#{$1},#{$2},#{$3},#{$4}]" }
   # キャラグラフィック表示
   text.gsub!(/\\[Cc]ha\[([0-9]+),([0-9]+),([^,\]]+),([0-9]+),([0-9]+),([0-9]+)\]/) { "\252[#{$1},#{$2},#{$3},#{$4},#{$5},#{$6}]" }

   return text
 end
 #--------------------------------------------------------------------------
 # ● 変換した文字列を描画
 #--------------------------------------------------------------------------
 def draw_ex_text(ox, oy, str, align=0)
   text = str.clone
   x = 0
   y = 0
   # c に 1 文字を取得 (文字が取得できなくなるまでループ)
   while ((c = text.slice!(/./m)) != nil)
     # \\ の場合
     if c == "\000"
       # 本来の文字に戻す
       c = "\\"
     end
     # \C[n] の場合
     if c == "\001"
       # 文字色を変更
       text.sub!(/\[([0-9]+)\]/, "")
       color = $1.to_i
       if color >= 0 and color <= 7
         self.contents.font.color = text_color(color)
       end
       # 次の文字へ
       next
     end
     # \G の場合
     if c == "\002"
       # 所持ゴールドに変換
       c = $game_party.gold.to_s
       # 文字を描画
       self.contents.draw_text(ox+4+x, oy+4+ 32 * y, self.contents.text_size(c).width, 32, c)
       # x に描画した文字の幅を加算
       x += self.contents.text_size(c).width
       # 次の文字へ
       next
     end

     # \O の場合
     if c == "\200"
       text.sub!(/\[([0-9]+)\]/, "")
       opacity = $1.to_i
       temp = self.contents.font.color
       self.contents.font.color = Color.new(temp.red, temp.green, temp.blue, opacity)
       # 次の文字へ
       next
     end
     # \H の場合
     if c == "\201"
       text.sub!(/\[([0-9]+)\]/, "")
       self.contents.font.size = [[$1.to_i, 6].max, 32].min
       # 次の文字へ
       next
     end
     # \R の場合
     if c == "\202"
       text.sub!(/\[(.+?),(.+?)\]/, "")
       x += ruby_set(ox+x,oy+(y*32),$1,$2)
       # 次の文字へ
       next
     end
     # \Pic の場合
     if c == "\250"
       text.sub!(/\[([0-9]+),([0-9]+),([^,\]]+)\]/, "")
       ope = self.contents.font.color.alpha
       set_picture($1.to_i, $2.to_i, $3, ope)
       # 次の文字へ
       next
     end
     # \Bat の場合
     if c == "\251"
       text.sub!(/\[([0-9]+),([0-9]+),([^,\]]+),([0-9]+)\]/, "")
       ope = self.contents.font.color.alpha
       set_battler($1.to_i, $2.to_i, $3, $4.to_i, ope)
       # 次の文字へ
       next
     end
     # \Cha の場合
     if c == "\252"
       text.sub!(/\[([0-9]+),([0-9]+),([^,\]]+),([0-9]+),([0-9]+),([0-9]+)\]/, "")
       ope = self.contents.font.color.alpha
       set_character($1.to_i, $2.to_i, $3, $4.to_i, $5.to_i, $6.to_i, ope)
       # 次の文字へ
       next
     end
     # 改行文字の場合
     if c == "\n"
       # y に 1 を加算
       y += 1
       x = 0
       # 次の文字へ
       next
     end
     # 文字を描画
     self.contents.draw_text(ox+4+x, 4+oy+ 32 * y, 40, 32, c)
     # x に描画した文字の幅を加算
     x += self.contents.text_size(c).width
   end
 end
 #--------------------------------------------------------------------------
 # ● ルビ描画
 #--------------------------------------------------------------------------
 def ruby_set(x,y,str,ruby)
   text_w = self.contents.text_size(str).width
   text_h = self.contents.text_size(str).height
   f_size_back = self.contents.font.size
   ruby_size = 10
   self.contents.font.size = ruby_size
   ruby_w = self.contents.text_size(ruby).width
   self.contents.draw_text(4+x, 4+4+y-ruby_size+1, text_w, ruby_size, ruby, 1)
   self.contents.font.size = f_size_back
   self.contents.draw_text(4+x, 4+4+y, text_w, text_h, str)
   return text_w
 end
 #--------------------------------------------------------------------------
 # ● ピクチャー描画
 #--------------------------------------------------------------------------
 def set_picture(x, y, filename, opacity=255)
   bitmap = RPG::Cache.picture(filename)
   self.contents.blt(x, y, bitmap, bitmap.rect, opacity)
 end
 #--------------------------------------------------------------------------
 # ● バトラー描画
 #--------------------------------------------------------------------------
 def set_battler(x, y, filename, hue, opacity=255)
   bitmap =RPG::Cache.battler(filename, hue)
   self.contents.blt(x, y, bitmap, bitmap.rect, opacity)
 end
 #--------------------------------------------------------------------------
 # ● キャラクター描画
 #--------------------------------------------------------------------------
 def set_character(x, y, filename, hue, dir, pat, opacity=255)
   bitmap = RPG::Cache.character(filename, hue)
   cw = bitmap.width / 4
   ch = bitmap.height / 4
   cy = ch * (dir / 2 - 1)
   cx = cw * (pat - 1)
   src_rect = Rect.new(cx, cy, cw, ch)
   self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect, opacity)
 end
 def window_opa
 end
 def font_name
 end
 def font_color
 end
end

 

 

Description: Allows you to add monsters, I added a few custom lines as an example with monster descriptions as an example.

 

# 図鑑コメント機能追加(魔物図鑑)
#
# コメントには冒険日記と同様の制御文字が使用可能です。
# 詳しくは冒険日記の方をご覧下さい。
#
# 2005.9.19
# ウィンドウの不透明度、フォントと文字色を指定可能に。

module MoMo_M_Book_Comment
 # コメントウィンドウの横幅
 C_WINDOW_WIDTH = 640
 # コメントウィンドウの縦幅
 C_WINDOW_HEIGHT = 128
 # コメントウィンドウのX座標
 C_WINDOW_X = 0
 # コメントウィンドウのY座標
 C_WINDOW_Y = 200
 # コメントウィンドウの不透明度
 C_WINDOW_OPA = 255
 # 使用するフォント名(希望順に配列に追加してください)
 C_WINDOW_FONT_NAME = ["Tahoma"]
 # 使用する文字色
 # Color.new(赤の値, 緑の値, 青の値, 不透明度) ※0~255まで
 C_WINDOW_FONT_COLOR = Color.new(255, 255, 255, 255)
end

class Window_Monster_Book_Comment < Window_Book_Comment
 def initialize
   x = MoMo_M_Book_Comment::C_WINDOW_X
   y = MoMo_M_Book_Comment::C_WINDOW_Y
   width = MoMo_M_Book_Comment::C_WINDOW_WIDTH
   height = MoMo_M_Book_Comment::C_WINDOW_HEIGHT
   super(x, y, width, height)
 end
 def draw_comment(id)
   self.contents.clear
   comment = get_comment(id)
   draw_ex_text(0, 0, transfer(comment))
 end
 def get_comment(id)
   return comment_set[0] if comment_set[id] == nil
   return comment_set[id]
 end
 def comment_set
   return MoMo_M_Book_Comment::M_BOOK_COMMENT
 end
 def refresh(id)
   draw_comment(id)
 end
 def window_opa
   return MoMo_M_Book_Comment::C_WINDOW_OPA
 end
 def font_name
   return MoMo_M_Book_Comment::C_WINDOW_FONT_NAME
 end
 def font_color
   return MoMo_M_Book_Comment::C_WINDOW_FONT_COLOR
 end
end

module MoMo_M_Book_Comment
 str = []
   # str[エネミーID]
   str[0] = <<-EOS #デフォ(コメント未設定時用、通常は使用しない)
コメントな~し!
   EOS
   str[1] = <<-EOS #ゴースト
A rooster, originally bred at the farms, that had fled into the wild through
errors in the past. They became exposed to hex magic and developed a wild
behaviour that meant they had to be exterminated.
   EOS
   str[2] = <<-EOS #ゴースト
A cult who developed a craving for the theivery of ones possessions
meant trouble for travellers. Proceed with caution through mountainous 
regieons for these ruffians are most like to carry out their deeds here.
   EOS
   str[3] = <<-EOS #ゴースト
It is unsure whether these beasts belong to the feline or canine species. 
They are a manifestation of magic, within the ranks of fairies and unicorns 
of myth.
   EOS
   str[4] = <<-EOS #ゴースト
Aquatic beasts with a taste for the entoxicated Hex-Fish Pirahn gave Drench 
Beasts a similar narcotic behaviour. They can only focus on one prey at a 
time, entangling the victim in its knarled tentacles.
   EOS
   str[5] = <<-EOS #ゴースト
A wild canine that always travels in packs, it will attempt to hunt and kill
as a team rather than alone. Humans have underestimated the Wargs smarts and
has became its food as a concequence.
   EOS
   str[6] = <<-EOS #ゴースト
A woman with a sharp tounge and a fitting blade that possesses strange 
fire-like attributes.
   EOS
   str[7] = <<-EOS #ゴースト
Eyerus are extremely dangerous large forms of virus that attack and sap 
its target, corrupting the host and allowing Eyerus to take a larger form.
Any seen targets or those infected by the Eyerus have been ordered executed.
   EOS
   str[8] = <<-EOS #ゴースト
As the name says, it is a venomous species of snake. Handle with care, as if
you are to be bitten, curative resources for this particular poison are hard
to come by.
   EOS
   str[9] = <<-EOS #ゴースト
Rejects from experiments that allow humans to transform into alternate beings.
No successful method has yet been developed. 
   EOS
   str[10] = <<-EOS #ゴースト
Another type of parasite, not as potentially dangerous as Iris, but is armed 
with a set of venomous tentacles. It was originally a standard caterpillar,
but grew and mutated due to high hex exposure.
   EOS
   str[11] = <<-EOS #ゴースト
Another victim of the deadly hex, fallen commanders who have either been taken
over by an Iris or fallen into dangerous territory, these fallen beings now
only seek death of others. Some have even tried killing each other.
   EOS
   str[12] = <<-EOS #ゴースト
Grifferon are very protective over territory, despite their size they are not
overly powerful. They reside mainly in the exotic jungle of Utocrush as the
climate is warm.
   EOS
   str[13] = <<-EOS #ゴースト
Another beast that basks in the jungle of Utocrush, and many other large 
forests. It is nowhere near as dangerous as Poison in terms of venom 
and there are many kinds of cures and ailments.
   EOS
   str[14] = <<-EOS #ゴースト
Nightwinger are the second most common beasts that reside in the world, 
next to the Invader. Like Invaders, Nightwingers are seen as pests. People 
tend to also call them 'Pidgeons of the Night'.
   EOS
   str[15] = <<-EOS #ゴースト
Invader are the most common creatures in the world. They are seen nothing 
more than pests. Soldiers are assigned to shoot them as a part of basic 
training.
   EOS

   M_BOOK_COMMENT = str
end

 

 

str[n] relates to the ID number of the monster in the beastry. For my sake, come up with your own descriptions or I will come at you with a flaming mace :)

that script is good but can you give me a quick guide to how to add monsters using the script since i have no clue?

Share this post


Link to post
Share on other sites

that script is good but can you give me a quick guide to how to add monsters using the script since i have no clue?

 

Hit space under EOS and paste this

The str[] relates to the string number, or in simpler terms the number ID of the monster in the beastry. So say if we wanted a ghost in our beastry (if you use the defaults as an example) it would be str[1]

 

    str[16] = <<-EOS #ゴースト
Description must go here. It can't be longer than 3 lines and the 
text cut-off applies here as well.
   EOS

 

So it would fit in like this:

 

...etc (Don't copy and paste this into your script window x3)
   str[13] = <<-EOS #ゴースト
Another beast that basks in the jungle of Utocrush, and many other large 
forests. It is nowhere near as dangerous as Poison in terms of venom 
and there are many kinds of cures and ailments.
   EOS
   str[14] = <<-EOS #ゴースト
Nightwinger are the second most common beasts that reside in the world, 
next to the Invader. Like Invaders, Nightwingers are seen as pests. People 
tend to also call them 'Pidgeons of the Night'.
   EOS
   str[15] = <<-EOS #ゴースト
Invader are the most common creatures in the world. They are seen nothing 
more than pests. Soldiers are assigned to shoot them as a part of basic 
training.
   EOS
   str[13] = <<-EOS #ゴースト
Another beast that basks in the jungle of Utocrush, and many other large 
forests. It is nowhere near as dangerous as Poison in terms of venom 
and there are many kinds of cures and ailments.
   EOS
   str[14] = <<-EOS #ゴースト
Nightwinger are the second most common beasts that reside in the world, 
next to the Invader. Like Invaders, Nightwingers are seen as pests. People 
tend to also call them 'Pidgeons of the Night'.
   EOS
   str[15] = <<-EOS #ゴースト 
Invader are the most common creatures in the world. They are seen nothing 
more than pests. Soldiers are assigned to shoot them as a part of basic 
training.
   EOS
# So this is were it would fit see? Straight under EOS.
   str[16] = <<-EOS #ゴースト
Description must go here. It can't be longer than 3 lines and the 
text cut-off applies here as well.
EOS
#Make sure EOS is at the bottom as well.

   M_BOOK_COMMENT = str
end
   M_BOOK_COMMENT = str
end

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...