Advertisement
luistop12

Bestiary MOD

Dec 22nd, 2014
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 97.01 KB | None | 0 0
  1. #===============================================================================
  2. #
  3. # Yanfly Engine RD - Bestiary + Display Scanned Enemy
  4. # Last Date Updated: 2009.06.13
  5. # Level: Easy, Normal, Hard, Lunatic
  6. #
  7. # Similar to the Display Skill Query script, I've made one for enemies. This was
  8. # mostly to replace my Display Target Data script, considering it didn't display
  9. # much data at all about the target. This one was also made on the account of
  10. # making a proper scan skill property in addition to different parts of enemy
  11. # data that it can scan.
  12. #
  13. # I've disliked scan systems where you would have to keep rescanning an enemy
  14. # to see its HP, MP, etc. It felt counterproductive on the player side since
  15. # valuable turns are wasted just to view some numbers. This system allows you to
  16. # pull up enemy data upon enemy selection (where I believe it matters most).
  17. # After all, providing convenience for the player is absolutely important since
  18. # it reduces metagaming, which is something that should never have to happen
  19. # for an RPG Maker project.
  20. #
  21. # For the users who fear giving too much information to their players, users can
  22. # disable parts of the script and prevent certain pages from appear at all. You
  23. # can limit how much and how little you want to show your players through <hide>
  24. # tags, too, for the enemies' noteboxes.
  25. #
  26. # Since the May 27th update, a bestiary option is created for the main menu.
  27. # You can access this menu and view all of the scanned data from the enemies
  28. # you've discovered. This option is accessible once the bestiary switch is on.
  29. #
  30. #===============================================================================
  31. # Updates:
  32. # ----------------------------------------------------------------------------
  33. # o 2009.06.10 - Compatibility added for Enemy Level Control.
  34. # o 2009.06.09 - Small fix to bestiary calculation for not requiring scan.
  35. # o 2009.05.27 - Bestiary added.
  36. # Monsters can now have more than one boss type.
  37. # o 2009.04.27 - MAJOR BUGFIX: Fixed a save game corrupting bug.
  38. # o 2009.04.21 - Finished and publicized.
  39. # o 2009.04.20 - Started script.
  40. #===============================================================================
  41. # How to Use: Normal Mode
  42. #===============================================================================
  43. #
  44. # To access the bestiary, make sure the switch governing the bestiary option
  45. # is on. Otherwise, it will not show. The bestiary will be accessible by default
  46. # at the start of a new game.
  47. #
  48. # ----------------------------------------------------------------------------
  49. # Placing these tags into a skill's notebox will reveal specific scan data. The
  50. # scan data will appear for all enemies of the same enemy type, but each indi-
  51. # vidual enemy will still possess their own modifiers.
  52. #
  53. # <scan whole>
  54. # Causes the skill to unlock all scan data about the target enemy.
  55. #
  56. # <scan hp mp>
  57. # Causes the skill to unlock only the HP and MP portion of the enemy data.
  58. # Note that even if HP and MP were unscanned, the gauge bars will still move up
  59. # and down as to give the player a general idea of how much health the enemy has
  60. # before giving the player more accurate information.
  61. #
  62. # <scan stats>
  63. # Causes the skill to unlock the ADSA and HECO stats for the target enemy scan
  64. # data. On the HECO stats side, you can hide certain stats from appear. Odds is
  65. # hidden by default with this script.
  66. #
  67. # <scan skills>
  68. # Causes the skill to unlock the skill page for the target enemy scan data. This
  69. # will list all of the skills the enemy will use in battle. Duplicate skills are
  70. # condensed and removed from the listing.
  71. #
  72. # <scan elements>
  73. # Causes the skill to unlock the elements page for the target enemy data. This
  74. # provides a chart of the enemy's elemental affinities as to what will damage
  75. # the enemy more or less.
  76. #
  77. # <scan status effects> or <scan states>
  78. # Causes the skill to unlock the status effects page for the target enemy data.
  79. # Like the elements page, this provides a listing of status effect chances to
  80. # occur for the enemy.
  81. #
  82. # <scan steal>
  83. # Only appears if you have KGC Steal. This page will reveal information about
  84. # items that can be stolen form the enemy along with their steal rates.
  85. #
  86. # <scan spoils>
  87. # Causes a skill to unlock the experience, gold, encounters page for target
  88. # enemy data. This is pretty much stuff that comes out of an enemy after a
  89. # battle is over. Can include drops (optional).
  90. #
  91. # <scan drops>
  92. # Causes a skill to unlock the drops page. Use this if you use KGC's Extra Drops
  93. # and if your enemies have huge drop lists. This will display way more.
  94. #
  95. # <scan description>
  96. # Causes a skill to unlock the extra description page where you can make your
  97. # own custom notes. Note that if you don't alter the Lunatic mode hash down
  98. # below, even if you scan the enemy, the extra page won't show unless there is
  99. # something to be shown.
  100. #
  101. #===============================================================================
  102. # How to Use: Hard Mode
  103. #===============================================================================
  104. #
  105. # <boss type x> or <boss type x,x>
  106. # This will determine the boss types available for that enemy. Boss types will
  107. # categorize enemies differently in the bestiary and also display certain parts
  108. # of the scan data differently.
  109. #
  110. # For those that would like to prevent certain pages from showing up on specific
  111. # enemies, you can use the following tags on those enemies to prevent those very
  112. # pages from appearing without completely disabling a part of the scan set.
  113. #
  114. # <hide whole>
  115. # Prevents everything from being shown at all for that enemy.
  116. #
  117. # <hide hp_mp>
  118. # Prevents HP and MP from being displayed for that enemy.
  119. #
  120. # <hide stats>
  121. # Prevents the ADSA and HECO stats from being displayed for that enemy.
  122. #
  123. # <hide skills>
  124. # Prevents skills from being displayed for that enemy.
  125. #
  126. # <hide elements>
  127. # Prevents element chart from being displayed for that enemy.
  128. #
  129. # <hide status effects> or <hide states>
  130. # Prevents status effect probability chart from being displayed for that enemy.
  131. #
  132. # <hide steal>
  133. # Prevents stolen items from being shown for that enemy.
  134. #
  135. # <hide spoils>
  136. # Prevents victory spoil information from being shown for that enemy.
  137. #
  138. # <hide drops>
  139. # Prevents drop information from being displayed for that enemy.
  140. #
  141. # If you might have noticed, there's no hide version for description. This is
  142. # because if you simply don't add the enemy extra notes description to the hash,
  143. # they won't appear at all. It's easier to manage that way instead.
  144. #
  145. #===============================================================================
  146. #
  147. # Compatibility
  148. # - Works With: KGC's ExtraDropItem, Steal
  149. # - Alias: Game_Battler, skill_effect
  150. # - Alias: Game_Enemy, initialize, transform, escape, perform_collapse
  151. # - Alias: Scene_Battle, create_info_viewport, update_target_enemy_selection
  152. #
  153. #===============================================================================
  154. # Credits:
  155. # KGC for Window_Command imports.
  156. #===============================================================================
  157.  
  158. $imported = {} if $imported == nil
  159. $imported["DisplayScannedEnemy"] = true
  160.  
  161. module YE
  162. module MENU
  163. module MONSTER
  164.  
  165. #------------------------------------------------------------------------
  166. # BESTIARY RELATED
  167. #------------------------------------------------------------------------
  168.  
  169. # The following will govern the rules which the bestiary scene will abide
  170. # by. Be sure to adjust it accordingly to your needs.
  171. BESTIARY_TITLE = "Bestiario" # The title which appears on the menu.
  172. BESTIARY_SWITCH = 117 # Which switch will enable this command?
  173. BESTIARY_LIST = "%s List" # Text which follows boss type.
  174. BESTIARY_MASK = "?" # Mask used for unknown enemies.
  175.  
  176. # The following is an array used to hide monsters from the bestiary.
  177. # Input the ID's of the monsters into the array if you wish to hide them.
  178. # By default, Swap Dummy Monsters are automatically hidden.
  179. HIDDEN_MONSTERS = [35]
  180.  
  181. # The following determines the order the monsters are displayed in. Note
  182. # that if you alphabetize the monster list, this will have no effect.
  183. BESTIARY_ORDER = [1...38]
  184.  
  185. # The following lets you govern the rules for displaying different
  186. # boss type categories.
  187. CATEGORIZE_TEXT = "Shift: Change Categories"
  188. CATEGORIZE_HELP = "Select a Category Type"
  189. CATEGORIZE_VIEW = "View %s"
  190. CATEGORIZE_BUTTON = Input::SHIFT
  191.  
  192. # The following adjusts the category data shown for the overall monster
  193. # book information.
  194. MENU_FONT_SIZE = 16
  195. BESTIARY_INFO = "Bestiary Information"
  196. TEXT_COMPLETION = "Bestiary Completion"
  197. RATE_COMPLETION = "%#.05g%%"
  198. ICON_COMPLETION = 141
  199. TEXT_DISCOVERED = "Total Discovered"
  200. ICON_DISCOVERED = 196
  201. TEXT_ENCOUNTERS = "Total Encounters"
  202. TEXT_DEFEATED = "Total Defeated"
  203. TEXT_ESCAPED = "Total Escaped"
  204. TEXT_TYPE_DIS = "%s Discovered"
  205. TEXT_TYPE_ENC = "%s Encountered"
  206. TEXT_TYPE_DEF = "%s Defeated"
  207. TEXT_TYPE_ESC = "%s Escaped"
  208.  
  209. #------------------------------------------------------------------------
  210. # SCAN WINDOW RELATED
  211. #------------------------------------------------------------------------
  212.  
  213. # This is the button pressed to trigger the enemy scan window in battle.
  214. ENEMY_SCAN_BUTTON = Input::A
  215.  
  216. # If this is set to true, you must use scan skills on an enemy type before
  217. # any data will be displayed at all.
  218. REQUIRE_SCAN = false
  219.  
  220. # This allows you to adjust the help info window's properties in battle.
  221. HELP_WINDOW_TX = "Shift ver información."
  222. HELP_WINDOW_ON = true # This turns the window on and off.
  223. HELP_WINDOW_X = 0 # This is where the X position is.
  224. HELP_WINDOW_Y = 0 # This is where the Y position is.
  225. HELP_WINDOW_W = 544 # This is what width the window is.
  226. HELP_WINDOW_O = 255 # This is the window's opacity level.
  227.  
  228. # This affects how you want the scan to appear.
  229. ENEMY_NAME = "Datos de %s"
  230.  
  231. # This displays the title information at the very top of the scan window.
  232. # Most of the strings are explained by the notes to the side.
  233. DATA_LEFT = "<<" # This appears if page can be moved back.
  234. DATA_PAGE1 = "Información" # This appears if only one page of info.
  235. DATA_PAGES = "Pagina %d/%d" # This appears if more than one page of info.
  236. DATA_RIGHT = ">>" # This appears if page can move right.
  237. DATA_CATEGORY_COLOUR = 4 # This affects category text color.
  238.  
  239. # This is the sound played when flipping through the various pages.
  240. # Set it to nil if you don't want a sound to play.
  241. PAGE_SOUND = RPG::SE.new("Wind7", 80, 125)
  242.  
  243. # Set this to true if you would rather the scan display the page info
  244. # type rather than Page X/Y. The titles following correspond to the pages'
  245. # titles should you decide to display them.
  246. REPLACE_PAGE_MSG = false
  247. TITLE_UNKNOWN = "¿¿¿???"
  248.  
  249. # This affects the information shown on the first page of the scan.
  250. # The first page shows HP, general stats, and states if the enemy is
  251. # under the effects of any.
  252. SHOW_GENERAL = false
  253. TITLE_GENERAL = "Datos Generales"
  254. GAUGE_HEIGHT = 9 # This affects the gauge height.
  255. EXHAUST_COLOUR = 7 # This adjusts the exhaustion color.
  256. FONT_SIZE = 16 # Sets font size for smaller text.
  257. HIDDEN_HP = "¿?" # If the enemy is unscanned or hides HP.
  258. HIDDEN_MP = "¿?" # If the enemy is unscanned or hides MP.
  259. DATA_STATES = "Parámetros" # Category for affected states.
  260. HIDDEN_STAT = "¿?" # If the enemy is unscanned or hides stats.
  261. DATA_ATK = "ATQ" # For attack.
  262. DATA_DEF = "DEF" # For defense.
  263. DATA_SPI = "CRI" # For spirit.
  264. DATA_AGI = "AGI" # For agility.
  265. DATA_HIT = "PUN" # For hit rate.
  266. HIDE_HIT = false # Set this to true if you wish to hide Hit.
  267. DATA_EVA = "EVA" # For evasion rate.
  268. HIDE_EVA = false # Set this to true if you wish to hide Eva.
  269. DATA_CRI = "CRI" # For critical rate.
  270. HIDE_CRI = false # Set this to true if you wish to hide Cri.
  271. DATA_ODDS = "LUK" # For odds value.
  272. HIDE_ODDS = true # Set this to true if you wish to hide Odds.
  273.  
  274. # The display types alter how HP and MP is shown for scanned enemies.
  275. # Type 1: Current HP
  276. # Type 2: Current HP/MaxHP
  277. # Type 3: Percentage of Current HP/MaxHP
  278. # The same goes for MP display type.
  279. HP_DISPLAY_TYPE = 2
  280. MP_DISPLAY_TYPE = 2
  281.  
  282. # Here you can control boss types and whatnot. To use boss types, add
  283. # the boss type category here and insert in the enemy's notebox the
  284. # <boss type x> tag. It will reference to this hash as to how to display
  285. # the following information: Boss Type Icon, HP Icon, HP color 1,
  286. # HP color 2, MP Icon, MP color 1, and MP color 2.
  287. BOSS_TYPES ={
  288. # Type => [Icon,HPIc,HPC1,HPC2,MPIc,MPC1,MPC2, Type Name, Pural]
  289. 0 => [ 118, 99, 20, 21, 100, 22, 23, "Monstruo", "Monstruos"],
  290. 1 => [ 112, 208, 18, 20, 209, 11, 22, "Jefe", "Jefes"],
  291. 2 => [ 157, 99, 20, 21, 100, 22, 23, "Mini Jefe", "Mini Jefes"],
  292. } # Do not remove this.
  293.  
  294. # This is for the bestiary and how you would like the order to appear.
  295. TYPE_ORDERING = [0, 2, 1]
  296.  
  297. # This is all of the icon information for the first page.
  298. ICON_HIGH = 142 # If a stat is higher than base stat.
  299. ICON_LOW = 143 # If a stat is lower than base stat.
  300. ICON_ATK = 2 # Icon for ATK
  301. ICON_DEF = 52 # Icon for DEF
  302. ICON_SPI = 21 # Icon for SPI
  303. ICON_AGI = 48 # Icon for AGI
  304. ICON_HIT = 135 # Icon for HIT
  305. ICON_EVA = 158 # Icon for EVA
  306. ICON_CRI = 119 # Icon for CRI
  307. ICON_ODDS = 137 # Icon for ODD
  308.  
  309. # This affects info displayed on the skill info page. Skills only appear
  310. # if the monster has those skills in its action list. Otherwise, this
  311. # page will not appear at all.
  312. SHOW_SKILLS = false
  313. TITLE_SKILLS = "Información de Artes"
  314. DATA_SKILLS = "Nombres de Artes"
  315. VIEW_SKILLS1 = "%d Arte"
  316. VIEW_SKILLS2 = "%d Artes"
  317.  
  318. # This affects info displayed for the element affinity info page.
  319. # Elements will only show if they are listed in the hash below.
  320. SHOW_ELEMENTS = false
  321. TITLE_ELEMENTS = "Afinidad Elemental"
  322. ICON_E_RATE_U = 9 # Icon used for unknown element rates.
  323. ICON_E_RATE_Z = 96 # Icon used for element rate Z.
  324. ICON_E_RATE_A = 99 # Icon used for element rate A.
  325. ICON_E_RATE_B = 99 # Icon used for element rate B.
  326. ICON_E_RATE_C = 102 # Icon used for element rate C.
  327. ICON_E_RATE_D = 101 # Icon used for element rate D.
  328. ICON_E_RATE_E = 100 # Icon used for element rate E.
  329. ICON_E_RATE_F = 103 # Icon used for element rate F.
  330. ELEMENT_HASH ={
  331. # These hashes allow you to construct various rows in the element page.
  332. # There's a maximum fit of 10 elements per row.
  333. "Physical Elements" => [
  334. # These are the element ID's.
  335. [1, 2, 3, 4, 8],
  336. # These are the element icons.
  337. [4684, 4753, 4791, 4754, 4767]
  338. ], # Next row
  339.  
  340. "Magical Elements" => [
  341. # These are the element ID's.
  342. [5, 7, 9, 10, 11, 12, 13, 14, 15, 16],
  343. # These are the element icons.
  344. [4702, 4803, 4758, 4765, 4764, 4759, 4761, 4760, 4762, 4766]
  345. ], # Next row
  346.  
  347. } # Do not remove this.
  348.  
  349. # This affects info displayed for the status effect probability page.
  350. # Status effect will only show if they're listed in the hash below.
  351. SHOW_STATES = false
  352. TITLE_STATES = "Efectividad Elemental"
  353. ICON_S_RATE_U = 94 # Icon used for unknown status rates.
  354. ICON_S_RATE_Z = 96 # Icon used for status rate Z.
  355. ICON_S_RATE_A = 99 # Icon used for status rate A.
  356. ICON_S_RATE_B = 99 # Icon used for status rate B.
  357. ICON_S_RATE_C = 102 # Icon used for status rate C.
  358. ICON_S_RATE_D = 101 # Icon used for status rate D.
  359. ICON_S_RATE_E = 100 # Icon used for status rate E.
  360. ICON_S_RATE_F = 103 # Icon used for status rate F.
  361. STATES_HASH ={
  362. # These hashes allow you to construct various rows in the states page.
  363. # There's a maximum fit of 10 states per row.
  364. "Conditions" => [ 2, 3, 4, 5, 6, 7, 8],
  365. "Buffs" => [ 9, 10, 11, 12],
  366. "Debuffs" => [13, 14, 15, 16],
  367. } # Do not remove this.
  368.  
  369. # The following portion requires KGC's Steal script to show, but doesn't
  370. # affect the rest of this script. This page shows a list of stealable
  371. # goodies you can nab using KGC's Steal script.
  372. SHOW_STEAL = false
  373. TITLE_STEAL = "Steal Info"
  374. DATA_S_ITEM = "Item Name"
  375. DATA_S_CHANCE = "Rate"
  376.  
  377. # This affects info displayed for the spoils page. Note that you can
  378. # choose to activate this page if an enemy of a type dies.
  379. SHOW_SPOILS = false
  380. TITLE_SPOILS = "Victory Spoils"
  381. DEATH_SPOILS = false # Set to true if you wish to reveal spoils info
  382. # when an enemy dies.
  383. DATA_GOLD = "Gold" # Message used to indicate gold drop.
  384. VIEW_GOLD = "%d Gold" # How the gold gain will appear.
  385. ICON_GOLD = 205 # Icon used for gold drop.
  386. DATA_EXP = "EXP" # Message used to indicate experience gain.
  387. VIEW_EXP = "%d EXP" # How the exp gain will appear.
  388. ICON_EXP = 62 # Icon used for exp gain.
  389. DATA_ENCOUNTER = "Encounters" # Message used to indicate encounters.
  390. VIEW_ENC1 = "%d Time" # How the encounters will appear. Singular.
  391. VIEW_ENC2 = "%d Times" # How the encounters will appear. Plural.
  392. ICON_ENCOUNTER = 63 # Icon used for encounters.
  393. DATA_KILLED = "Defeated" # Message used to indicate defeats.
  394. VIEW_KILLED1 = "%d Kill" # How the defeats will appear. Singular.
  395. VIEW_KILLED2 = "%d Kills" # How the defeats will appear. Plural.
  396. ICON_KILLED = 157 # Icon used for defeats.
  397. DATA_ESCAPED = "Escaped" # Message used to indicate escapes.
  398. VIEW_ESCAPED1 = "%d Fled" # How the defeats will appear. Singular.
  399. VIEW_ESCAPED2 = "%d Fled" # How the defeats will appear. Plural.
  400. ICON_ESCAPED = 155 # Icon used for escapes.
  401. SPOIL_DROPS = false # Draw drops for the Spoils page?
  402. DATA_DROPS = "Drops" # Message used to indicate drops.
  403.  
  404. # For those that would like a separate page for drops, use this page.
  405. # This affects all of the information relative to drops anyway.
  406. SHOW_DROPS = false
  407. TITLE_DROPS = "Drops Info"
  408. DEATH_DROPS = false # Set to true if you wish to reveal spoils info
  409. # when an enemy dies.
  410. DATA_D_ITEM = "Drop Name"
  411. DATA_D_CHANCE = "Chance"
  412.  
  413.  
  414. # This affects the enemy notes section which requires Lunatic modifying.
  415. # This page can be about anything you want to write about.
  416. SHOW_NOTES = true
  417. TITLE_NOTES = "Notas"
  418. NOTE_PAGE_WIDTH = 240
  419. NOTE_PAGE_TEXT_SIZE = 16
  420. NOTE_PAGE_TEXT_COLOUR = 0
  421.  
  422. end # MONSTER
  423. end # MENU
  424. end # YE
  425.  
  426. #===============================================================================
  427. # How to Use: Lunatic Mode
  428. #===============================================================================
  429. #
  430. # This part allows you to input your own custom notes and whatnot. Custom notes
  431. # page will only appear for enemies that are listed in the note hash beneath the
  432. # Lunatic Mode section.
  433. #
  434. # The process is pretty simple. Just follow the template below.
  435. #
  436. # ENEMY_NOTES ={
  437. # enemy_id => "This would be the first line| and this would be the next!",
  438. # } # Do not remove this.
  439. #
  440. # Enter the enemy's ID number where "enemy_id" is. Following the "=>" input
  441. # the custom notes you'd like for that enemy to display. If you wish to add
  442. # line breaks to notes, add a | where you would like the break to appear. Now
  443. # while they do appear in the notebox, they are confined by the note page's
  444. # width and will shrink if the lines end up being too long. You can adjust the
  445. # note page's width in the part before the Lunatic Mode instructions.
  446. #
  447. #===============================================================================
  448.  
  449. module YE
  450. module HASH
  451.  
  452. ENEMY_NOTES ={
  453. 10 => "Vampires are mythological or|folkloric revenants who sub-|sist by feeding on the blood|of the living. In folkloric|tales, the undead vampires|often visited loved ones and|caused mischief or deaths in|the neighbourhoods they in-|habited when they were alive.",
  454. 1 => "Limo es un monstruo gélatina. Limo no|debe tocarse porque si lo haces el te|transformará en su esclavo estilo java ._.",
  455. 1201 => "Good bye, world.|It was nice meeting you.",
  456. } # Do not remove this.
  457.  
  458. end #module HASH
  459. end #module YE
  460.  
  461. #===============================================================================
  462. # Editting anything past this point may potentially result in causing computer
  463. # damage, incontinence, explosion of user's head, coma, death, and/or halitosis.
  464. # Therefore, edit at your own risk.
  465. #===============================================================================
  466.  
  467. module YE
  468. module REGEXP
  469. module BASEITEM
  470.  
  471. SCAN_WHOLE = /<(?:SCAN_WHOLE|scan whole)>/i
  472. SCAN_HP_MP = /<(?:SCAN_HP_MP|scan hp mp)>/i
  473. SCAN_STATS = /<(?:SCAN_STATS|scan stats)>/i
  474. SCAN_SKILL = /<(?:SCAN_SKILLS|scan skills)>/i
  475. SCAN_ELEM = /<(?:SCAN_ELEMENTS|scan elements)>/i
  476. SCAN_STATE = /<(?:SCAN_STATUS_EFFECTS|scan status effects|scan states)>/i
  477. SCAN_SPOIL = /<(?:SCAN_SPOILS|scan spoils)>/i
  478. SCAN_DROPS = /<(?:SCAN_DROPS|scan drops)>/i
  479. SCAN_STEAL = /<(?:SCAN_STEAL|scan steal)>/i
  480. SCAN_DESC = /<(?:SCAN_DESCRIPTION|scan description)>/i
  481.  
  482. end # BASEITEM
  483. module ENEMY
  484.  
  485. BOSS_TYPE = /<(?:BOSS_TYPE|boss type)[ ]*(\d+(?:\s*,\s*\d+)*)>/i
  486.  
  487. HIDE_WHOLE = /<(?:HIDE_WHOLE|hide whole)>/i
  488. HIDE_HP_MP = /<(?:HIDE_HP_MP|hide hp mp)>/i
  489. HIDE_STATS = /<(?:HIDE_STATS|hide stats)>/i
  490. HIDE_SKILL = /<(?:HIDE_SKILLS|hide skills)>/i
  491. HIDE_ELEM = /<(?:HIDE_ELEMENTS|hide elements)>/i
  492. HIDE_STATE = /<(?:HIDE_STATUS_EFFECTS|hide status effects|hide states)>/i
  493. HIDE_SPOIL = /<(?:HIDE_SPOILS|hide spoils)>/i
  494. HIDE_DROPS = /<(?:HIDE_DROPS|hide drops)>/i
  495. HIDE_STEAL = /<(?:HIDE_STEAL|hide steal)>/i
  496.  
  497. end # ENEMY
  498. end # REGEXP
  499.  
  500. module_function
  501. #--------------------------------------------------------------------------
  502. # Convert Array to Integer
  503. #--------------------------------------------------------------------------
  504. def convert_integer_array(array)
  505. result = []
  506. for i in array
  507. case i
  508. when Range; result += i.to_a
  509. when Integer; result.push(i)
  510. end
  511. end
  512. return result
  513. end
  514.  
  515. #--------------------------------------------------------------------------
  516. # Converted Constants
  517. #--------------------------------------------------------------------------
  518. ENEMY_LIST = convert_integer_array(MENU::MONSTER::BESTIARY_ORDER)
  519. HIDDEN_ENEMY = convert_integer_array(MENU::MONSTER::HIDDEN_MONSTERS)
  520.  
  521. end # YE
  522.  
  523. #===============================================================================
  524. # RPG::Enemy
  525. #===============================================================================
  526.  
  527. class RPG::Enemy
  528.  
  529. #--------------------------------------------------------------------------
  530. # Yanfly_Cache_DSE
  531. #--------------------------------------------------------------------------
  532. def yanfly_cache_enemy_dse
  533. @hide_whole = false; @hide_hp_mp = false; @hide_stats = false
  534. @hide_elem = false; @hide_state = false; @hide_desc = false
  535. @hide_skill = false; @hide_spoil = false; @hide_drops = false
  536. @hide_steal = false
  537. @boss_type = []
  538.  
  539. self.note.split(/[\r\n]+/).each { |line|
  540. case line
  541. when YE::REGEXP::ENEMY::BOSS_TYPE
  542. $1.scan(/\d+/).each { |num|
  543. if num.to_i >= 0
  544. @boss_type.push(num.to_i)
  545. end }
  546.  
  547. when YE::REGEXP::ENEMY::HIDE_WHOLE
  548. @hide_whole = true
  549. when YE::REGEXP::ENEMY::HIDE_HP_MP
  550. @hide_hp_mp = true
  551. when YE::REGEXP::ENEMY::HIDE_STATS
  552. @hide_stats = true
  553. when YE::REGEXP::ENEMY::HIDE_SKILL
  554. @hide_skill = true
  555. when YE::REGEXP::ENEMY::HIDE_ELEM
  556. @hide_elem = true
  557. when YE::REGEXP::ENEMY::HIDE_STATE
  558. @hide_state = true
  559. when YE::REGEXP::ENEMY::HIDE_SPOIL
  560. @hide_spoil = true
  561. when YE::REGEXP::ENEMY::HIDE_DROPS
  562. @hide_drops = true
  563. when YE::REGEXP::ENEMY::HIDE_STEAL
  564. @hide_steal = true
  565.  
  566. end
  567. }
  568. @boss_type = [0] if @boss_type == []
  569. end # end yanfly_cache_cse
  570.  
  571. #--------------------------------------------------------------------------
  572. # Boss Type
  573. #--------------------------------------------------------------------------
  574. def boss_type
  575. yanfly_cache_enemy_dse if @boss_type == nil
  576. return @boss_type
  577. end
  578.  
  579. #--------------------------------------------------------------------------
  580. # Hide Scan
  581. #--------------------------------------------------------------------------
  582. def hide_whole
  583. yanfly_cache_enemy_dse if @hide_whole == nil
  584. return @hide_whole
  585. end
  586. def hide_hp_mp
  587. yanfly_cache_enemy_dse if @hide_hp_mp == nil
  588. return @hide_hp_mp
  589. end
  590. def hide_stats
  591. yanfly_cache_enemy_dse if @hide_stats == nil
  592. return @hide_stats
  593. end
  594. def hide_skill
  595. yanfly_cache_enemy_dse if @hide_skill == nil
  596. return @hide_skill
  597. end
  598. def hide_elem
  599. yanfly_cache_enemy_dse if @hide_elem == nil
  600. return @hide_elem
  601. end
  602. def hide_state
  603. yanfly_cache_enemy_dse if @hide_state == nil
  604. return @hide_state
  605. end
  606. def hide_spoil
  607. yanfly_cache_enemy_dse if @hide_spoil == nil
  608. return @hide_spoil
  609. end
  610. def hide_drops
  611. yanfly_cache_enemy_dse if @hide_drops == nil
  612. return @hide_drops
  613. end
  614. def hide_steal
  615. yanfly_cache_enemy_dse if @hide_steal == nil
  616. return @hide_steal
  617. end
  618.  
  619. end # RPG::Enemy
  620.  
  621. #===============================================================================
  622. # RPG::BaseItem
  623. #===============================================================================
  624. class RPG::BaseItem
  625.  
  626. #--------------------------------------------------------------------------
  627. # Yanfly_Cache_DSE
  628. #--------------------------------------------------------------------------
  629. def yanfly_cache_baseitem_dse
  630. @scan_whole = false; @scan_hp_mp = false; @scan_stats = false
  631. @scan_elem = false; @scan_state = false; @scan_desc = false
  632. @scan_skill = false; @scan_spoil = false; @scan_drops = false
  633. @scan_steal = false
  634.  
  635. self.note.split(/[\r\n]+/).each { |line|
  636. case line
  637. when YE::REGEXP::BASEITEM::SCAN_WHOLE
  638. @scan_whole = true
  639. when YE::REGEXP::BASEITEM::SCAN_HP_MP
  640. @scan_hp_mp = true
  641. when YE::REGEXP::BASEITEM::SCAN_STATS
  642. @scan_stats = true
  643. when YE::REGEXP::BASEITEM::SCAN_SKILL
  644. @scan_skill = true
  645. when YE::REGEXP::BASEITEM::SCAN_ELEM
  646. @scan_elem = true
  647. when YE::REGEXP::BASEITEM::SCAN_STATE
  648. @scan_state = true
  649. when YE::REGEXP::BASEITEM::SCAN_SPOIL
  650. @scan_spoil = true
  651. when YE::REGEXP::BASEITEM::SCAN_DROPS
  652. @scan_drops = true
  653. when YE::REGEXP::BASEITEM::SCAN_STEAL
  654. @scan_steal = true
  655. when YE::REGEXP::BASEITEM::SCAN_DESC
  656. @scan_desc = true
  657.  
  658. end
  659. }
  660. end # end yanfly_cache_cse
  661.  
  662. #--------------------------------------------------------------------------
  663. # Skill Scan
  664. #--------------------------------------------------------------------------
  665. def scan_whole
  666. yanfly_cache_baseitem_dse if @scan_whole == nil
  667. return @scan_whole
  668. end
  669. def scan_hp_mp
  670. yanfly_cache_baseitem_dse if @scan_hp_mp == nil
  671. return @scan_hp_mp
  672. end
  673. def scan_stats
  674. yanfly_cache_baseitem_dse if @scan_stats == nil
  675. return @scan_stats
  676. end
  677. def scan_skill
  678. yanfly_cache_enemy_dse if @scan_skill == nil
  679. return @scan_skill
  680. end
  681. def scan_elem
  682. yanfly_cache_baseitem_dse if @scan_elem == nil
  683. return @scan_elem
  684. end
  685. def scan_state
  686. yanfly_cache_baseitem_dse if @scan_state == nil
  687. return @scan_state
  688. end
  689. def scan_spoil
  690. yanfly_cache_baseitem_dse if @scan_spoil == nil
  691. return @scan_spoil
  692. end
  693. def scan_drops
  694. yanfly_cache_baseitem_dse if @scan_drops == nil
  695. return @scan_drops
  696. end
  697. def scan_steal
  698. yanfly_cache_baseitem_dse if @scan_steal == nil
  699. return @scan_steal
  700. end
  701. def scan_desc
  702. yanfly_cache_baseitem_dse if @scan_desc == nil
  703. return @scan_desc
  704. end
  705.  
  706. end # RPG::BaseItem
  707.  
  708. #===============================================================================
  709. # Game Battler
  710. #===============================================================================
  711.  
  712. class Game_Battler
  713.  
  714. #--------------------------------------------------------------------------
  715. # alias skill_effect
  716. #--------------------------------------------------------------------------
  717. alias skill_effect_dse skill_effect unless $@
  718. def skill_effect(user, skill)
  719. skill_effect_dse(user, skill)
  720. if user.actor? and !self.actor?
  721. if skill.scan_hp_mp or skill.scan_whole
  722. $game_party.scan_hp_mp.push(enemy.id) unless $game_party.scan_hp_mp.include?(enemy.id)
  723. end
  724. if skill.scan_stats or skill.scan_whole
  725. $game_party.scan_stats.push(enemy.id) unless $game_party.scan_stats.include?(enemy.id)
  726. end
  727. if skill.scan_skill or skill.scan_whole
  728. $game_party.scan_skill.push(enemy.id) unless $game_party.scan_skill.include?(enemy.id)
  729. end
  730. if skill.scan_state or skill.scan_whole
  731. $game_party.scan_state.push(enemy.id) unless $game_party.scan_state.include?(enemy.id)
  732. end
  733. if skill.scan_elem or skill.scan_whole
  734. $game_party.scan_elem.push(enemy.id) unless $game_party.scan_elem.include?(enemy.id)
  735. end
  736. if skill.scan_spoil or skill.scan_whole
  737. $game_party.scan_spoil.push(enemy.id) unless $game_party.scan_spoil.include?(enemy.id)
  738. end
  739. if skill.scan_drops or skill.scan_whole
  740. $game_party.scan_drops.push(enemy.id) unless $game_party.scan_drops.include?(enemy.id)
  741. end
  742. if skill.scan_steal or skill.scan_whole
  743. $game_party.scan_steal.push(enemy.id) unless $game_party.scan_steal.include?(enemy.id)
  744. end
  745. if skill.scan_desc or skill.scan_whole
  746. $game_party.scan_desc.push(enemy.id) unless $game_party.scan_desc.include?(enemy.id)
  747. end
  748. end
  749. end
  750.  
  751. end # Game_Battler
  752.  
  753. #===============================================================================
  754. # Game Party
  755. #===============================================================================
  756.  
  757. class Game_Party < Game_Unit
  758.  
  759. #--------------------------------------------------------------------------
  760. # Public Instance Variables
  761. #--------------------------------------------------------------------------
  762. attr_writer :monsters_encounter
  763. attr_writer :monsters_defeated
  764. attr_writer :monsters_escaped
  765.  
  766. attr_writer :scan_hp_mp
  767. attr_writer :scan_stats
  768. attr_writer :scan_skill
  769. attr_writer :scan_state
  770. attr_writer :scan_elem
  771. attr_writer :scan_spoil
  772. attr_writer :scan_drops
  773. attr_writer :scan_steal
  774. attr_writer :scan_desc
  775.  
  776. #--------------------------------------------------------------------------
  777. # Definitions
  778. #--------------------------------------------------------------------------
  779. def monsters_encounter
  780. @monsters_encounter = {} if @monsters_encounter == nil
  781. return @monsters_encounter
  782. end
  783. def monsters_defeated
  784. @monsters_defeated = {} if @monsters_defeated == nil
  785. return @monsters_defeated
  786. end
  787. def monsters_escaped
  788. @monsters_escaped = {} if @monsters_escaped == nil
  789. return @monsters_escaped
  790. end
  791.  
  792. #--------------------------------------------------------------------------
  793. # Definitions
  794. #--------------------------------------------------------------------------
  795. def scan_hp_mp
  796. @scan_hp_mp = [] if @scan_hp_mp == nil
  797. return @scan_hp_mp
  798. end
  799. def scan_stats
  800. @scan_stats = [] if @scan_stats == nil
  801. return @scan_stats
  802. end
  803. def scan_skill
  804. @scan_skill = [] if @scan_skill == nil
  805. return @scan_skill
  806. end
  807. def scan_state
  808. @scan_state = [] if @scan_state == nil
  809. return @scan_state
  810. end
  811. def scan_elem
  812. @scan_elem = [] if @scan_elem == nil
  813. return @scan_elem
  814. end
  815. def scan_spoil
  816. @scan_spoil = [] if @scan_spoil == nil
  817. return @scan_spoil
  818. end
  819. def scan_drops
  820. @scan_drops = [] if @scan_drops == nil
  821. return @scan_drops
  822. end
  823. def scan_steal
  824. @scan_steal = [] if @scan_steal == nil
  825. return @scan_steal
  826. end
  827. def scan_desc
  828. @scan_desc = [] if @scan_desc == nil
  829. return @scan_desc
  830. end
  831.  
  832. end
  833.  
  834. #===============================================================================
  835. # Game Enemy
  836. #===============================================================================
  837.  
  838. class Game_Enemy < Game_Battler
  839.  
  840. #--------------------------------------------------------------------------
  841. # alias initialize
  842. #--------------------------------------------------------------------------
  843. alias initialize_dse initialize unless $@
  844. def initialize(index, enemy_id)
  845. initialize_dse(index, enemy_id)
  846. $game_party.monsters_encounter = {} if $game_party.monsters_encounter == nil
  847. if $game_party.monsters_encounter[enemy_id] == nil
  848. $game_party.monsters_encounter[enemy_id] = 0
  849. end
  850. $game_party.monsters_encounter[enemy_id] += 1 unless $scene.is_a?(Scene_Bestiary)
  851. end
  852.  
  853. #--------------------------------------------------------------------------
  854. # alias Transform
  855. #--------------------------------------------------------------------------
  856. alias transform_dse transform unless $@
  857. def transform(enemy_id)
  858. transform_dse(enemy_id)
  859. $game_party.monsters_encounter = {} if $game_party.monsters_encounter == nil
  860. if $game_party.monsters_encounter[enemy_id] == nil
  861. $game_party.monsters_encounter[enemy_id] = 0
  862. end
  863. $game_party.monsters_encounter[enemy_id] += 1
  864. end
  865.  
  866. #--------------------------------------------------------------------------
  867. # alias Collapse
  868. #--------------------------------------------------------------------------
  869. alias perform_collapse_dse perform_collapse unless $@
  870. def perform_collapse
  871. perform_collapse_dse
  872. if $game_temp.in_battle and dead?
  873. if YE::MENU::MONSTER::DEATH_SPOILS
  874. $game_party.scan_spoil.push(enemy.id) unless $game_party.scan_spoil.include?(enemy.id)
  875. end
  876. if YE::MENU::MONSTER::DEATH_DROPS
  877. $game_party.scan_drops.push(enemy.id) unless $game_party.scan_drops.include?(enemy.id)
  878. end
  879. $game_party.monsters_defeated = {} if $game_party.monsters_defeated == nil
  880. if $game_party.monsters_defeated[enemy_id] == nil
  881. $game_party.monsters_defeated[enemy_id] = 0
  882. end
  883. $game_party.monsters_defeated[enemy.id] += 1
  884. end
  885.  
  886. end
  887.  
  888. #--------------------------------------------------------------------------
  889. # alias Escape
  890. #--------------------------------------------------------------------------
  891. alias escape_dse escape unless $@
  892. def escape
  893. $game_party.monsters_escaped = {} if $game_party.monsters_escaped == nil
  894. if $game_party.monsters_escaped[enemy_id] == nil
  895. $game_party.monsters_escaped[enemy_id] = 0
  896. end
  897. $game_party.monsters_escaped[enemy.id] += 1
  898. escape_dse
  899. end
  900.  
  901. #--------------------------------------------------------------------------
  902. # Encounter Details
  903. #--------------------------------------------------------------------------
  904. def encounters_dse
  905. if $game_party.monsters_encounter[enemy.id] == nil
  906. $game_party.monsters_encounter[enemy.id] = 0
  907. end
  908. return $game_party.monsters_encounter[enemy.id]
  909. end
  910. def defeated_dse
  911. if $game_party.monsters_defeated[enemy.id] == nil
  912. $game_party.monsters_defeated[enemy.id] = 0
  913. end
  914. return $game_party.monsters_defeated[enemy.id]
  915. end
  916. def escaped_dse
  917. if $game_party.monsters_escaped[enemy.id] == nil
  918. $game_party.monsters_escaped[enemy.id] = 0
  919. end
  920. return $game_party.monsters_escaped[enemy.id]
  921. end
  922.  
  923. end # Game_Enemy
  924.  
  925. #==============================================================================
  926. # Window_Command (imported from KGC)
  927. #==============================================================================
  928.  
  929. class Window_Command < Window_Selectable
  930. unless method_defined?(:add_command)
  931. #--------------------------------------------------------------------------
  932. # add command
  933. #--------------------------------------------------------------------------
  934. def add_command(command)
  935. @commands << command
  936. @item_max = @commands.size
  937. item_index = @item_max - 1
  938. refresh_command
  939. draw_item(item_index)
  940. return item_index
  941. end
  942. #--------------------------------------------------------------------------
  943. # refresh command
  944. #--------------------------------------------------------------------------
  945. def refresh_command
  946. buf = self.contents.clone
  947. self.height = [self.height, row_max * WLH + 32].max
  948. create_contents
  949. self.contents.blt(0, 0, buf, buf.rect)
  950. buf.dispose
  951. end
  952. #--------------------------------------------------------------------------
  953. # insert command
  954. #--------------------------------------------------------------------------
  955. def insert_command(index, command)
  956. @commands.insert(index, command)
  957. @item_max = @commands.size
  958. refresh_command
  959. refresh
  960. end
  961. #--------------------------------------------------------------------------
  962. # remove command
  963. #--------------------------------------------------------------------------
  964. def remove_command(command)
  965. @commands.delete(command)
  966. @item_max = @commands.size
  967. refresh
  968. end
  969. end
  970. end
  971.  
  972. #===============================================================================
  973. # Scene Menu
  974. #===============================================================================
  975.  
  976. class Scene_Menu < Scene_Base
  977.  
  978. #--------------------------------------------------------------------------
  979. # alias create command window
  980. #--------------------------------------------------------------------------
  981. alias create_command_window_dse create_command_window unless $@
  982. def create_command_window
  983. create_command_window_dse
  984. return if $imported["CustomMenuCommand"]
  985. if $game_switches[YE::MENU::MONSTER::BESTIARY_SWITCH]
  986. scc_text = YE::MENU::MONSTER::BESTIARY_TITLE
  987. @command_bestiary = @command_window.add_command(scc_text)
  988. if @command_window.oy > 0
  989. @command_window.oy -= Window_Base::WLH
  990. end
  991. end
  992. @command_window.index = @menu_index
  993. end
  994.  
  995. #--------------------------------------------------------------------------
  996. # alias update command selection
  997. #--------------------------------------------------------------------------
  998. alias update_command_selection_dse update_command_selection unless $@
  999. def update_command_selection
  1000. call_yerd_command = 0
  1001. if Input.trigger?(Input::C)
  1002. case @command_window.index
  1003. when @command_bestiary
  1004. Sound.play_decision
  1005. $scene = Scene_Bestiary.new(@command_window.index)
  1006. end
  1007. end
  1008. update_command_selection_dse
  1009. end
  1010.  
  1011. end # Scene Menu
  1012.  
  1013. #===============================================================================
  1014. # Scene Title
  1015. #===============================================================================
  1016.  
  1017. class Scene_Title < Scene_Base
  1018.  
  1019. #--------------------------------------------------------------------------
  1020. # alias create game objects
  1021. #--------------------------------------------------------------------------
  1022. alias create_game_objects_dse create_game_objects unless $@
  1023. def create_game_objects
  1024. create_game_objects_dse
  1025. $game_switches[YE::MENU::MONSTER::BESTIARY_SWITCH] = true
  1026. end
  1027.  
  1028. end # Scene_Title
  1029.  
  1030. #===============================================================================
  1031. # Scene Battle
  1032. #===============================================================================
  1033.  
  1034. class Scene_Battle
  1035.  
  1036. #--------------------------------------------------------------------------
  1037. # alias create_info_viewport
  1038. #--------------------------------------------------------------------------
  1039. alias create_info_viewport_dse create_info_viewport unless $@
  1040. def create_info_viewport
  1041. create_info_viewport_dse
  1042. #---
  1043. @enemy_name_window = Window_Enemy_Name.new(0, 0, 272, 56)
  1044. @enemy_name_window.visible = false
  1045. @enemy_name_window.active = false
  1046. #---
  1047. @enemy_image_window = Window_Enemy_Image.new(0, 56, 272, 232)
  1048. @enemy_image_window.visible = false
  1049. @enemy_image_window.active = false
  1050. #---
  1051. @enemy_scan_window = Window_Enemy_Scan.new(272, 0, 272, 288, true)
  1052. @enemy_scan_window.visible = false
  1053. @enemy_scan_window.active = false
  1054. #---
  1055. hix = YE::MENU::MONSTER::HELP_WINDOW_X
  1056. hiy = YE::MENU::MONSTER::HELP_WINDOW_Y
  1057. hiw = YE::MENU::MONSTER::HELP_WINDOW_W
  1058. text = YE::MENU::MONSTER::HELP_WINDOW_TX
  1059. @scan_info_window = Window_Base.new(hix, hiy, hiw, 56)
  1060. @scan_info_window.back_opacity = YE::MENU::MONSTER::HELP_WINDOW_O
  1061. @scan_info_window.contents.draw_text(2, 0, hiw - 32, 24, text, 1)
  1062. @scan_info_window.visible = false
  1063. @scan_info_window.z = 200
  1064. end
  1065.  
  1066. #--------------------------------------------------------------------------
  1067. # alias terminate
  1068. #--------------------------------------------------------------------------
  1069. alias terminate_dse terminate unless $@
  1070. def terminate
  1071. @enemy_scan_window.dispose if @enemy_scan_window != nil
  1072. @enemy_image_window.dispose if @enemy_image_window != nil
  1073. @enemy_name_window.dispose if @enemy_name_window != nil
  1074. @scan_info_window.dispose if @scan_info_window != nil
  1075. terminate_dse
  1076. end
  1077.  
  1078. #--------------------------------------------------------------------------
  1079. # alias update_target_enemy_selection
  1080. #--------------------------------------------------------------------------
  1081. alias update_target_enemy_selection_dse update_target_enemy_selection unless $@
  1082. def update_target_enemy_selection
  1083. if YE::MENU::MONSTER::HELP_WINDOW_ON
  1084. if @enemy_scan_window.active
  1085. @scan_info_window.visible = false
  1086. elsif @target_enemy_window.active
  1087. @scan_info_window.visible = true
  1088. else
  1089. @scan_info_window.visible = false
  1090. end
  1091. else
  1092. @scan_info_window.visible = false
  1093. end
  1094. #------------------------------------------
  1095. # If the Enemy Scan Window is active
  1096. #------------------------------------------
  1097. if @enemy_scan_window != nil and @enemy_scan_window.active
  1098. @enemy_scan_window.update
  1099. @enemy_image_window.update
  1100. @enemy_name_window.update
  1101. if Input.trigger?(Input::B) #end1
  1102. Sound.play_cancel
  1103. @enemy_scan_window.disappear
  1104. @enemy_image_window.disappear
  1105. @enemy_name_window.visible = false
  1106. @target_enemy_window.active = true
  1107. elsif Input.trigger?(Input::LEFT) or Input.trigger?(Input::UP)
  1108. @enemy_scan_window.previous_page
  1109. elsif Input.trigger?(Input::RIGHT) or Input.trigger?(Input::DOWN)
  1110. @enemy_scan_window.next_page
  1111. elsif Input.trigger?(Input::L)
  1112. @enemy_scan_window.top_page
  1113. elsif Input.trigger?(Input::R)
  1114. @enemy_scan_window.bottom_page
  1115. end
  1116. #------------------------------------------
  1117. # If the Target Window is Active
  1118. #------------------------------------------
  1119. else
  1120. if Input.trigger?(Input::B)
  1121. @scan_info_window.visible = false
  1122. elsif Input.trigger?(Input::C)
  1123. @scan_info_window.visible = false
  1124. elsif Input.trigger?(YE::MENU::MONSTER::ENEMY_SCAN_BUTTON)
  1125. Sound.play_decision
  1126. enemy = @target_enemy_window.enemy
  1127. @enemy_scan_window.appear(enemy, @target_enemy_window)
  1128. @enemy_image_window.appear(enemy, @target_enemy_window)
  1129. @enemy_name_window.appear(enemy, @target_enemy_window)
  1130. @target_enemy_window.active = false
  1131. end
  1132. update_target_enemy_selection_dse
  1133. #---------
  1134. end
  1135. end
  1136.  
  1137. #--------------------------------------------------------------------------
  1138. # update enemy name window
  1139. #--------------------------------------------------------------------------
  1140. def update_enemy_name_window(enemy, window)
  1141. @enemy_name_window.visible = true
  1142. @enemy_name_window.contents.clear
  1143. name = window.enemy.name
  1144. @enemy_name_window.contents.draw_text(0, 0, 240, 32, name, 1)
  1145. @enemy_name_window.update
  1146. end
  1147.  
  1148. end # Scene_Battle
  1149.  
  1150. #===============================================================================
  1151. # Scene Bestiary
  1152. #===============================================================================
  1153.  
  1154. class Scene_Bestiary < Scene_Base
  1155.  
  1156. #--------------------------------------------------------------------------
  1157. # initialize
  1158. #--------------------------------------------------------------------------
  1159. def initialize(menu_index = nil)
  1160. @menu_index = menu_index
  1161. end
  1162.  
  1163. #--------------------------------------------------------------------------
  1164. # start
  1165. #--------------------------------------------------------------------------
  1166. def start
  1167. super
  1168. create_menu_background
  1169. @boss_type = 0
  1170. @enemy_list_window = Window_Enemy_List.new(@boss_type)
  1171. @enemy_data_window = Window_Type_Data.new(@boss_type)
  1172. @enemy_type_window = Window_Base.new(0, 0, 272, 56)
  1173. refresh_type_window
  1174. @enemy_help_category = Window_Base.new(272, 0, 272, 56)
  1175. text = YE::MENU::MONSTER::CATEGORIZE_TEXT
  1176. @enemy_help_category.contents.draw_text(0, 0, 240, 24, text, 1)
  1177. @boss_help_window = Window_Base.new(136, 56, 272, 304)
  1178. text = YE::MENU::MONSTER::CATEGORIZE_HELP
  1179. @boss_help_window.back_opacity = 255
  1180. @boss_help_window.contents.draw_text(0, 0, 240, 24, text, 1)
  1181. @boss_help_window.visible = false
  1182. @boss_type_window = Window_Boss_Types.new
  1183. #---
  1184. @enemy_name_window = Window_Enemy_Name.new(0, 0, 272, 56)
  1185. @enemy_name_window.visible = false
  1186. @enemy_name_window.active = false
  1187. #---
  1188. @enemy_image_window = Window_Enemy_Image.new(0, 56, 272, 360)
  1189. @enemy_image_window.visible = false
  1190. @enemy_image_window.active = false
  1191. #---
  1192. @enemy_scan_window = Window_Enemy_Scan.new(272, 0, 272, 416, true)#416 xd
  1193. @enemy_scan_window.visible = false
  1194. @enemy_scan_window.active = false
  1195. #---
  1196. end
  1197.  
  1198. #--------------------------------------------------------------------------
  1199. # terminate
  1200. #--------------------------------------------------------------------------
  1201. def terminate
  1202. super
  1203. dispose_menu_background
  1204. @boss_type_window.dispose if @boss_type_window != nil
  1205. @boss_help_window.dispose if @boss_help_window != nil
  1206. @enemy_name_window.dispose if @enemy_name_window != nil
  1207. @enemy_data_window.dispose if @enemy_data_window != nil
  1208. @enemy_image_window.dispose if @enemy_image_window != nil
  1209. @enemy_scan_window.dispose if @enemy_scan_window != nil
  1210. @enemy_list_window.dispose if @enemy_list_window != nil
  1211. @enemy_type_window.dispose if @enemy_type_window != nil
  1212. @enemy_help_category.dispose if @enemy_help_category != nil
  1213. end
  1214.  
  1215. #--------------------------------------------------------------------------
  1216. # return scene
  1217. #--------------------------------------------------------------------------
  1218. def return_scene
  1219. if @menu_index == nil
  1220. $scene = Scene_Map.new
  1221. else
  1222. $scene = Scene_Menu.new(@menu_index)
  1223. end
  1224. end
  1225.  
  1226. #--------------------------------------------------------------------------
  1227. # update
  1228. #--------------------------------------------------------------------------
  1229. def update
  1230. super
  1231. update_menu_background
  1232. if @boss_type_window.active
  1233. update_type_window
  1234. elsif @enemy_scan_window.active
  1235. update_scan_window
  1236. elsif @enemy_list_window.active
  1237. update_enemy_list
  1238. end
  1239. end
  1240.  
  1241. #--------------------------------------------------------------------------
  1242. # update_type_window
  1243. #--------------------------------------------------------------------------
  1244. def update_type_window
  1245. @boss_type_window.update
  1246. if Input.trigger?(Input::B)
  1247. Sound.play_cancel
  1248. @boss_type_window.visible = false
  1249. @boss_help_window.visible = false
  1250. @boss_type_window.active = false
  1251. @enemy_list_window.active = true
  1252. elsif Input.trigger?(Input::C)
  1253. Sound.play_decision
  1254. last_boss_type = @boss_type
  1255. @boss_type = @boss_type_window.type
  1256. @enemy_list_window.refresh(@boss_type)
  1257. @enemy_list_window.index = 0 unless last_boss_type == @boss_type
  1258. @enemy_data_window.refresh(@boss_type)
  1259. refresh_type_window
  1260. @boss_type_window.visible = false
  1261. @boss_help_window.visible = false
  1262. @boss_type_window.active = false
  1263. @enemy_list_window.active = true
  1264. end
  1265. end
  1266.  
  1267. #--------------------------------------------------------------------------
  1268. # update_scan_window
  1269. #--------------------------------------------------------------------------
  1270. def update_scan_window
  1271. @enemy_scan_window.update
  1272. @enemy_image_window.update
  1273. @enemy_name_window.update
  1274. if Input.trigger?(Input::B)
  1275. Sound.play_cancel
  1276. @enemy_scan_window.disappear
  1277. @enemy_image_window.disappear
  1278. @enemy_name_window.visible = false
  1279. @enemy_list_window.active = true
  1280. @enemy = nil
  1281. elsif Input.trigger?(Input::LEFT) or Input.trigger?(Input::UP)
  1282. @enemy_scan_window.previous_page
  1283. elsif Input.trigger?(Input::RIGHT) or Input.trigger?(Input::DOWN)
  1284. @enemy_scan_window.next_page
  1285. elsif Input.trigger?(Input::L)
  1286. @enemy_scan_window.top_page
  1287. elsif Input.trigger?(Input::R)
  1288. @enemy_scan_window.bottom_page
  1289. end
  1290. end
  1291.  
  1292. #--------------------------------------------------------------------------
  1293. # update_enemy_list
  1294. #--------------------------------------------------------------------------
  1295. def update_enemy_list
  1296. @enemy_list_window.update
  1297. if Input.trigger?(Input::B)
  1298. Sound.play_cancel
  1299. return_scene
  1300. elsif Input.trigger?(Input::C)
  1301. if @enemy_list_window.enemy == nil
  1302. Sound.play_buzzer
  1303. elsif !viewable?(@enemy_list_window.enemy)
  1304. Sound.play_buzzer
  1305. else
  1306. Sound.play_decision
  1307. @enemy = Game_Enemy.new(0, @enemy_list_window.enemy.id)
  1308. @enemy_scan_window.appear(@enemy)
  1309. @enemy_image_window.appear(@enemy)
  1310. @enemy_name_window.appear(@enemy)
  1311. @enemy_list_window.active = false
  1312. end
  1313. elsif Input.trigger?(YE::MENU::MONSTER::CATEGORIZE_BUTTON)
  1314. Sound.play_decision
  1315. @boss_type_window.visible = true
  1316. @boss_help_window.visible = true
  1317. @boss_type_window.active = true
  1318. @enemy_list_window.active = false
  1319. end
  1320. end
  1321.  
  1322. #--------------------------------------------------------------------------
  1323. # viewable?
  1324. #--------------------------------------------------------------------------
  1325. def viewable?(enemy)
  1326. $game_party.monsters_encounter[enemy.id] = 0 if
  1327. $game_party.monsters_encounter[enemy.id] == nil
  1328. return false if $game_party.monsters_encounter[enemy.id] <= 0
  1329. return true
  1330. end
  1331.  
  1332. #--------------------------------------------------------------------------
  1333. # refresh type window
  1334. #--------------------------------------------------------------------------
  1335. def refresh_type_window
  1336. @enemy_type_window.contents.clear
  1337. array = YE::MENU::MONSTER::BOSS_TYPES[@boss_type]
  1338. icon = array[0]
  1339. text = sprintf(YE::MENU::MONSTER::BESTIARY_LIST, array[7])
  1340. @enemy_type_window.draw_icon(icon, 0, 0)
  1341. @enemy_type_window.contents.draw_text(24, 0, 216, 24, text, 0)
  1342. end
  1343.  
  1344. end # Scene_Bestiary
  1345.  
  1346. #==============================================================================
  1347. # Window_Enemy_List
  1348. #==============================================================================
  1349.  
  1350. class Window_Enemy_List < Window_Selectable
  1351.  
  1352. #--------------------------------------------------------------------------
  1353. # initialize
  1354. #--------------------------------------------------------------------------
  1355. def initialize(boss_type)
  1356. super(0, 56, 272, 360)
  1357. self.index = 0
  1358. refresh(boss_type)
  1359. end
  1360.  
  1361. #--------------------------------------------------------------------------
  1362. # refresh
  1363. #--------------------------------------------------------------------------
  1364. def refresh(boss_type)
  1365. @boss_type = boss_type
  1366. @data = []
  1367. for enemy in monster_list
  1368. @data.push(enemy)
  1369. end
  1370. @item_max = @data.size
  1371. create_contents
  1372. for i in 0...@item_max
  1373. draw_item(i)
  1374. end
  1375. end
  1376.  
  1377. #--------------------------------------------------------------------------
  1378. # draw item
  1379. #--------------------------------------------------------------------------
  1380. def draw_item(index)
  1381. rect = item_rect(index)
  1382. self.contents.clear_rect(rect)
  1383. enemy = @data[index]
  1384. $game_party.monsters_encounter[enemy.id] = 0 if
  1385. $game_party.monsters_encounter[enemy.id] == nil
  1386. if $game_party.monsters_encounter[enemy.id] > 0
  1387. text = enemy.name.gsub(/\[.*\]/) { "" }
  1388. self.contents.font.color.alpha = 255
  1389. else
  1390. mask = YE::MENU::MONSTER::BESTIARY_MASK
  1391. if mask.scan(/./).size == 1
  1392. mask = mask * enemy.name.scan(/./).size
  1393. end
  1394. text = mask
  1395. self.contents.font.color.alpha = 128
  1396. end
  1397. self.contents.draw_text(rect.x+4, rect.y, rect.width-4, WLH, text)
  1398. end
  1399.  
  1400. #--------------------------------------------------------------------------
  1401. # include?
  1402. #--------------------------------------------------------------------------
  1403. def include?(enemy)
  1404. return false if enemy == nil
  1405. return false unless enemy.boss_type.include?(@boss_type)
  1406. return false if YE::HIDDEN_ENEMY.include?(enemy.id)
  1407. return false if $imported["SwapDummyMonster"] and
  1408. YE::SWAP::DUMMY_MONSTER.include?(enemy.id)
  1409. return true
  1410. end
  1411.  
  1412. #--------------------------------------------------------------------------
  1413. # monster_list
  1414. #--------------------------------------------------------------------------
  1415. def monster_list
  1416. result = []
  1417. for enemy_id in YE::ENEMY_LIST
  1418. result.push($data_enemies[enemy_id]) if include?($data_enemies[enemy_id])
  1419. end
  1420. return result
  1421. end
  1422.  
  1423. #--------------------------------------------------------------------------
  1424. # return enemy
  1425. #--------------------------------------------------------------------------
  1426. def enemy
  1427. return @data[self.index]
  1428. end
  1429.  
  1430. end # Window_Enemy_list
  1431.  
  1432. #==============================================================================
  1433. # Window_Type_Data
  1434. #==============================================================================
  1435.  
  1436. class Window_Type_Data < Window_Base
  1437.  
  1438. #--------------------------------------------------------------------------
  1439. # initialize
  1440. #--------------------------------------------------------------------------
  1441. def initialize(boss_type)
  1442. super(272, 56, 272, 360)
  1443. refresh(boss_type)
  1444. end
  1445.  
  1446. #--------------------------------------------------------------------------
  1447. # refresh
  1448. #--------------------------------------------------------------------------
  1449. def refresh(boss_type = 0)
  1450. self.contents.clear
  1451. self.contents.font.size = Font.default_size
  1452. @boss_type = boss_type
  1453. sw = self.width - 32
  1454. @category_colour = YE::MENU::MONSTER::DATA_CATEGORY_COLOUR
  1455. self.contents.font.color = text_color(@category_colour)
  1456. text = YE::MENU::MONSTER::BESTIARY_INFO
  1457. self.contents.draw_text(0, 0, sw, WLH, text, 1)
  1458.  
  1459. unique_discovered = 0
  1460. unique_type_enc = 0
  1461. unique_encounters = 0
  1462. unique_defeated = 0
  1463. unique_escaped = 0
  1464. total_encountered = 0
  1465. total_defeated = 0
  1466. total_escaped = 0
  1467. type_encountered = 0
  1468. type_defeated = 0
  1469. type_escaped = 0
  1470.  
  1471. for key in $game_party.monsters_encounter
  1472. next if key[1] == nil or key[1] <= 0
  1473. unique_encounters += 1
  1474. total_encountered += key[1]
  1475. if $data_enemies[key[0]].boss_type.include?(@boss_type)
  1476. unique_discovered += 1
  1477. unique_type_enc += key[1]
  1478. end
  1479. end
  1480. for key in $game_party.monsters_defeated
  1481. next if key[1] == nil or key[1] <= 0
  1482. total_defeated += key[1]
  1483. if $data_enemies[key[0]].boss_type.include?(@boss_type)
  1484. unique_defeated += key[1]
  1485. end
  1486. end
  1487. for key in $game_party.monsters_escaped
  1488. next if key[1] == nil or key[1] <= 0
  1489. total_escaped += key[1]
  1490. if $data_enemies[key[0]].boss_type.include?(@boss_type)
  1491. unique_escaped += key[1]
  1492. end
  1493. end
  1494. total_size = YE::ENEMY_LIST.size - YE::HIDDEN_ENEMY.size
  1495.  
  1496. self.contents.font.size = YE::MENU::MONSTER::MENU_FONT_SIZE
  1497. #---
  1498. dy = WLH + WLH / 2
  1499. boss_type_name = YE::MENU::MONSTER::BOSS_TYPES[@boss_type][8]
  1500. icon = YE::MENU::MONSTER::BOSS_TYPES[@boss_type][0]
  1501. #---
  1502. self.contents.font.color = text_color(@category_colour)
  1503. draw_icon(YE::MENU::MONSTER::ICON_COMPLETION, 0, dy)
  1504. text = YE::MENU::MONSTER::TEXT_COMPLETION
  1505. self.contents.draw_text(24, dy, sw-24, WLH, text, 0)
  1506. self.contents.font.color = normal_color
  1507. text = sprintf(YE::MENU::MONSTER::RATE_COMPLETION, bestiary_completion)
  1508. self.contents.draw_text(24, dy, sw-24, WLH, text, 2)
  1509. #---
  1510. dy += WLH + WLH / 2
  1511. self.contents.font.color = text_color(@category_colour)
  1512. draw_icon(YE::MENU::MONSTER::ICON_DISCOVERED, 0, dy)
  1513. text = YE::MENU::MONSTER::TEXT_DISCOVERED
  1514. self.contents.draw_text(24, dy, sw-24, WLH, text, 0)
  1515. self.contents.font.color = normal_color
  1516. self.contents.draw_text(24, dy, sw-24, WLH, unique_encounters, 2)
  1517. #---
  1518. dy += WLH
  1519. self.contents.font.color = text_color(@category_colour)
  1520. draw_icon(icon, 12, dy)
  1521. text = sprintf(YE::MENU::MONSTER::TEXT_TYPE_DIS, boss_type_name)
  1522. self.contents.draw_text(36, dy, sw-36, WLH, text, 0)
  1523. self.contents.font.color = normal_color
  1524. self.contents.draw_text(36, dy, sw-36, WLH, unique_discovered, 2)
  1525. #---
  1526. dy += WLH
  1527. self.contents.font.color = text_color(@category_colour)
  1528. draw_icon(YE::MENU::MONSTER::ICON_ENCOUNTER, 0, dy)
  1529. text = YE::MENU::MONSTER::TEXT_ENCOUNTERS
  1530. self.contents.draw_text(24, dy, sw-24, WLH, text, 0)
  1531. self.contents.font.color = normal_color
  1532. self.contents.draw_text(24, dy, sw-24, WLH, total_encountered, 2)
  1533. #---
  1534. dy += WLH
  1535. self.contents.font.color = text_color(@category_colour)
  1536. draw_icon(icon, 12, dy)
  1537. text = sprintf(YE::MENU::MONSTER::TEXT_TYPE_ENC, boss_type_name)
  1538. self.contents.draw_text(36, dy, sw-36, WLH, text, 0)
  1539. self.contents.font.color = normal_color
  1540. self.contents.draw_text(36, dy, sw-36, WLH, unique_type_enc, 2)
  1541. #---
  1542. dy += WLH
  1543. self.contents.font.color = text_color(@category_colour)
  1544. draw_icon(YE::MENU::MONSTER::ICON_KILLED, 0, dy)
  1545. text = YE::MENU::MONSTER::TEXT_DEFEATED
  1546. self.contents.draw_text(24, dy, sw-24, WLH, text, 0)
  1547. self.contents.font.color = normal_color
  1548. self.contents.draw_text(24, dy, sw-24, WLH, total_defeated, 2)
  1549. #---
  1550. dy += WLH
  1551. self.contents.font.color = text_color(@category_colour)
  1552. draw_icon(icon, 12, dy)
  1553. text = sprintf(YE::MENU::MONSTER::TEXT_TYPE_DEF, boss_type_name)
  1554. self.contents.draw_text(36, dy, sw-36, WLH, text, 0)
  1555. self.contents.font.color = normal_color
  1556. self.contents.draw_text(36, dy, sw-36, WLH, unique_defeated, 2)
  1557. #---
  1558. dy += WLH
  1559. self.contents.font.color = text_color(@category_colour)
  1560. draw_icon(YE::MENU::MONSTER::ICON_ESCAPED, 0, dy)
  1561. text = YE::MENU::MONSTER::TEXT_ESCAPED
  1562. self.contents.draw_text(24, dy, sw-24, WLH, text, 0)
  1563. self.contents.font.color = normal_color
  1564. self.contents.draw_text(24, dy, sw-24, WLH, total_escaped, 2)
  1565. #---
  1566. dy += WLH
  1567. self.contents.font.color = text_color(@category_colour)
  1568. draw_icon(icon, 12, dy)
  1569. text = sprintf(YE::MENU::MONSTER::TEXT_TYPE_ESC, boss_type_name)
  1570. self.contents.draw_text(36, dy, sw-36, WLH, text, 0)
  1571. self.contents.font.color = normal_color
  1572. self.contents.draw_text(36, dy, sw-36, WLH, unique_escaped, 2)
  1573. end
  1574.  
  1575. #--------------------------------------------------------------------------
  1576. # bestiary_completion
  1577. #--------------------------------------------------------------------------
  1578. def bestiary_completion
  1579. total = 0; result = 0
  1580. for enemy in $data_enemies
  1581. next if $imported["SwapDummyMonster"] and
  1582. YE::SWAP::DUMMY_MONSTER.include?(enemy.id)
  1583. next if YE::HIDDEN_ENEMY.include?(enemy.id)
  1584. next if enemy == nil
  1585. total += 1
  1586. if $game_party.monsters_encounter.include?(enemy.id) and
  1587. $game_party.monsters_encounter[enemy.id] > 0
  1588. result += 1
  1589. end
  1590. next unless YE::MENU::MONSTER::REQUIRE_SCAN
  1591. next if enemy.hide_whole
  1592. total += 1 if YE::MENU::MONSTER::SHOW_GENERAL and !enemy.hide_hp_mp
  1593. total += 1 if YE::MENU::MONSTER::SHOW_GENERAL and !enemy.hide_stats
  1594. total += 1 if YE::MENU::MONSTER::SHOW_SKILLS and !enemy.hide_skill
  1595. total += 1 if YE::MENU::MONSTER::SHOW_ELEMENTS and !enemy.hide_elem
  1596. total += 1 if YE::MENU::MONSTER::SHOW_STATES and !enemy.hide_state
  1597. total += 1 if YE::MENU::MONSTER::SHOW_SPOILS and !enemy.hide_spoil
  1598. if YE::MENU::MONSTER::SPOIL_DROPS or (YE::MENU::MONSTER::SHOW_DROPS and
  1599. $imported["ExtraDropItem"]) and !enemy.hide_drops
  1600. total += 1
  1601. end
  1602. if $imported["Steal"] and YE::MENU::MONSTER::SHOW_STEAL and
  1603. !enemy.hide_steal
  1604. total += 1
  1605. end
  1606. if YE::MENU::MONSTER::SHOW_NOTES and YE::HASH::ENEMY_NOTES.include?(enemy.id)
  1607. total += 1
  1608. end
  1609. end
  1610. if YE::MENU::MONSTER::REQUIRE_SCAN
  1611. result += $game_party.scan_hp_mp.size
  1612. result += $game_party.scan_stats.size
  1613. result += $game_party.scan_skill.size
  1614. result += $game_party.scan_state.size
  1615. result += $game_party.scan_spoil.size
  1616. result += $game_party.scan_drops.size
  1617. result += $game_party.scan_steal.size
  1618. result += $game_party.scan_desc.size
  1619. end
  1620. result *= 100.0
  1621. result /= total
  1622. return result
  1623. end
  1624.  
  1625. end # Window_Type_Data
  1626.  
  1627. #==============================================================================
  1628. # Window_Boss_Types
  1629. #==============================================================================
  1630.  
  1631. class Window_Boss_Types < Window_Selectable
  1632.  
  1633. #--------------------------------------------------------------------------
  1634. # initialize
  1635. #--------------------------------------------------------------------------
  1636. def initialize
  1637. super(136, 80, 272, 280)
  1638. self.index = 0
  1639. self.opacity = 0
  1640. self.visible = false
  1641. self.active = false
  1642. refresh
  1643. end
  1644.  
  1645. #--------------------------------------------------------------------------
  1646. # refresh
  1647. #--------------------------------------------------------------------------
  1648. def refresh
  1649. @data = YE::MENU::MONSTER::TYPE_ORDERING
  1650. @item_max = @data.size
  1651. create_contents
  1652. for i in 0...@item_max
  1653. draw_item(i)
  1654. end
  1655. end
  1656.  
  1657. #--------------------------------------------------------------------------
  1658. # type
  1659. #--------------------------------------------------------------------------
  1660. def type
  1661. return @data[self.index]
  1662. end
  1663.  
  1664. #--------------------------------------------------------------------------
  1665. # draw_item
  1666. #--------------------------------------------------------------------------
  1667. def draw_item(index)
  1668. rect = item_rect(index)
  1669. self.contents.clear_rect(rect)
  1670. type = @data[index]
  1671. icon = YE::MENU::MONSTER::BOSS_TYPES[type][0]
  1672. name = YE::MENU::MONSTER::BOSS_TYPES[type][8]
  1673. text = sprintf(YE::MENU::MONSTER::CATEGORIZE_VIEW, name)
  1674. draw_icon(icon, rect.x+4, rect.y)
  1675. self.contents.draw_text(rect.x+28, rect.y, rect.width-28, WLH, text)
  1676. end
  1677.  
  1678. end # Window_Boss_Types
  1679.  
  1680. #===============================================================================
  1681. # Window Enemy Name
  1682. #===============================================================================
  1683.  
  1684. class Window_Enemy_Name < Window_Base
  1685.  
  1686. #--------------------------------------------------------------------------
  1687. # initialize
  1688. #--------------------------------------------------------------------------
  1689. def initialize(x, y, width, height)
  1690. super(x, y, width, height)
  1691. self.back_opacity = 255
  1692. @target_enemy_window = nil
  1693. self.z = 200
  1694. self.visible = false
  1695. end
  1696.  
  1697. #--------------------------------------------------------------------------
  1698. # appear and disappear
  1699. #--------------------------------------------------------------------------
  1700. def appear(enemy, window = nil)
  1701. @enemy = enemy
  1702. @target_enemy_window = window
  1703. self.openness = 128
  1704. @opening = true
  1705. self.visible = true
  1706. draw_content
  1707. end
  1708.  
  1709. def disappear
  1710. self.visible = false
  1711. end
  1712.  
  1713. #--------------------------------------------------------------------------
  1714. # draw content
  1715. #--------------------------------------------------------------------------
  1716. def draw_content
  1717. self.contents.clear
  1718. text = sprintf(YE::MENU::MONSTER::ENEMY_NAME, @enemy.name)
  1719. if $imported["EnemyLevelControl"]
  1720. level = @enemy.level
  1721. text = sprintf(YE::BATTLE::ENEMY::SCANNED_ENEMY_LEVEL, level, text)
  1722. end
  1723. self.contents.draw_text(0, 0, 240, 24, text, 1)
  1724. end
  1725.  
  1726. end # Window_Enemy_Name
  1727.  
  1728. #===============================================================================
  1729. # Window Enemy Image
  1730. #===============================================================================
  1731.  
  1732. class Window_Enemy_Image < Window_Base
  1733.  
  1734. #--------------------------------------------------------------------------
  1735. # initialize
  1736. #--------------------------------------------------------------------------
  1737. def initialize(x, y, width, height)
  1738. super(x, y, width, height)
  1739. self.back_opacity = 255
  1740. @target_enemy_window = nil
  1741. self.z = 200
  1742. self.visible = false
  1743. end
  1744.  
  1745. #--------------------------------------------------------------------------
  1746. # appear and disappear
  1747. #--------------------------------------------------------------------------
  1748. def appear (enemy, window = nil)
  1749. @enemy = enemy
  1750. @target_enemy_window = window
  1751. self.openness = 128
  1752. @opening = true
  1753. self.visible = true
  1754. draw_content
  1755. end
  1756.  
  1757. def disappear
  1758. self.visible = false
  1759. end
  1760.  
  1761. #--------------------------------------------------------------------------
  1762. # draw content
  1763. #--------------------------------------------------------------------------
  1764. def draw_content
  1765. self.contents.clear
  1766. enemybit = Cache.battler(@enemy.battler_name, @enemy.battler_hue)
  1767. bw = enemybit.width
  1768. bh = enemybit.height
  1769. if bw > (self.width - 32)
  1770. bw = (self.width - 32)
  1771. bh *= (self.width - 32)
  1772. bh /= enemybit.width
  1773. end
  1774. if bh > (self.height - 32)
  1775. bh = (self.height - 32)
  1776. bw *= (self.height - 32)
  1777. bw /= enemybit.height
  1778. end
  1779. rect = Rect.new(0, 0, bw, bh)
  1780. #---------
  1781. rect.x = (self.width - 32 - rect.width) / 2
  1782. rect.y = (self.height - 32 - rect.height) / 2
  1783. #---------
  1784. self.contents.stretch_blt(rect, enemybit, enemybit.rect)
  1785. end
  1786.  
  1787. end # Window_Enemy_Image
  1788.  
  1789. #===============================================================================
  1790. # Window Enemy Scan
  1791. #===============================================================================
  1792.  
  1793. class Window_Enemy_Scan < Window_Base
  1794.  
  1795. #--------------------------------------------------------------------------
  1796. # initialize
  1797. #--------------------------------------------------------------------------
  1798. def initialize(x, y, width, height, inbattle)
  1799. super(x, y, width, height)
  1800. self.back_opacity = 255
  1801. @target_enemy_window = nil
  1802. @inbattle = inbattle
  1803. @require = YE::MENU::MONSTER::REQUIRE_SCAN
  1804. self.z = 200
  1805. self.visible = false
  1806. end
  1807.  
  1808. #--------------------------------------------------------------------------
  1809. # appear and disappear
  1810. #--------------------------------------------------------------------------
  1811. def appear (enemy, window = nil)
  1812. @enemy = enemy
  1813. @target_enemy_window = window
  1814. @page = 1
  1815. @total_pages = create_total_pages
  1816. draw_enemy_data
  1817. self.openness = 128
  1818. @opening = true
  1819. self.active = true
  1820. self.visible = true
  1821. end
  1822.  
  1823. def disappear
  1824. self.active = false
  1825. self.visible = false
  1826. end
  1827.  
  1828. #--------------------------------------------------------------------------
  1829. # page switching
  1830. #--------------------------------------------------------------------------
  1831. def next_page
  1832. if @page != @total_pages
  1833. @page += 1
  1834. else
  1835. @page = 1
  1836. end
  1837. turn_sound
  1838. draw_enemy_data
  1839. end
  1840.  
  1841. def previous_page
  1842. if @page != 1
  1843. @page -= 1
  1844. else
  1845. @page = @total_pages
  1846. end
  1847. turn_sound
  1848. draw_enemy_data
  1849. end
  1850.  
  1851. def top_page
  1852. @page = 1
  1853. turn_sound
  1854. draw_enemy_data
  1855. end
  1856.  
  1857. def bottom_page
  1858. @page = @total_pages
  1859. turn_sound
  1860. draw_enemy_data
  1861. end
  1862.  
  1863. #--------------------------------------------------------------------------
  1864. # turn sound
  1865. #--------------------------------------------------------------------------
  1866. def turn_sound
  1867. unless YE::MENU::MONSTER::PAGE_SOUND == nil
  1868. sound = YE::MENU::MONSTER::PAGE_SOUND
  1869. sound.play
  1870. end
  1871. end
  1872.  
  1873. #--------------------------------------------------------------------------
  1874. # draw enemy data
  1875. #--------------------------------------------------------------------------
  1876. def draw_enemy_data
  1877. self.contents.clear
  1878. self.contents.font.color.alpha = 255
  1879. self.contents.font.size = Font.default_size
  1880. self.contents.font.color = normal_color
  1881. @category_colour = YE::MENU::MONSTER::DATA_CATEGORY_COLOUR
  1882. #--------------------
  1883. pagecase = @contents[@page - 1]
  1884. if @page == 1 and !YE::MENU::MONSTER::REPLACE_PAGE_MSG
  1885. text1 = ""
  1886. else
  1887. text1 = YE::MENU::MONSTER::DATA_LEFT
  1888. end
  1889. if YE::MENU::MONSTER::REPLACE_PAGE_MSG #--------------------------------------
  1890.  
  1891. text2 = case_page_name(pagecase)
  1892.  
  1893. else #----------------------------------------------------------------------
  1894. text2 = sprintf(YE::MENU::MONSTER::DATA_PAGES, @page, @total_pages)
  1895. end
  1896. if @page == @total_pages and !YE::MENU::MONSTER::REPLACE_PAGE_MSG
  1897. text3 = ""
  1898. else
  1899. text3 = YE::MENU::MONSTER::DATA_RIGHT
  1900. end
  1901. #--------------------
  1902. self.contents.draw_text(2, 0, 232, WLH, text1, 0)
  1903. self.contents.draw_text(2, 0, 232, WLH, text2, 1)
  1904. self.contents.draw_text(2, 0, 232, WLH, text3, 2)
  1905. #--------------------
  1906. if @enemy != nil
  1907. case_page_run(pagecase)
  1908. end
  1909. end
  1910.  
  1911. #--------------------------------------------------------------------------
  1912. # make general page
  1913. #--------------------------------------------------------------------------
  1914. def make_general_page
  1915. y = WLH
  1916. x = 0
  1917. sw = self.width - 32
  1918. gc0 = gauge_back_color
  1919. gce = text_color(YE::MENU::MONSTER::EXHAUST_COLOUR)
  1920. gh = YE::MENU::MONSTER::GAUGE_HEIGHT
  1921. dx = (sw - (24 * @enemy.enemy.boss_type.size)) / 2
  1922. for boss_type in @enemy.enemy.boss_type
  1923. array = YE::MENU::MONSTER::BOSS_TYPES[boss_type]
  1924. icon = array[0]
  1925. draw_icon(icon, dx, y, true)
  1926. dx += 24
  1927. end
  1928. dsearray = YE::MENU::MONSTER::BOSS_TYPES[@enemy.enemy.boss_type[0]]
  1929. #--------Draw HP--------
  1930. y += WLH
  1931. if @enemy.maxhp > @enemy.base_maxhp
  1932. icon = YE::MENU::MONSTER::ICON_HIGH
  1933. elsif @enemy.maxhp < @enemy.base_maxhp
  1934. icon = YE::MENU::MONSTER::ICON_LOW
  1935. else
  1936. icon = dsearray[1]
  1937. end
  1938. @enemy.hp = @enemy.maxhp if @enemy.hp > @enemy.maxhp
  1939. gc1 = text_color(dsearray[2])
  1940. gc2 = text_color(dsearray[3])
  1941. gy = y + WLH - 8 - (gh - 6)
  1942. if @enemy.maxhp < @enemy.base_maxhp and @enemy.base_maxhp > 0
  1943. gb = sw * @enemy.maxhp / @enemy.base_maxhp
  1944. self.contents.fill_rect(x, gy, sw, gh, gce)
  1945. else
  1946. gb = sw
  1947. end
  1948. self.contents.fill_rect(x, gy, gb, gh, gc0)
  1949. if @enemy.maxhp <= 0
  1950. if @enemy.base_maxhp <= 0
  1951. gw = sw
  1952. else
  1953. gw = 0
  1954. end
  1955. else
  1956. gw = gb * @enemy.hp / @enemy.maxhp
  1957. self.contents.gradient_fill_rect(x, gy, gw, gh, gc1, gc2)
  1958. end
  1959. draw_icon(icon, x, y, true)
  1960. text = Vocab::hp
  1961. self.contents.font.color = text_color(@category_colour)
  1962. self.contents.draw_text(24, y, sw-24, WLH, text, 0)
  1963. self.contents.font.color = normal_color
  1964. hidehp = false
  1965. if @require
  1966. hidehp = true unless $game_party.scan_hp_mp.include?(@enemy.enemy_id)
  1967. end
  1968. if hidehp or @enemy.enemy.hide_hp_mp
  1969. text = YE::MENU::MONSTER::HIDDEN_HP
  1970. elsif YE::MENU::MONSTER::HP_DISPLAY_TYPE == 1
  1971. text = @enemy.hp
  1972. elsif YE::MENU::MONSTER::HP_DISPLAY_TYPE == 2
  1973. text = sprintf("%d/%d",@enemy.hp,@enemy.maxhp)
  1974. else
  1975. text = sprintf("%#.05g%%",@enemy.hp * 100.000 / @enemy.maxhp)
  1976. end
  1977. self.contents.draw_text(0, y, sw, WLH, text, 2)
  1978. #--------Draw MP--------
  1979. y += WLH
  1980. if @enemy.maxmp > @enemy.base_maxmp
  1981. icon = YE::MENU::MONSTER::ICON_HIGH
  1982. elsif @enemy.maxmp < @enemy.base_maxmp
  1983. icon = YE::MENU::MONSTER::ICON_LOW
  1984. else
  1985. icon = dsearray[4]
  1986. end
  1987. @enemy.mp = @enemy.maxmp if @enemy.mp > @enemy.maxmp
  1988. gc1 = text_color(dsearray[5])
  1989. gc2 = text_color(dsearray[6])
  1990. gy = y + WLH - 8 - (gh - 6)
  1991. if @enemy.maxmp < @enemy.base_maxmp and @enemy.base_maxmp > 0
  1992. gb = sw * @enemy.maxmp / @enemy.base_maxmp
  1993. self.contents.fill_rect(x, gy, sw, gh, gce)
  1994. else
  1995. gb = sw
  1996. end
  1997. self.contents.fill_rect(x, gy, gb, gh, gc0)
  1998. if @enemy.maxmp <= 0
  1999. if @enemy.base_maxmp <= 0
  2000. gw = sw
  2001. else
  2002. gw = 0
  2003. end
  2004. else
  2005. gw = gb * @enemy.mp / @enemy.maxmp
  2006. end
  2007. self.contents.gradient_fill_rect(x, gy, gw, gh, gc1, gc2)
  2008. draw_icon(icon, x, y, true)
  2009. text = Vocab::mp
  2010. self.contents.font.color = text_color(@category_colour)
  2011. self.contents.draw_text(24, y, sw-24, WLH, text, 0)
  2012. self.contents.font.color = normal_color
  2013. hidemp = false
  2014. if @require
  2015. hidemp = true unless $game_party.scan_hp_mp.include?(@enemy.enemy_id)
  2016. end
  2017. if hidemp or @enemy.enemy.hide_hp_mp
  2018. text = YE::MENU::MONSTER::HIDDEN_MP
  2019. elsif YE::MENU::MONSTER::MP_DISPLAY_TYPE == 1
  2020. text = @enemy.mp
  2021. elsif YE::MENU::MONSTER::MP_DISPLAY_TYPE == 2
  2022. text = sprintf("%d/%d",@enemy.mp,@enemy.maxmp)
  2023. else
  2024. if @enemy.maxmp
  2025. text = sprintf("%#.05g%%", 100.000)
  2026. else
  2027. text = sprintf("%#.05g%%",@enemy.mp * 100.000 / @enemy.maxmp)
  2028. end
  2029. end
  2030. self.contents.draw_text(0, y, sw, WLH, text, 2)
  2031. #--------Draw ADSA and HECO Stats--------
  2032. self.contents.font.size = YE::MENU::MONSTER::FONT_SIZE
  2033. hide = YE::MENU::MONSTER::HIDDEN_STAT
  2034. hidestats = false
  2035. if @require
  2036. hidestats = true unless $game_party.scan_stats.include?(@enemy.enemy_id)
  2037. end
  2038. if hidestats or @enemy.enemy.hide_stats
  2039. textatk = hide; textdef = hide; textspi = hide; textagi = hide
  2040. texthit = hide; texteva = hide; textcri = hide; textodds = hide
  2041. else
  2042. textatk = @enemy.atk; textdef = @enemy.def
  2043. textspi = @enemy.spi; textagi = @enemy.agi
  2044. texthit = sprintf("%d%%",@enemy.hit)
  2045. texteva = sprintf("%d%%",@enemy.eva)
  2046. textcri = sprintf("%d%%",@enemy.cri)
  2047. textodds = sprintf("%d", @enemy.odds)
  2048. end
  2049. #---ATK---
  2050. y += WLH + WLH / 4
  2051. if @enemy.atk > @enemy.base_atk
  2052. icon = YE::MENU::MONSTER::ICON_HIGH
  2053. elsif @enemy.atk < @enemy.base_atk
  2054. icon = YE::MENU::MONSTER::ICON_LOW
  2055. else
  2056. icon = YE::MENU::MONSTER::ICON_ATK
  2057. end
  2058. draw_icon(icon, 0, y, true)
  2059. self.contents.font.color = text_color(@category_colour)
  2060. text = YE::MENU::MONSTER::DATA_ATK
  2061. self.contents.draw_text(24, y, sw/4-24, WLH, text, 0)
  2062. self.contents.font.color = normal_color
  2063. self.contents.draw_text(sw/4, y, sw/4-12, WLH, textatk, 2)
  2064. #---HIT---
  2065. unless YE::MENU::MONSTER::HIDE_HIT
  2066. icon = YE::MENU::MONSTER::ICON_HIT
  2067. draw_icon(icon, sw/2, y, true)
  2068. self.contents.font.color = text_color(@category_colour)
  2069. text = YE::MENU::MONSTER::DATA_HIT
  2070. self.contents.draw_text(sw/2+24, y, sw/4-24, WLH, text, 0)
  2071. self.contents.font.color = normal_color
  2072. self.contents.draw_text(sw*3/4, y, sw/4-12, WLH, texthit, 2)
  2073. end
  2074. #---DEF---
  2075. y += WLH
  2076. if @enemy.def > @enemy.base_def
  2077. icon = YE::MENU::MONSTER::ICON_HIGH
  2078. elsif @enemy.def < @enemy.base_def
  2079. icon = YE::MENU::MONSTER::ICON_LOW
  2080. else
  2081. icon = YE::MENU::MONSTER::ICON_DEF
  2082. end
  2083. draw_icon(icon, 0, y, true)
  2084. self.contents.font.color = text_color(@category_colour)
  2085. text = YE::MENU::MONSTER::DATA_DEF
  2086. self.contents.draw_text(24, y, sw/4-24, WLH, text, 0)
  2087. self.contents.font.color = normal_color
  2088. self.contents.draw_text(sw/4, y, sw/4-12, WLH, textdef, 2)
  2089. #---EVA---
  2090. unless YE::MENU::MONSTER::HIDE_EVA
  2091. icon = YE::MENU::MONSTER::ICON_EVA
  2092. draw_icon(icon, sw/2, y, true)
  2093. self.contents.font.color = text_color(@category_colour)
  2094. text = YE::MENU::MONSTER::DATA_EVA
  2095. self.contents.draw_text(sw/2+24, y, sw/4-24, WLH, text, 0)
  2096. self.contents.font.color = normal_color
  2097. self.contents.draw_text(sw*3/4, y, sw/4-12, WLH, texteva, 2)
  2098. end
  2099. #---SPI---
  2100. y += WLH
  2101. if @enemy.spi > @enemy.base_spi
  2102. icon = YE::MENU::MONSTER::ICON_HIGH
  2103. elsif @enemy.spi < @enemy.base_spi
  2104. icon = YE::MENU::MONSTER::ICON_LOW
  2105. else
  2106. icon = YE::MENU::MONSTER::ICON_SPI
  2107. end
  2108. draw_icon(icon, 0, y, true)
  2109. self.contents.font.color = text_color(@category_colour)
  2110. text = YE::MENU::MONSTER::DATA_SPI
  2111. self.contents.draw_text(24, y, sw/4-24, WLH, text, 0)
  2112. self.contents.font.color = normal_color
  2113. self.contents.draw_text(sw/4, y, sw/4-12, WLH, textspi, 2)
  2114. #---CRI---
  2115. unless YE::MENU::MONSTER::HIDE_CRI
  2116. icon = YE::MENU::MONSTER::ICON_CRI
  2117. draw_icon(icon, sw/2, y, true)
  2118. self.contents.font.color = text_color(@category_colour)
  2119. text = YE::MENU::MONSTER::DATA_CRI
  2120. self.contents.draw_text(sw/2+24, y, sw/4-24, WLH, text, 0)
  2121. self.contents.font.color = normal_color
  2122. self.contents.draw_text(sw*3/4, y, sw/4-12, WLH, textcri, 2)
  2123. end
  2124. #---AGI---
  2125. y += WLH
  2126. if @enemy.agi > @enemy.base_agi
  2127. icon = YE::MENU::MONSTER::ICON_HIGH
  2128. elsif @enemy.agi < @enemy.base_agi
  2129. icon = YE::MENU::MONSTER::ICON_LOW
  2130. else
  2131. icon = YE::MENU::MONSTER::ICON_AGI
  2132. end
  2133. draw_icon(icon, 0, y, true)
  2134. self.contents.font.color = text_color(@category_colour)
  2135. text = YE::MENU::MONSTER::DATA_AGI
  2136. self.contents.draw_text(24, y, sw/4-24, WLH, text, 0)
  2137. self.contents.font.color = normal_color
  2138. self.contents.draw_text(sw/4, y, sw/4-12, WLH, textagi, 2)
  2139. #---ODDS---
  2140. unless YE::MENU::MONSTER::HIDE_ODDS
  2141. icon = YE::MENU::MONSTER::ICON_ODDS
  2142. draw_icon(icon, sw/2, y, true)
  2143. self.contents.font.color = text_color(@category_colour)
  2144. text = YE::MENU::MONSTER::DATA_ODDS
  2145. self.contents.draw_text(sw/2+24, y, sw/4-24, WLH, text, 0)
  2146. self.contents.font.color = normal_color
  2147. self.contents.draw_text(sw*3/4, y, sw/4-12, WLH, textodds, 2)
  2148. end
  2149. #--------STATUS EFFECTS--------
  2150. y += WLH + WLH / 4
  2151. state_draw = @enemy.states
  2152. for state in state_draw
  2153. state_draw.delete(state) if state.icon_index == 0
  2154. end
  2155. unless state_draw == []
  2156. self.contents.font.size = Font.default_size
  2157. self.contents.font.color = text_color(@category_colour)
  2158. text = YE::MENU::MONSTER::DATA_STATES
  2159. self.contents.draw_text(0, y, sw, WLH, text, 1)
  2160. y += WLH
  2161. draw_actor_state(@enemy, 0, y, sw + 12)
  2162. end
  2163. end # make general page
  2164.  
  2165. #--------------------------------------------------------------------------
  2166. # make skills page
  2167. #--------------------------------------------------------------------------
  2168. def make_skills_page
  2169. x = 0
  2170. y = WLH
  2171. sw = self.width - 32
  2172. action_list = []
  2173. skilltotal = 0
  2174. for action in @enemy.enemy.actions
  2175. if action.kind == 1
  2176. obj = $data_skills[action.skill_id]
  2177. unless action_list.include?(obj)
  2178. action_list.push(obj)
  2179. skilltotal += 1
  2180. end
  2181. end
  2182. end
  2183. y += WLH
  2184. self.contents.font.color = normal_color
  2185. for obj in action_list
  2186. break if (y + 24) > (self.height - 32)
  2187. draw_item_name(obj, x, y, true)
  2188. y += WLH
  2189. end
  2190. y = WLH
  2191. self.contents.font.color = text_color(@category_colour)
  2192. text = YE::MENU::MONSTER::DATA_SKILLS
  2193. self.contents.draw_text(0, y, sw, WLH, text, 0)
  2194. if skilltotal == 1
  2195. text = sprintf(YE::MENU::MONSTER::VIEW_SKILLS1, skilltotal)
  2196. else
  2197. text = sprintf(YE::MENU::MONSTER::VIEW_SKILLS2, skilltotal)
  2198. end
  2199. self.contents.draw_text(0, y, sw, WLH, text, 2)
  2200. end # end make skills page
  2201.  
  2202. #--------------------------------------------------------------------------
  2203. # make elements page
  2204. #--------------------------------------------------------------------------
  2205. def make_elements_page
  2206. x = 0
  2207. y = WLH
  2208. sw = self.width - 32
  2209. for key in YE::MENU::MONSTER::ELEMENT_HASH
  2210. doublearr = key[1]
  2211. ele_array = doublearr[0]
  2212. ele_icon = doublearr[1]
  2213. self.contents.font.color = text_color(@category_colour)
  2214. text = key[0]
  2215. self.contents.draw_text(0, y, sw, WLH, text, 1)
  2216. y += WLH
  2217. x = (sw - ele_array.size * 24) / 2
  2218. for icon in ele_icon
  2219. draw_icon(icon, x, y, true)
  2220. x += 24
  2221. end
  2222. y += WLH
  2223. x = (sw - ele_array.size * 24) / 2
  2224. for element in ele_array
  2225. rank = @enemy.enemy.element_ranks[element]
  2226. result = [0,1,2,3,4,5,6][rank]
  2227. if result == 0
  2228. draw_icon(YE::MENU::MONSTER::ICON_E_RATE_Z, x, y, true)
  2229. elsif result == 1
  2230. draw_icon(YE::MENU::MONSTER::ICON_E_RATE_A, x, y, true)
  2231. elsif result == 2
  2232. draw_icon(YE::MENU::MONSTER::ICON_E_RATE_B, x, y, true)
  2233. elsif result == 3
  2234. draw_icon(YE::MENU::MONSTER::ICON_E_RATE_C, x, y, true)
  2235. elsif result == 4
  2236. draw_icon(YE::MENU::MONSTER::ICON_E_RATE_D, x, y, true)
  2237. elsif result == 5
  2238. draw_icon(YE::MENU::MONSTER::ICON_E_RATE_E, x, y, true)
  2239. elsif result == 6
  2240. draw_icon(YE::MENU::MONSTER::ICON_E_RATE_F, x, y, true)
  2241. else
  2242. draw_icon(YE::MENU::MONSTER::ICON_E_RATE_U, x, y, true)
  2243. end
  2244. x += 24
  2245. end
  2246. y += WLH * 2
  2247. end
  2248. end # make elements page
  2249.  
  2250. #--------------------------------------------------------------------------
  2251. # make states page
  2252. #--------------------------------------------------------------------------
  2253. def make_states_page
  2254. x = 0
  2255. y = WLH
  2256. sw = self.width - 32
  2257. for key in YE::MENU::MONSTER::STATES_HASH
  2258. states_array = key[1]
  2259. self.contents.font.color = text_color(@category_colour)
  2260. text = key[0]
  2261. self.contents.draw_text(0, y, sw, WLH, text, 1)
  2262. y += WLH
  2263. x = (sw - states_array.size * 24) / 2
  2264. for state_id in states_array
  2265. icon = $data_states[state_id].icon_index
  2266. draw_icon(icon, x, y, true)
  2267. x += 24
  2268. end
  2269. y += WLH
  2270. x = (sw - states_array.size * 24) / 2
  2271. for state_id in states_array
  2272. icon = $data_states[state_id].icon_index
  2273. rank = @enemy.enemy.state_ranks[state_id]
  2274. result = [0,1,2,3,4,5,6][rank]
  2275. if result == 0
  2276. draw_icon(YE::MENU::MONSTER::ICON_S_RATE_Z, x, y, true)
  2277. elsif result == 1
  2278. draw_icon(YE::MENU::MONSTER::ICON_S_RATE_A, x, y, true)
  2279. elsif result == 2
  2280. draw_icon(YE::MENU::MONSTER::ICON_S_RATE_B, x, y, true)
  2281. elsif result == 3
  2282. draw_icon(YE::MENU::MONSTER::ICON_S_RATE_C, x, y, true)
  2283. elsif result == 4
  2284. draw_icon(YE::MENU::MONSTER::ICON_S_RATE_D, x, y, true)
  2285. elsif result == 5
  2286. draw_icon(YE::MENU::MONSTER::ICON_S_RATE_E, x, y, true)
  2287. elsif result == 6
  2288. draw_icon(YE::MENU::MONSTER::ICON_S_RATE_F, x, y, true)
  2289. else
  2290. draw_icon(YE::MENU::MONSTER::ICON_S_RATE_U, x, y, true)
  2291. end
  2292. x += 24
  2293. end
  2294. y += WLH
  2295. end
  2296. end # make states page
  2297.  
  2298. #--------------------------------------------------------------------------
  2299. # make steal page
  2300. #--------------------------------------------------------------------------
  2301. def make_steal_page
  2302. return unless $imported["Steal"]
  2303. x = 0
  2304. y = 0
  2305. sw = self.width - 32
  2306. y += WLH
  2307. self.contents.font.color = text_color(@category_colour)
  2308. text = YE::MENU::MONSTER::DATA_S_ITEM
  2309. self.contents.draw_text(0, y, sw, WLH, text, 0)
  2310. text = YE::MENU::MONSTER::DATA_S_CHANCE
  2311. self.contents.draw_text(0, y, sw, WLH, text, 2)
  2312. y += WLH
  2313. steal_objects = @enemy.steal_objects.clone
  2314. steal_objects.each_with_index { |item, i|
  2315. break if (y + 24) > (self.height - 32)
  2316. next if item == nil
  2317. case item.kind
  2318. when 0
  2319. next
  2320. when 1
  2321. steal_item = $data_items[item.item_id]
  2322. when 2
  2323. steal_item = $data_weapons[item.weapon_id]
  2324. when 3
  2325. steal_item = $data_armors[item.armor_id]
  2326. end
  2327. draw_item_name(steal_item, 0, y)
  2328. text = sprintf("%d%%", item.success_prob)
  2329. self.contents.draw_text(0, y, sw, WLH, text, 2)
  2330. y += WLH
  2331. }
  2332. end # make steal page
  2333.  
  2334. #--------------------------------------------------------------------------
  2335. # make spoils page
  2336. #--------------------------------------------------------------------------
  2337. def make_spoils_page
  2338. x = 0
  2339. y = 0
  2340. sw = self.width - 32
  2341. #---Encounters---
  2342. y += WLH
  2343. self.contents.font.color = text_color(@category_colour)
  2344. text = YE::MENU::MONSTER::DATA_ENCOUNTER
  2345. self.contents.draw_text(24, y, sw-24, WLH, text, 0)
  2346. draw_icon(YE::MENU::MONSTER::ICON_ENCOUNTER, 0, y, true)
  2347. self.contents.font.color = normal_color
  2348. if @enemy.encounters_dse == 1
  2349. text = sprintf(YE::MENU::MONSTER::VIEW_ENC1, @enemy.encounters_dse)
  2350. else
  2351. text = sprintf(YE::MENU::MONSTER::VIEW_ENC2, @enemy.encounters_dse)
  2352. end
  2353. self.contents.draw_text(24, y, sw-24, WLH, text, 2)
  2354. #---Defeated---
  2355. y += WLH
  2356. self.contents.font.color = text_color(@category_colour)
  2357. text = YE::MENU::MONSTER::DATA_KILLED
  2358. self.contents.draw_text(24, y, sw-24, WLH, text, 0)
  2359. draw_icon(YE::MENU::MONSTER::ICON_KILLED, 0, y, true)
  2360. self.contents.font.color = normal_color
  2361. if @enemy.defeated_dse == 1
  2362. text = sprintf(YE::MENU::MONSTER::VIEW_KILLED1, @enemy.defeated_dse)
  2363. else
  2364. text = sprintf(YE::MENU::MONSTER::VIEW_KILLED2, @enemy.defeated_dse)
  2365. end
  2366. self.contents.draw_text(24, y, sw-24, WLH, text, 2)
  2367. #---Escaped---
  2368. y += WLH
  2369. self.contents.font.color = text_color(@category_colour)
  2370. text = YE::MENU::MONSTER::DATA_ESCAPED
  2371. self.contents.draw_text(24, y, sw-24, WLH, text, 0)
  2372. draw_icon(YE::MENU::MONSTER::ICON_ESCAPED, 0, y, true)
  2373. self.contents.font.color = normal_color
  2374. if @enemy.escaped_dse == 1
  2375. text = sprintf(YE::MENU::MONSTER::VIEW_ESCAPED1, @enemy.escaped_dse)
  2376. else
  2377. text = sprintf(YE::MENU::MONSTER::VIEW_ESCAPED2, @enemy.escaped_dse)
  2378. end
  2379. self.contents.draw_text(24, y, sw-24, WLH, text, 2)
  2380. #---Gold---
  2381. y += WLH
  2382. self.contents.font.color = text_color(@category_colour)
  2383. text = YE::MENU::MONSTER::DATA_GOLD
  2384. self.contents.draw_text(24, y, sw-24, WLH, text, 0)
  2385. draw_icon(YE::MENU::MONSTER::ICON_GOLD, 0, y, true)
  2386. self.contents.font.color = normal_color
  2387. text = sprintf(YE::MENU::MONSTER::VIEW_GOLD, @enemy.gold)
  2388. self.contents.draw_text(24, y, sw-24, WLH, text, 2)
  2389. #---Exp---
  2390. y += WLH
  2391. self.contents.font.color = text_color(@category_colour)
  2392. text = YE::MENU::MONSTER::DATA_EXP
  2393. self.contents.draw_text(24, y, sw-24, WLH, text, 0)
  2394. draw_icon(YE::MENU::MONSTER::ICON_EXP, 0, y, true)
  2395. self.contents.font.color = normal_color
  2396. text = sprintf(YE::MENU::MONSTER::VIEW_EXP, @enemy.exp)
  2397. self.contents.draw_text(24, y, sw-24, WLH, text, 2)
  2398. #---Drops---
  2399. if YE::MENU::MONSTER::SPOIL_DROPS and !@enemy.enemy.hide_drops
  2400. y += WLH
  2401. drop_items = [@enemy.drop_item1, @enemy.drop_item2]
  2402. if $imported["ExtraDropItem"]
  2403. drop_items += @enemy.extra_drop_items
  2404. end
  2405. self.contents.font.color = text_color(@category_colour)
  2406. text = YE::MENU::MONSTER::DATA_DROPS
  2407. self.contents.draw_text(0, y, sw, WLH, text, 1)
  2408. y += WLH
  2409. drop_items.each_with_index { |item, i|
  2410. break if (y + 24) > (self.height - 32)
  2411. case item.kind
  2412. when 0
  2413. next
  2414. when 1
  2415. drop_item = $data_items[item.item_id]
  2416. when 2
  2417. drop_item = $data_weapons[item.weapon_id]
  2418. when 3
  2419. drop_item = $data_armors[item.armor_id]
  2420. end
  2421. draw_item_name(drop_item, 0, y)
  2422. if $imported["ExtraDropItem"] && item.drop_prob > 0
  2423. text = sprintf("%d%%", item.drop_prob)
  2424. else
  2425. text = sprintf("%d%%", 1 * 100 /item.denominator)
  2426. end
  2427. self.contents.draw_text(0, y, sw, WLH, text, 2)
  2428. y += WLH
  2429. }
  2430. end
  2431. end # make spoils page
  2432.  
  2433. #--------------------------------------------------------------------------
  2434. # make drops page
  2435. #--------------------------------------------------------------------------
  2436. def make_drops_page
  2437. x = 0
  2438. y = 0
  2439. sw = self.width - 32
  2440. y += WLH
  2441. self.contents.font.color = text_color(@category_colour)
  2442. text = YE::MENU::MONSTER::DATA_D_ITEM
  2443. self.contents.draw_text(0, y, sw, WLH, text, 0)
  2444. text = YE::MENU::MONSTER::DATA_D_CHANCE
  2445. self.contents.draw_text(0, y, sw, WLH, text, 2)
  2446. y += WLH
  2447. drop_items = [@enemy.drop_item1, @enemy.drop_item2]
  2448. if $imported["ExtraDropItem"]
  2449. drop_items += @enemy.extra_drop_items
  2450. end
  2451. drop_items.each_with_index { |item, i|
  2452. break if (y + 24) > (self.height - 32)
  2453. case item.kind
  2454. when 0
  2455. next
  2456. when 1
  2457. drop_item = $data_items[item.item_id]
  2458. when 2
  2459. drop_item = $data_weapons[item.weapon_id]
  2460. when 3
  2461. drop_item = $data_armors[item.armor_id]
  2462. end
  2463. draw_item_name(drop_item, 0, y)
  2464. if $imported["ExtraDropItem"] && item.drop_prob > 0
  2465. text = sprintf("%d%%", item.drop_prob)
  2466. else
  2467. text = sprintf("%d%%", 1 * 100 /item.denominator)
  2468. end
  2469. self.contents.draw_text(0, y, sw, WLH, text, 2)
  2470. y += WLH
  2471. }
  2472. end # make drops page
  2473.  
  2474. #--------------------------------------------------------------------------
  2475. # make notes page
  2476. #--------------------------------------------------------------------------
  2477. def make_notes_page
  2478. self.contents.font.color.alpha = 255
  2479. self.contents.font.size = YE::MENU::MONSTER::NOTE_PAGE_TEXT_SIZE
  2480. self.contents.font.color = text_color(YE::MENU::MONSTER::NOTE_PAGE_TEXT_COLOUR)
  2481. y = 24
  2482. txsize = YE::MENU::MONSTER::NOTE_PAGE_TEXT_SIZE + 4
  2483. text = YE::HASH::ENEMY_NOTES[@enemy.enemy_id]
  2484. nwidth = YE::MENU::MONSTER::NOTE_PAGE_WIDTH
  2485. buf = text.gsub(/\\N(\[\d+\])/i) { "\\__#{$1}" }
  2486. lines = buf.split(/(?:[|]|\\n)/i)
  2487. lines.each_with_index { |l, i|
  2488. l.gsub!(/\\__(\[\d+\])/i) { "\\N#{$1}" }
  2489. self.contents.draw_text(0, i * txsize + y, nwidth, WLH, l, 0)
  2490. }
  2491. end #end def
  2492.  
  2493. #--------------------------------------------------------------------------
  2494. # create_total_pages
  2495. #--------------------------------------------------------------------------
  2496. def create_total_pages
  2497. @contents = []
  2498. @contents.push(0) if YE::MENU::MONSTER::SHOW_GENERAL
  2499. #----------------
  2500. action_list = []
  2501. for action in @enemy.enemy.actions
  2502. if action.kind == 1
  2503. obj = $data_skills[action.skill_id]
  2504. action_list.push(obj) unless action_list.include?(obj)
  2505. end
  2506. end
  2507. if YE::MENU::MONSTER::SHOW_SKILLS and action_list != []
  2508. if @require
  2509. if $game_party.scan_skill.include?(@enemy.enemy_id)
  2510. @contents.push(1) unless @enemy.enemy.hide_skill
  2511. end
  2512. else
  2513. @contents.push(1) unless @enemy.enemy.hide_skill
  2514. end
  2515. end
  2516. #----------------
  2517. if YE::MENU::MONSTER::SHOW_ELEMENTS
  2518. if @require
  2519. if $game_party.scan_elem.include?(@enemy.enemy_id)
  2520. @contents.push(2) unless @enemy.enemy.hide_elem
  2521. end
  2522. else
  2523. @contents.push(2) unless @enemy.enemy.hide_elem
  2524. end
  2525. end
  2526. #----------------
  2527. if YE::MENU::MONSTER::SHOW_STATES
  2528. if @require
  2529. if $game_party.scan_state.include?(@enemy.enemy_id)
  2530. @contents.push(3) unless @enemy.enemy.hide_state
  2531. end
  2532. else
  2533. @contents.push(3) unless @enemy.enemy.hide_state
  2534. end
  2535. end
  2536. #----------------
  2537. if YE::MENU::MONSTER::SHOW_STEAL and $imported["Steal"]
  2538. if @require
  2539. if $game_party.scan_steal.include?(@enemy.enemy_id)
  2540. @contents.push(80) unless @enemy.enemy.hide_steal
  2541. end
  2542. else
  2543. @contents.push(80) unless @enemy.enemy.hide_steal
  2544. end
  2545. end
  2546. #----------------
  2547. if YE::MENU::MONSTER::SHOW_SPOILS
  2548. if @require
  2549. if $game_party.scan_spoil.include?(@enemy.enemy_id)
  2550. @contents.push(90) unless @enemy.enemy.hide_spoil
  2551. end
  2552. else
  2553. @contents.push(90) unless @enemy.enemy.hide_spoil
  2554. end
  2555. end
  2556. #----------------
  2557. if YE::MENU::MONSTER::SHOW_DROPS
  2558. if @require
  2559. if $game_party.scan_drops.include?(@enemy.enemy_id)
  2560. @contents.push(91) unless @enemy.enemy.hide_drops
  2561. end
  2562. else
  2563. @contents.push(91) unless @enemy.enemy.hide_drops
  2564. end
  2565. end
  2566. #----------------
  2567. if YE::MENU::MONSTER::SHOW_NOTES
  2568. if @require
  2569. if YE::HASH::ENEMY_NOTES.include?(@enemy.enemy_id)
  2570. @contents.push(100) if $game_party.scan_desc.include?(@enemy.enemy_id)
  2571. end
  2572. else
  2573. if YE::HASH::ENEMY_NOTES.include?(@enemy.enemy_id)
  2574. @contents.push(100)
  2575. end
  2576. end
  2577. end
  2578. #----------------
  2579. n = @contents.size
  2580. return n
  2581. end
  2582.  
  2583. #--------------------------------------------------------------------------
  2584. # case_page_name
  2585. #--------------------------------------------------------------------------
  2586. def case_page_name(pagecase)
  2587. if pagecase == 0
  2588. #text = YE::MENU::MONSTER::TITLE_GENERAL
  2589. elsif pagecase == 1
  2590. #text = YE::MENU::MONSTER::TITLE_SKILLS
  2591. elsif pagecase == 2
  2592. #text = YE::MENU::MONSTER::TITLE_ELEMENTS
  2593. elsif pagecase == 3
  2594. #text = YE::MENU::MONSTER::TITLE_STATES
  2595. elsif pagecase == 80
  2596. #text = YE::MENU::MONSTER::TITLE_STEAL
  2597. elsif pagecase == 90
  2598. #text = YE::MENU::MONSTER::TITLE_SPOILS
  2599. elsif pagecase == 91
  2600. #text = YE::MENU::MONSTER::TITLE_DROPS
  2601. elsif pagecase == 100
  2602. text = YE::MENU::MONSTER::TITLE_NOTES
  2603. else
  2604. #text = YE::MENU::MONSTER::TITLE_UNKNOWN
  2605. end
  2606. return text
  2607. end
  2608.  
  2609. #--------------------------------------------------------------------------
  2610. # case_page_run
  2611. #--------------------------------------------------------------------------
  2612. def case_page_run(pagecase)
  2613. if pagecase == 0
  2614. make_general_page
  2615. elsif pagecase == 1
  2616. make_skills_page
  2617. elsif pagecase == 2
  2618. make_elements_page
  2619. elsif pagecase == 3
  2620. make_states_page
  2621. elsif pagecase == 80
  2622. make_steal_page
  2623. elsif pagecase == 90
  2624. make_spoils_page
  2625. elsif pagecase == 91
  2626. make_drops_page
  2627. elsif pagecase == 100
  2628. make_notes_page
  2629. end
  2630. end
  2631.  
  2632. end # Window_Enemy_Scan
  2633.  
  2634. #===============================================================================
  2635. #
  2636. # END OF FILE
  2637. #
  2638. #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement