dsiver144

DSI Bestiary v1.3

May 14th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.08 KB | None | 0 0
  1. #==============================================================================
  2. # DSI Bestiary v1.3
  3. # -- Last Updated: 2017.03.29
  4. # -- Author: dsiver144
  5. # -- Level: Normal
  6. # -- Requires: n/a
  7. # -- Conmission for: Luke / Golden Unicorn Gaming
  8. #==============================================================================
  9. $imported = {} if $imported.nil?
  10. $imported["DSI-Bestiary"] = true
  11. #==============================================================================
  12. # + Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2017.03.12 - Finish first version.
  15. # 2017.03.15 - Fix encounter issues & Add notetag to rearrange enemy in bestiary
  16. # 2017.03.29 - Add a notetag for zero luk.
  17. # 2017.05.15 - Fix a small error.
  18. #==============================================================================
  19. # + Instructions
  20. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  21. # To install this script, open up your script editor and copy/paste this script
  22. # to an open slot below ▼ Materials but above ▼ Main. Remember to save.
  23. # Put this below "Sixth Menu Add Ons"! <- IMPORTANT!
  24. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  25. # Script Call:
  26. # SceneManager.call(Scene_DSI_Bestiary) -> Open Bestiary Scene
  27. # reveal_beast(id) -> Reveal an enemy from Database.
  28. # can_upgrade_bestiary? -> Use in conditional branches for checking if player
  29. # can upgrade bestiary
  30. # upgrade_bestiary -> Upgrade bestiary.
  31. # -----------------------------------------------------------------------------
  32. # Notetags:
  33. # <hide_from_list> : Hide enemy from Bestiary List
  34. # <bestiary_level: x> : This enemy will be in the list if x <= bestiary
  35. # level
  36. # <bestiary_type: st> : Define enemy type. ex <bestiary_type: Rare>
  37. # <bestiary_diff: st> : Define enemy difficulty. ex: <bestiary_diff: Hard>
  38. # <bestiary_id: x> : Manually Set bestiary ID for an enemy.
  39. # if you don't set. Bestiary ID will equal to its id from
  40. # database.
  41. # <zero_luk> : Allow zero luk for monster.
  42. #==============================================================================
  43. module DSIVER144
  44. module BESTIARY
  45.  
  46. COMMAND_NAME = "Bestiary"
  47. NO_DATA_PIC = "QuestionMark" # Located in Graphics/System Folder
  48. NO_DATA_TEXT = "NO DATA"
  49. GENERAL_INFO_TEXT = "General Info"
  50. DEBUG_MODE = true # Check duplicated bestiary ID
  51.  
  52. TOKENS = {}
  53. TOKENS[1] = /<hide_from_list>/i
  54. TOKENS[2] = /<bestiary_level:\s*(\d+)>/i
  55. TOKENS[3] = /<bestiary_type:\s*(.+)>/i
  56. TOKENS[4] = /<bestiary_diff:\s*(.+)>/i
  57. TOKENS[5] = /<bestiary_bg:\s*(.+)>/i
  58. TOKENS[6] = /<add_bestiary_skill:\s*(.+)>/i
  59. TOKENS[7] = /<bestiary_id:\s*(\d+)>/i
  60. TOKENS[8] = /<zero_luk>/i
  61. #------------------------------------------------------------------------
  62. # * new method: count_bestiary_size
  63. #------------------------------------------------------------------------
  64. def self.count_bestiary_size
  65. return get_bestiary_list.size - 1
  66. end
  67. #------------------------------------------------------------------------
  68. # * new method: get_complete
  69. #------------------------------------------------------------------------
  70. def self.get_complete
  71. list = get_bestiary_list
  72. size = 0
  73. list.each do |enemy|
  74. next if enemy.nil?
  75. if $game_system.bestiary_list.include?(enemy.id)
  76. size += 1
  77. end
  78. end
  79. return size
  80. end
  81. #------------------------------------------------------------------------
  82. # * new method: reveal_beast
  83. #------------------------------------------------------------------------
  84. def self.reveal_beast(id)
  85. return if $data_enemies[id].nil?
  86. return if $game_system.bestiary_list.include?(id)
  87. $game_system.bestiary_list << id
  88. end
  89. #------------------------------------------------------------------------
  90. # * new method: get_bestiary_list
  91. #------------------------------------------------------------------------
  92. def self.get_bestiary_list
  93. _list = []
  94. $data_enemies.each do |enemy|
  95. if enemy && enemy.bestiary_level <= $game_system.bestiary_level && !enemy.hideFromBestiaryList && enemy.name.size > 0
  96. _list << enemy
  97. end
  98. end
  99. _list.sort! {|a,b| a.bestiaryID <=> b.bestiaryID}
  100. _list.unshift(nil)
  101. end
  102.  
  103. end # BESTIARY
  104.  
  105. end # DSIVER144
  106.  
  107. class Game_Interpreter
  108. alias_method(:dsiver_battle_processing_alias, :command_301)
  109. #--------------------------------------------------------------------------
  110. # * new method: reveal_beast
  111. #--------------------------------------------------------------------------
  112. def reveal_beast(id)
  113. DSIVER144::BESTIARY.reveal_beast(id)
  114. end
  115. #--------------------------------------------------------------------------
  116. # * new method: can_upgrade_bestiary?
  117. #--------------------------------------------------------------------------
  118. def can_upgrade_bestiary?
  119. return DSIVER144::BESTIARY.get_complete >= DSIVER144::BESTIARY.count_bestiary_size
  120. end
  121. #--------------------------------------------------------------------------
  122. # * new method: upgrade_bestiary
  123. #--------------------------------------------------------------------------
  124. def upgrade_bestiary
  125. $game_system.bestiary_level += 1 if can_upgrade_bestiary?
  126. end
  127. #--------------------------------------------------------------------------
  128. # * Battle Processing
  129. #--------------------------------------------------------------------------
  130. def command_301
  131. dsiver_battle_processing_alias
  132. if @params[0] == 0 # Direct designation
  133. troop_id = @params[1]
  134. elsif @params[0] == 1 # Designation with variables
  135. troop_id = $game_variables[@params[1]]
  136. else # Map-designated troop
  137. troop_id = $game_player.make_encounter_troop_id
  138. end
  139. if $data_troops[troop_id]
  140. $data_troops[troop_id].members.each do |member|
  141. DSIVER144::BESTIARY.reveal_beast(member.enemy_id)
  142. end
  143. end
  144. end
  145. end # Game_Interpreter
  146.  
  147. class Scene_DSI_Bestiary < Scene_Base
  148. #--------------------------------------------------------------------------
  149. # * Start Processing
  150. #--------------------------------------------------------------------------
  151. def start
  152. super
  153. create_background
  154. create_main_windows
  155. init_cursors
  156. end
  157. #--------------------------------------------------------------------------
  158. # * Termination Processing
  159. #--------------------------------------------------------------------------
  160. def terminate
  161. super
  162. dispose_background
  163. end
  164. #--------------------------------------------------------------------------
  165. # * Create Background
  166. #--------------------------------------------------------------------------
  167. def create_background
  168. @background_sprite = Sprite.new
  169. @background_sprite.bitmap = SceneManager.background_bitmap
  170. @background_sprite.color.set(16, 16, 16, 128)
  171. end
  172. #--------------------------------------------------------------------------
  173. # * Free Background
  174. #--------------------------------------------------------------------------
  175. def dispose_background
  176. @background_sprite.dispose
  177. @beast_sprite.bitmap.dispose
  178. @beast_sprite.dispose
  179. end
  180. #--------------------------------------------------------------------------
  181. # * new method: create_main_windows
  182. #--------------------------------------------------------------------------
  183. def create_main_windows
  184. @bestiary_list = DSIVER144::BESTIARY.get_bestiary_list
  185. @current_index = 1
  186. @title_window = Bestiary_Title_Window.new(0,0,250,48)
  187. @title_window.z = 10
  188. @title_window.draw(@current_index)
  189. ww = Graphics.width - @title_window.width
  190. wh = Graphics.height
  191. @info_window = Bestiary_Info_Window.new(@title_window.width,0,ww,wh)
  192. @info_window.z = 10
  193. wy = Graphics.height - 48
  194. ww = Graphics.width - @info_window.width
  195. @progress_window = Window_Base.new(0,wy,ww,48)
  196. @progress_window.z = 10
  197. cw = @progress_window.contents_width
  198. progress = sprintf("Completed: %03d/%03d", DSIVER144::BESTIARY.get_complete, @bestiary_list.size - 1)
  199. @progress_window.draw_text(0,0,cw,24,progress,1)
  200. @beast_sprite = Sprite.new
  201. @beast_sprite.z = 0
  202. refresh_windows
  203. end
  204. #--------------------------------------------------------------------------
  205. # * new method: refresh_background
  206. #--------------------------------------------------------------------------
  207. def refresh_background # Not use yet!
  208. if is_revealed?
  209. enemy = $data_enemies[@current_index]
  210. end
  211. end
  212. #--------------------------------------------------------------------------
  213. # * new method: refresh_background
  214. #--------------------------------------------------------------------------
  215. def is_revealed?
  216. return false if @bestiary_list[@current_index].nil?
  217. return $game_system.bestiary_list.include?(@bestiary_list[@current_index].id)
  218. end
  219. #--------------------------------------------------------------------------
  220. # * new method: refresh_sprite
  221. #--------------------------------------------------------------------------
  222. def refresh_sprite
  223. if is_revealed?
  224. enemy = @bestiary_list[@current_index]
  225. @beast_sprite.bitmap = Cache.battler(enemy.battler_name,enemy.battler_hue)
  226. correct_sprite_xy
  227. else
  228. @beast_sprite.bitmap = Cache.system(DSIVER144::BESTIARY::NO_DATA_PIC)
  229. correct_sprite_xy
  230. end
  231. end
  232. #--------------------------------------------------------------------------
  233. # * new method: init_cursors
  234. #--------------------------------------------------------------------------
  235. def init_cursors
  236. @cursors = {}
  237. pad = AstoriaMenuAddons::Misc[:eq_cursor][:padding]
  238. yo = (Graphics.height - 24)*0.5#AstoriaMenuAddons::Misc[:eq_cursor][:y]
  239. [:left,:right].each_with_index do |type,i|
  240. @cursors[type] = WinCursor.new(@info_window.windowskin,@info_window.z,type)
  241. case type
  242. when :left
  243. xx = pad
  244. when :right
  245. xx = @info_window.x + @info_window.width - @cursors[type].size[:w] - pad
  246. end
  247. yy = yo
  248. @cursors[type].set_ori_pos(xx,yy)
  249. end
  250. end
  251. #--------------------------------------------------------------------------
  252. # * new method: correct_sprite_xy
  253. #--------------------------------------------------------------------------
  254. def correct_sprite_xy
  255. @sprite_offset_x = @beast_sprite.bitmap.width / 2
  256. @sprite_offset_y = @beast_sprite.bitmap.height / 2
  257. @beast_sprite.ox = @sprite_offset_x
  258. @beast_sprite.oy = @sprite_offset_y
  259. @beast_sprite.x = (@title_window.width - @beast_sprite.bitmap.width) * 0.5
  260. @beast_sprite.x += @sprite_offset_x
  261. y = @title_window.height + ((Graphics.height - 48*2) - @beast_sprite.bitmap.height) * 0.5
  262. @beast_sprite.y = y
  263. @beast_sprite.y += @sprite_offset_y
  264. end
  265. #--------------------------------------------------------------------------
  266. # * new method: refresh_windows
  267. #--------------------------------------------------------------------------
  268. def refresh_windows
  269. @title_window.draw(@current_index)
  270. @info_window.draw(@current_index,is_revealed?,@bestiary_list)
  271. refresh_sprite
  272. end
  273. #--------------------------------------------------------------------------
  274. # * new method: update_input
  275. #--------------------------------------------------------------------------
  276. def update_input
  277. if Input.repeat?(:RIGHT)
  278. Sound.play_cursor
  279. @current_index += 1
  280. if @current_index > @bestiary_list.size - 1
  281. @current_index = 1
  282. end
  283. refresh_windows
  284. end
  285. if Input.repeat?(:LEFT)
  286. Sound.play_cursor
  287. @current_index -= 1
  288. if @current_index < 1
  289. @current_index = @bestiary_list.size - 1
  290. end
  291. refresh_windows
  292. end
  293. end
  294. #--------------------------------------------------------------------------
  295. # * new method: update
  296. #--------------------------------------------------------------------------
  297. def update
  298. super
  299. update_input
  300. @cursors.each_value {|curs| curs.update} if @cursors
  301. return_scene if Input.trigger?(:B)
  302. end
  303. end
  304.  
  305. class Bestiary_Info_Window < Window_Base
  306. attr_accessor :mode
  307. attr_accessor :toggle_on
  308. attr_accessor :current_index
  309. #--------------------------------------------------------------------------
  310. # * new method: draw
  311. #--------------------------------------------------------------------------
  312. def draw(index,revealed,list)
  313. contents.clear
  314. @toggle_on = revealed
  315. @list = list
  316. @mode = 0
  317. @current_index = index
  318. @drop_items = nil
  319. draw_reveal(index) if revealed
  320. draw_unreveal if !revealed
  321. end
  322. #--------------------------------------------------------------------------
  323. # * new method: draw_reveal
  324. #--------------------------------------------------------------------------
  325. def draw_reveal(index)
  326. contents.clear
  327. enemy = @list[index]
  328. battler = Game_Enemy.new(0,enemy.id)
  329. cw = contents_width
  330. change_color(text_color(2))
  331. draw_text(0,0,cw,24,enemy.name,1)
  332. x = 0; y = 24;
  333. draw_param(Vocab.param(0),battler.param_base(0),x,y,cw/2)
  334. draw_param(Vocab.param(1),battler.param_base(1),cw/2,y,cw/2)
  335. y += 24
  336. draw_param(Vocab.param(2),battler.param_base(2),x,y,cw/2)
  337. draw_param(Vocab.param(3),battler.param_base(3),cw/2,y,cw/2)
  338. y += 24
  339. draw_param(Vocab.param(4),battler.param_base(4),x,y,cw/2)
  340. draw_param(Vocab.param(5),battler.param_base(5),cw/2,y,cw/2)
  341. y += 24
  342. draw_param(Vocab.param(6),battler.param_base(6),x,y,cw/2)
  343. draw_param(Vocab.param(7),battler.param_base(7),cw/2,y,cw/2)
  344. y += 24
  345. names = AstoriaMenuAddons::Vocab[:xparams]
  346. xparam = [7,8,6,1]
  347. draw_param(names[7],(battler.xparam(7)*100).to_i.to_s + "%",x,y,cw/2)
  348. draw_param(names[8],(battler.xparam(8)*100).to_i.to_s + "%",cw/2,y,cw/2)
  349. y += 24
  350. draw_param(names[6],(battler.xparam(6)*100).to_i.to_s + "%",x,y,cw/2)
  351. draw_param(names[1],(battler.xparam(1)*100).to_i.to_s + "%",cw/2,y,cw/2)
  352. count_i = 0
  353. AstoriaMenuAddons::Vocab[:elements].each_pair do |id,icon_index|
  354. value = battler.element_rate(id)
  355. if count_i % 2 == 0
  356. y += 24
  357. draw_elements(icon_index,value,x,y,cw/2)
  358. else
  359. draw_elements(icon_index,value,cw/2,y,cw/2)
  360. end
  361. count_i += 1
  362. end
  363. change_color(text_color(2))
  364. y += 24
  365. draw_text(x,y+2,cw,24,DSIVER144::BESTIARY::GENERAL_INFO_TEXT,1)
  366. y += 26
  367. draw_param("Type: ", enemy.enemyType, x, y, cw)
  368. y += 24
  369. draw_param("Difficulty: ", enemy.enemyDifficulty, x, y, cw); y += 24
  370. if @drop_items
  371. @drop_items.push(@drop_items.shift) if Graphics.frame_count % 2 == 0
  372. else
  373. @drop_items = make_drop_items(enemy,battler)
  374. end
  375. if @drop_items && @drop_items.size > 0 && @drop_items[0]
  376. draw_param("Drops: ", "", x, y, cw)
  377. x_plus = x + text_size("Drops: ").width
  378. draw_item(@drop_items[0].icon_index,@drop_items[0].name,x,y,cw)
  379. else
  380. draw_param("Drops: ", "None", x, y, cw)
  381. end
  382. y += 24;
  383. draw_param("Gold: ", enemy.gold, x, y, cw/2)
  384. draw_param("EXP: ", enemy.exp, cw/2, y, cw/2)
  385. end
  386. #--------------------------------------------------------------------------
  387. # * new method: draw_skill
  388. #--------------------------------------------------------------------------
  389. def draw_item(icon_index,name,x,y,width)
  390. change_color(normal_color)
  391. icon_x = width - text_size(name).width - 24 - 8
  392. draw_icon(icon_index,icon_x,y)
  393. draw_text(x+8,y,width - 12,24,name,2)
  394. end
  395. #--------------------------------------------------------------------------
  396. # * Create Array of Dropped Items
  397. #--------------------------------------------------------------------------
  398. def make_drop_items(enemy,battler)
  399. enemy.drop_items.inject([]) do |r, di|
  400. if di.kind > 0
  401. r.push(battler.item_object(di.kind, di.data_id))
  402. else
  403. r
  404. end
  405. end
  406. end
  407. #--------------------------------------------------------------------------
  408. # * new method: update
  409. #--------------------------------------------------------------------------
  410. def update
  411. super
  412. if @toggle_on && Graphics.frame_count % 60 == 0
  413. draw_reveal(@current_index)
  414. @mode = mode == 0 ? 1 : 0
  415. end
  416. end
  417. #--------------------------------------------------------------------------
  418. # * new method: draw_skill
  419. #--------------------------------------------------------------------------
  420. def draw_skill(name,x,y,width,align)
  421. change_color(normal_color)
  422. draw_text(x+8,y,width - 12,24,name,align)
  423. end
  424. #--------------------------------------------------------------------------
  425. # * new method: draw_elements
  426. #--------------------------------------------------------------------------
  427. def draw_elements(icon_index,value,x,y,width)
  428. draw_icon(icon_index,x+8,y)
  429. change_color(normal_color)
  430. vtxt = sprintf("%1.0f%",(1.0-value)*100)
  431. draw_text(x+8,y,width - 12,24,vtxt,2)
  432. end
  433. #--------------------------------------------------------------------------
  434. # * new method: draw_param
  435. #--------------------------------------------------------------------------
  436. def draw_param(name,value,x,y,width)
  437. change_color(system_color)
  438. draw_text(x+8,y,width - 12,24,name,0)
  439. change_color(normal_color)
  440. draw_text(x+8,y,width - 12,24,value,2)
  441. end
  442. #--------------------------------------------------------------------------
  443. # * new method: draw_unreveal
  444. #--------------------------------------------------------------------------
  445. def draw_unreveal
  446. contents.clear
  447. cw = contents_width
  448. draw_text(0,0,cw,24,"???????",1)
  449. draw_text(0,0,cw,contents_height,DSIVER144::BESTIARY::NO_DATA_TEXT,1)
  450. end
  451. end
  452.  
  453. class Bestiary_Title_Window < Window_Base
  454. #--------------------------------------------------------------------------
  455. # * new method: draw
  456. #--------------------------------------------------------------------------
  457. def draw(index)
  458. contents.clear
  459. size = DSIVER144::BESTIARY.count_bestiary_size
  460. draw_text(0,0,contents_width,24,sprintf("Bestiary %03d/%03d",index,size),1)
  461. end
  462. end # Bestiary_Title_Window
  463. #==============================================================================
  464. # DataManager
  465. #==============================================================================
  466. module DataManager
  467. #--------------------------------------------------------------------------
  468. # alias method: load_database
  469. #--------------------------------------------------------------------------
  470. class <<self; alias load_database_seal_item load_database; end
  471. def self.load_database
  472. load_database_seal_item
  473. load_notetags_enemy_bestiary
  474. end
  475. #--------------------------------------------------------------------------
  476. # Load Notetag Rental Weapons
  477. #--------------------------------------------------------------------------
  478. def self.load_notetags_enemy_bestiary
  479. index = 0
  480. @dup_ids = []
  481. for enemy in $data_enemies
  482. next if enemy.nil?
  483. enemy.load_bestiary_notetags
  484. next if enemy.bestiaryID < 0
  485. @dup_ids[enemy.bestiaryID] ||= []
  486. @dup_ids[enemy.bestiaryID].push([enemy.id,enemy.name])
  487. end
  488. if DSIVER144::BESTIARY::DEBUG_MODE && $TEST
  489. @dup_ids.each do |pack|
  490. next unless pack
  491. if pack.size > 1
  492. str = "[Need correction!] Has same bestiary ID: "
  493. pack.each do |enemy_info|
  494. str += "[#{enemy_info[0]} : #{enemy_info[1]}] "
  495. end
  496. msgbox_p(str)
  497. end
  498. end
  499. end
  500. end
  501. end # DataManager
  502.  
  503. class RPG::Enemy
  504. include DSIVER144
  505. attr_accessor :hideFromBestiaryList
  506. attr_accessor :specialSkills
  507. attr_accessor :enemyType
  508. attr_accessor :enemyDifficulty
  509. attr_accessor :bestiary_level
  510. attr_accessor :bestiary_skills
  511. attr_accessor :bestiaryID
  512. attr_accessor :no_luk
  513. #--------------------------------------------------------------------------
  514. # * new method: load_bestiary_notetags
  515. #--------------------------------------------------------------------------
  516. def load_bestiary_notetags
  517. @hideFromBestiaryList = false
  518. @specialSkills = []
  519. @enemyType = "---"
  520. @enemyDifficulty = "---"
  521. @bestiary_level = 1
  522. @bestiary_bg = []
  523. @bestiary_skills = []
  524. @bestiaryID = self.name.size == 0 ? -self.id : self.id
  525. @no_luk = false
  526. self.note.split(/[\r\n]+/).each do |line|
  527. case line
  528. when BESTIARY::TOKENS[1]
  529. @hideFromBestiaryList = true
  530. @bestiaryID = -self.id
  531. break
  532. when BESTIARY::TOKENS[2]
  533. @bestiary_level = $1.to_i
  534. when BESTIARY::TOKENS[3]
  535. @enemyType = $1.to_s
  536. when BESTIARY::TOKENS[4]
  537. @enemyDifficulty = $1.to_s
  538. when BESTIARY::TOKENS[5]
  539. if $1.include?(",")
  540. $1.split(",").each do |name|
  541. @bestiary_bg << name
  542. end
  543. else
  544. @bestiary_bg[0] = $1
  545. end
  546. when BESTIARY::TOKENS[6]
  547. name = $1.clone
  548. if $1 =~ /(\d+)/
  549. @bestiary_skills << $data_skills[$1.to_i].name
  550. else
  551. @bestiary_skills << name
  552. end
  553. when BESTIARY::TOKENS[7]
  554. @bestiaryID = $1.to_i
  555. when BESTIARY::TOKENS[8]
  556. @no_luk = true
  557. end
  558. end # loop end
  559. end # load_bestiary_notetags
  560. end # RPG::Enemy
  561.  
  562. class Game_System
  563. attr_accessor :bestiary_list
  564. attr_accessor :bestiary_level
  565. alias_method(:dsi_bestiary_init_z, :initialize)
  566. #--------------------------------------------------------------------------
  567. # * new method: initialize
  568. #--------------------------------------------------------------------------
  569. def initialize
  570. @bestiary_list = []
  571. @bestiary_level = 1
  572. dsi_bestiary_init_z
  573. end
  574. end # Game_System
  575.  
  576. class Game_Enemy
  577. #--------------------------------------------------------------------------
  578. # * Get Base Value of Parameter
  579. #--------------------------------------------------------------------------
  580. def param_base(param_id)
  581. if $data_enemies[@enemy_id].no_luk && param_id == 7
  582. return 0
  583. else
  584. enemy.params[param_id]
  585. end
  586. end
  587. #--------------------------------------------------------------------------
  588. # * Get Parameter
  589. #--------------------------------------------------------------------------
  590. alias_method(:dsi_param_bestiary, :param)
  591. def param(param_id)
  592. return_value = dsi_param_bestiary(param_id)
  593. if $data_enemies[@enemy_id].no_luk && param_id == 7
  594. return 0
  595. end
  596. return return_value
  597. end
  598. end
  599.  
  600. class Game_Player
  601. #--------------------------------------------------------------------------
  602. # * overwrite method: encounter
  603. #--------------------------------------------------------------------------
  604. def encounter
  605. return false if $game_map.interpreter.running?
  606. return false if $game_system.encounter_disabled
  607. return false if @encounter_count > 0
  608. make_encounter_count
  609. troop_id = make_encounter_troop_id
  610. return false unless $data_troops[troop_id]
  611. $data_troops[troop_id].members.each do |member|
  612. DSIVER144::BESTIARY.reveal_beast(member.enemy_id)
  613. end
  614. BattleManager.setup(troop_id)
  615. BattleManager.on_encounter
  616. return true
  617. end
  618. end # Game_Player
  619.  
  620. class Window_MenuCommand
  621. alias_method(:dsi_bestiary_add_original_commands, :add_original_commands)
  622. #--------------------------------------------------------------------------
  623. # * For Adding Original Commands
  624. #--------------------------------------------------------------------------
  625. def add_original_commands
  626. dsi_bestiary_add_original_commands
  627. add_command(DSIVER144::BESTIARY::COMMAND_NAME, :bestiary)
  628. end
  629. end # Window_Command
  630.  
  631. class Scene_Menu
  632. alias_method(:dsi_bestiary_create_command_window, :create_command_window)
  633. #--------------------------------------------------------------------------
  634. # * alias method: create_command_window
  635. #--------------------------------------------------------------------------
  636. def create_command_window
  637. dsi_bestiary_create_command_window
  638. @command_window.set_handler(:bestiary, method(:command_bestiary))
  639. end
  640. #--------------------------------------------------------------------------
  641. # * new method: command_bestiary
  642. #--------------------------------------------------------------------------
  643. def command_bestiary
  644. SceneManager.call(Scene_DSI_Bestiary)
  645. end
  646. end # Scene_Menu
  647. #===============================================================================
  648. # * END OF FILE
  649. #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment