Advertisement
dsiver144

DSI Bestiary v1.02

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