Advertisement
FlipelyFlip

YERD Query Icon Thing

Feb 11th, 2014
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 89.13 KB | None | 0 0
  1. #===============================================================================
  2. #
  3. # Yanfly Engine RD - Display Item Query
  4. # Last Date Updated: 2009.06.24
  5. # Level: Easy, Normal, Hard, Lunatic
  6. #
  7. # Similar to the other Display Query scripts, this one lets you view item info
  8. # by simply pressing the Shift/A button. This query appears in the item menu,
  9. # the battle scene, and the shop scene where they're needed the most. Although
  10. # the information displayed isn't nearly as large as the other queries, it will
  11. # still hopefully prevent the player from becoming too frustrated with figuring
  12. # out what an item does.
  13. #
  14. # This script also records (over time) where the items can be obtained from
  15. # drops, stolen items, or purchases from shops. This way, players do not need
  16. # to search back and forth between towns to find out where to buy those certain
  17. # items they need so promptly.
  18. #
  19. #===============================================================================
  20. # Updates:
  21. # ----------------------------------------------------------------------------
  22. # o 2009.06.21 - Finished script.
  23. # o 2009.04.26 - Started script.
  24. #===============================================================================
  25. # Instructions
  26. #===============================================================================
  27. #
  28. # These tags can go inside the noteboxes of your items, weapons, and armours.
  29. #
  30. # <key item>
  31. # This will designate the item as a key item. It will replace the cost value
  32. # since most key items shouldn't be buyable or sellable anyway.
  33. #
  34. # <hide general page> <hide class page> <hide value>
  35. # <hide purchase page> <hide steal page> <hide drop page>
  36. # Disables specific pages for those items. General page lists all the usable
  37. # information. Purchase page displays all the buyable information. Steal page
  38. # and drop page displays all the enemies that can drop the item.
  39. #
  40. # <hide usable>
  41. # Hides how the item can be used. (ie battle-only, menu-only, etc)
  42. #
  43. # <query conditional>
  44. # Marks the item's usable as conditional.
  45. #
  46. # <query basedmg x> <query accuracy x> <query hp_f x> <query mp_f x>
  47. # <query atk_f x> <query def_x > <query spi_f x> <query agi_f x>
  48. # <query physical> <query mpdamage> <query absorb> <query ignoredef>
  49. # The above alters the general information displayed to reflect any custom
  50. # changes made to item.
  51. #
  52. # <query hide elements>
  53. # Hides all elemental information available to the item.
  54. #
  55. # <query add element x> <query sub element x>
  56. # Adds/removes element from shown query data. use multiple tags to display more
  57. # of the queried elements.
  58. #
  59. # <query hide state apply> <query hide state erase>
  60. # Hides the applied state properties shown for the item.
  61. #
  62. # <query add state apply> <query add state erase>
  63. # <query sub state apply> <query sub state erase>
  64. # Adds and removes states shown for applied and removed states. Use multiple
  65. # tags to display more of the queried states.
  66. #
  67. #===============================================================================
  68. #
  69. # Compatibility
  70. # - Works With: KGC Extra Drop Items, Steal, Yanfly's Actor Item Synthesis
  71. # - Alias: Window_ShopBuy, initialize
  72. # - Alias: Game_Enemy, perform_collapse
  73. # - Alias: Scene_Battle
  74. #
  75. #===============================================================================
  76.  
  77. $imported = {} if $imported == nil
  78. $imported["DisplayItemQuery"] = true
  79.  
  80. module YE
  81. module MENU
  82. module ITEM
  83.  
  84. # This sets which button will activate the item query window.
  85. ITEM_QUERY_BATTLE_BUTTON = Input::A
  86. ITEM_QUERY_MENU_BUTTON = Input::A
  87. ITEM_QUERY_SHOP_BUTTON = Input::A
  88.  
  89. # This affects the item query help window inside battle.
  90. BATTLE_HELP_SHOW = false
  91. BATTLE_HELP_TEXT = "Shift:Info"
  92. BATTLE_HELP_X = 416
  93. BATTLE_HELP_Y = 288
  94. BATTLE_HELP_W = 128
  95. BATTLE_HELP_O = 255
  96.  
  97. # This affects whether or not the help window shows inside the item menu.
  98. MENU_HELP_SHOW = true
  99. MENU_HELP_TEXT = ["Drücke", "für mehr Informationen."]
  100. MENU_HELP_ICON = 5
  101.  
  102. # This is the sound played when flipping through the various pages.
  103. # Set it to nil if you don't want a sound to play.
  104. PAGE_SOUND = RPG::SE.new("Wind7", 80, 125)
  105.  
  106. # This displays the title information at the very top of the data window.
  107. DATA_LEFT = "<<" # This appears if page can be moved back.
  108. DATA_PAGE1 = "- Information -" # This appears if only one page of info.
  109. DATA_PAGES = "%d/%d" # This appears if more than one page of info.
  110. DATA_RIGHT = ">>" # This appears if page can move right.
  111. DATA_CATEGORY_COLOUR = 16 # This affects category text colour.
  112.  
  113. # Set this to true if you would rather the query display the page info
  114. # type rather than Page X/Y. The titles following correspond to the pages'
  115. # titles should you decide to display them.
  116. REPLACE_PAGE_MSG = true
  117. TITLE_UNKNOWN = "- Keine Informationen -"
  118.  
  119. # This is the string data for other attributes. All seen on page 1.
  120. # Page 1 is always available for every skill unless you change SHOW_PAGE.
  121. TITLE_GENERAL_ITEM = "- Information -"
  122. SHOW_PAGE_GEN_ITEM = true
  123. GEN_ITEM_FONT_SIZE = 16
  124.  
  125. # String data for item value. If an item has no value, this part is
  126. # automatically skipped. Use <hide value> to also hide it.
  127. ICON_VALUE = 205
  128.  
  129. ZERO_INITIATIVE = "+0" # This is given if there's zero initiative.
  130. DATA_NIL = "-" # Nil Data is generally for numbered terms.
  131. DATA_TRUE = "Y" # True and false data stand for attributes.
  132. DATA_FALSE = "N"
  133.  
  134. # String data for when the item is usable. To provide conditional use,
  135. # place in the <query conditional> tag. To hide this, <hide usable>.
  136. TEXT_USABLE_BATTLE = "Nur im Kampf einsetzbar"
  137. TEXT_USABLE_MENU = "Nur im Menü einsetzbar"
  138. TEXT_USABLE_ALWAYS = "Immer einsetzbar"
  139. TEXT_USABLE_NEVER = "Niemals einsetzbar"
  140. TEXT_USABLE_COND = "Unter bestimmten Bedingungen"
  141.  
  142. DATA_SHOP_VAL = "%d Gold bei Verkauf"
  143. DATA_KEY_ITEM = "Wichtiger Gegenstand"
  144.  
  145. # Text and icon data for Recovery effect.
  146. TEXT_HP_RECOVERY = "HP"
  147. TEXT_MP_RECOVERY = "MP"
  148. ICON_HP_RECOVERY = 99
  149. ICON_MP_RECOVERY = 100
  150.  
  151. # Used for scrolls or any other kind of spell-like items. Only shows if
  152. # there is a
  153. DATA_WIDTH = 24 # This sets text width for query data.
  154. DATA_ALIGN = 1 # This sets alignment. 0=left. 1=center. 2=right.
  155. ICON_BASEDMG = 119 # Used for base damage.
  156. ICON_BASEHEAL = 128 # Used for base healing.
  157. ICON_ACCURACY = 135 # Used for accuracy.
  158. ICON_HP_F = 200 # Used for HP F (for CustomDmgFormula).
  159. ICON_MP_F = 201 # Used for MP F (for CustomDmgFormula).
  160. ICON_ATK_F = 2 # Used for Attack F.
  161. ICON_DEF_F = 52 # Used for Defense F (for CustomDmgFormula).
  162. ICON_SPI_F = 21 # Used for Spirit F.
  163. ICON_AGI_F = 48 # Used for Agility F (for CustomDmgFormula).
  164. ICON_PHYS = 132 # Used for the physical attack icon.
  165. ICON_MPDMG = 130 # Used for MP damage icon.
  166. ICON_ABSORB = 215 # Used for absorb damage icon.
  167. ICON_IGDEF = 53 # Used for ignore defense icon.
  168.  
  169. # This is the text used for parameter growth. Icon data is used from
  170. # the list above with the relative ATK_F's and such.
  171. TEXT_MAXHP_GROWTH = "MaxHP Growth"
  172. TEXT_MAXMP_GROWTH = "MaxMP Growth"
  173. TEXT_ATK_GROWTH = "ATK Growth"
  174. TEXT_DEF_GROWTH = "DEF Growth"
  175. TEXT_SPI_GROWTH = "SPI Growth"
  176. TEXT_AGI_GROWTH = "AGI Growth"
  177.  
  178. # This part displays the element text and what elements can be shown.
  179. TEXT_ELEMENTS = "- Information -"
  180. SHOWN_ELEMENTS = [ 2, 3, 4, 5, 6,
  181. 9, 10, 11, 12, 13, 14, 15, 16,
  182. ] # Do not remove this.
  183. ELEMENT_ICONS = { 2 => 10, 3 => 4, 4 => 14, 5 => 16, 6 => 12,
  184. 9 => 104, 10 => 105, 11 => 106, 12 => 107,
  185. 13 => 108, 14 => 109, 15 => 110, 16 => 111,
  186. } # Do not remove this.
  187.  
  188. # This part displays status related changes.
  189. TEXT_APPLY_STATES = "Fügt hinzu:"
  190. TEXT_ERASE_STATES = "Negiert:"
  191.  
  192. # This page will show any custom notes you've set for that item.
  193. SHOW_PAGE_NOTES = true
  194. TITLE_NOTES_ITEMS = "- Information -"
  195. TITLE_NOTES_WEAPONS = "- Information -"
  196. TITLE_NOTES_ARMOURS = "- Information -"
  197. NOTE_PAGE_WIDTH = 240
  198. NOTE_PAGE_TEXT_SIZE = 16
  199. NOTE_PAGE_TEXT_COLOUR = 0
  200.  
  201. # This page is for the equipment stat boosts. Icons are selected here.
  202. ICON_MAXHP = 200
  203. ICON_MAXMP = 201
  204. ICON_ATK = 1314
  205. ICON_DEF = 1478
  206. ICON_SPI = 2298
  207. ICON_AGI = 2172
  208. ICON_HIT = 135
  209. ICON_EVA = 158
  210. ICON_CRI = 119
  211. ICON_ODDS = 137
  212. EQUIP_MAXHP = "MaxHP"
  213. EQUIP_MAXMP = "MaxMP"
  214. EQUIP_ATK = "ATK"
  215. EQUIP_DEF = "DEF"
  216. EQUIP_SPI = "INT"
  217. EQUIP_AGI = "SPD"
  218. EQUIP_HIT = "HIT"
  219. EQUIP_EVA = "EVA"
  220. EQUIP_CRI = "CRI"
  221. EQUIP_ODDS = "LUK"
  222.  
  223. # This sets the display process for the class page under equipments.
  224. # It will show what classes can and can't equip the particular item.
  225. SHOW_CLASSES = false
  226. TITLE_CLASSES = "Classes"
  227.  
  228. # If this is enabled, if all classes can equip that item, it will display
  229. # the all class text instead of listing out every single class.
  230. USE_ALL_CLASS = false
  231. ALL_CLASSES = "All Classes"
  232.  
  233. # If this is enabled, the class structure will show unequippable classes
  234. # in addition to the ones that can equip the item.
  235. SHOW_UNEQUIPPABLE_CLASSES = false
  236.  
  237. # This following hash will determine which classes will be shown and
  238. # what icons will be attributed to them. Class 0 will indicate the ALL
  239. # class which will appear if all other ID's appear on the list.
  240. CLASS_HASH ={
  241. # Class ID => Class Icon
  242. 0 => 62, # All classes
  243. 1 => 3, # Paladin
  244. 2 => 6, # Warrior
  245. 3 => 128, # Priest
  246. 4 => 119, # Magician
  247. 5 => 32, # Knight
  248. 6 => 136, # Dark Knight
  249. 7 => 132, # Grappler
  250. 8 => 39, # Thief
  251. } # Do not remove this.
  252.  
  253. # If this is enabled, it will show all of the locations that the item can
  254. # be bought from (that the player has visited).
  255. SHOW_PURCHASE = true
  256. TITLE_PURCHASE = "- Information -"
  257. TEXT_PURCHASE = "Kaufbei in"
  258. PURCHASE_FSIZE = 16
  259.  
  260. # If this is enabled, it will show all of the enemyes that the item can
  261. # be stolen from (that the player has tried stealing from).
  262. SHOW_STOLEN = false
  263. TITLE_STOLEN = "- Information -"
  264. TEXT_STOLEN = "Stehlbar"
  265. STOLEN_FSIZE = 16
  266.  
  267. # If this is enabled, it will show all of the enemyes that the item can
  268. # be dropped from (that the player has already defeated).
  269. SHOW_DROPPED = true
  270. TITLE_DROPPED = "- Information -"
  271. TEXT_DROPPED = "Erhätlich von"
  272. DROPPED_FSIZE = 16
  273.  
  274. end # ITEM
  275. end # MENU
  276. end # YE
  277.  
  278. #===============================================================================
  279. # How to Use: Lunatic Mode
  280. #===============================================================================
  281. #
  282. # This part allows you to input your own custom notes and whatnot. Custom notes
  283. # page will only appear for item that are listed in the note hash beneath the
  284. # Lunatic Mode section.
  285. #
  286. # The process is pretty simple. Just follow the template below.
  287. #
  288. # ITEM_NOTES ={
  289. # item.id => "This would be the first line| and this would be the next!",
  290. # } # Do not remove this.
  291. #
  292. # Enter the item's ID number where "item.id" is. Following the "=>" input
  293. # the custom notes you'd like for that skill to display. If you wish to add
  294. # line breaks to notes, add a | where you would like the break to appear. Now
  295. # while they do appear in the notebox, they are confined by the note page's
  296. # width and will shrink if the lines end up being too long. You can adjust the
  297. # note page's width in the part before the Lunatic Mode instructions.
  298. #
  299. #===============================================================================
  300.  
  301. module YE
  302. module HASH
  303.  
  304. #Ah, the potion. Nothing can|
  305.  
  306. #Was soll das heißen, dass
  307. #Forbidden Story nicht bug-
  308. #frei ist?
  309. #Ich hoffe für dich, dass
  310. #zumindest dieses Item nun
  311. #funktionieren wird!
  312.  
  313.  
  314. #Ein wahrlich komisches Buch.||Was es damit auf sich hat?
  315.  
  316. # This is for usable items.
  317. ITEM_NOTES ={
  318. 1 => "Ein gewöhnlicher Trank.||Dieser heilt zwar nur 25%|der gesamten HP, jedoch ist|dieser relativ preisgünstig.",
  319. 2 => "Ein gewöhnlicher Trank.||Dieses beliebte Getränk|wird gerne von Gilden und|Teams für vielseitige Dinge|verwendet.",
  320. 3 => "Blaue Tränke werden haupt-|sächlich zur Erfrischung|des Geistes genutzt.",
  321. 4 => "Blaue Tränke werden haupt-|sächlich zur Erfrischung|des Geistes genutzt.",
  322. 5 => "Grüne Tränke beinhalten|besondere Heilstoffe, die|jede Vergiftung heilen.||Die Menge reicht ausschließ-|lich nur für eine Person.",
  323. 6 => "Grüne Tränke beinhalten|besondere Heilstoffe, die|jede Vergiftung heilen.||Die Menge reicht für die|ganze Gruppe aus.",
  324. 11 => "Die Phoenixfeder ist einer|der letzten Relikte, die der|Insel ihren mysteriösen Ruf|geben.||Sie lässt einen gefallenen|Mitstreiter wieder erwachen.",
  325. 12 => "Die Phoenixfeder ist einer|der letzten Relikte, die der|Insel ihren mysteriösen Ruf|geben.||Sie lässt alle gefallenen|Mitstreiter wieder erwachen.",
  326. 13 => "Das Quellwaser ist einer|der letzten Relikte, die der|Insel ihren mysteriösen Ruf|geben.||Man erzählt sich, dass dies|der Trank einer alten Zivi-|lisation sei.",
  327. 14 => "Das Quellwaser ist einer|der letzten Relikte, die der|Insel ihren mysteriösen Ruf|geben.||Man erzählt sich, dass dies|der Trank einer alten Zivi-|lisation sei.",
  328. 15 => "Niemand weiß so richtig,|was in so einem Elixir nun|tatsächlich drinnen ist...",
  329. 16 => "Allzwecksgegenstand zur|Weiterverarbeitung.||Bitte nicht auf Menschen und|Tiere werfen!",
  330. 19 => "Eine gewöhnliche Kugel für|Fernkampfwaffen.",
  331. 20 => "In einen Magazin passen bis|zu 20 Kugeln hinein.",
  332. 25 => "Eine gewöhnliche Nuss.||Kann zur Weiterverarbeitung|verwendet werden.",
  333. 29 => "Ein gewöhnlicher Pilz.||Kann zur Weiterverarbeitung|verwendet werden.",
  334. 30 => "Ein gewöhnliches Ei.||Kann zur Weiterverarbeitung|verwendet werden.",
  335. 35 => "Ein gewöhnlicher Apfel.||Kann zur Weiterverarbeitung|verwendet werden.",
  336. 92 => "Ein wahrlich komisches Buch.||Was es damit auf sich hat?",
  337. 265 => "Nellos altes Tagebuch.||Für gewöhnlich schreibt er|täglich darin. Laut seinen|Aussagen ist dies sein|bedeutendster Besitz.",
  338. 1200 => "Hello, world.|It's nice to meet you.",
  339. 1200 => "Hello, world.|It's nice to meet you.",
  340. 1201 => "Good bye, world.|It was nice meeting you.",
  341. } # Do not remove this.
  342.  
  343. # This is for weapons.
  344. WEAPON_NOTES ={
  345. 1 => "Typically, a club is small |enough to be wielded in one|hand. Clubs that need both|hands to wield are called|quarterstaffs in English.",
  346. 1200 => "Hello, world.|It's nice to meet you.",
  347. 1201 => "Good bye, world.|It was nice meeting you.",
  348. } # Do not remove this.
  349.  
  350. # This is for armours.
  351. ARMOUR_NOTES ={
  352. 1 => "A shield is a protective|device, meant to intercept|attacks. The term often re-|fers to a device that is held|in the hand/arm.",
  353. 1200 => "Hello, world.|It's nice to meet you.",
  354. 1201 => "Good bye, world.|It was nice meeting you.",
  355. } # Do not remove this.
  356.  
  357. end #module HASH
  358. end #module YE
  359.  
  360. #===============================================================================
  361. # Editting anything past this point may potentially result in causing computer
  362. # damage, incontinence, explosion of user's head, coma, death, and/or halitosis.
  363. # Therefore, edit at your own risk.
  364. #===============================================================================
  365.  
  366. module YE
  367. module REGEXP
  368. module BASEITEM
  369.  
  370. KEY_ITEM = /<(?:KEY_ITEM|key item)>/i
  371.  
  372. HIDE_VALUE = /<(?:HIDE_VALUE|hide value)>/i
  373. HIDE_USABLE = /<(?:HIDE_USABLE|hide usable)>/i
  374. HIDE_GENERAL = /<(?:HIDE_GENERAL_PAGE|hide general page)>/i
  375. HIDE_PURCHASE = /<(?:HIDE_PURCHASE_PAGE|hide purchase page)>/i
  376. HIDE_CLASS_PAGE = /<(?:HIDE_CLASS_PAGE|hide class page)>/i
  377. HIDE_STEAL_FROM = /<(?:HIDE_STEAL_PAGE|hide steal page)>/i
  378. HIDE_DROP_FROM = /<(?:HIDE_DROP_PAGE|hide drop page)>/i
  379. QUERY_CONDITIONAL = /<(?:QUERY_PHYSICAL|query conditional)>/i
  380.  
  381. QUERY_BASEDMG = /<(?:QUERY_BASEDMG|query basedmg|query base dmg)[ ]*(\d+)>/i
  382. QUERY_NBASEDMG = /<(?:QUERY_BASEDMG|query basedmg|query base dmg)[ ]*[-](\d+)>/i
  383. QUERY_ACCURACY = /<(?:QUERY_ACCURACY|query accuracy)[ ]*(\d+)>/i
  384. QUERY_HP_F = /<(?:QUERY_HP_F|query hp_f)[ ]*(\d+)>/i
  385. QUERY_MP_F = /<(?:QUERY_MP_F|query mp_f)[ ]*(\d+)>/i
  386. QUERY_ATK_F = /<(?:QUERY_ATK_F|query atk_f)[ ]*(\d+)>/i
  387. QUERY_DEF_F = /<(?:QUERY_DEF_F|query def_f)[ ]*(\d+)>/i
  388. QUERY_SPI_F = /<(?:QUERY_SPI_F|query spi_f)[ ]*(\d+)>/i
  389. QUERY_AGI_F = /<(?:QUERY_AGI_F|query agi_f)[ ]*(\d+)>/i
  390.  
  391. # Put this in if you want to force query to show it as a physical.
  392. QUERY_PHYSICAL = /<(?:QUERY_PHYSICAL|query physical)>/i
  393. QUERY_MPDAMAGE = /<(?:QUERY_MPDAMAGE|query mpdamage|query mp damage)>/i
  394. QUERY_ABSORB = /<(?:QUERY_ABSORB|query absorb)>/i
  395. QUERY_IGDEF = /<(?:QUERY_IGNOREDEF|query ignoredef|query ignore def)>/i
  396.  
  397. QUERY_HIDE_ELEMENTS = /<(?:QUERY_HIDE_ELEMENTS|query hide elements)>/i
  398. QUERY_ADD_ELEMENT = /<(?:QUERY_ADD_ELEMENT|query add element)[ ]*(\d+)>/i
  399. QUERY_SUB_ELEMENT = /<(?:QUERY_SUB_ELEMENT|query sub element)[ ]*(\d+)>/i
  400.  
  401. # These affect status effects.
  402. QUERY_HIDE_STATE_APPLY = /<(?:QUERY_HIDE_STATE_APPLY|query hide state apply)>/i
  403. QUERY_HIDE_STATE_ERASE = /<(?:QUERY_HIDE_STATE_ERASE|query hide state erase)>/i
  404. QUERY_ADD_STATE_APPLY = /<(?:QUERY_ADD_STATE_APPLY|query add state apply)[ ]*(\d+)>/i
  405. QUERY_SUB_STATE_APPLY = /<(?:QUERY_SUB_STATE_APPLY|query sub state apply)[ ]*(\d+)>/i
  406. QUERY_ADD_STATE_ERASE = /<(?:QUERY_ADD_STATE_ERASE|query add state erase)[ ]*(\d+)>/i
  407. QUERY_SUB_STATE_ERASE = /<(?:QUERY_SUB_STATE_ERASE|query sub state erase)[ ]*(\d+)>/i
  408.  
  409. end # MENU
  410. end # REGEXP
  411. end # YE
  412.  
  413. #===============================================================================
  414. # RPG::BaseItem
  415. #===============================================================================
  416.  
  417. class RPG::BaseItem
  418.  
  419. #--------------------------------------------------------------------------
  420. # Yanfly_Cache_DSE
  421. #--------------------------------------------------------------------------
  422. def yanfly_cache_diq
  423. @hide_value = false; @hide_usable = false; @query_conditional = false
  424. @hide_purchase = false; @hide_general = false; @hide_drop_page = false
  425. @hide_steal_page = false; @key_item = false; @hide_class_page = false
  426. @query_basedmg = 0; @query_accuracy = 0; @query_hp_f = 0; @query_mp_f = 0
  427. @query_atk_f = 0; @query_def_f = 0; @query_spi_f = 0; @query_agi_f = 0
  428. @query_physical = false; @query_mpdamage = false; @query_absorb = false
  429. @query_ignore_def = false; @query_hide_elements = false
  430. @query_add_elements = []; @query_sub_elements = [];
  431. @query_hide_state_apply = false; @query_hide_state_erase = false
  432. @query_add_state_apply = []; @query_sub_state_apply = []
  433. @query_add_state_erase = []; @query_sub_state_erase = []
  434.  
  435. self.note.split(/[\r\n]+/).each { |line|
  436. case line
  437. when YE::REGEXP::BASEITEM::KEY_ITEM
  438. @key_item = true
  439.  
  440. when YE::REGEXP::BASEITEM::HIDE_VALUE
  441. @hide_value = true
  442. when YE::REGEXP::BASEITEM::HIDE_USABLE
  443. @hide_usable = true
  444. when YE::REGEXP::BASEITEM::HIDE_PURCHASE
  445. @hide_purchase = true
  446. when YE::REGEXP::BASEITEM::HIDE_GENERAL
  447. @hide_general = true
  448. when YE::REGEXP::BASEITEM::HIDE_CLASS_PAGE
  449. @hide_class_page = true
  450. when YE::REGEXP::BASEITEM::HIDE_STEAL_FROM
  451. @hide_steal_page = true
  452. when YE::REGEXP::BASEITEM::HIDE_DROP_FROM
  453. @hide_drop_page = true
  454. when YE::REGEXP::BASEITEM::QUERY_CONDITIONAL
  455. @query_conditional = true
  456.  
  457. when YE::REGEXP::BASEITEM::QUERY_BASEDMG
  458. @query_basedmg = $1.to_i
  459. when YE::REGEXP::BASEITEM::QUERY_NBASEDMG
  460. @query_basedmg = $1.to_i * -1
  461. when YE::REGEXP::BASEITEM::QUERY_ACCURACY
  462. @query_accuracy = $1.to_i
  463. when YE::REGEXP::BASEITEM::QUERY_HP_F
  464. @query_hp_f = $1.to_i
  465. when YE::REGEXP::BASEITEM::QUERY_MP_F
  466. @query_mp_f = $1.to_i
  467. when YE::REGEXP::BASEITEM::QUERY_ATK_F
  468. @query_atk_f = $1.to_i
  469. when YE::REGEXP::BASEITEM::QUERY_DEF_F
  470. @query_def_f = $1.to_i
  471. when YE::REGEXP::BASEITEM::QUERY_SPI_F
  472. @query_spi_f = $1.to_i
  473. when YE::REGEXP::BASEITEM::QUERY_AGI_F
  474. @query_agi_f = $1.to_i
  475.  
  476. when YE::REGEXP::BASEITEM::QUERY_PHYSICAL
  477. @query_physical = true
  478. when YE::REGEXP::BASEITEM::QUERY_MPDAMAGE
  479. @query_mpdamage = true
  480. when YE::REGEXP::BASEITEM::QUERY_ABSORB
  481. @query_absorb = true
  482. when YE::REGEXP::BASEITEM::QUERY_IGDEF
  483. @query_ignore_def = true
  484.  
  485. when YE::REGEXP::BASEITEM::QUERY_HIDE_ELEMENTS
  486. @query_hide_elements = true
  487. when YE::REGEXP::BASEITEM::QUERY_ADD_ELEMENT
  488. element = $1.to_i
  489. @query_add_elements.push(element)
  490. when YE::REGEXP::BASEITEM::QUERY_SUB_ELEMENT
  491. element = $1.to_i
  492. @query_sub_elements.push(element)
  493.  
  494. when YE::REGEXP::BASEITEM::QUERY_HIDE_STATE_APPLY
  495. @query_hide_state_apply = true
  496. when YE::REGEXP::BASEITEM::QUERY_HIDE_STATE_ERASE
  497. @query_hide_state_erase = true
  498.  
  499. when YE::REGEXP::BASEITEM::QUERY_ADD_STATE_APPLY
  500. state = $1.to_i
  501. @query_add_state_apply.push(state)
  502. when YE::REGEXP::BASEITEM::QUERY_SUB_STATE_APPLY
  503. state = $1.to_i
  504. @query_sub_state_apply.push(state)
  505. when YE::REGEXP::BASEITEM::QUERY_ADD_STATE_ERASE
  506. state = $1.to_i
  507. @query_add_state_erase.push(state)
  508. when YE::REGEXP::BASEITEM::QUERY_SUB_STATE_ERASE
  509. state = $1.to_i
  510. @query_sub_state_erase.push(state)
  511.  
  512. end
  513. }
  514. end # end yanfly_cache_diq
  515.  
  516. #--------------------------------------------------------------------------
  517. # Definitions
  518. #--------------------------------------------------------------------------
  519. def key_item
  520. yanfly_cache_diq if @key_item == nil
  521. return @key_item
  522. end
  523. def hide_value
  524. yanfly_cache_diq if @hide_value == nil
  525. return @hide_value
  526. end
  527. def hide_usable
  528. yanfly_cache_diq if @hide_usable == nil
  529. return @hide_usable
  530. end
  531. def hide_purchase
  532. yanfly_cache_diq if @hide_purchase == nil
  533. return @hide_purchase
  534. end
  535. def hide_class_page
  536. yanfly_cache_diq if @hide_class_page == nil
  537. return @hide_class_page
  538. end
  539. def hide_general_page
  540. yanfly_cache_diq if @hide_general == nil
  541. return @hide_general
  542. end
  543. def hide_steal_page
  544. yanfly_cache_diq if @hide_steal_page == nil
  545. return @hide_steal_page
  546. end
  547. def hide_drop_page
  548. yanfly_cache_diq if @hide_drop_page == nil
  549. return @hide_drop_page
  550. end
  551. def query_conditional
  552. yanfly_cache_diq if @query_conditional == nil
  553. return @query_conditional
  554. end
  555. def query_basedmg
  556. yanfly_cache_diq if @query_basedmg
  557. return @query_basedmg
  558. end
  559. def query_accuracy
  560. yanfly_cache_diq if @query_accuracy
  561. return @query_accuracy
  562. end
  563. def query_hp_f
  564. yanfly_cache_diq if @query_hp_f
  565. return @query_hp_f
  566. end
  567. def query_mp_f
  568. yanfly_cache_diq if @query_mp_f
  569. return @query_mp_f
  570. end
  571. def query_atk_f
  572. yanfly_cache_diq if @query_atk_f
  573. return @query_atk_f
  574. end
  575. def query_def_f
  576. yanfly_cache_diq if @query_def_f
  577. return @query_def_f
  578. end
  579. def query_spi_f
  580. yanfly_cache_diq if @query_spi_f
  581. return @query_spi_f
  582. end
  583. def query_agi_f
  584. yanfly_cache_diq if @query_agi_f
  585. return @query_agi_f
  586. end
  587.  
  588. #--------------------------------------------------------------------------
  589. # query_physical
  590. #--------------------------------------------------------------------------
  591. def query_physical
  592. yanfly_cache_diq if @query_physical == nil
  593. return @query_physical
  594. end
  595.  
  596. #--------------------------------------------------------------------------
  597. # query_mpdamage
  598. #--------------------------------------------------------------------------
  599. def query_mpdamage
  600. yanfly_cache_diq if @query_mpdamage == nil
  601. return @query_mpdamage
  602. end
  603.  
  604. #--------------------------------------------------------------------------
  605. # query_absorb
  606. #--------------------------------------------------------------------------
  607. def query_absorb
  608. yanfly_cache_diq if @query_absorb == nil
  609. return @query_absorb
  610. end
  611.  
  612. #--------------------------------------------------------------------------
  613. # query_ignore_def
  614. #--------------------------------------------------------------------------
  615. def query_ignore_def
  616. yanfly_cache_diq if @query_ignore_def == nil
  617. return @query_ignore_def
  618. end
  619.  
  620. #--------------------------------------------------------------------------
  621. # query_hide_aggro
  622. #--------------------------------------------------------------------------
  623. def query_hide_aggro
  624. yanfly_cache_diq if @query_hide_aggro == nil
  625. return @query_hide_aggro
  626. end
  627.  
  628. #--------------------------------------------------------------------------
  629. # query_hide_grudge
  630. #--------------------------------------------------------------------------
  631. def query_hide_grudge
  632. yanfly_cache_diq if @query_hide_grudge == nil
  633. return @query_hide_grudge
  634. end
  635.  
  636. #--------------------------------------------------------------------------
  637. # query_hide_elements
  638. #--------------------------------------------------------------------------
  639. def query_hide_elements
  640. yanfly_cache_diq if @query_hide_elements == nil
  641. return @query_hide_elements
  642. end
  643.  
  644. #--------------------------------------------------------------------------
  645. # query add elements
  646. #--------------------------------------------------------------------------
  647. def query_add_elements
  648. yanfly_cache_diq if @query_add_elements == nil
  649. return @query_add_elements
  650. end
  651.  
  652. #--------------------------------------------------------------------------
  653. # query sub elements
  654. #--------------------------------------------------------------------------
  655. def query_sub_elements
  656. yanfly_cache_diq if @query_sub_elements == nil
  657. return @query_sub_elements
  658. end
  659.  
  660. #--------------------------------------------------------------------------
  661. # query_hide_state_apply
  662. #--------------------------------------------------------------------------
  663. def query_hide_state_apply
  664. yanfly_cache_diq if @query_hide_state_apply == nil
  665. return @query_hide_state_apply
  666. end
  667.  
  668. #--------------------------------------------------------------------------
  669. # query_hide_state_erase
  670. #--------------------------------------------------------------------------
  671. def query_hide_state_erase
  672. yanfly_cache_diq if @query_hide_state_erase == nil
  673. return @query_hide_state_erase
  674. end
  675.  
  676. #--------------------------------------------------------------------------
  677. # query add state apply
  678. #--------------------------------------------------------------------------
  679. def query_add_state_apply
  680. yanfly_cache_diq if @query_add_state_apply == nil
  681. return @query_add_state_apply
  682. end
  683.  
  684. #--------------------------------------------------------------------------
  685. # query sub state apply
  686. #--------------------------------------------------------------------------
  687. def query_sub_state_apply
  688. yanfly_cache_diq if @query_sub_state_apply == nil
  689. return @query_sub_state_apply
  690. end
  691.  
  692. #--------------------------------------------------------------------------
  693. # query add state erase
  694. #--------------------------------------------------------------------------
  695. def query_add_state_erase
  696. yanfly_cache_diq if @query_add_state_erase == nil
  697. return @query_add_state_erase
  698. end
  699.  
  700. #--------------------------------------------------------------------------
  701. # query sub state erase
  702. #--------------------------------------------------------------------------
  703. def query_sub_state_erase
  704. yanfly_cache_diq if @query_sub_state_erase == nil
  705. return @query_sub_state_erase
  706. end
  707.  
  708. end # RPG::BaseItem
  709.  
  710. #==============================================================================
  711. # Game_Party
  712. #==============================================================================
  713.  
  714. class Game_Party < Game_Unit
  715.  
  716. #--------------------------------------------------------------------------
  717. # purchased_items, purchased_weapons, purchased_armours
  718. #--------------------------------------------------------------------------
  719. def purchased_items
  720. @purchased_items = {} if @purchased_items == nil
  721. return @purchased_items
  722. end
  723. def purchased_weapons
  724. @purchased_weapons = {} if @purchased_weapons == nil
  725. return @purchased_weapons
  726. end
  727. def purchased_armours
  728. @purchased_armours = {} if @purchased_armours == nil
  729. return @purchased_armours
  730. end
  731.  
  732. #--------------------------------------------------------------------------
  733. # stolen_items, stolen_weapons, stolen_armours
  734. #--------------------------------------------------------------------------
  735. def stolen_items
  736. @stolen_items = {} if @stolen_items == nil
  737. return @stolen_items
  738. end
  739. def stolen_weapons
  740. @stolen_weapons = {} if @stolen_weapons == nil
  741. return @stolen_weapons
  742. end
  743. def stolen_armours
  744. @stolen_armours = {} if @stolen_armours == nil
  745. return @stolen_armours
  746. end
  747.  
  748. #--------------------------------------------------------------------------
  749. # dropped_items
  750. #--------------------------------------------------------------------------
  751. def dropped_items
  752. @dropped_items = {} if @dropped_items == nil
  753. return @dropped_items
  754. end
  755. def dropped_weapons
  756. @dropped_weapons = {} if @dropped_weapons == nil
  757. return @dropped_weapons
  758. end
  759. def dropped_armours
  760. @dropped_armours = {} if @dropped_armours == nil
  761. return @dropped_armours
  762. end
  763.  
  764. end # Game_Party
  765.  
  766. #===============================================================================
  767. # Game Enemy
  768. #===============================================================================
  769.  
  770. class Game_Enemy < Game_Battler
  771.  
  772. #--------------------------------------------------------------------------
  773. # alias Collapse
  774. #--------------------------------------------------------------------------
  775. alias perform_collapse_diq perform_collapse unless $@
  776. def perform_collapse
  777. perform_collapse_diq
  778. if $game_temp.in_battle and dead?
  779. drop_items = [enemy.drop_item1, enemy.drop_item2]
  780. if $imported["ExtraDropItem"]
  781. drop_items += enemy.extra_drop_items
  782. end
  783. drop_items.each_with_index { |item, i|
  784. case item.kind
  785. when 0
  786. next
  787. when 1
  788. drop_item = $data_items[item.item_id].id
  789. $game_party.dropped_items[drop_item] = [] if
  790. $game_party.dropped_items[drop_item] == nil
  791. $game_party.dropped_items[drop_item].push(@enemy_id) unless
  792. $game_party.dropped_items[drop_item].include?(@enemy_id)
  793. when 2
  794. drop_item = $data_weapons[item.weapon_id].id
  795. $game_party.dropped_weapons[drop_item] = [] if
  796. $game_party.dropped_weapons[drop_item] == nil
  797. $game_party.dropped_weapons[drop_item].push(@enemy_id) unless
  798. $game_party.dropped_weapons[drop_item].include?(@enemy_id)
  799. when 3
  800. drop_item = $data_armors[item.armor_id].id
  801. $game_party.dropped_armours[drop_item] = [] if
  802. $game_party.dropped_armours[drop_item] == nil
  803. $game_party.dropped_armours[drop_item].push(@enemy_id) unless
  804. $game_party.dropped_armours[drop_item].include?(@enemy_id)
  805. end
  806. }
  807. end
  808. end
  809.  
  810. end # Game_Enemy
  811.  
  812. =begin
  813. #==============================================================================
  814. # Scene_Battle
  815. #==============================================================================
  816.  
  817. class Scene_Battle < Scene_Base
  818.  
  819. #--------------------------------------------------------------------------
  820. # alias create_info_viewport
  821. #--------------------------------------------------------------------------
  822. alias create_info_viewport_diq create_info_viewport unless $@
  823. def create_info_viewport
  824. create_info_viewport_diq
  825. if $imported["HelpExtension"]
  826. sdy = 32
  827. sdy += 24 * (KGC::HelpExtension::ROW_MAX)
  828. else
  829. sdy = 56
  830. end
  831. sdx = 0; sdw = 272; sdh = 416 - sdy - @status_window.height
  832. @item_data_window = Window_Item_Data.new(0, sdy, 272, sdh)
  833. @item_data_window.visible = false
  834. @item_data_window.active = false
  835. hix = YE::MENU::ITEM::BATTLE_HELP_X
  836. hiy = YE::MENU::ITEM::BATTLE_HELP_Y
  837. hiw = YE::MENU::ITEM::BATTLE_HELP_W
  838. text = YE::MENU::ITEM::BATTLE_HELP_TEXT
  839. @help_item_window = Window_Base.new(hix, hiy, hiw, 56)
  840. @help_item_window.back_opacity = YE::MENU::ITEM::BATTLE_HELP_O
  841. @help_item_window.contents.draw_text(2, 0, hiw - 40, 24, text, 1)
  842. @help_item_window.visible = false
  843. end
  844.  
  845. #--------------------------------------------------------------------------
  846. # alias terminate
  847. #--------------------------------------------------------------------------
  848. alias terminate_battle_diq terminate unless $@
  849. def terminate
  850. terminate_battle_diq
  851. @help_item_window.dispose if @help_item_window != nil
  852. @item_data_window.dispose if @item_data_window != nil
  853. end
  854.  
  855. #--------------------------------------------------------------------------
  856. # alias update item selection
  857. #--------------------------------------------------------------------------
  858. alias update_item_selection_diq update_item_selection unless $@
  859. def update_item_selection
  860. if YE::MENU::ITEM::BATTLE_HELP_SHOW
  861. if @item_data_window.active
  862. @help_item_window.visible = false
  863. elsif @item_window.active
  864. @help_item_window.visible = true
  865. else
  866. @help_item_window.visible = false
  867. end
  868. else
  869. @help_item_window.visible = false
  870. end
  871. #------------------------------------------
  872. # If the Item Data Window is active
  873. #------------------------------------------
  874. if @item_data_window != nil and @item_data_window.active
  875. @item_data_window.update
  876. if Input.trigger?(Input::B)
  877. Sound.play_cancel
  878. @item_data_window.disappear
  879. @item_window.active = true
  880. elsif Input.trigger?(Input::LEFT) or Input.trigger?(Input::UP)
  881. @item_data_window.previous_page
  882. elsif Input.trigger?(Input::RIGHT) or Input.trigger?(Input::DOWN)
  883. @item_data_window.next_page
  884. elsif Input.trigger?(Input::L)
  885. @item_data_window.top_page
  886. elsif Input.trigger?(Input::R)
  887. @item_data_window.bottom_page
  888. end
  889. #------------------------------------------
  890. # If the Item Data Window is not active
  891. #------------------------------------------
  892. else
  893. if Input.trigger?(Input::B)
  894. @help_item_window.visible = false
  895. elsif Input.trigger?(Input::C)
  896. @item = @item_window.item
  897. if $game_party.item_can_use?(@item)
  898. @help_item_window.visible = false
  899. end
  900.  
  901. @item = @item_window.item
  902. if @item == nil
  903. Sound.play_buzzer
  904. else
  905. Sound.play_decision
  906. @item = @item_window.item
  907. @item_data_window.appear(@item, @item_window)
  908. @item_window.active = false
  909. end
  910. end
  911. update_item_selection_diq
  912. end
  913. end
  914.  
  915. #--------------------------------------------------------------------------
  916. # alias display_steal_effects
  917. #--------------------------------------------------------------------------
  918. if $imported["Steal"]
  919. alias display_stole_object_diq display_stole_object unless $@
  920. def display_stole_object(target, obj = nil)
  921. if !target.skipped and !target.actor?
  922. target.enemy.steal_objects.each_with_index { |item, i|
  923. next if item == nil
  924. case item.kind
  925. when 0
  926. next
  927. when 1
  928. steal_item = $data_items[item.item_id].id
  929. $game_party.stolen_items[steal_item] = [] if
  930. $game_party.stolen_items[steal_item] == nil
  931. $game_party.stolen_items[steal_item].push(target.enemy_id) unless
  932. $game_party.stolen_items[steal_item].include?(target.enemy_id)
  933. when 2
  934. steal_item = $data_weapons[item.weapon_id].id
  935. $game_party.stolen_weapons[steal_item] = [] if
  936. $game_party.stolen_weapons[steal_item] == nil
  937. $game_party.stolen_weapons[steal_item].push(target.enemy_id) unless
  938. $game_party.stolen_weapons[steal_item].include?(target.enemy_id)
  939. when 3
  940. steal_item = $data_armors[item.armor_id].id
  941. $game_party.stolen_armours[steal_item] = [] if
  942. $game_party.stolen_armours[steal_item] == nil
  943. $game_party.stolen_armours[steal_item].push(target.enemy_id) unless
  944. $game_party.stolen_armours[steal_item].include?(target.enemy_id)
  945. end
  946. }
  947. end
  948. display_stole_object_diq(target, obj)
  949. end
  950. end
  951.  
  952. end # Scene Battle
  953. =end
  954.  
  955. #==============================================================================
  956. # Scene_Item
  957. #==============================================================================
  958.  
  959. class Scene_Item < Scene_Base
  960.  
  961. #--------------------------------------------------------------------------
  962. # alias start
  963. #--------------------------------------------------------------------------
  964. alias start_item_diq start unless $@
  965. def start
  966. start_item_diq
  967. #---------
  968. text = YE::MENU::ITEM::MENU_HELP_TEXT
  969. icon = YE::MENU::ITEM::MENU_HELP_ICON
  970. @help_item_window = Window_Base.new(0, 360, 544, 56)
  971. @help_item_window.contents.draw_text(2, 0, 60, 24, text[0], 1)
  972. @help_item_window.draw_icon(icon,62,0)
  973. @help_item_window.contents.draw_text(70,0,240,24, text[1], 1)
  974. @help_item_window.viewport = @viewport
  975. if YE::MENU::ITEM::MENU_HELP_SHOW
  976. @help_item_window.visible = true
  977. @item_window.height -= 56
  978. @item_window.refresh
  979. else
  980. @help_item_window.visible = false
  981. end
  982. sdx = 0
  983. sdy = @item_window.y
  984. sdw = 272
  985. sdh = @item_window.height
  986. @item_data_window = Window_Item_Data.new(0, sdy, 272, sdh)
  987. @item_data_window.visible = false
  988. @item_data_window.active = false
  989. end
  990.  
  991. #--------------------------------------------------------------------------
  992. # alias terminate
  993. #--------------------------------------------------------------------------
  994. alias terminate_menu_diq terminate unless $@
  995. def terminate
  996. terminate_menu_diq
  997. @help_item_window.dispose if @help_item_window != nil
  998. @item_data_window.dispose if @item_data_window != nil
  999. end
  1000.  
  1001. #--------------------------------------------------------------------------
  1002. # alias update
  1003. #--------------------------------------------------------------------------
  1004. alias update_item_diq update unless $@
  1005. def update
  1006. update_item_diq
  1007. if @item_data_window.active
  1008. update_item_data_window
  1009. end
  1010. end
  1011.  
  1012. #--------------------------------------------------------------------------
  1013. # update_item_data_window
  1014. #--------------------------------------------------------------------------
  1015. def update_item_data_window
  1016. @item_data_window.update
  1017. if Input.trigger?(Input::B)
  1018. Sound.play_cancel
  1019. @item_data_window.disappear
  1020. @item_window.active = true
  1021. elsif Input.trigger?(Input::LEFT) or Input.trigger?(Input::UP)
  1022. @item_data_window.previous_page
  1023. elsif Input.trigger?(Input::RIGHT) or Input.trigger?(Input::DOWN)
  1024. @item_data_window.next_page
  1025. elsif Input.trigger?(Input::L)
  1026. @item_data_window.top_page
  1027. elsif Input.trigger?(Input::R)
  1028. @item_data_window.bottom_page
  1029. end
  1030. end
  1031.  
  1032. #--------------------------------------------------------------------------
  1033. # alias update_item_selection
  1034. #--------------------------------------------------------------------------
  1035. alias update_item_selection_diq update_item_selection unless $@
  1036. def update_item_selection
  1037. if Input.trigger?(YE::MENU::ITEM::ITEM_QUERY_MENU_BUTTON)
  1038. @item = @item_window.item
  1039. if @item == nil
  1040. Sound.play_buzzer
  1041. else
  1042. Sound.play_decision
  1043. @item = @item_window.item
  1044. @item_data_window.appear(@item, @item_window)
  1045. @item_window.active = false
  1046. end
  1047. end
  1048. update_item_selection_diq
  1049. end
  1050.  
  1051.  
  1052. end # Scene Item
  1053.  
  1054. #==============================================================================
  1055. # Window Item Data
  1056. #==============================================================================
  1057.  
  1058. class Window_Item_Data < Window_Base
  1059.  
  1060. #--------------------------------------------------------------------------
  1061. # initialize
  1062. #--------------------------------------------------------------------------
  1063. def initialize(x, y, width, height)
  1064. super(x, y, width, height)
  1065. self.back_opacity = 200
  1066. @page = 1
  1067. @item = nil
  1068. self.z = 200
  1069. self.visible = false
  1070. end
  1071.  
  1072. #--------------------------------------------------------------------------
  1073. # appear
  1074. #--------------------------------------------------------------------------
  1075. def appear(item, window, condition = 0)
  1076. @item = item
  1077. @page = 1
  1078. @total_pages = create_total_pages
  1079. if condition == 1
  1080. self.x = 272
  1081. elsif condition == 2
  1082. self.x = 272
  1083. else
  1084. if window.index % 2 == 0
  1085. self.x = 272
  1086. else
  1087. self.x = 272
  1088. end
  1089. end
  1090. setup
  1091. self.openness = 128
  1092. @opening = true
  1093. self.active = true
  1094. self.visible = true
  1095. end
  1096.  
  1097. def disappear
  1098. self.active = false
  1099. self.visible = false
  1100. end
  1101.  
  1102. #--------------------------------------------------------------------------
  1103. # page switching
  1104. #--------------------------------------------------------------------------
  1105. def next_page
  1106. if @page != @total_pages
  1107. @page += 1
  1108. else
  1109. @page = 1
  1110. end
  1111. turn_sound
  1112. setup
  1113. end
  1114.  
  1115. def previous_page
  1116. if @page != 1
  1117. @page -= 1
  1118. else
  1119. @page = @total_pages
  1120. end
  1121. turn_sound
  1122. setup
  1123. end
  1124.  
  1125. def top_page
  1126. @page = 1
  1127. turn_sound
  1128. setup
  1129. end
  1130.  
  1131. def bottom_page
  1132. @page = @total_pages
  1133. turn_sound
  1134. setup
  1135. end
  1136.  
  1137. #--------------------------------------------------------------------------
  1138. # turn sound
  1139. #--------------------------------------------------------------------------
  1140. def turn_sound
  1141. unless YE::MENU::ITEM::PAGE_SOUND == nil
  1142. sound = YE::MENU::ITEM::PAGE_SOUND
  1143. sound.play
  1144. end
  1145. end
  1146.  
  1147. #--------------------------------------------------------------------------
  1148. # setup
  1149. #--------------------------------------------------------------------------
  1150. def setup
  1151. self.contents.clear
  1152. self.contents.font.color.alpha = 255
  1153. self.contents.font.size = Font.default_size
  1154. self.contents.font.color = normal_color
  1155. @category_colour = YE::MENU::ITEM::DATA_CATEGORY_COLOUR
  1156. #--------------------
  1157. pagecase = @contents[@page - 1]
  1158. if @total_pages <= 1
  1159. text1 = ""
  1160. elsif @page == 1 and !YE::MENU::ITEM::REPLACE_PAGE_MSG
  1161. text1 = ""
  1162. else
  1163. text1 = YE::MENU::ITEM::DATA_LEFT
  1164. end
  1165. if YE::MENU::ITEM::REPLACE_PAGE_MSG #--------------------------------------
  1166. text2 = case_page_name(pagecase)
  1167. else #---------------------------------------------------------------------
  1168. text2 = sprintf(YE::MENU::ITEM::DATA_PAGES, @page, @total_pages)
  1169. end
  1170. if @total_pages <= 1
  1171. text3 = ""
  1172. elsif @page == @total_pages and !YE::MENU::ITEM::REPLACE_PAGE_MSG
  1173. text3 = ""
  1174. else
  1175. text3 = YE::MENU::ITEM::DATA_RIGHT
  1176. end
  1177. #--------------------
  1178. self.contents.draw_text(2, 0, 232, WLH, text1, 0)
  1179. self.contents.draw_text(2, 0, 232, WLH, text2, 1)
  1180. self.contents.draw_text(2, 0, 232, WLH, text3, 2)
  1181. #--------------------
  1182. if @item != nil
  1183. case_page_run(pagecase)
  1184. end
  1185. end
  1186.  
  1187. #--------------------------------------------------------------------------
  1188. # invisible_states
  1189. #--------------------------------------------------------------------------
  1190. def invisible_states(state_list)
  1191. new_state_list = []
  1192. for state in state_list
  1193. icon = $data_states[state].icon_index
  1194. new_state_list.push(state) unless icon == 0
  1195. end
  1196. return new_state_list
  1197. end #end def
  1198.  
  1199. #--------------------------------------------------------------------------
  1200. # make_first_item_page
  1201. #--------------------------------------------------------------------------
  1202. def make_first_item_page
  1203. y = WLH
  1204. sw = self.width - 32
  1205. #---
  1206. draw_item_name(@item, 0, y)
  1207. self.contents.font.size = YE::MENU::ITEM::GEN_ITEM_FONT_SIZE
  1208. if @item.key_item
  1209. unless $imported["HelpExtension"] and KGC::HelpExtension::ROW_MAX > 1 and
  1210. $scene.is_a?(Scene_Battle)
  1211. y += WLH
  1212. text = YE::MENU::ITEM::DATA_KEY_ITEM
  1213. self.contents.draw_text(0, y, sw, WLH, text, 1)
  1214. end
  1215. elsif @item.price > 0 and !@item.hide_value
  1216. unless $imported["HelpExtension"] and KGC::HelpExtension::ROW_MAX > 1
  1217. unless $scene.is_a?(Scene_Battle)
  1218. y += WLH
  1219. text = sprintf(YE::MENU::ITEM::DATA_SHOP_VAL, @item.price)
  1220. self.contents.draw_text(0, y, sw, WLH, text, 1)
  1221. end
  1222. end
  1223. end
  1224. #---
  1225. self.contents.font.color = normal_color
  1226. unless $imported["HelpExtension"] and KGC::HelpExtension::ROW_MAX > 2 and
  1227. $scene.is_a?(Scene_Battle)
  1228. y += WLH
  1229. self.contents.font.color = text_color(@category_colour)
  1230. if @item.hide_usable
  1231. text = ""
  1232. elsif @item.query_conditional
  1233. text = YE::MENU::ITEM::TEXT_USABLE_COND
  1234. elsif @item.battle_ok? and @item.menu_ok?
  1235. text = YE::MENU::ITEM::TEXT_USABLE_ALWAYS
  1236. elsif @item.battle_ok?
  1237. text = YE::MENU::ITEM::TEXT_USABLE_BATTLE
  1238. elsif @item.menu_ok?
  1239. text = YE::MENU::ITEM::TEXT_USABLE_MENU
  1240. else
  1241. text = YE::MENU::ITEM::TEXT_USABLE_NEVER
  1242. end
  1243. self.contents.draw_text(0, y, sw, WLH, text, 1)
  1244. end
  1245. #---
  1246. if @item.hp_recovery != 0 or @item.hp_recovery_rate != 0
  1247. y += WLH
  1248. icon = YE::MENU::ITEM::ICON_HP_RECOVERY
  1249. draw_icon(icon, 0, y)
  1250. text = YE::MENU::ITEM::TEXT_HP_RECOVERY
  1251. self.contents.font.color = text_color(@category_colour)
  1252. self.contents.draw_text(24, y, sw/2 - 24, WLH, text, 0)
  1253. self.contents.font.color = normal_color
  1254. if @item.hp_recovery != 0
  1255. text = sprintf("%+d",@item.hp_recovery)
  1256. self.contents.draw_text(sw*3/4, y, sw/4, WLH, text, 1)
  1257. end
  1258. if @item.hp_recovery_rate != 0
  1259. text = sprintf("%+d%%",@item.hp_recovery_rate)
  1260. if @item.hp_recovery != 0
  1261. self.contents.draw_text(sw/2, y, sw/4, WLH, text, 1)
  1262. else
  1263. self.contents.draw_text(sw*3/4, y, sw/4, WLH, text, 1)
  1264. end
  1265. end
  1266. end
  1267. self.contents.font.color = normal_color
  1268. #---
  1269. if @item.mp_recovery_rate != 0 or @item.mp_recovery != 0
  1270. y += WLH
  1271. icon = YE::MENU::ITEM::ICON_MP_RECOVERY
  1272. draw_icon(icon, 0, y)
  1273. text = YE::MENU::ITEM::TEXT_MP_RECOVERY
  1274. self.contents.font.color = text_color(@category_colour)
  1275. self.contents.draw_text(24, y, sw/2 - 24, WLH, text, 0)
  1276. self.contents.font.color = normal_color
  1277. if @item.mp_recovery != 0
  1278. text = sprintf("%+d",@item.mp_recovery)
  1279. self.contents.draw_text(sw*3/4, y, sw/4, WLH, text, 1)
  1280. end
  1281. if @item.mp_recovery_rate != 0
  1282. text = sprintf("%+d%%",@item.mp_recovery_rate)
  1283. if @item.mp_recovery != 0
  1284. self.contents.draw_text(sw/2, y, sw/4, WLH, text, 1)
  1285. else
  1286. self.contents.draw_text(sw*3/4, y, sw/4, WLH, text, 1)
  1287. end
  1288. end
  1289. end
  1290. #---
  1291. if @item.base_damage != 0 or @item.query_basedmg != 0
  1292. tw = YE::MENU::ITEM::DATA_WIDTH
  1293. ta = YE::MENU::ITEM::DATA_ALIGN
  1294. y += WLH
  1295. # 1st Row ---------------------------------
  1296. #---Base Damage
  1297. if @item.base_damage != 0 or @item.query_basedmg != 0
  1298. textno = @item.base_damage
  1299. textno = @item.query_basedmg if @item.query_basedmg != 0
  1300. if @item.base_damage < 0 or @item.query_basedmg < 0
  1301. textno *= -1
  1302. draw_icon(YE::MENU::ITEM::ICON_BASEHEAL, 0, y, true)
  1303. else
  1304. draw_icon(YE::MENU::ITEM::ICON_BASEDMG, 0, y, true)
  1305. end
  1306. self.contents.font.color.alpha = 255
  1307.  
  1308. self.contents.draw_text(24, y, tw, WLH, textno, ta)
  1309. else
  1310. draw_icon(YE::MENU::ITEM::ICON_BASEDMG, 0, y, false)
  1311. self.contents.font.color.alpha = 128
  1312. self.contents.draw_text(24, y, tw, WLH, YE::MENU::ITEM::DATA_NIL, ta)
  1313. end
  1314. if $imported["CustomDmgFormulaRD"]
  1315. #---Accuracy
  1316. draw_icon(YE::MENU::ITEM::ICON_ACCURACY, 60, y, true)
  1317. self.contents.font.color.alpha = 255
  1318. acchit = 100
  1319. textno = sprintf("%d%%", acchit)
  1320. self.contents.draw_text(84, y, tw, WLH, textno, ta)
  1321. #---HP Hi/Lo/F
  1322. if @item.hp_hi > 0 or @item.hp_lo > 0 or @item.query_hp_f > 0
  1323. draw_icon(YE::MENU::ITEM::ICON_HP_F, 120, y, true)
  1324. self.contents.font.color.alpha = 255
  1325. num = @item.hp_hi if @item.hp_hi > 0
  1326. num = @item.hp_lo if @item.hp_lo > 0
  1327. num = @item.query_hp_f if @item.query_hp_f > 0
  1328. textno = sprintf("%d%%", num)
  1329. self.contents.draw_text(144, y, tw, WLH, textno, ta)
  1330. else
  1331. draw_icon(YE::MENU::ITEM::ICON_HP_F, 120, y, false)
  1332. self.contents.font.color.alpha = 128
  1333. self.contents.draw_text(144, y, tw, WLH, YE::MENU::ITEM::DATA_NIL, ta)
  1334. end
  1335. #---MP Hi/Lo/F
  1336. if @item.mp_hi > 0 or @item.mp_lo > 0 or @item.query_mp_f > 0
  1337. draw_icon(YE::MENU::ITEM::ICON_MP_F, 180, y, true)
  1338. self.contents.font.color.alpha = 255
  1339. num = @item.mp_hi if @item.mp_hi > 0
  1340. num = @item.mp_lo if @item.mp_lo > 0
  1341. num = @item.query_mp_f if @item.query_mp_f > 0
  1342. textno = sprintf("%d%%", num)
  1343. self.contents.draw_text(204, y, tw, WLH, textno, ta)
  1344. else
  1345. draw_icon(YE::MENU::ITEM::ICON_MP_F, 180, y, false)
  1346. self.contents.font.color.alpha = 128
  1347. self.contents.draw_text(204, y, tw, WLH, YE::MENU::ITEM::DATA_NIL, ta)
  1348. end
  1349. else
  1350. #---Accuracy
  1351. draw_icon(YE::MENU::ITEM::ICON_ACCURACY, 120, y, true)
  1352. self.contents.font.color.alpha = 255
  1353. acchit = 100
  1354. acchit = @item.query_accuracy if @item.query_accuracy > 0
  1355. textno = sprintf("%d%%", acchit)
  1356. self.contents.draw_text(144, y, tw, WLH, textno, ta)
  1357. end
  1358. # 2nd Row --------------------------------------
  1359. y += WLH
  1360. if $imported["CustomDmgFormulaRD"]
  1361. #---Attack F
  1362. if @item.atk_f > 0 or @item.newatk_f > 0 or @item.query_atk_f > 0
  1363. draw_icon(YE::MENU::ITEM::ICON_ATK_F, 0, y, true)
  1364. self.contents.font.color.alpha = 255
  1365. num = @item.atk_f
  1366. num = @item.newatk_f if @item.newatk_f > 0
  1367. num = @item.query_atk_f if @item.query_atk_f > 0
  1368. textno = sprintf("%d%%", num)
  1369. self.contents.draw_text(24, y, tw, WLH, textno, ta)
  1370. else
  1371. draw_icon(YE::MENU::ITEM::ICON_ATK_F, 0, y, false)
  1372. self.contents.font.color.alpha = 128
  1373. self.contents.draw_text(24, y, tw, WLH, YE::MENU::ITEM::DATA_NIL, ta)
  1374. end
  1375. #---Defense F
  1376. if @item.def_f > 0 or @item.query_def_f > 0
  1377. draw_icon(YE::MENU::ITEM::ICON_DEF_F, 60, y, true)
  1378. self.contents.font.color.alpha = 255
  1379. num = @item.def_f
  1380. num = @item.query_def_f if @item.query_def_f > 0
  1381. textno = sprintf("%d%%", num)
  1382. self.contents.draw_text(84, y, tw, WLH, textno, ta)
  1383. else
  1384. draw_icon(YE::MENU::ITEM::ICON_DEF_F, 60, y, false)
  1385. self.contents.font.color.alpha = 128
  1386. self.contents.draw_text(84, y, tw, WLH, YE::MENU::ITEM::DATA_NIL, ta)
  1387. end
  1388. #---Spirit F
  1389. if @item.spi_f > 0 or @item.newspi_f > 0 or @item.query_spi_f > 0
  1390. draw_icon(YE::MENU::ITEM::ICON_SPI_F, 120, y, true)
  1391. self.contents.font.color.alpha = 255
  1392. num = @item.spi_f
  1393. num = @item.newspi_f if @item.newspi_f > 0
  1394. num = @item.query_spi_f if @item.query_spi_f > 0
  1395. textno = sprintf("%d%%", num)
  1396. self.contents.draw_text(144, y, tw, WLH, textno, ta)
  1397. else
  1398. draw_icon(YE::MENU::ITEM::ICON_SPI_F, 120, y, false)
  1399. self.contents.font.color.alpha = 128
  1400. self.contents.draw_text(144, y, tw, WLH, YE::MENU::ITEM::DATA_NIL, ta)
  1401. end
  1402. #---Agility F
  1403. if @item.agi_f > 0 or @item.query_agi_f > 0
  1404. draw_icon(YE::MENU::ITEM::ICON_AGI_F, 180, y, true)
  1405. self.contents.font.color.alpha = 255
  1406. num = @item.agi_f
  1407. num = @item.query_agi_f if @item.query_agi_f > 0
  1408. textno = sprintf("%d%%", num)
  1409. self.contents.draw_text(204, y, tw, WLH, textno, ta)
  1410. else
  1411. draw_icon(YE::MENU::ITEM::ICON_AGI_F, 180, y, false)
  1412. self.contents.font.color.alpha = 128
  1413. self.contents.draw_text(204, y, tw, WLH, YE::MENU::ITEM::DATA_NIL, ta)
  1414. end
  1415. else
  1416. #---Attack F
  1417. if @item.atk_f > 0 or @item.query_atk_f > 0
  1418. draw_icon(YE::MENU::ITEM::ICON_ATK_F, 0, y, true)
  1419. self.contents.font.color.alpha = 255
  1420. num = @item.atk_f
  1421. num = @item.query_atk_f if @item.query_atk_f > 0
  1422. textno = sprintf("%d%%", num)
  1423. self.contents.draw_text(24, y, tw, WLH, textno, ta)
  1424. else
  1425. draw_icon(YE::MENU::ITEM::ICON_ATK_F, 0, y, false)
  1426. self.contents.font.color.alpha = 128
  1427. self.contents.draw_text(24, y, tw, WLH, YE::MENU::ITEM::DATA_NIL, ta)
  1428. end
  1429. #---Spirit F
  1430. if @item.spi_f > 0 or @item.query_spi_f > 0
  1431. draw_icon(YE::MENU::ITEM::ICON_SPI_F, 120, y, true)
  1432. self.contents.font.color.alpha = 255
  1433. num = @item.spi_f
  1434. num = @item.query_spi_f if @item.query_spi_f > 0
  1435. textno = sprintf("%d%%", num)
  1436. self.contents.draw_text(144, y, tw, WLH, textno, ta)
  1437. else
  1438. draw_icon(YE::MENU::ITEM::ICON_SPI_F, 120, y, false)
  1439. self.contents.font.color.alpha = 128
  1440. self.contents.draw_text(144, y, tw, WLH, YE::MENU::ITEM::DATA_NIL, ta)
  1441. end
  1442. end
  1443. # 3rd Row --------------------------------------
  1444. y += WLH
  1445. #---Physical Attack
  1446. if @item.physical_attack or @item.query_physical
  1447. draw_icon(YE::MENU::ITEM::ICON_PHYS, 0, y, true)
  1448. self.contents.font.color.alpha = 255
  1449. textflag = YE::MENU::ITEM::DATA_TRUE
  1450. else
  1451. draw_icon(YE::MENU::ITEM::ICON_PHYS, 0, y, false)
  1452. self.contents.font.color.alpha = 128
  1453. textflag = YE::MENU::ITEM::DATA_FALSE
  1454. end
  1455. self.contents.draw_text(24, y, tw, WLH, textflag, ta)
  1456. #---Damage to MP
  1457. if @item.damage_to_mp or @item.query_mpdamage
  1458. draw_icon(YE::MENU::ITEM::ICON_MPDMG, 60, y, true)
  1459. self.contents.font.color.alpha = 255
  1460. textflag = YE::MENU::ITEM::DATA_TRUE
  1461. else
  1462. draw_icon(YE::MENU::ITEM::ICON_MPDMG, 60, y, false)
  1463. self.contents.font.color.alpha = 128
  1464. textflag = YE::MENU::ITEM::DATA_FALSE
  1465. end
  1466. self.contents.draw_text(84, y, tw, WLH, textflag, ta)
  1467. #---Absorb Damage
  1468. if @item.absorb_damage or @item.query_absorb
  1469. draw_icon(YE::MENU::ITEM::ICON_ABSORB, 120, y, true)
  1470. self.contents.font.color.alpha = 255
  1471. textflag = YE::MENU::ITEM::DATA_TRUE
  1472. else
  1473. draw_icon(YE::MENU::ITEM::ICON_ABSORB, 120, y, false)
  1474. self.contents.font.color.alpha = 128
  1475. textflag = YE::MENU::ITEM::DATA_FALSE
  1476. end
  1477. self.contents.draw_text(144, y, tw, WLH, textflag, ta)
  1478. #---Ignore Defense?
  1479. if @item.ignore_defense or @item.query_ignore_def
  1480. draw_icon(YE::MENU::ITEM::ICON_IGDEF, 180, y, true)
  1481. self.contents.font.color.alpha = 255
  1482. textflag = YE::MENU::ITEM::DATA_TRUE
  1483. else
  1484. draw_icon(YE::MENU::ITEM::ICON_IGDEF, 180, y, false)
  1485. self.contents.font.color.alpha = 128
  1486. textflag = YE::MENU::ITEM::DATA_FALSE
  1487. end
  1488. self.contents.draw_text(204, y, tw, WLH, textflag, ta)
  1489. end
  1490. #---
  1491. if @item.parameter_type > 0
  1492. y += WLH
  1493. if @item.parameter_type == 1
  1494. icon = YE::MENU::ITEM::ICON_HP_F
  1495. text = YE::MENU::ITEM::TEXT_MAXHP_GROWTH
  1496. elsif @item.parameter_type == 2
  1497. icon = YE::MENU::ITEM::ICON_MP_F
  1498. text = YE::MENU::ITEM::TEXT_MAXMP_GROWTH
  1499. elsif @item.parameter_type == 3
  1500. icon = YE::MENU::ITEM::ICON_ATK_F
  1501. text = YE::MENU::ITEM::TEXT_ATK_GROWTH
  1502. elsif @item.parameter_type == 4
  1503. icon = YE::MENU::ITEM::ICON_DEF_F
  1504. text = YE::MENU::ITEM::TEXT_DEF_GROWTH
  1505. elsif @item.parameter_type == 5
  1506. icon = YE::MENU::ITEM::ICON_SPI_F
  1507. text = YE::MENU::ITEM::TEXT_SPI_GROWTH
  1508. elsif @item.parameter_type == 6
  1509. icon = YE::MENU::ITEM::ICON_AGI_F
  1510. text = YE::MENU::ITEM::TEXT_AGI_GROWTH
  1511. end
  1512. draw_icon(icon, 0, y)
  1513. self.contents.font.color = text_color(@category_colour)
  1514. self.contents.draw_text(24, y, sw/2 - 24, WLH, text, 0)
  1515. text = sprintf("%+d", @item.parameter_points)
  1516. self.contents.font.color = normal_color
  1517. self.contents.draw_text(sw*3/4, y, sw/4, WLH, text, 1)
  1518. end
  1519. #---
  1520. element_list = YE::MENU::ITEM::SHOWN_ELEMENTS
  1521. element_set = @item.element_set
  1522. element_set += @item.query_add_elements
  1523. element_set.uniq
  1524. element_set -= @item.query_sub_elements
  1525. element_set.uniq
  1526. if !@item.query_hide_elements and element_set != []
  1527. y += WLH
  1528. unless $imported["HelpExtension"] and KGC::HelpExtension::ROW_MAX > 1 and
  1529. $scene.is_a?(Scene_Battle)
  1530. text = YE::MENU::ITEM::TEXT_ELEMENTS
  1531. self.contents.font.color = text_color(@category_colour)
  1532. self.contents.draw_text(0, y, sw, WLH, text, 1)
  1533. y += WLH
  1534. end
  1535. ix = (sw/2) - (element_set.size * 24)/2
  1536. for ele in element_list
  1537. if element_set.include?(ele)
  1538. icon = YE::MENU::ITEM::ELEMENT_ICONS[ele]
  1539. draw_icon(icon, ix, y, true)
  1540. if ix == 216
  1541. ix = 0
  1542. y += WLH
  1543. else
  1544. ix += 24
  1545. end
  1546. end
  1547. end
  1548. end
  1549. #---
  1550. state_show = false
  1551. if !@item.query_hide_state_apply
  1552. state_list = []
  1553. state_list += @item.plus_state_set
  1554. state_list += @item.query_add_state_apply
  1555. state_list -= @item.query_sub_state_apply
  1556. state_list = invisible_states(state_list)
  1557. state_show = true if state_list != []
  1558. end
  1559. if state_show
  1560. y += WLH
  1561. text = YE::MENU::ITEM::TEXT_APPLY_STATES
  1562. self.contents.font.color = text_color(@category_colour)
  1563. self.contents.draw_text(0, y, sw, WLH, text, 1)
  1564. y += WLH
  1565. ix = (sw/2) - (state_list.size * 24)/2
  1566. for state_id in state_list
  1567. icon = $data_states[state_id].icon_index
  1568. draw_icon(icon, ix, y)
  1569. ix += 24
  1570. end
  1571. end
  1572. #---
  1573. state_show = false
  1574. if !@item.query_hide_state_erase
  1575. state_list = []
  1576. state_list += @item.minus_state_set
  1577. state_list += @item.query_add_state_erase
  1578. state_list -= @item.query_sub_state_erase
  1579. state_list = invisible_states(state_list)
  1580. state_show = true if state_list != []
  1581. end
  1582. if state_show
  1583. y += WLH
  1584. text = YE::MENU::ITEM::TEXT_ERASE_STATES
  1585. self.contents.font.color = text_color(@category_colour)
  1586. self.contents.draw_text(0, y, sw, WLH, text, 1)
  1587. y += WLH
  1588. ix = (sw/2) - (state_list.size * 24)/2
  1589. for state_id in state_list
  1590. icon = $data_states[state_id].icon_index
  1591. draw_icon(icon, ix, y)
  1592. ix += 24
  1593. end
  1594. end
  1595. end # End Make First Item Page
  1596.  
  1597. #--------------------------------------------------------------------------
  1598. # make equip page
  1599. #--------------------------------------------------------------------------
  1600. def make_equip_page(type)
  1601. # Type 1 means weapon. Type 2 means armour.
  1602. y = WLH
  1603. sw = self.width - 32
  1604. draw_item_name(@item, 0, y)
  1605. self.contents.font.size = YE::MENU::ITEM::GEN_ITEM_FONT_SIZE
  1606. if @item.key_item
  1607. y += WLH
  1608. text = YE::MENU::ITEM::DATA_KEY_ITEM
  1609. self.contents.draw_text(0, y, sw, WLH, text, 1)
  1610. elsif @item.price > 0 and !@item.hide_value
  1611. y += WLH
  1612. text = sprintf(YE::MENU::ITEM::DATA_SHOP_VAL, @item.price)
  1613. self.contents.draw_text(0, y, sw, WLH, text, 1)
  1614. end
  1615. #---
  1616. y += WLH
  1617. self.contents.font.color = text_color(@category_colour)
  1618. if @item.is_a?(RPG::Weapon)
  1619. text = Vocab.weapon
  1620. else
  1621. if @item.kind == 0
  1622. text = Vocab.armor1
  1623. elsif @item.kind == 1
  1624. text = Vocab.armor2
  1625. elsif @item.kind == 2
  1626. text = Vocab.armor3
  1627. elsif @item.kind == 3
  1628. text = Vocab.armor4
  1629. elsif $imported["EquipExtension"]
  1630. text = Vocab.extra_armor(@item.kind - 4)
  1631. else
  1632. text = "Unknown"
  1633. end
  1634. end
  1635. self.contents.draw_text(0, y, sw, WLH, text, 1)
  1636. #---HP AND MP ROW---
  1637. if $imported["ExtraEquipmentOptions"]
  1638. y += WLH
  1639. self.contents.font.color = text_color(@category_colour)
  1640. if @item.bonus_param[:maxhp] == 0 and @item.bonus_paramp[:maxhp] == 100
  1641. self.contents.font.color.alpha = 128
  1642. enabled = false
  1643. else
  1644. self.contents.font.color.alpha = 255
  1645. enabled = true
  1646. end
  1647. icon = YE::MENU::ITEM::ICON_MAXHP
  1648. draw_icon(icon, 0, y, enabled)
  1649. text = YE::MENU::ITEM::EQUIP_MAXHP
  1650. self.contents.draw_text(24, y, sw/4-24, WLH, text, 0)
  1651. self.contents.font.color = normal_color
  1652. if !enabled
  1653. self.contents.font.color.alpha = 128
  1654. else
  1655. self.contents.font.color.alpha = 255
  1656. end
  1657. if @item.bonus_paramp[:maxhp] != 100
  1658. text = sprintf("%+d%%", @item.bonus_paramp[:maxhp] - 100)
  1659. else
  1660. text = sprintf("%+d", @item.bonus_param[:maxhp])
  1661. end
  1662. self.contents.draw_text(sw/4, y, sw/4, WLH, text, 1)
  1663. #---
  1664. self.contents.font.color = text_color(@category_colour)
  1665. if @item.bonus_param[:maxhp] == 0 and @item.bonus_paramp[:maxmp] == 100
  1666. self.contents.font.color.alpha = 128
  1667. enabled = false
  1668. else
  1669. self.contents.font.color.alpha = 255
  1670. enabled = true
  1671. end
  1672. icon = YE::MENU::ITEM::ICON_MAXMP
  1673. draw_icon(icon, sw/2, y, enabled)
  1674. text = YE::MENU::ITEM::EQUIP_MAXMP
  1675. self.contents.draw_text(sw/2+24, y, sw/4-24, WLH, text, 0)
  1676. self.contents.font.color = normal_color
  1677. if !enabled
  1678. self.contents.font.color.alpha = 128
  1679. else
  1680. self.contents.font.color.alpha = 255
  1681. end
  1682. if @item.bonus_paramp[:maxmp] != 100
  1683. text = sprintf("%+d%%", @item.bonus_paramp[:maxmp] - 100)
  1684. else
  1685. text = sprintf("%+d", @item.bonus_param[:maxmp])
  1686. end
  1687. self.contents.draw_text(sw*3/4, y, sw/4, WLH, text, 1)
  1688. end
  1689. #---ATK AND DEF ROW---
  1690. y += WLH
  1691. self.contents.font.size = YE::MENU::ITEM::GEN_ITEM_FONT_SIZE
  1692. self.contents.font.color = text_color(@category_colour)
  1693. if $imported["ExtraEquipmentOptions"]
  1694. if @item.atk == 0 and @item.bonus_param[:atk] == 0 and
  1695. @item.bonus_paramp[:atk] == 100
  1696. self.contents.font.color.alpha = 128
  1697. enabled = false
  1698. else
  1699. self.contents.font.color.alpha = 255
  1700. enabled = true
  1701. end
  1702. elsif @item.atk == 0
  1703. self.contents.font.color.alpha = 128
  1704. enabled = false
  1705. else
  1706. self.contents.font.color.alpha = 255
  1707. enabled = true
  1708. end
  1709. icon = YE::MENU::ITEM::ICON_ATK
  1710. draw_icon(icon, 0, y, enabled)
  1711. text = YE::MENU::ITEM::EQUIP_ATK
  1712. self.contents.draw_text(24, y, sw/4-24, WLH, text, 0)
  1713. self.contents.font.color = normal_color
  1714. if !enabled
  1715. self.contents.font.color.alpha = 128
  1716. else
  1717. self.contents.font.color.alpha = 255
  1718. end
  1719. if $imported["ExtraEquipmentOptions"] and @item.bonus_paramp[:atk] != 100
  1720. value = @item.bonus_paramp[:atk] - 100
  1721. text = sprintf("%+d%%", value)
  1722. else
  1723. value = @item.atk
  1724. value += @item.bonus_param[:atk] if $imported["ExtraEquipmentOptions"]
  1725. text = sprintf("%+d", value)
  1726. end
  1727. self.contents.draw_text(sw/4, y, sw/4, WLH, text, 1)
  1728. #---
  1729. self.contents.font.color = text_color(@category_colour)
  1730. if $imported["ExtraEquipmentOptions"]
  1731. if @item.def == 0 and @item.bonus_param[:def] == 0 and
  1732. @item.bonus_paramp[:def] == 100
  1733. self.contents.font.color.alpha = 128
  1734. enabled = false
  1735. else
  1736. self.contents.font.color.alpha = 255
  1737. enabled = true
  1738. end
  1739. elsif @item.def == 0
  1740. self.contents.font.color.alpha = 128
  1741. enabled = false
  1742. else
  1743. self.contents.font.color.alpha = 255
  1744. enabled = true
  1745. end
  1746. icon = YE::MENU::ITEM::ICON_DEF
  1747. draw_icon(icon, sw/2, y, enabled)
  1748. text = YE::MENU::ITEM::EQUIP_DEF
  1749. self.contents.draw_text(sw/2+24, y, sw/4-24, WLH, text, 0)
  1750. self.contents.font.color = normal_color
  1751. if !enabled
  1752. self.contents.font.color.alpha = 128
  1753. else
  1754. self.contents.font.color.alpha = 255
  1755. end
  1756. if $imported["ExtraEquipmentOptions"] and @item.bonus_paramp[:def] != 100
  1757. value = @item.bonus_paramp[:def] - 100
  1758. text = sprintf("%+d%%", value)
  1759. else
  1760. value = @item.def
  1761. value += @item.bonus_param[:def] if $imported["ExtraEquipmentOptions"]
  1762. text = sprintf("%+d", value)
  1763. end
  1764. self.contents.draw_text(sw*3/4, y, sw/4, WLH, text, 1)
  1765. #---SPI AND AGI ROW---
  1766. y += WLH
  1767. self.contents.font.size = YE::MENU::ITEM::GEN_ITEM_FONT_SIZE
  1768. self.contents.font.color = text_color(@category_colour)
  1769. if $imported["ExtraEquipmentOptions"]
  1770. if @item.spi == 0 and @item.bonus_param[:spi] == 0 and
  1771. @item.bonus_paramp[:spi] == 100
  1772. self.contents.font.color.alpha = 128
  1773. enabled = false
  1774. else
  1775. self.contents.font.color.alpha = 255
  1776. enabled = true
  1777. end
  1778. elsif @item.spi == 0
  1779. self.contents.font.color.alpha = 128
  1780. enabled = false
  1781. else
  1782. self.contents.font.color.alpha = 255
  1783. enabled = true
  1784. end
  1785. icon = YE::MENU::ITEM::ICON_SPI
  1786. draw_icon(icon, 0, y, enabled)
  1787. text = YE::MENU::ITEM::EQUIP_SPI
  1788. self.contents.draw_text(24, y, sw/4-24, WLH, text, 0)
  1789. self.contents.font.color = normal_color
  1790. if !enabled
  1791. self.contents.font.color.alpha = 128
  1792. else
  1793. self.contents.font.color.alpha = 255
  1794. end
  1795. if $imported["ExtraEquipmentOptions"] and @item.bonus_paramp[:spi] != 100
  1796. value = @item.bonus_paramp[:spi] - 100
  1797. text = sprintf("%+d%%", value)
  1798. else
  1799. value = @item.spi
  1800. value += @item.bonus_param[:spi] if $imported["ExtraEquipmentOptions"]
  1801. text = sprintf("%+d", value)
  1802. end
  1803. self.contents.draw_text(sw/4, y, sw/4, WLH, text, 1)
  1804. #---
  1805. self.contents.font.color = text_color(@category_colour)
  1806. if $imported["ExtraEquipmentOptions"]
  1807. if @item.agi == 0 and @item.bonus_param[:agi] == 0 and
  1808. @item.bonus_paramp[:agi] == 100
  1809. self.contents.font.color.alpha = 128
  1810. enabled = false
  1811. else
  1812. self.contents.font.color.alpha = 255
  1813. enabled = true
  1814. end
  1815. elsif @item.agi == 0
  1816. self.contents.font.color.alpha = 128
  1817. enabled = false
  1818. else
  1819. self.contents.font.color.alpha = 255
  1820. enabled = true
  1821. end
  1822. icon = YE::MENU::ITEM::ICON_AGI
  1823. draw_icon(icon, sw/2, y, enabled)
  1824. text = YE::MENU::ITEM::EQUIP_AGI
  1825. self.contents.draw_text(sw/2+24, y, sw/4-24, WLH, text, 0)
  1826. self.contents.font.color = normal_color
  1827. if !enabled
  1828. self.contents.font.color.alpha = 128
  1829. else
  1830. self.contents.font.color.alpha = 255
  1831. end
  1832. if $imported["ExtraEquipmentOptions"] and @item.bonus_paramp[:agi] != 100
  1833. value = @item.bonus_paramp[:agi] - 100
  1834. text = sprintf("%+d%%", value)
  1835. else
  1836. value = @item.agi
  1837. value += @item.bonus_param[:agi] if $imported["ExtraEquipmentOptions"]
  1838. text = sprintf("%+d", value)
  1839. end
  1840. self.contents.draw_text(sw*3/4, y, sw/4, WLH, text, 1)
  1841. #---HIT AND EVA ROW---
  1842. y += WLH
  1843. self.contents.font.size = YE::MENU::ITEM::GEN_ITEM_FONT_SIZE
  1844. self.contents.font.color = text_color(@category_colour)
  1845. if $imported["ExtraEquipmentOptions"] and type == 1
  1846. self.contents.font.color.alpha = 255
  1847. enabled = true
  1848. elsif $imported["ExtraEquipmentOptions"] and type == 2
  1849. if @item.bonus_param[:hit] != 0 or @item.bonus_paramp[:hit] != 100
  1850. self.contents.font.color.alpha = 255
  1851. enabled = true
  1852. else
  1853. self.contents.font.color.alpha = 128
  1854. enabled = false
  1855. end
  1856. elsif type == 1
  1857. self.contents.font.color.alpha = 255
  1858. enabled = true
  1859. else
  1860. self.contents.font.color.alpha = 128
  1861. enabled = false
  1862. end
  1863. icon = YE::MENU::ITEM::ICON_HIT
  1864. draw_icon(icon, 0, y, enabled)
  1865. text = YE::MENU::ITEM::EQUIP_HIT
  1866. self.contents.draw_text(24, y, sw/4-24, WLH, text, 0)
  1867. self.contents.font.color = normal_color
  1868. if !enabled
  1869. self.contents.font.color.alpha = 128
  1870. else
  1871. self.contents.font.color.alpha = 255
  1872. end
  1873. value = 0
  1874. value += @item.hit if type == 1
  1875. if $imported["ExtraEquipmentOptions"]
  1876. value += @item.bonus_param[:hit]
  1877. value += @item.bonus_paramp[:hit] - 100
  1878. end
  1879. text = sprintf("%+d%%", value)
  1880. self.contents.draw_text(sw/4, y, sw/4, WLH, text, 1)
  1881. #---
  1882. self.contents.font.color = text_color(@category_colour)
  1883. if $imported["ExtraEquipmentOptions"] and type == 1
  1884. if @item.bonus_param[:eva] != 0 or @item.bonus_paramp[:eva] != 100
  1885. self.contents.font.color.alpha = 255
  1886. enabled = true
  1887. else
  1888. self.contents.font.color.alpha = 128
  1889. enabled = false
  1890. end
  1891. elsif $imported["ExtraEquipmentOptions"] and type == 2
  1892. if @item.eva == 0 and @item.bonus_param[:eva] == 0 and
  1893. @item.bonus_paramp[:eva] == 100
  1894. self.contents.font.color.alpha = 128
  1895. enabled = false
  1896. else
  1897. self.contents.font.color.alpha = 255
  1898. enabled = true
  1899. end
  1900. elsif type == 2 and @item.eva != 0
  1901. self.contents.font.color.alpha = 255
  1902. enabled = true
  1903. else
  1904. self.contents.font.color.alpha = 128
  1905. enabled = false
  1906. end
  1907. icon = YE::MENU::ITEM::ICON_EVA
  1908. draw_icon(icon, sw/2, y, enabled)
  1909. text = YE::MENU::ITEM::EQUIP_EVA
  1910. self.contents.draw_text(sw/2+24, y, sw/4-24, WLH, text, 0)
  1911. self.contents.font.color = normal_color
  1912. if !enabled
  1913. self.contents.font.color.alpha = 128
  1914. else
  1915. self.contents.font.color.alpha = 255
  1916. end
  1917. value = 0
  1918. value += @item.eva if type == 2
  1919. if $imported["ExtraEquipmentOptions"]
  1920. value += @item.bonus_param[:eva]
  1921. value += @item.bonus_paramp[:eva] - 100
  1922. end
  1923. text = sprintf("%+d%%", value)
  1924. self.contents.draw_text(sw*3/4, y, sw/4, WLH, text, 1)
  1925. #---CRI AND ODDS ROW---
  1926. if $imported["ExtraEquipmentOptions"]
  1927. y += WLH
  1928. self.contents.font.color = text_color(@category_colour)
  1929. if @item.bonus_param[:cri] == 0 and @item.bonus_paramp[:cri] == 100
  1930. self.contents.font.color.alpha = 128
  1931. enabled = false
  1932. else
  1933. self.contents.font.color.alpha = 255
  1934. enabled = true
  1935. end
  1936. icon = YE::MENU::ITEM::ICON_CRI
  1937. draw_icon(icon, 0, y, enabled)
  1938. text = YE::MENU::ITEM::EQUIP_CRI
  1939. self.contents.draw_text(24, y, sw/4-24, WLH, text, 0)
  1940. self.contents.font.color = normal_color
  1941. if !enabled
  1942. self.contents.font.color.alpha = 128
  1943. else
  1944. self.contents.font.color.alpha = 255
  1945. end
  1946. value = @item.bonus_param[:cri]
  1947. value += @item.bonus_paramp[:cri] - 100
  1948. text = sprintf("%+d%%", value)
  1949. self.contents.draw_text(sw/4, y, sw/4, WLH, text, 1)
  1950. #---
  1951. self.contents.font.color = text_color(@category_colour)
  1952. if @item.bonus_param[:odds] == 0 and @item.bonus_paramp[:odds] == 100
  1953. self.contents.font.color.alpha = 128
  1954. enabled = false
  1955. else
  1956. self.contents.font.color.alpha = 255
  1957. enabled = true
  1958. end
  1959. icon = YE::MENU::ITEM::ICON_ODDS
  1960. draw_icon(icon, sw/2, y, enabled)
  1961. text = YE::MENU::ITEM::EQUIP_ODDS
  1962. self.contents.draw_text(sw/2+24, y, sw/4-24, WLH, text, 0)
  1963. self.contents.font.color = normal_color
  1964. if !enabled
  1965. self.contents.font.color.alpha = 128
  1966. else
  1967. self.contents.font.color.alpha = 255
  1968. end
  1969. value = @item.bonus_param[:odds]
  1970. value += @item.bonus_paramp[:odds] - 100
  1971. text = sprintf("%+d", value)
  1972. self.contents.draw_text(sw*3/4, y, sw/4, WLH, text, 1)
  1973. end
  1974. end # end make equip page
  1975.  
  1976. #--------------------------------------------------------------------------
  1977. # make class page
  1978. #--------------------------------------------------------------------------
  1979. def make_class_page(type)
  1980. # Type 1 = weapon
  1981. # Type 2 = armour
  1982. # $data_classes
  1983. query_classes = YE::MENU::ITEM::CLASS_HASH
  1984. class_array = []
  1985. all_class = []
  1986. for key in query_classes
  1987. class_id = key[0]
  1988. next if class_id == 0
  1989. next if $data_classes[class_id] == nil
  1990. all_class.push(class_id)
  1991. if type == 1
  1992. equip_array = $data_classes[class_id].weapon_set
  1993. else
  1994. equip_array = $data_classes[class_id].armor_set
  1995. end
  1996. if equip_array.include?(@item.id)
  1997. class_array.push(class_id)
  1998. end
  1999. end
  2000. self.contents.font.color.alpha = 255
  2001. self.contents.font.size = YE::MENU::ITEM::GEN_ITEM_FONT_SIZE
  2002. self.contents.font.color = normal_color
  2003. y = WLH
  2004. x = 0
  2005. sw = self.width - 32
  2006. class_array = class_array.sort{ |xx,yy| xx <=> yy }
  2007. all_class = all_class.sort{ |xx,yy| xx <=> yy }
  2008. if class_array.size == (query_classes.size - 1) and
  2009. YE::MENU::ITEM::USE_ALL_CLASS
  2010. icon = query_classes[0]
  2011. draw_icon(icon, x, y)
  2012. text = YE::MENU::ITEM::ALL_CLASSES
  2013. self.contents.draw_text(x+24, y, sw/2-24, WLH, text, 0)
  2014. else
  2015. if YE::MENU::ITEM::SHOW_UNEQUIPPABLE_CLASSES
  2016. for class_id in all_class
  2017. next if class_id == 0
  2018. if x >= sw
  2019. y += WLH
  2020. x = 0
  2021. end
  2022. if class_array.include?(class_id)
  2023. self.contents.font.color.alpha = 255
  2024. enable = true
  2025. else
  2026. self.contents.font.color.alpha = 128
  2027. enable = false
  2028. end
  2029. icon = query_classes[class_id]
  2030. draw_icon(icon, x, y, enable)
  2031. text = $data_classes[class_id].name
  2032. self.contents.draw_text(x+24, y, sw/2-30, WLH, text, 0)
  2033. x += sw / 2
  2034. end
  2035. else
  2036. for class_id in class_array
  2037. next if class_id == 0
  2038. if x >= sw
  2039. y += WLH
  2040. x = 0
  2041. end
  2042. icon = query_classes[class_id]
  2043. draw_icon(icon, x, y, true)
  2044. text = $data_classes[class_id].name
  2045. self.contents.draw_text(x+24, y, sw/2-30, WLH, text, 0)
  2046. x += sw / 2
  2047. end
  2048. end
  2049. end
  2050. end
  2051.  
  2052. #--------------------------------------------------------------------------
  2053. # make_purchase_page
  2054. #--------------------------------------------------------------------------
  2055. def make_purchase_page(type)
  2056. sw = self.width - 32
  2057. dy = WLH
  2058. dx = 0
  2059. self.contents.font.color.alpha = 255
  2060. case type
  2061. when 0 # Item
  2062. purchase_hash = $game_party.purchased_items[@item.id]
  2063. when 1 # Weapon
  2064. purchase_hash = $game_party.purchased_weapons[@item.id]
  2065. when 2 # Armour
  2066. purchase_hash = $game_party.purchased_armours[@item.id]
  2067. end
  2068. data = load_data("Data/MapInfos.rvdata")
  2069. map_array = []
  2070. for i in purchase_hash
  2071. next if data[i] == nil
  2072. text = data[i].name.gsub(/\[.*\]/) { "" }
  2073. map_array.push(text)
  2074. end
  2075. self.contents.font.color = system_color
  2076. self.contents.draw_text(dx, dy, sw, WLH, YE::MENU::ITEM::TEXT_PURCHASE, 1)
  2077. self.contents.font.color = normal_color
  2078. self.contents.font.size = YE::MENU::ITEM::PURCHASE_FSIZE
  2079. dy += WLH
  2080. for name in map_array.sort!
  2081. next if name == ""
  2082. self.contents.draw_text(dx, dy, sw/2-5, WLH, name)
  2083. dy += WLH
  2084. if dy + WLH > self.height - 32
  2085. dy = WLH * 2
  2086. dx = sw/2+5
  2087. end
  2088. end
  2089. end # make_purchase_page
  2090.  
  2091. #--------------------------------------------------------------------------
  2092. # make_steal_page
  2093. #--------------------------------------------------------------------------
  2094. def make_steal_page(type)
  2095. sw = self.width - 32
  2096. dy = WLH
  2097. dx = 0
  2098. self.contents.font.color.alpha = 255
  2099. case type
  2100. when 0 # Item
  2101. stolen_hash = $game_party.stolen_items[@item.id]
  2102. when 1 # Weapon
  2103. stolen_hash = $game_party.stolen_weapons[@item.id]
  2104. when 2 # Armour
  2105. stolen_hash = $game_party.stolen_armours[@item.id]
  2106. end
  2107. enemy_array = []
  2108. for i in stolen_hash
  2109. next if $data_enemies[i] == nil
  2110. text = $data_enemies[i].name.gsub(/\[.*\]/) { "" }
  2111. enemy_array.push(text)
  2112. end
  2113. self.contents.font.color = system_color
  2114. self.contents.draw_text(dx, dy, sw, WLH, YE::MENU::ITEM::TEXT_STOLEN, 1)
  2115. self.contents.font.color = normal_color
  2116. self.contents.font.size = YE::MENU::ITEM::STOLEN_FSIZE
  2117. dy += WLH
  2118. for name in enemy_array.sort!
  2119. next if name == ""
  2120. self.contents.draw_text(dx, dy, sw/2-5, WLH, name)
  2121. dy += WLH
  2122. if dy + WLH > self.height - 32
  2123. dy = WLH * 2
  2124. dx = sw/2+5
  2125. end
  2126. end
  2127. end # make_steal_page
  2128.  
  2129. #--------------------------------------------------------------------------
  2130. # make_drop_page
  2131. #--------------------------------------------------------------------------
  2132. def make_drop_page(type)
  2133. sw = self.width - 32
  2134. dy = WLH
  2135. dx = 0
  2136. self.contents.font.color.alpha = 255
  2137. case type
  2138. when 0 # Item
  2139. stolen_hash = $game_party.dropped_items[@item.id]
  2140. when 1 # Weapon
  2141. stolen_hash = $game_party.dropped_weapons[@item.id]
  2142. when 2 # Armour
  2143. stolen_hash = $game_party.dropped_armours[@item.id]
  2144. end
  2145. enemy_array = []
  2146. for i in stolen_hash
  2147. next if $data_enemies[i] == nil
  2148. text = $data_enemies[i].name.gsub(/\[.*\]/) { "" }
  2149. enemy_array.push(text)
  2150. end
  2151. self.contents.font.color = system_color
  2152. self.contents.draw_text(dx, dy, sw, WLH, YE::MENU::ITEM::TEXT_DROPPED, 1)
  2153. self.contents.font.color = normal_color
  2154. self.contents.font.size = YE::MENU::ITEM::DROPPED_FSIZE
  2155. dy += WLH
  2156. for name in enemy_array.sort!
  2157. next if name == ""
  2158. self.contents.draw_text(dx, dy, sw/2-5, WLH, name)
  2159. dy += WLH
  2160. if dy + WLH > self.height - 32
  2161. dy = WLH * 2
  2162. dx = sw/2+5
  2163. end
  2164. end
  2165. end # make_drop_page
  2166.  
  2167. #--------------------------------------------------------------------------
  2168. # make notes item page
  2169. #--------------------------------------------------------------------------
  2170. def make_notes_item_page
  2171. self.contents.font.color.alpha = 255
  2172. self.contents.font.size = YE::MENU::ITEM::NOTE_PAGE_TEXT_SIZE
  2173. self.contents.font.color = text_color(YE::MENU::ITEM::NOTE_PAGE_TEXT_COLOUR)
  2174. y = 24
  2175. txsize = YE::MENU::ITEM::NOTE_PAGE_TEXT_SIZE + 4
  2176. text = YE::HASH::ITEM_NOTES[@item.id]
  2177. nwidth = YE::MENU::ITEM::NOTE_PAGE_WIDTH
  2178. buf = text.gsub(/\\N(\[\d+\])/i) { "\\__#{$1}" }
  2179. lines = buf.split(/(?:[|]|\\n)/i)
  2180. lines.each_with_index { |l, i|
  2181. l.gsub!(/\\__(\[\d+\])/i) { "\\N#{$1}" }
  2182. self.contents.draw_text(0, i * txsize + y, nwidth, WLH, l, 0)
  2183. }
  2184. end #end def
  2185.  
  2186. #--------------------------------------------------------------------------
  2187. # make notes weapon page
  2188. #--------------------------------------------------------------------------
  2189. def make_notes_weapon_page
  2190. self.contents.font.color.alpha = 255
  2191. self.contents.font.size = YE::MENU::ITEM::NOTE_PAGE_TEXT_SIZE
  2192. self.contents.font.color = text_color(YE::MENU::ITEM::NOTE_PAGE_TEXT_COLOUR)
  2193. y = 24
  2194. txsize = YE::MENU::ITEM::NOTE_PAGE_TEXT_SIZE + 4
  2195. text = YE::HASH::WEAPON_NOTES[@item.id]
  2196. nwidth = YE::MENU::ITEM::NOTE_PAGE_WIDTH
  2197. buf = text.gsub(/\\N(\[\d+\])/i) { "\\__#{$1}" }
  2198. lines = buf.split(/(?:[|]|\\n)/i)
  2199. lines.each_with_index { |l, i|
  2200. l.gsub!(/\\__(\[\d+\])/i) { "\\N#{$1}" }
  2201. self.contents.draw_text(0, i * txsize + y, nwidth, WLH, l, 0)
  2202. }
  2203. end #end def
  2204.  
  2205. #--------------------------------------------------------------------------
  2206. # make notes armour page
  2207. #--------------------------------------------------------------------------
  2208. def make_notes_armour_page
  2209. self.contents.font.color.alpha = 255
  2210. self.contents.font.size = YE::MENU::ITEM::NOTE_PAGE_TEXT_SIZE
  2211. self.contents.font.color = text_color(YE::MENU::ITEM::NOTE_PAGE_TEXT_COLOUR)
  2212. y = 24
  2213. txsize = YE::MENU::ITEM::NOTE_PAGE_TEXT_SIZE + 4
  2214. text = YE::HASH::ARMOUR_NOTES[@item.id]
  2215. nwidth = YE::MENU::ITEM::NOTE_PAGE_WIDTH
  2216. buf = text.gsub(/\\N(\[\d+\])/i) { "\\__#{$1}" }
  2217. lines = buf.split(/(?:[|]|\\n)/i)
  2218. lines.each_with_index { |l, i|
  2219. l.gsub!(/\\__(\[\d+\])/i) { "\\N#{$1}" }
  2220. self.contents.draw_text(0, i * txsize + y, nwidth, WLH, l, 0)
  2221. }
  2222. end #end def
  2223.  
  2224. #--------------------------------------------------------------------------
  2225. # create total pages
  2226. #--------------------------------------------------------------------------
  2227. def create_total_pages
  2228. @contents = []
  2229. #---
  2230. if @item.is_a?(RPG::Item)
  2231. @contents.push(100) if YE::MENU::ITEM::SHOW_PAGE_GEN_ITEM
  2232. if YE::MENU::ITEM::SHOW_PURCHASE and !@item.hide_purchase
  2233. $game_party.purchased_items[@item.id] = [] if
  2234. $game_party.purchased_items[@item.id] == nil
  2235. if $game_party.purchased_items[@item.id] != []
  2236. @contents.push(105)
  2237. end
  2238. end
  2239. if YE::MENU::ITEM::SHOW_STOLEN and !@item.hide_steal_page
  2240. $game_party.stolen_items[@item.id] = [] if
  2241. $game_party.stolen_items[@item.id] == nil
  2242. if $game_party.stolen_items[@item.id] != []
  2243. @contents.push(106)
  2244. end
  2245. end
  2246. if YE::MENU::ITEM::SHOW_DROPPED and !@item.hide_drop_page
  2247. $game_party.dropped_items[@item.id] = [] if
  2248. $game_party.dropped_items[@item.id] == nil
  2249. if $game_party.dropped_items[@item.id] != []
  2250. @contents.push(107)
  2251. end
  2252. end
  2253. if YE::MENU::ITEM::SHOW_PAGE_NOTES
  2254. if YE::HASH::ITEM_NOTES.include?(@item.id)
  2255. @contents.push(199)
  2256. end
  2257. end
  2258. end
  2259. #---
  2260. if @item.is_a?(RPG::Weapon)
  2261. @contents.push(200) if YE::MENU::ITEM::SHOW_PAGE_GEN_ITEM
  2262. if YE::MENU::ITEM::SHOW_CLASSES and !@item.hide_class_page
  2263. @contents.push(202)
  2264. end
  2265. if YE::MENU::ITEM::SHOW_PURCHASE and !@item.hide_purchase
  2266. $game_party.purchased_weapons[@item.id] = [] if
  2267. $game_party.purchased_weapons[@item.id] == nil
  2268. if $game_party.purchased_weapons[@item.id] != []
  2269. @contents.push(205)
  2270. end
  2271. end
  2272. if YE::MENU::ITEM::SHOW_STOLEN and !@item.hide_steal_page
  2273. $game_party.stolen_weapons[@item.id] = [] if
  2274. $game_party.stolen_weapons[@item.id] == nil
  2275. if $game_party.stolen_weapons[@item.id] != []
  2276. @contents.push(206)
  2277. end
  2278. end
  2279. if YE::MENU::ITEM::SHOW_DROPPED and !@item.hide_drop_page
  2280. $game_party.dropped_weapons[@item.id] = [] if
  2281. $game_party.dropped_weapons[@item.id] == nil
  2282. if $game_party.dropped_weapons[@item.id] != []
  2283. @contents.push(207)
  2284. end
  2285. end
  2286. if YE::MENU::ITEM::SHOW_PAGE_NOTES
  2287. if YE::HASH::WEAPON_NOTES.include?(@item.id)
  2288. @contents.push(299)
  2289. end
  2290. end
  2291. end
  2292. #---
  2293. if @item.is_a?(RPG::Armor)
  2294. @contents.push(300) if YE::MENU::ITEM::SHOW_PAGE_GEN_ITEM
  2295. if YE::MENU::ITEM::SHOW_CLASSES and !@item.hide_class_page
  2296. @contents.push(302)
  2297. end
  2298. if YE::MENU::ITEM::SHOW_PURCHASE and !@item.hide_purchase
  2299. $game_party.purchased_armours[@item.id] = [] if
  2300. $game_party.purchased_armours[@item.id] == nil
  2301. if $game_party.purchased_armours[@item.id] != []
  2302. @contents.push(305)
  2303. end
  2304. end
  2305. if YE::MENU::ITEM::SHOW_STOLEN and !@item.hide_steal_page
  2306. $game_party.stolen_armours[@item.id] = [] if
  2307. $game_party.stolen_armours[@item.id] == nil
  2308. if $game_party.stolen_armours[@item.id] != []
  2309. @contents.push(206)
  2310. end
  2311. end
  2312. if YE::MENU::ITEM::SHOW_DROPPED and !@item.hide_drop_page
  2313. $game_party.dropped_armours[@item.id] = [] if
  2314. $game_party.dropped_armours[@item.id] == nil
  2315. if $game_party.dropped_armours[@item.id] != []
  2316. @contents.push(307)
  2317. end
  2318. end
  2319. if YE::MENU::ITEM::SHOW_PAGE_NOTES
  2320. if YE::HASH::ARMOUR_NOTES.include?(@item.id)
  2321. @contents.push(399)
  2322. end
  2323. end
  2324. end
  2325. #---
  2326. @total_pages = @contents.size
  2327. return @total_pages
  2328. end
  2329.  
  2330. #--------------------------------------------------------------------------
  2331. # case_page_name
  2332. #--------------------------------------------------------------------------
  2333. def case_page_name(pagecase)
  2334. if pagecase == 100 or pagecase == 200 or pagecase == 300
  2335. text = YE::MENU::ITEM::TITLE_GENERAL_ITEM
  2336. elsif pagecase == 202 or pagecase == 302
  2337. text = YE::MENU::ITEM::TITLE_CLASSES
  2338. elsif pagecase == 105 or pagecase == 205 or pagecase == 305
  2339. text = YE::MENU::ITEM::TITLE_PURCHASE
  2340. elsif pagecase == 106 or pagecase == 206 or pagecase == 306
  2341. text = YE::MENU::ITEM::TITLE_STOLEN
  2342. elsif pagecase == 107 or pagecase == 207 or pagecase == 307
  2343. text = YE::MENU::ITEM::TITLE_DROPPED
  2344. elsif pagecase == 199
  2345. text = YE::MENU::ITEM::TITLE_NOTES_ITEMS
  2346. elsif pagecase == 299
  2347. text = YE::MENU::ITEM::TITLE_NOTES_WEAPONS
  2348. elsif pagecase == 399
  2349. text = YE::MENU::ITEM::TITLE_NOTES_ARMOURS
  2350. else
  2351. text = YE::MENU::ITEM::TITLE_UNKNOWN
  2352. end
  2353. return text
  2354. end
  2355.  
  2356. #--------------------------------------------------------------------------
  2357. # case_page_run
  2358. #--------------------------------------------------------------------------
  2359. def case_page_run(pagecase)
  2360. if pagecase == 100
  2361. make_first_item_page
  2362. elsif pagecase == 200
  2363. make_equip_page(1)
  2364. elsif pagecase == 300
  2365. make_equip_page(2)
  2366. elsif pagecase == 202
  2367. make_class_page(1)
  2368. elsif pagecase == 302
  2369. make_class_page(2)
  2370. elsif pagecase == 199
  2371. make_notes_item_page
  2372. elsif pagecase == 299
  2373. make_notes_weapon_page
  2374. elsif pagecase == 399
  2375. make_notes_armour_page
  2376. elsif pagecase == 105
  2377. make_purchase_page(0)
  2378. elsif pagecase == 205
  2379. make_purchase_page(1)
  2380. elsif pagecase == 305
  2381. make_purchase_page(2)
  2382. elsif pagecase == 106
  2383. make_steal_page(0)
  2384. elsif pagecase == 206
  2385. make_steal_page(1)
  2386. elsif pagecase == 306
  2387. make_steal_page(2)
  2388. elsif pagecase == 107
  2389. make_drop_page(0)
  2390. elsif pagecase == 207
  2391. make_drop_page(1)
  2392. elsif pagecase == 307
  2393. make_drop_page(2)
  2394. end
  2395. end
  2396.  
  2397. end # Window Item Data
  2398.  
  2399. #===============================================================================
  2400. #
  2401. # END OF FILE
  2402. #
  2403. #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement