Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- #
- # Yanfly Engine RD - Display Item Query
- # Last Date Updated: 2009.06.24
- # Level: Easy, Normal, Hard, Lunatic
- #
- # Similar to the other Display Query scripts, this one lets you view item info
- # by simply pressing the Shift/A button. This query appears in the item menu,
- # the battle scene, and the shop scene where they're needed the most. Although
- # the information displayed isn't nearly as large as the other queries, it will
- # still hopefully prevent the player from becoming too frustrated with figuring
- # out what an item does.
- #
- # This script also records (over time) where the items can be obtained from
- # drops, stolen items, or purchases from shops. This way, players do not need
- # to search back and forth between towns to find out where to buy those certain
- # items they need so promptly.
- #
- #===============================================================================
- # Updates:
- # ----------------------------------------------------------------------------
- # o 2009.06.21 - Finished script.
- # o 2009.04.26 - Started script.
- #===============================================================================
- # Instructions
- #===============================================================================
- #
- # These tags can go inside the noteboxes of your items, weapons, and armours.
- #
- # <key item>
- # This will designate the item as a key item. It will replace the cost value
- # since most key items shouldn't be buyable or sellable anyway.
- #
- # <hide general page> <hide class page> <hide value>
- # <hide purchase page> <hide steal page> <hide drop page>
- # Disables specific pages for those items. General page lists all the usable
- # information. Purchase page displays all the buyable information. Steal page
- # and drop page displays all the enemies that can drop the item.
- #
- # <hide usable>
- # Hides how the item can be used. (ie battle-only, menu-only, etc)
- #
- # <query conditional>
- # Marks the item's usable as conditional.
- #
- # <query basedmg x> <query accuracy x> <query hp_f x> <query mp_f x>
- # <query atk_f x> <query def_x > <query spi_f x> <query agi_f x>
- # <query physical> <query mpdamage> <query absorb> <query ignoredef>
- # The above alters the general information displayed to reflect any custom
- # changes made to item.
- #
- # <query hide elements>
- # Hides all elemental information available to the item.
- #
- # <query add element x> <query sub element x>
- # Adds/removes element from shown query data. use multiple tags to display more
- # of the queried elements.
- #
- # <query hide state apply> <query hide state erase>
- # Hides the applied state properties shown for the item.
- #
- # <query add state apply> <query add state erase>
- # <query sub state apply> <query sub state erase>
- # Adds and removes states shown for applied and removed states. Use multiple
- # tags to display more of the queried states.
- #
- #===============================================================================
- #
- # Compatibility
- # - Works With: KGC Extra Drop Items, Steal, Yanfly's Actor Item Synthesis
- # - Alias: Window_ShopBuy, initialize
- # - Alias: Game_Enemy, perform_collapse
- # - Alias: Scene_Battle
- #
- #===============================================================================
- $imported = {} if $imported == nil
- $imported["DisplayItemQuery"] = true
- module YE
- module MENU
- module ITEM
- # This sets which button will activate the item query window.
- ITEM_QUERY_BATTLE_BUTTON = Input::A
- ITEM_QUERY_MENU_BUTTON = Input::A
- ITEM_QUERY_SHOP_BUTTON = Input::A
- # This affects the item query help window inside battle.
- BATTLE_HELP_SHOW = false
- BATTLE_HELP_TEXT = "Shift:Info"
- BATTLE_HELP_X = 416
- BATTLE_HELP_Y = 288
- BATTLE_HELP_W = 128
- BATTLE_HELP_O = 255
- # This affects whether or not the help window shows inside the item menu.
- MENU_HELP_SHOW = true
- MENU_HELP_TEXT = ["Drücke", "für mehr Informationen."]
- MENU_HELP_ICON = 5
- # This is the sound played when flipping through the various pages.
- # Set it to nil if you don't want a sound to play.
- PAGE_SOUND = RPG::SE.new("Wind7", 80, 125)
- # This displays the title information at the very top of the data window.
- DATA_LEFT = "<<" # This appears if page can be moved back.
- DATA_PAGE1 = "- Information -" # This appears if only one page of info.
- DATA_PAGES = "%d/%d" # This appears if more than one page of info.
- DATA_RIGHT = ">>" # This appears if page can move right.
- DATA_CATEGORY_COLOUR = 16 # This affects category text colour.
- # Set this to true if you would rather the query display the page info
- # type rather than Page X/Y. The titles following correspond to the pages'
- # titles should you decide to display them.
- REPLACE_PAGE_MSG = true
- TITLE_UNKNOWN = "- Keine Informationen -"
- # This is the string data for other attributes. All seen on page 1.
- # Page 1 is always available for every skill unless you change SHOW_PAGE.
- TITLE_GENERAL_ITEM = "- Information -"
- SHOW_PAGE_GEN_ITEM = true
- GEN_ITEM_FONT_SIZE = 16
- # String data for item value. If an item has no value, this part is
- # automatically skipped. Use <hide value> to also hide it.
- ICON_VALUE = 205
- ZERO_INITIATIVE = "+0" # This is given if there's zero initiative.
- DATA_NIL = "-" # Nil Data is generally for numbered terms.
- DATA_TRUE = "Y" # True and false data stand for attributes.
- DATA_FALSE = "N"
- # String data for when the item is usable. To provide conditional use,
- # place in the <query conditional> tag. To hide this, <hide usable>.
- TEXT_USABLE_BATTLE = "Nur im Kampf einsetzbar"
- TEXT_USABLE_MENU = "Nur im Menü einsetzbar"
- TEXT_USABLE_ALWAYS = "Immer einsetzbar"
- TEXT_USABLE_NEVER = "Niemals einsetzbar"
- TEXT_USABLE_COND = "Unter bestimmten Bedingungen"
- DATA_SHOP_VAL = "%d Gold bei Verkauf"
- DATA_KEY_ITEM = "Wichtiger Gegenstand"
- # Text and icon data for Recovery effect.
- TEXT_HP_RECOVERY = "HP"
- TEXT_MP_RECOVERY = "MP"
- ICON_HP_RECOVERY = 99
- ICON_MP_RECOVERY = 100
- # Used for scrolls or any other kind of spell-like items. Only shows if
- # there is a
- DATA_WIDTH = 24 # This sets text width for query data.
- DATA_ALIGN = 1 # This sets alignment. 0=left. 1=center. 2=right.
- ICON_BASEDMG = 119 # Used for base damage.
- ICON_BASEHEAL = 128 # Used for base healing.
- ICON_ACCURACY = 135 # Used for accuracy.
- ICON_HP_F = 200 # Used for HP F (for CustomDmgFormula).
- ICON_MP_F = 201 # Used for MP F (for CustomDmgFormula).
- ICON_ATK_F = 2 # Used for Attack F.
- ICON_DEF_F = 52 # Used for Defense F (for CustomDmgFormula).
- ICON_SPI_F = 21 # Used for Spirit F.
- ICON_AGI_F = 48 # Used for Agility F (for CustomDmgFormula).
- ICON_PHYS = 132 # Used for the physical attack icon.
- ICON_MPDMG = 130 # Used for MP damage icon.
- ICON_ABSORB = 215 # Used for absorb damage icon.
- ICON_IGDEF = 53 # Used for ignore defense icon.
- # This is the text used for parameter growth. Icon data is used from
- # the list above with the relative ATK_F's and such.
- TEXT_MAXHP_GROWTH = "MaxHP Growth"
- TEXT_MAXMP_GROWTH = "MaxMP Growth"
- TEXT_ATK_GROWTH = "ATK Growth"
- TEXT_DEF_GROWTH = "DEF Growth"
- TEXT_SPI_GROWTH = "SPI Growth"
- TEXT_AGI_GROWTH = "AGI Growth"
- # This part displays the element text and what elements can be shown.
- TEXT_ELEMENTS = "- Information -"
- SHOWN_ELEMENTS = [ 2, 3, 4, 5, 6,
- 9, 10, 11, 12, 13, 14, 15, 16,
- ] # Do not remove this.
- ELEMENT_ICONS = { 2 => 10, 3 => 4, 4 => 14, 5 => 16, 6 => 12,
- 9 => 104, 10 => 105, 11 => 106, 12 => 107,
- 13 => 108, 14 => 109, 15 => 110, 16 => 111,
- } # Do not remove this.
- # This part displays status related changes.
- TEXT_APPLY_STATES = "Fügt hinzu:"
- TEXT_ERASE_STATES = "Negiert:"
- # This page will show any custom notes you've set for that item.
- SHOW_PAGE_NOTES = true
- TITLE_NOTES_ITEMS = "- Information -"
- TITLE_NOTES_WEAPONS = "- Information -"
- TITLE_NOTES_ARMOURS = "- Information -"
- NOTE_PAGE_WIDTH = 240
- NOTE_PAGE_TEXT_SIZE = 16
- NOTE_PAGE_TEXT_COLOUR = 0
- # This page is for the equipment stat boosts. Icons are selected here.
- ICON_MAXHP = 200
- ICON_MAXMP = 201
- ICON_ATK = 1314
- ICON_DEF = 1478
- ICON_SPI = 2298
- ICON_AGI = 2172
- ICON_HIT = 135
- ICON_EVA = 158
- ICON_CRI = 119
- ICON_ODDS = 137
- EQUIP_MAXHP = "MaxHP"
- EQUIP_MAXMP = "MaxMP"
- EQUIP_ATK = "ATK"
- EQUIP_DEF = "DEF"
- EQUIP_SPI = "INT"
- EQUIP_AGI = "SPD"
- EQUIP_HIT = "HIT"
- EQUIP_EVA = "EVA"
- EQUIP_CRI = "CRI"
- EQUIP_ODDS = "LUK"
- # This sets the display process for the class page under equipments.
- # It will show what classes can and can't equip the particular item.
- SHOW_CLASSES = false
- TITLE_CLASSES = "Classes"
- # If this is enabled, if all classes can equip that item, it will display
- # the all class text instead of listing out every single class.
- USE_ALL_CLASS = false
- ALL_CLASSES = "All Classes"
- # If this is enabled, the class structure will show unequippable classes
- # in addition to the ones that can equip the item.
- SHOW_UNEQUIPPABLE_CLASSES = false
- # This following hash will determine which classes will be shown and
- # what icons will be attributed to them. Class 0 will indicate the ALL
- # class which will appear if all other ID's appear on the list.
- CLASS_HASH ={
- # Class ID => Class Icon
- 0 => 62, # All classes
- 1 => 3, # Paladin
- 2 => 6, # Warrior
- 3 => 128, # Priest
- 4 => 119, # Magician
- 5 => 32, # Knight
- 6 => 136, # Dark Knight
- 7 => 132, # Grappler
- 8 => 39, # Thief
- } # Do not remove this.
- # If this is enabled, it will show all of the locations that the item can
- # be bought from (that the player has visited).
- SHOW_PURCHASE = true
- TITLE_PURCHASE = "- Information -"
- TEXT_PURCHASE = "Kaufbei in"
- PURCHASE_FSIZE = 16
- # If this is enabled, it will show all of the enemyes that the item can
- # be stolen from (that the player has tried stealing from).
- SHOW_STOLEN = false
- TITLE_STOLEN = "- Information -"
- TEXT_STOLEN = "Stehlbar"
- STOLEN_FSIZE = 16
- # If this is enabled, it will show all of the enemyes that the item can
- # be dropped from (that the player has already defeated).
- SHOW_DROPPED = true
- TITLE_DROPPED = "- Information -"
- TEXT_DROPPED = "Erhätlich von"
- DROPPED_FSIZE = 16
- end # ITEM
- end # MENU
- end # YE
- #===============================================================================
- # How to Use: Lunatic Mode
- #===============================================================================
- #
- # This part allows you to input your own custom notes and whatnot. Custom notes
- # page will only appear for item that are listed in the note hash beneath the
- # Lunatic Mode section.
- #
- # The process is pretty simple. Just follow the template below.
- #
- # ITEM_NOTES ={
- # item.id => "This would be the first line| and this would be the next!",
- # } # Do not remove this.
- #
- # Enter the item's ID number where "item.id" is. Following the "=>" input
- # the custom notes you'd like for that skill to display. If you wish to add
- # line breaks to notes, add a | where you would like the break to appear. Now
- # while they do appear in the notebox, they are confined by the note page's
- # width and will shrink if the lines end up being too long. You can adjust the
- # note page's width in the part before the Lunatic Mode instructions.
- #
- #===============================================================================
- module YE
- module HASH
- #Ah, the potion. Nothing can|
- #Was soll das heißen, dass
- #Forbidden Story nicht bug-
- #frei ist?
- #Ich hoffe für dich, dass
- #zumindest dieses Item nun
- #funktionieren wird!
- #Ein wahrlich komisches Buch.||Was es damit auf sich hat?
- # This is for usable items.
- ITEM_NOTES ={
- 1 => "Ein gewöhnlicher Trank.||Dieser heilt zwar nur 25%|der gesamten HP, jedoch ist|dieser relativ preisgünstig.",
- 2 => "Ein gewöhnlicher Trank.||Dieses beliebte Getränk|wird gerne von Gilden und|Teams für vielseitige Dinge|verwendet.",
- 3 => "Blaue Tränke werden haupt-|sächlich zur Erfrischung|des Geistes genutzt.",
- 4 => "Blaue Tränke werden haupt-|sächlich zur Erfrischung|des Geistes genutzt.",
- 5 => "Grüne Tränke beinhalten|besondere Heilstoffe, die|jede Vergiftung heilen.||Die Menge reicht ausschließ-|lich nur für eine Person.",
- 6 => "Grüne Tränke beinhalten|besondere Heilstoffe, die|jede Vergiftung heilen.||Die Menge reicht für die|ganze Gruppe aus.",
- 11 => "Die Phoenixfeder ist einer|der letzten Relikte, die der|Insel ihren mysteriösen Ruf|geben.||Sie lässt einen gefallenen|Mitstreiter wieder erwachen.",
- 12 => "Die Phoenixfeder ist einer|der letzten Relikte, die der|Insel ihren mysteriösen Ruf|geben.||Sie lässt alle gefallenen|Mitstreiter wieder erwachen.",
- 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.",
- 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.",
- 15 => "Niemand weiß so richtig,|was in so einem Elixir nun|tatsächlich drinnen ist...",
- 16 => "Allzwecksgegenstand zur|Weiterverarbeitung.||Bitte nicht auf Menschen und|Tiere werfen!",
- 19 => "Eine gewöhnliche Kugel für|Fernkampfwaffen.",
- 20 => "In einen Magazin passen bis|zu 20 Kugeln hinein.",
- 25 => "Eine gewöhnliche Nuss.||Kann zur Weiterverarbeitung|verwendet werden.",
- 29 => "Ein gewöhnlicher Pilz.||Kann zur Weiterverarbeitung|verwendet werden.",
- 30 => "Ein gewöhnliches Ei.||Kann zur Weiterverarbeitung|verwendet werden.",
- 35 => "Ein gewöhnlicher Apfel.||Kann zur Weiterverarbeitung|verwendet werden.",
- 92 => "Ein wahrlich komisches Buch.||Was es damit auf sich hat?",
- 265 => "Nellos altes Tagebuch.||Für gewöhnlich schreibt er|täglich darin. Laut seinen|Aussagen ist dies sein|bedeutendster Besitz.",
- 1200 => "Hello, world.|It's nice to meet you.",
- 1200 => "Hello, world.|It's nice to meet you.",
- 1201 => "Good bye, world.|It was nice meeting you.",
- } # Do not remove this.
- # This is for weapons.
- WEAPON_NOTES ={
- 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.",
- 1200 => "Hello, world.|It's nice to meet you.",
- 1201 => "Good bye, world.|It was nice meeting you.",
- } # Do not remove this.
- # This is for armours.
- ARMOUR_NOTES ={
- 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.",
- 1200 => "Hello, world.|It's nice to meet you.",
- 1201 => "Good bye, world.|It was nice meeting you.",
- } # Do not remove this.
- end #module HASH
- end #module YE
- #===============================================================================
- # Editting anything past this point may potentially result in causing computer
- # damage, incontinence, explosion of user's head, coma, death, and/or halitosis.
- # Therefore, edit at your own risk.
- #===============================================================================
- module YE
- module REGEXP
- module BASEITEM
- KEY_ITEM = /<(?:KEY_ITEM|key item)>/i
- HIDE_VALUE = /<(?:HIDE_VALUE|hide value)>/i
- HIDE_USABLE = /<(?:HIDE_USABLE|hide usable)>/i
- HIDE_GENERAL = /<(?:HIDE_GENERAL_PAGE|hide general page)>/i
- HIDE_PURCHASE = /<(?:HIDE_PURCHASE_PAGE|hide purchase page)>/i
- HIDE_CLASS_PAGE = /<(?:HIDE_CLASS_PAGE|hide class page)>/i
- HIDE_STEAL_FROM = /<(?:HIDE_STEAL_PAGE|hide steal page)>/i
- HIDE_DROP_FROM = /<(?:HIDE_DROP_PAGE|hide drop page)>/i
- QUERY_CONDITIONAL = /<(?:QUERY_PHYSICAL|query conditional)>/i
- QUERY_BASEDMG = /<(?:QUERY_BASEDMG|query basedmg|query base dmg)[ ]*(\d+)>/i
- QUERY_NBASEDMG = /<(?:QUERY_BASEDMG|query basedmg|query base dmg)[ ]*[-](\d+)>/i
- QUERY_ACCURACY = /<(?:QUERY_ACCURACY|query accuracy)[ ]*(\d+)>/i
- QUERY_HP_F = /<(?:QUERY_HP_F|query hp_f)[ ]*(\d+)>/i
- QUERY_MP_F = /<(?:QUERY_MP_F|query mp_f)[ ]*(\d+)>/i
- QUERY_ATK_F = /<(?:QUERY_ATK_F|query atk_f)[ ]*(\d+)>/i
- QUERY_DEF_F = /<(?:QUERY_DEF_F|query def_f)[ ]*(\d+)>/i
- QUERY_SPI_F = /<(?:QUERY_SPI_F|query spi_f)[ ]*(\d+)>/i
- QUERY_AGI_F = /<(?:QUERY_AGI_F|query agi_f)[ ]*(\d+)>/i
- # Put this in if you want to force query to show it as a physical.
- QUERY_PHYSICAL = /<(?:QUERY_PHYSICAL|query physical)>/i
- QUERY_MPDAMAGE = /<(?:QUERY_MPDAMAGE|query mpdamage|query mp damage)>/i
- QUERY_ABSORB = /<(?:QUERY_ABSORB|query absorb)>/i
- QUERY_IGDEF = /<(?:QUERY_IGNOREDEF|query ignoredef|query ignore def)>/i
- QUERY_HIDE_ELEMENTS = /<(?:QUERY_HIDE_ELEMENTS|query hide elements)>/i
- QUERY_ADD_ELEMENT = /<(?:QUERY_ADD_ELEMENT|query add element)[ ]*(\d+)>/i
- QUERY_SUB_ELEMENT = /<(?:QUERY_SUB_ELEMENT|query sub element)[ ]*(\d+)>/i
- # These affect status effects.
- QUERY_HIDE_STATE_APPLY = /<(?:QUERY_HIDE_STATE_APPLY|query hide state apply)>/i
- QUERY_HIDE_STATE_ERASE = /<(?:QUERY_HIDE_STATE_ERASE|query hide state erase)>/i
- QUERY_ADD_STATE_APPLY = /<(?:QUERY_ADD_STATE_APPLY|query add state apply)[ ]*(\d+)>/i
- QUERY_SUB_STATE_APPLY = /<(?:QUERY_SUB_STATE_APPLY|query sub state apply)[ ]*(\d+)>/i
- QUERY_ADD_STATE_ERASE = /<(?:QUERY_ADD_STATE_ERASE|query add state erase)[ ]*(\d+)>/i
- QUERY_SUB_STATE_ERASE = /<(?:QUERY_SUB_STATE_ERASE|query sub state erase)[ ]*(\d+)>/i
- end # MENU
- end # REGEXP
- end # YE
- #===============================================================================
- # RPG::BaseItem
- #===============================================================================
- class RPG::BaseItem
- #--------------------------------------------------------------------------
- # Yanfly_Cache_DSE
- #--------------------------------------------------------------------------
- def yanfly_cache_diq
- @hide_value = false; @hide_usable = false; @query_conditional = false
- @hide_purchase = false; @hide_general = false; @hide_drop_page = false
- @hide_steal_page = false; @key_item = false; @hide_class_page = false
- @query_basedmg = 0; @query_accuracy = 0; @query_hp_f = 0; @query_mp_f = 0
- @query_atk_f = 0; @query_def_f = 0; @query_spi_f = 0; @query_agi_f = 0
- @query_physical = false; @query_mpdamage = false; @query_absorb = false
- @query_ignore_def = false; @query_hide_elements = false
- @query_add_elements = []; @query_sub_elements = [];
- @query_hide_state_apply = false; @query_hide_state_erase = false
- @query_add_state_apply = []; @query_sub_state_apply = []
- @query_add_state_erase = []; @query_sub_state_erase = []
- self.note.split(/[\r\n]+/).each { |line|
- case line
- when YE::REGEXP::BASEITEM::KEY_ITEM
- @key_item = true
- when YE::REGEXP::BASEITEM::HIDE_VALUE
- @hide_value = true
- when YE::REGEXP::BASEITEM::HIDE_USABLE
- @hide_usable = true
- when YE::REGEXP::BASEITEM::HIDE_PURCHASE
- @hide_purchase = true
- when YE::REGEXP::BASEITEM::HIDE_GENERAL
- @hide_general = true
- when YE::REGEXP::BASEITEM::HIDE_CLASS_PAGE
- @hide_class_page = true
- when YE::REGEXP::BASEITEM::HIDE_STEAL_FROM
- @hide_steal_page = true
- when YE::REGEXP::BASEITEM::HIDE_DROP_FROM
- @hide_drop_page = true
- when YE::REGEXP::BASEITEM::QUERY_CONDITIONAL
- @query_conditional = true
- when YE::REGEXP::BASEITEM::QUERY_BASEDMG
- @query_basedmg = $1.to_i
- when YE::REGEXP::BASEITEM::QUERY_NBASEDMG
- @query_basedmg = $1.to_i * -1
- when YE::REGEXP::BASEITEM::QUERY_ACCURACY
- @query_accuracy = $1.to_i
- when YE::REGEXP::BASEITEM::QUERY_HP_F
- @query_hp_f = $1.to_i
- when YE::REGEXP::BASEITEM::QUERY_MP_F
- @query_mp_f = $1.to_i
- when YE::REGEXP::BASEITEM::QUERY_ATK_F
- @query_atk_f = $1.to_i
- when YE::REGEXP::BASEITEM::QUERY_DEF_F
- @query_def_f = $1.to_i
- when YE::REGEXP::BASEITEM::QUERY_SPI_F
- @query_spi_f = $1.to_i
- when YE::REGEXP::BASEITEM::QUERY_AGI_F
- @query_agi_f = $1.to_i
- when YE::REGEXP::BASEITEM::QUERY_PHYSICAL
- @query_physical = true
- when YE::REGEXP::BASEITEM::QUERY_MPDAMAGE
- @query_mpdamage = true
- when YE::REGEXP::BASEITEM::QUERY_ABSORB
- @query_absorb = true
- when YE::REGEXP::BASEITEM::QUERY_IGDEF
- @query_ignore_def = true
- when YE::REGEXP::BASEITEM::QUERY_HIDE_ELEMENTS
- @query_hide_elements = true
- when YE::REGEXP::BASEITEM::QUERY_ADD_ELEMENT
- element = $1.to_i
- @query_add_elements.push(element)
- when YE::REGEXP::BASEITEM::QUERY_SUB_ELEMENT
- element = $1.to_i
- @query_sub_elements.push(element)
- when YE::REGEXP::BASEITEM::QUERY_HIDE_STATE_APPLY
- @query_hide_state_apply = true
- when YE::REGEXP::BASEITEM::QUERY_HIDE_STATE_ERASE
- @query_hide_state_erase = true
- when YE::REGEXP::BASEITEM::QUERY_ADD_STATE_APPLY
- state = $1.to_i
- @query_add_state_apply.push(state)
- when YE::REGEXP::BASEITEM::QUERY_SUB_STATE_APPLY
- state = $1.to_i
- @query_sub_state_apply.push(state)
- when YE::REGEXP::BASEITEM::QUERY_ADD_STATE_ERASE
- state = $1.to_i
- @query_add_state_erase.push(state)
- when YE::REGEXP::BASEITEM::QUERY_SUB_STATE_ERASE
- state = $1.to_i
- @query_sub_state_erase.push(state)
- end
- }
- end # end yanfly_cache_diq
- #--------------------------------------------------------------------------
- # Definitions
- #--------------------------------------------------------------------------
- def key_item
- yanfly_cache_diq if @key_item == nil
- return @key_item
- end
- def hide_value
- yanfly_cache_diq if @hide_value == nil
- return @hide_value
- end
- def hide_usable
- yanfly_cache_diq if @hide_usable == nil
- return @hide_usable
- end
- def hide_purchase
- yanfly_cache_diq if @hide_purchase == nil
- return @hide_purchase
- end
- def hide_class_page
- yanfly_cache_diq if @hide_class_page == nil
- return @hide_class_page
- end
- def hide_general_page
- yanfly_cache_diq if @hide_general == nil
- return @hide_general
- end
- def hide_steal_page
- yanfly_cache_diq if @hide_steal_page == nil
- return @hide_steal_page
- end
- def hide_drop_page
- yanfly_cache_diq if @hide_drop_page == nil
- return @hide_drop_page
- end
- def query_conditional
- yanfly_cache_diq if @query_conditional == nil
- return @query_conditional
- end
- def query_basedmg
- yanfly_cache_diq if @query_basedmg
- return @query_basedmg
- end
- def query_accuracy
- yanfly_cache_diq if @query_accuracy
- return @query_accuracy
- end
- def query_hp_f
- yanfly_cache_diq if @query_hp_f
- return @query_hp_f
- end
- def query_mp_f
- yanfly_cache_diq if @query_mp_f
- return @query_mp_f
- end
- def query_atk_f
- yanfly_cache_diq if @query_atk_f
- return @query_atk_f
- end
- def query_def_f
- yanfly_cache_diq if @query_def_f
- return @query_def_f
- end
- def query_spi_f
- yanfly_cache_diq if @query_spi_f
- return @query_spi_f
- end
- def query_agi_f
- yanfly_cache_diq if @query_agi_f
- return @query_agi_f
- end
- #--------------------------------------------------------------------------
- # query_physical
- #--------------------------------------------------------------------------
- def query_physical
- yanfly_cache_diq if @query_physical == nil
- return @query_physical
- end
- #--------------------------------------------------------------------------
- # query_mpdamage
- #--------------------------------------------------------------------------
- def query_mpdamage
- yanfly_cache_diq if @query_mpdamage == nil
- return @query_mpdamage
- end
- #--------------------------------------------------------------------------
- # query_absorb
- #--------------------------------------------------------------------------
- def query_absorb
- yanfly_cache_diq if @query_absorb == nil
- return @query_absorb
- end
- #--------------------------------------------------------------------------
- # query_ignore_def
- #--------------------------------------------------------------------------
- def query_ignore_def
- yanfly_cache_diq if @query_ignore_def == nil
- return @query_ignore_def
- end
- #--------------------------------------------------------------------------
- # query_hide_aggro
- #--------------------------------------------------------------------------
- def query_hide_aggro
- yanfly_cache_diq if @query_hide_aggro == nil
- return @query_hide_aggro
- end
- #--------------------------------------------------------------------------
- # query_hide_grudge
- #--------------------------------------------------------------------------
- def query_hide_grudge
- yanfly_cache_diq if @query_hide_grudge == nil
- return @query_hide_grudge
- end
- #--------------------------------------------------------------------------
- # query_hide_elements
- #--------------------------------------------------------------------------
- def query_hide_elements
- yanfly_cache_diq if @query_hide_elements == nil
- return @query_hide_elements
- end
- #--------------------------------------------------------------------------
- # query add elements
- #--------------------------------------------------------------------------
- def query_add_elements
- yanfly_cache_diq if @query_add_elements == nil
- return @query_add_elements
- end
- #--------------------------------------------------------------------------
- # query sub elements
- #--------------------------------------------------------------------------
- def query_sub_elements
- yanfly_cache_diq if @query_sub_elements == nil
- return @query_sub_elements
- end
- #--------------------------------------------------------------------------
- # query_hide_state_apply
- #--------------------------------------------------------------------------
- def query_hide_state_apply
- yanfly_cache_diq if @query_hide_state_apply == nil
- return @query_hide_state_apply
- end
- #--------------------------------------------------------------------------
- # query_hide_state_erase
- #--------------------------------------------------------------------------
- def query_hide_state_erase
- yanfly_cache_diq if @query_hide_state_erase == nil
- return @query_hide_state_erase
- end
- #--------------------------------------------------------------------------
- # query add state apply
- #--------------------------------------------------------------------------
- def query_add_state_apply
- yanfly_cache_diq if @query_add_state_apply == nil
- return @query_add_state_apply
- end
- #--------------------------------------------------------------------------
- # query sub state apply
- #--------------------------------------------------------------------------
- def query_sub_state_apply
- yanfly_cache_diq if @query_sub_state_apply == nil
- return @query_sub_state_apply
- end
- #--------------------------------------------------------------------------
- # query add state erase
- #--------------------------------------------------------------------------
- def query_add_state_erase
- yanfly_cache_diq if @query_add_state_erase == nil
- return @query_add_state_erase
- end
- #--------------------------------------------------------------------------
- # query sub state erase
- #--------------------------------------------------------------------------
- def query_sub_state_erase
- yanfly_cache_diq if @query_sub_state_erase == nil
- return @query_sub_state_erase
- end
- end # RPG::BaseItem
- #==============================================================================
- # Game_Party
- #==============================================================================
- class Game_Party < Game_Unit
- #--------------------------------------------------------------------------
- # purchased_items, purchased_weapons, purchased_armours
- #--------------------------------------------------------------------------
- def purchased_items
- @purchased_items = {} if @purchased_items == nil
- return @purchased_items
- end
- def purchased_weapons
- @purchased_weapons = {} if @purchased_weapons == nil
- return @purchased_weapons
- end
- def purchased_armours
- @purchased_armours = {} if @purchased_armours == nil
- return @purchased_armours
- end
- #--------------------------------------------------------------------------
- # stolen_items, stolen_weapons, stolen_armours
- #--------------------------------------------------------------------------
- def stolen_items
- @stolen_items = {} if @stolen_items == nil
- return @stolen_items
- end
- def stolen_weapons
- @stolen_weapons = {} if @stolen_weapons == nil
- return @stolen_weapons
- end
- def stolen_armours
- @stolen_armours = {} if @stolen_armours == nil
- return @stolen_armours
- end
- #--------------------------------------------------------------------------
- # dropped_items
- #--------------------------------------------------------------------------
- def dropped_items
- @dropped_items = {} if @dropped_items == nil
- return @dropped_items
- end
- def dropped_weapons
- @dropped_weapons = {} if @dropped_weapons == nil
- return @dropped_weapons
- end
- def dropped_armours
- @dropped_armours = {} if @dropped_armours == nil
- return @dropped_armours
- end
- end # Game_Party
- #===============================================================================
- # Game Enemy
- #===============================================================================
- class Game_Enemy < Game_Battler
- #--------------------------------------------------------------------------
- # alias Collapse
- #--------------------------------------------------------------------------
- alias perform_collapse_diq perform_collapse unless $@
- def perform_collapse
- perform_collapse_diq
- if $game_temp.in_battle and dead?
- drop_items = [enemy.drop_item1, enemy.drop_item2]
- if $imported["ExtraDropItem"]
- drop_items += enemy.extra_drop_items
- end
- drop_items.each_with_index { |item, i|
- case item.kind
- when 0
- next
- when 1
- drop_item = $data_items[item.item_id].id
- $game_party.dropped_items[drop_item] = [] if
- $game_party.dropped_items[drop_item] == nil
- $game_party.dropped_items[drop_item].push(@enemy_id) unless
- $game_party.dropped_items[drop_item].include?(@enemy_id)
- when 2
- drop_item = $data_weapons[item.weapon_id].id
- $game_party.dropped_weapons[drop_item] = [] if
- $game_party.dropped_weapons[drop_item] == nil
- $game_party.dropped_weapons[drop_item].push(@enemy_id) unless
- $game_party.dropped_weapons[drop_item].include?(@enemy_id)
- when 3
- drop_item = $data_armors[item.armor_id].id
- $game_party.dropped_armours[drop_item] = [] if
- $game_party.dropped_armours[drop_item] == nil
- $game_party.dropped_armours[drop_item].push(@enemy_id) unless
- $game_party.dropped_armours[drop_item].include?(@enemy_id)
- end
- }
- end
- end
- end # Game_Enemy
- =begin
- #==============================================================================
- # Scene_Battle
- #==============================================================================
- class Scene_Battle < Scene_Base
- #--------------------------------------------------------------------------
- # alias create_info_viewport
- #--------------------------------------------------------------------------
- alias create_info_viewport_diq create_info_viewport unless $@
- def create_info_viewport
- create_info_viewport_diq
- if $imported["HelpExtension"]
- sdy = 32
- sdy += 24 * (KGC::HelpExtension::ROW_MAX)
- else
- sdy = 56
- end
- sdx = 0; sdw = 272; sdh = 416 - sdy - @status_window.height
- @item_data_window = Window_Item_Data.new(0, sdy, 272, sdh)
- @item_data_window.visible = false
- @item_data_window.active = false
- hix = YE::MENU::ITEM::BATTLE_HELP_X
- hiy = YE::MENU::ITEM::BATTLE_HELP_Y
- hiw = YE::MENU::ITEM::BATTLE_HELP_W
- text = YE::MENU::ITEM::BATTLE_HELP_TEXT
- @help_item_window = Window_Base.new(hix, hiy, hiw, 56)
- @help_item_window.back_opacity = YE::MENU::ITEM::BATTLE_HELP_O
- @help_item_window.contents.draw_text(2, 0, hiw - 40, 24, text, 1)
- @help_item_window.visible = false
- end
- #--------------------------------------------------------------------------
- # alias terminate
- #--------------------------------------------------------------------------
- alias terminate_battle_diq terminate unless $@
- def terminate
- terminate_battle_diq
- @help_item_window.dispose if @help_item_window != nil
- @item_data_window.dispose if @item_data_window != nil
- end
- #--------------------------------------------------------------------------
- # alias update item selection
- #--------------------------------------------------------------------------
- alias update_item_selection_diq update_item_selection unless $@
- def update_item_selection
- if YE::MENU::ITEM::BATTLE_HELP_SHOW
- if @item_data_window.active
- @help_item_window.visible = false
- elsif @item_window.active
- @help_item_window.visible = true
- else
- @help_item_window.visible = false
- end
- else
- @help_item_window.visible = false
- end
- #------------------------------------------
- # If the Item Data Window is active
- #------------------------------------------
- if @item_data_window != nil and @item_data_window.active
- @item_data_window.update
- if Input.trigger?(Input::B)
- Sound.play_cancel
- @item_data_window.disappear
- @item_window.active = true
- elsif Input.trigger?(Input::LEFT) or Input.trigger?(Input::UP)
- @item_data_window.previous_page
- elsif Input.trigger?(Input::RIGHT) or Input.trigger?(Input::DOWN)
- @item_data_window.next_page
- elsif Input.trigger?(Input::L)
- @item_data_window.top_page
- elsif Input.trigger?(Input::R)
- @item_data_window.bottom_page
- end
- #------------------------------------------
- # If the Item Data Window is not active
- #------------------------------------------
- else
- if Input.trigger?(Input::B)
- @help_item_window.visible = false
- elsif Input.trigger?(Input::C)
- @item = @item_window.item
- if $game_party.item_can_use?(@item)
- @help_item_window.visible = false
- end
- @item = @item_window.item
- if @item == nil
- Sound.play_buzzer
- else
- Sound.play_decision
- @item = @item_window.item
- @item_data_window.appear(@item, @item_window)
- @item_window.active = false
- end
- end
- update_item_selection_diq
- end
- end
- #--------------------------------------------------------------------------
- # alias display_steal_effects
- #--------------------------------------------------------------------------
- if $imported["Steal"]
- alias display_stole_object_diq display_stole_object unless $@
- def display_stole_object(target, obj = nil)
- if !target.skipped and !target.actor?
- target.enemy.steal_objects.each_with_index { |item, i|
- next if item == nil
- case item.kind
- when 0
- next
- when 1
- steal_item = $data_items[item.item_id].id
- $game_party.stolen_items[steal_item] = [] if
- $game_party.stolen_items[steal_item] == nil
- $game_party.stolen_items[steal_item].push(target.enemy_id) unless
- $game_party.stolen_items[steal_item].include?(target.enemy_id)
- when 2
- steal_item = $data_weapons[item.weapon_id].id
- $game_party.stolen_weapons[steal_item] = [] if
- $game_party.stolen_weapons[steal_item] == nil
- $game_party.stolen_weapons[steal_item].push(target.enemy_id) unless
- $game_party.stolen_weapons[steal_item].include?(target.enemy_id)
- when 3
- steal_item = $data_armors[item.armor_id].id
- $game_party.stolen_armours[steal_item] = [] if
- $game_party.stolen_armours[steal_item] == nil
- $game_party.stolen_armours[steal_item].push(target.enemy_id) unless
- $game_party.stolen_armours[steal_item].include?(target.enemy_id)
- end
- }
- end
- display_stole_object_diq(target, obj)
- end
- end
- end # Scene Battle
- =end
- #==============================================================================
- # Scene_Item
- #==============================================================================
- class Scene_Item < Scene_Base
- #--------------------------------------------------------------------------
- # alias start
- #--------------------------------------------------------------------------
- alias start_item_diq start unless $@
- def start
- start_item_diq
- #---------
- text = YE::MENU::ITEM::MENU_HELP_TEXT
- icon = YE::MENU::ITEM::MENU_HELP_ICON
- @help_item_window = Window_Base.new(0, 360, 544, 56)
- @help_item_window.contents.draw_text(2, 0, 60, 24, text[0], 1)
- @help_item_window.draw_icon(icon,62,0)
- @help_item_window.contents.draw_text(70,0,240,24, text[1], 1)
- @help_item_window.viewport = @viewport
- if YE::MENU::ITEM::MENU_HELP_SHOW
- @help_item_window.visible = true
- @item_window.height -= 56
- @item_window.refresh
- else
- @help_item_window.visible = false
- end
- sdx = 0
- sdy = @item_window.y
- sdw = 272
- sdh = @item_window.height
- @item_data_window = Window_Item_Data.new(0, sdy, 272, sdh)
- @item_data_window.visible = false
- @item_data_window.active = false
- end
- #--------------------------------------------------------------------------
- # alias terminate
- #--------------------------------------------------------------------------
- alias terminate_menu_diq terminate unless $@
- def terminate
- terminate_menu_diq
- @help_item_window.dispose if @help_item_window != nil
- @item_data_window.dispose if @item_data_window != nil
- end
- #--------------------------------------------------------------------------
- # alias update
- #--------------------------------------------------------------------------
- alias update_item_diq update unless $@
- def update
- update_item_diq
- if @item_data_window.active
- update_item_data_window
- end
- end
- #--------------------------------------------------------------------------
- # update_item_data_window
- #--------------------------------------------------------------------------
- def update_item_data_window
- @item_data_window.update
- if Input.trigger?(Input::B)
- Sound.play_cancel
- @item_data_window.disappear
- @item_window.active = true
- elsif Input.trigger?(Input::LEFT) or Input.trigger?(Input::UP)
- @item_data_window.previous_page
- elsif Input.trigger?(Input::RIGHT) or Input.trigger?(Input::DOWN)
- @item_data_window.next_page
- elsif Input.trigger?(Input::L)
- @item_data_window.top_page
- elsif Input.trigger?(Input::R)
- @item_data_window.bottom_page
- end
- end
- #--------------------------------------------------------------------------
- # alias update_item_selection
- #--------------------------------------------------------------------------
- alias update_item_selection_diq update_item_selection unless $@
- def update_item_selection
- if Input.trigger?(YE::MENU::ITEM::ITEM_QUERY_MENU_BUTTON)
- @item = @item_window.item
- if @item == nil
- Sound.play_buzzer
- else
- Sound.play_decision
- @item = @item_window.item
- @item_data_window.appear(@item, @item_window)
- @item_window.active = false
- end
- end
- update_item_selection_diq
- end
- end # Scene Item
- #==============================================================================
- # Window Item Data
- #==============================================================================
- class Window_Item_Data < Window_Base
- #--------------------------------------------------------------------------
- # initialize
- #--------------------------------------------------------------------------
- def initialize(x, y, width, height)
- super(x, y, width, height)
- self.back_opacity = 200
- @page = 1
- @item = nil
- self.z = 200
- self.visible = false
- end
- #--------------------------------------------------------------------------
- # appear
- #--------------------------------------------------------------------------
- def appear(item, window, condition = 0)
- @item = item
- @page = 1
- @total_pages = create_total_pages
- if condition == 1
- self.x = 272
- elsif condition == 2
- self.x = 272
- else
- if window.index % 2 == 0
- self.x = 272
- else
- self.x = 272
- end
- end
- setup
- self.openness = 128
- @opening = true
- self.active = true
- self.visible = true
- end
- def disappear
- self.active = false
- self.visible = false
- end
- #--------------------------------------------------------------------------
- # page switching
- #--------------------------------------------------------------------------
- def next_page
- if @page != @total_pages
- @page += 1
- else
- @page = 1
- end
- turn_sound
- setup
- end
- def previous_page
- if @page != 1
- @page -= 1
- else
- @page = @total_pages
- end
- turn_sound
- setup
- end
- def top_page
- @page = 1
- turn_sound
- setup
- end
- def bottom_page
- @page = @total_pages
- turn_sound
- setup
- end
- #--------------------------------------------------------------------------
- # turn sound
- #--------------------------------------------------------------------------
- def turn_sound
- unless YE::MENU::ITEM::PAGE_SOUND == nil
- sound = YE::MENU::ITEM::PAGE_SOUND
- sound.play
- end
- end
- #--------------------------------------------------------------------------
- # setup
- #--------------------------------------------------------------------------
- def setup
- self.contents.clear
- self.contents.font.color.alpha = 255
- self.contents.font.size = Font.default_size
- self.contents.font.color = normal_color
- @category_colour = YE::MENU::ITEM::DATA_CATEGORY_COLOUR
- #--------------------
- pagecase = @contents[@page - 1]
- if @total_pages <= 1
- text1 = ""
- elsif @page == 1 and !YE::MENU::ITEM::REPLACE_PAGE_MSG
- text1 = ""
- else
- text1 = YE::MENU::ITEM::DATA_LEFT
- end
- if YE::MENU::ITEM::REPLACE_PAGE_MSG #--------------------------------------
- text2 = case_page_name(pagecase)
- else #---------------------------------------------------------------------
- text2 = sprintf(YE::MENU::ITEM::DATA_PAGES, @page, @total_pages)
- end
- if @total_pages <= 1
- text3 = ""
- elsif @page == @total_pages and !YE::MENU::ITEM::REPLACE_PAGE_MSG
- text3 = ""
- else
- text3 = YE::MENU::ITEM::DATA_RIGHT
- end
- #--------------------
- self.contents.draw_text(2, 0, 232, WLH, text1, 0)
- self.contents.draw_text(2, 0, 232, WLH, text2, 1)
- self.contents.draw_text(2, 0, 232, WLH, text3, 2)
- #--------------------
- if @item != nil
- case_page_run(pagecase)
- end
- end
- #--------------------------------------------------------------------------
- # invisible_states
- #--------------------------------------------------------------------------
- def invisible_states(state_list)
- new_state_list = []
- for state in state_list
- icon = $data_states[state].icon_index
- new_state_list.push(state) unless icon == 0
- end
- return new_state_list
- end #end def
- #--------------------------------------------------------------------------
- # make_first_item_page
- #--------------------------------------------------------------------------
- def make_first_item_page
- y = WLH
- sw = self.width - 32
- #---
- draw_item_name(@item, 0, y)
- self.contents.font.size = YE::MENU::ITEM::GEN_ITEM_FONT_SIZE
- if @item.key_item
- unless $imported["HelpExtension"] and KGC::HelpExtension::ROW_MAX > 1 and
- $scene.is_a?(Scene_Battle)
- y += WLH
- text = YE::MENU::ITEM::DATA_KEY_ITEM
- self.contents.draw_text(0, y, sw, WLH, text, 1)
- end
- elsif @item.price > 0 and !@item.hide_value
- unless $imported["HelpExtension"] and KGC::HelpExtension::ROW_MAX > 1
- unless $scene.is_a?(Scene_Battle)
- y += WLH
- text = sprintf(YE::MENU::ITEM::DATA_SHOP_VAL, @item.price)
- self.contents.draw_text(0, y, sw, WLH, text, 1)
- end
- end
- end
- #---
- self.contents.font.color = normal_color
- unless $imported["HelpExtension"] and KGC::HelpExtension::ROW_MAX > 2 and
- $scene.is_a?(Scene_Battle)
- y += WLH
- self.contents.font.color = text_color(@category_colour)
- if @item.hide_usable
- text = ""
- elsif @item.query_conditional
- text = YE::MENU::ITEM::TEXT_USABLE_COND
- elsif @item.battle_ok? and @item.menu_ok?
- text = YE::MENU::ITEM::TEXT_USABLE_ALWAYS
- elsif @item.battle_ok?
- text = YE::MENU::ITEM::TEXT_USABLE_BATTLE
- elsif @item.menu_ok?
- text = YE::MENU::ITEM::TEXT_USABLE_MENU
- else
- text = YE::MENU::ITEM::TEXT_USABLE_NEVER
- end
- self.contents.draw_text(0, y, sw, WLH, text, 1)
- end
- #---
- if @item.hp_recovery != 0 or @item.hp_recovery_rate != 0
- y += WLH
- icon = YE::MENU::ITEM::ICON_HP_RECOVERY
- draw_icon(icon, 0, y)
- text = YE::MENU::ITEM::TEXT_HP_RECOVERY
- self.contents.font.color = text_color(@category_colour)
- self.contents.draw_text(24, y, sw/2 - 24, WLH, text, 0)
- self.contents.font.color = normal_color
- if @item.hp_recovery != 0
- text = sprintf("%+d",@item.hp_recovery)
- self.contents.draw_text(sw*3/4, y, sw/4, WLH, text, 1)
- end
- if @item.hp_recovery_rate != 0
- text = sprintf("%+d%%",@item.hp_recovery_rate)
- if @item.hp_recovery != 0
- self.contents.draw_text(sw/2, y, sw/4, WLH, text, 1)
- else
- self.contents.draw_text(sw*3/4, y, sw/4, WLH, text, 1)
- end
- end
- end
- self.contents.font.color = normal_color
- #---
- if @item.mp_recovery_rate != 0 or @item.mp_recovery != 0
- y += WLH
- icon = YE::MENU::ITEM::ICON_MP_RECOVERY
- draw_icon(icon, 0, y)
- text = YE::MENU::ITEM::TEXT_MP_RECOVERY
- self.contents.font.color = text_color(@category_colour)
- self.contents.draw_text(24, y, sw/2 - 24, WLH, text, 0)
- self.contents.font.color = normal_color
- if @item.mp_recovery != 0
- text = sprintf("%+d",@item.mp_recovery)
- self.contents.draw_text(sw*3/4, y, sw/4, WLH, text, 1)
- end
- if @item.mp_recovery_rate != 0
- text = sprintf("%+d%%",@item.mp_recovery_rate)
- if @item.mp_recovery != 0
- self.contents.draw_text(sw/2, y, sw/4, WLH, text, 1)
- else
- self.contents.draw_text(sw*3/4, y, sw/4, WLH, text, 1)
- end
- end
- end
- #---
- if @item.base_damage != 0 or @item.query_basedmg != 0
- tw = YE::MENU::ITEM::DATA_WIDTH
- ta = YE::MENU::ITEM::DATA_ALIGN
- y += WLH
- # 1st Row ---------------------------------
- #---Base Damage
- if @item.base_damage != 0 or @item.query_basedmg != 0
- textno = @item.base_damage
- textno = @item.query_basedmg if @item.query_basedmg != 0
- if @item.base_damage < 0 or @item.query_basedmg < 0
- textno *= -1
- draw_icon(YE::MENU::ITEM::ICON_BASEHEAL, 0, y, true)
- else
- draw_icon(YE::MENU::ITEM::ICON_BASEDMG, 0, y, true)
- end
- self.contents.font.color.alpha = 255
- self.contents.draw_text(24, y, tw, WLH, textno, ta)
- else
- draw_icon(YE::MENU::ITEM::ICON_BASEDMG, 0, y, false)
- self.contents.font.color.alpha = 128
- self.contents.draw_text(24, y, tw, WLH, YE::MENU::ITEM::DATA_NIL, ta)
- end
- if $imported["CustomDmgFormulaRD"]
- #---Accuracy
- draw_icon(YE::MENU::ITEM::ICON_ACCURACY, 60, y, true)
- self.contents.font.color.alpha = 255
- acchit = 100
- textno = sprintf("%d%%", acchit)
- self.contents.draw_text(84, y, tw, WLH, textno, ta)
- #---HP Hi/Lo/F
- if @item.hp_hi > 0 or @item.hp_lo > 0 or @item.query_hp_f > 0
- draw_icon(YE::MENU::ITEM::ICON_HP_F, 120, y, true)
- self.contents.font.color.alpha = 255
- num = @item.hp_hi if @item.hp_hi > 0
- num = @item.hp_lo if @item.hp_lo > 0
- num = @item.query_hp_f if @item.query_hp_f > 0
- textno = sprintf("%d%%", num)
- self.contents.draw_text(144, y, tw, WLH, textno, ta)
- else
- draw_icon(YE::MENU::ITEM::ICON_HP_F, 120, y, false)
- self.contents.font.color.alpha = 128
- self.contents.draw_text(144, y, tw, WLH, YE::MENU::ITEM::DATA_NIL, ta)
- end
- #---MP Hi/Lo/F
- if @item.mp_hi > 0 or @item.mp_lo > 0 or @item.query_mp_f > 0
- draw_icon(YE::MENU::ITEM::ICON_MP_F, 180, y, true)
- self.contents.font.color.alpha = 255
- num = @item.mp_hi if @item.mp_hi > 0
- num = @item.mp_lo if @item.mp_lo > 0
- num = @item.query_mp_f if @item.query_mp_f > 0
- textno = sprintf("%d%%", num)
- self.contents.draw_text(204, y, tw, WLH, textno, ta)
- else
- draw_icon(YE::MENU::ITEM::ICON_MP_F, 180, y, false)
- self.contents.font.color.alpha = 128
- self.contents.draw_text(204, y, tw, WLH, YE::MENU::ITEM::DATA_NIL, ta)
- end
- else
- #---Accuracy
- draw_icon(YE::MENU::ITEM::ICON_ACCURACY, 120, y, true)
- self.contents.font.color.alpha = 255
- acchit = 100
- acchit = @item.query_accuracy if @item.query_accuracy > 0
- textno = sprintf("%d%%", acchit)
- self.contents.draw_text(144, y, tw, WLH, textno, ta)
- end
- # 2nd Row --------------------------------------
- y += WLH
- if $imported["CustomDmgFormulaRD"]
- #---Attack F
- if @item.atk_f > 0 or @item.newatk_f > 0 or @item.query_atk_f > 0
- draw_icon(YE::MENU::ITEM::ICON_ATK_F, 0, y, true)
- self.contents.font.color.alpha = 255
- num = @item.atk_f
- num = @item.newatk_f if @item.newatk_f > 0
- num = @item.query_atk_f if @item.query_atk_f > 0
- textno = sprintf("%d%%", num)
- self.contents.draw_text(24, y, tw, WLH, textno, ta)
- else
- draw_icon(YE::MENU::ITEM::ICON_ATK_F, 0, y, false)
- self.contents.font.color.alpha = 128
- self.contents.draw_text(24, y, tw, WLH, YE::MENU::ITEM::DATA_NIL, ta)
- end
- #---Defense F
- if @item.def_f > 0 or @item.query_def_f > 0
- draw_icon(YE::MENU::ITEM::ICON_DEF_F, 60, y, true)
- self.contents.font.color.alpha = 255
- num = @item.def_f
- num = @item.query_def_f if @item.query_def_f > 0
- textno = sprintf("%d%%", num)
- self.contents.draw_text(84, y, tw, WLH, textno, ta)
- else
- draw_icon(YE::MENU::ITEM::ICON_DEF_F, 60, y, false)
- self.contents.font.color.alpha = 128
- self.contents.draw_text(84, y, tw, WLH, YE::MENU::ITEM::DATA_NIL, ta)
- end
- #---Spirit F
- if @item.spi_f > 0 or @item.newspi_f > 0 or @item.query_spi_f > 0
- draw_icon(YE::MENU::ITEM::ICON_SPI_F, 120, y, true)
- self.contents.font.color.alpha = 255
- num = @item.spi_f
- num = @item.newspi_f if @item.newspi_f > 0
- num = @item.query_spi_f if @item.query_spi_f > 0
- textno = sprintf("%d%%", num)
- self.contents.draw_text(144, y, tw, WLH, textno, ta)
- else
- draw_icon(YE::MENU::ITEM::ICON_SPI_F, 120, y, false)
- self.contents.font.color.alpha = 128
- self.contents.draw_text(144, y, tw, WLH, YE::MENU::ITEM::DATA_NIL, ta)
- end
- #---Agility F
- if @item.agi_f > 0 or @item.query_agi_f > 0
- draw_icon(YE::MENU::ITEM::ICON_AGI_F, 180, y, true)
- self.contents.font.color.alpha = 255
- num = @item.agi_f
- num = @item.query_agi_f if @item.query_agi_f > 0
- textno = sprintf("%d%%", num)
- self.contents.draw_text(204, y, tw, WLH, textno, ta)
- else
- draw_icon(YE::MENU::ITEM::ICON_AGI_F, 180, y, false)
- self.contents.font.color.alpha = 128
- self.contents.draw_text(204, y, tw, WLH, YE::MENU::ITEM::DATA_NIL, ta)
- end
- else
- #---Attack F
- if @item.atk_f > 0 or @item.query_atk_f > 0
- draw_icon(YE::MENU::ITEM::ICON_ATK_F, 0, y, true)
- self.contents.font.color.alpha = 255
- num = @item.atk_f
- num = @item.query_atk_f if @item.query_atk_f > 0
- textno = sprintf("%d%%", num)
- self.contents.draw_text(24, y, tw, WLH, textno, ta)
- else
- draw_icon(YE::MENU::ITEM::ICON_ATK_F, 0, y, false)
- self.contents.font.color.alpha = 128
- self.contents.draw_text(24, y, tw, WLH, YE::MENU::ITEM::DATA_NIL, ta)
- end
- #---Spirit F
- if @item.spi_f > 0 or @item.query_spi_f > 0
- draw_icon(YE::MENU::ITEM::ICON_SPI_F, 120, y, true)
- self.contents.font.color.alpha = 255
- num = @item.spi_f
- num = @item.query_spi_f if @item.query_spi_f > 0
- textno = sprintf("%d%%", num)
- self.contents.draw_text(144, y, tw, WLH, textno, ta)
- else
- draw_icon(YE::MENU::ITEM::ICON_SPI_F, 120, y, false)
- self.contents.font.color.alpha = 128
- self.contents.draw_text(144, y, tw, WLH, YE::MENU::ITEM::DATA_NIL, ta)
- end
- end
- # 3rd Row --------------------------------------
- y += WLH
- #---Physical Attack
- if @item.physical_attack or @item.query_physical
- draw_icon(YE::MENU::ITEM::ICON_PHYS, 0, y, true)
- self.contents.font.color.alpha = 255
- textflag = YE::MENU::ITEM::DATA_TRUE
- else
- draw_icon(YE::MENU::ITEM::ICON_PHYS, 0, y, false)
- self.contents.font.color.alpha = 128
- textflag = YE::MENU::ITEM::DATA_FALSE
- end
- self.contents.draw_text(24, y, tw, WLH, textflag, ta)
- #---Damage to MP
- if @item.damage_to_mp or @item.query_mpdamage
- draw_icon(YE::MENU::ITEM::ICON_MPDMG, 60, y, true)
- self.contents.font.color.alpha = 255
- textflag = YE::MENU::ITEM::DATA_TRUE
- else
- draw_icon(YE::MENU::ITEM::ICON_MPDMG, 60, y, false)
- self.contents.font.color.alpha = 128
- textflag = YE::MENU::ITEM::DATA_FALSE
- end
- self.contents.draw_text(84, y, tw, WLH, textflag, ta)
- #---Absorb Damage
- if @item.absorb_damage or @item.query_absorb
- draw_icon(YE::MENU::ITEM::ICON_ABSORB, 120, y, true)
- self.contents.font.color.alpha = 255
- textflag = YE::MENU::ITEM::DATA_TRUE
- else
- draw_icon(YE::MENU::ITEM::ICON_ABSORB, 120, y, false)
- self.contents.font.color.alpha = 128
- textflag = YE::MENU::ITEM::DATA_FALSE
- end
- self.contents.draw_text(144, y, tw, WLH, textflag, ta)
- #---Ignore Defense?
- if @item.ignore_defense or @item.query_ignore_def
- draw_icon(YE::MENU::ITEM::ICON_IGDEF, 180, y, true)
- self.contents.font.color.alpha = 255
- textflag = YE::MENU::ITEM::DATA_TRUE
- else
- draw_icon(YE::MENU::ITEM::ICON_IGDEF, 180, y, false)
- self.contents.font.color.alpha = 128
- textflag = YE::MENU::ITEM::DATA_FALSE
- end
- self.contents.draw_text(204, y, tw, WLH, textflag, ta)
- end
- #---
- if @item.parameter_type > 0
- y += WLH
- if @item.parameter_type == 1
- icon = YE::MENU::ITEM::ICON_HP_F
- text = YE::MENU::ITEM::TEXT_MAXHP_GROWTH
- elsif @item.parameter_type == 2
- icon = YE::MENU::ITEM::ICON_MP_F
- text = YE::MENU::ITEM::TEXT_MAXMP_GROWTH
- elsif @item.parameter_type == 3
- icon = YE::MENU::ITEM::ICON_ATK_F
- text = YE::MENU::ITEM::TEXT_ATK_GROWTH
- elsif @item.parameter_type == 4
- icon = YE::MENU::ITEM::ICON_DEF_F
- text = YE::MENU::ITEM::TEXT_DEF_GROWTH
- elsif @item.parameter_type == 5
- icon = YE::MENU::ITEM::ICON_SPI_F
- text = YE::MENU::ITEM::TEXT_SPI_GROWTH
- elsif @item.parameter_type == 6
- icon = YE::MENU::ITEM::ICON_AGI_F
- text = YE::MENU::ITEM::TEXT_AGI_GROWTH
- end
- draw_icon(icon, 0, y)
- self.contents.font.color = text_color(@category_colour)
- self.contents.draw_text(24, y, sw/2 - 24, WLH, text, 0)
- text = sprintf("%+d", @item.parameter_points)
- self.contents.font.color = normal_color
- self.contents.draw_text(sw*3/4, y, sw/4, WLH, text, 1)
- end
- #---
- element_list = YE::MENU::ITEM::SHOWN_ELEMENTS
- element_set = @item.element_set
- element_set += @item.query_add_elements
- element_set.uniq
- element_set -= @item.query_sub_elements
- element_set.uniq
- if !@item.query_hide_elements and element_set != []
- y += WLH
- unless $imported["HelpExtension"] and KGC::HelpExtension::ROW_MAX > 1 and
- $scene.is_a?(Scene_Battle)
- text = YE::MENU::ITEM::TEXT_ELEMENTS
- self.contents.font.color = text_color(@category_colour)
- self.contents.draw_text(0, y, sw, WLH, text, 1)
- y += WLH
- end
- ix = (sw/2) - (element_set.size * 24)/2
- for ele in element_list
- if element_set.include?(ele)
- icon = YE::MENU::ITEM::ELEMENT_ICONS[ele]
- draw_icon(icon, ix, y, true)
- if ix == 216
- ix = 0
- y += WLH
- else
- ix += 24
- end
- end
- end
- end
- #---
- state_show = false
- if !@item.query_hide_state_apply
- state_list = []
- state_list += @item.plus_state_set
- state_list += @item.query_add_state_apply
- state_list -= @item.query_sub_state_apply
- state_list = invisible_states(state_list)
- state_show = true if state_list != []
- end
- if state_show
- y += WLH
- text = YE::MENU::ITEM::TEXT_APPLY_STATES
- self.contents.font.color = text_color(@category_colour)
- self.contents.draw_text(0, y, sw, WLH, text, 1)
- y += WLH
- ix = (sw/2) - (state_list.size * 24)/2
- for state_id in state_list
- icon = $data_states[state_id].icon_index
- draw_icon(icon, ix, y)
- ix += 24
- end
- end
- #---
- state_show = false
- if !@item.query_hide_state_erase
- state_list = []
- state_list += @item.minus_state_set
- state_list += @item.query_add_state_erase
- state_list -= @item.query_sub_state_erase
- state_list = invisible_states(state_list)
- state_show = true if state_list != []
- end
- if state_show
- y += WLH
- text = YE::MENU::ITEM::TEXT_ERASE_STATES
- self.contents.font.color = text_color(@category_colour)
- self.contents.draw_text(0, y, sw, WLH, text, 1)
- y += WLH
- ix = (sw/2) - (state_list.size * 24)/2
- for state_id in state_list
- icon = $data_states[state_id].icon_index
- draw_icon(icon, ix, y)
- ix += 24
- end
- end
- end # End Make First Item Page
- #--------------------------------------------------------------------------
- # make equip page
- #--------------------------------------------------------------------------
- def make_equip_page(type)
- # Type 1 means weapon. Type 2 means armour.
- y = WLH
- sw = self.width - 32
- draw_item_name(@item, 0, y)
- self.contents.font.size = YE::MENU::ITEM::GEN_ITEM_FONT_SIZE
- if @item.key_item
- y += WLH
- text = YE::MENU::ITEM::DATA_KEY_ITEM
- self.contents.draw_text(0, y, sw, WLH, text, 1)
- elsif @item.price > 0 and !@item.hide_value
- y += WLH
- text = sprintf(YE::MENU::ITEM::DATA_SHOP_VAL, @item.price)
- self.contents.draw_text(0, y, sw, WLH, text, 1)
- end
- #---
- y += WLH
- self.contents.font.color = text_color(@category_colour)
- if @item.is_a?(RPG::Weapon)
- text = Vocab.weapon
- else
- if @item.kind == 0
- text = Vocab.armor1
- elsif @item.kind == 1
- text = Vocab.armor2
- elsif @item.kind == 2
- text = Vocab.armor3
- elsif @item.kind == 3
- text = Vocab.armor4
- elsif $imported["EquipExtension"]
- text = Vocab.extra_armor(@item.kind - 4)
- else
- text = "Unknown"
- end
- end
- self.contents.draw_text(0, y, sw, WLH, text, 1)
- #---HP AND MP ROW---
- if $imported["ExtraEquipmentOptions"]
- y += WLH
- self.contents.font.color = text_color(@category_colour)
- if @item.bonus_param[:maxhp] == 0 and @item.bonus_paramp[:maxhp] == 100
- self.contents.font.color.alpha = 128
- enabled = false
- else
- self.contents.font.color.alpha = 255
- enabled = true
- end
- icon = YE::MENU::ITEM::ICON_MAXHP
- draw_icon(icon, 0, y, enabled)
- text = YE::MENU::ITEM::EQUIP_MAXHP
- self.contents.draw_text(24, y, sw/4-24, WLH, text, 0)
- self.contents.font.color = normal_color
- if !enabled
- self.contents.font.color.alpha = 128
- else
- self.contents.font.color.alpha = 255
- end
- if @item.bonus_paramp[:maxhp] != 100
- text = sprintf("%+d%%", @item.bonus_paramp[:maxhp] - 100)
- else
- text = sprintf("%+d", @item.bonus_param[:maxhp])
- end
- self.contents.draw_text(sw/4, y, sw/4, WLH, text, 1)
- #---
- self.contents.font.color = text_color(@category_colour)
- if @item.bonus_param[:maxhp] == 0 and @item.bonus_paramp[:maxmp] == 100
- self.contents.font.color.alpha = 128
- enabled = false
- else
- self.contents.font.color.alpha = 255
- enabled = true
- end
- icon = YE::MENU::ITEM::ICON_MAXMP
- draw_icon(icon, sw/2, y, enabled)
- text = YE::MENU::ITEM::EQUIP_MAXMP
- self.contents.draw_text(sw/2+24, y, sw/4-24, WLH, text, 0)
- self.contents.font.color = normal_color
- if !enabled
- self.contents.font.color.alpha = 128
- else
- self.contents.font.color.alpha = 255
- end
- if @item.bonus_paramp[:maxmp] != 100
- text = sprintf("%+d%%", @item.bonus_paramp[:maxmp] - 100)
- else
- text = sprintf("%+d", @item.bonus_param[:maxmp])
- end
- self.contents.draw_text(sw*3/4, y, sw/4, WLH, text, 1)
- end
- #---ATK AND DEF ROW---
- y += WLH
- self.contents.font.size = YE::MENU::ITEM::GEN_ITEM_FONT_SIZE
- self.contents.font.color = text_color(@category_colour)
- if $imported["ExtraEquipmentOptions"]
- if @item.atk == 0 and @item.bonus_param[:atk] == 0 and
- @item.bonus_paramp[:atk] == 100
- self.contents.font.color.alpha = 128
- enabled = false
- else
- self.contents.font.color.alpha = 255
- enabled = true
- end
- elsif @item.atk == 0
- self.contents.font.color.alpha = 128
- enabled = false
- else
- self.contents.font.color.alpha = 255
- enabled = true
- end
- icon = YE::MENU::ITEM::ICON_ATK
- draw_icon(icon, 0, y, enabled)
- text = YE::MENU::ITEM::EQUIP_ATK
- self.contents.draw_text(24, y, sw/4-24, WLH, text, 0)
- self.contents.font.color = normal_color
- if !enabled
- self.contents.font.color.alpha = 128
- else
- self.contents.font.color.alpha = 255
- end
- if $imported["ExtraEquipmentOptions"] and @item.bonus_paramp[:atk] != 100
- value = @item.bonus_paramp[:atk] - 100
- text = sprintf("%+d%%", value)
- else
- value = @item.atk
- value += @item.bonus_param[:atk] if $imported["ExtraEquipmentOptions"]
- text = sprintf("%+d", value)
- end
- self.contents.draw_text(sw/4, y, sw/4, WLH, text, 1)
- #---
- self.contents.font.color = text_color(@category_colour)
- if $imported["ExtraEquipmentOptions"]
- if @item.def == 0 and @item.bonus_param[:def] == 0 and
- @item.bonus_paramp[:def] == 100
- self.contents.font.color.alpha = 128
- enabled = false
- else
- self.contents.font.color.alpha = 255
- enabled = true
- end
- elsif @item.def == 0
- self.contents.font.color.alpha = 128
- enabled = false
- else
- self.contents.font.color.alpha = 255
- enabled = true
- end
- icon = YE::MENU::ITEM::ICON_DEF
- draw_icon(icon, sw/2, y, enabled)
- text = YE::MENU::ITEM::EQUIP_DEF
- self.contents.draw_text(sw/2+24, y, sw/4-24, WLH, text, 0)
- self.contents.font.color = normal_color
- if !enabled
- self.contents.font.color.alpha = 128
- else
- self.contents.font.color.alpha = 255
- end
- if $imported["ExtraEquipmentOptions"] and @item.bonus_paramp[:def] != 100
- value = @item.bonus_paramp[:def] - 100
- text = sprintf("%+d%%", value)
- else
- value = @item.def
- value += @item.bonus_param[:def] if $imported["ExtraEquipmentOptions"]
- text = sprintf("%+d", value)
- end
- self.contents.draw_text(sw*3/4, y, sw/4, WLH, text, 1)
- #---SPI AND AGI ROW---
- y += WLH
- self.contents.font.size = YE::MENU::ITEM::GEN_ITEM_FONT_SIZE
- self.contents.font.color = text_color(@category_colour)
- if $imported["ExtraEquipmentOptions"]
- if @item.spi == 0 and @item.bonus_param[:spi] == 0 and
- @item.bonus_paramp[:spi] == 100
- self.contents.font.color.alpha = 128
- enabled = false
- else
- self.contents.font.color.alpha = 255
- enabled = true
- end
- elsif @item.spi == 0
- self.contents.font.color.alpha = 128
- enabled = false
- else
- self.contents.font.color.alpha = 255
- enabled = true
- end
- icon = YE::MENU::ITEM::ICON_SPI
- draw_icon(icon, 0, y, enabled)
- text = YE::MENU::ITEM::EQUIP_SPI
- self.contents.draw_text(24, y, sw/4-24, WLH, text, 0)
- self.contents.font.color = normal_color
- if !enabled
- self.contents.font.color.alpha = 128
- else
- self.contents.font.color.alpha = 255
- end
- if $imported["ExtraEquipmentOptions"] and @item.bonus_paramp[:spi] != 100
- value = @item.bonus_paramp[:spi] - 100
- text = sprintf("%+d%%", value)
- else
- value = @item.spi
- value += @item.bonus_param[:spi] if $imported["ExtraEquipmentOptions"]
- text = sprintf("%+d", value)
- end
- self.contents.draw_text(sw/4, y, sw/4, WLH, text, 1)
- #---
- self.contents.font.color = text_color(@category_colour)
- if $imported["ExtraEquipmentOptions"]
- if @item.agi == 0 and @item.bonus_param[:agi] == 0 and
- @item.bonus_paramp[:agi] == 100
- self.contents.font.color.alpha = 128
- enabled = false
- else
- self.contents.font.color.alpha = 255
- enabled = true
- end
- elsif @item.agi == 0
- self.contents.font.color.alpha = 128
- enabled = false
- else
- self.contents.font.color.alpha = 255
- enabled = true
- end
- icon = YE::MENU::ITEM::ICON_AGI
- draw_icon(icon, sw/2, y, enabled)
- text = YE::MENU::ITEM::EQUIP_AGI
- self.contents.draw_text(sw/2+24, y, sw/4-24, WLH, text, 0)
- self.contents.font.color = normal_color
- if !enabled
- self.contents.font.color.alpha = 128
- else
- self.contents.font.color.alpha = 255
- end
- if $imported["ExtraEquipmentOptions"] and @item.bonus_paramp[:agi] != 100
- value = @item.bonus_paramp[:agi] - 100
- text = sprintf("%+d%%", value)
- else
- value = @item.agi
- value += @item.bonus_param[:agi] if $imported["ExtraEquipmentOptions"]
- text = sprintf("%+d", value)
- end
- self.contents.draw_text(sw*3/4, y, sw/4, WLH, text, 1)
- #---HIT AND EVA ROW---
- y += WLH
- self.contents.font.size = YE::MENU::ITEM::GEN_ITEM_FONT_SIZE
- self.contents.font.color = text_color(@category_colour)
- if $imported["ExtraEquipmentOptions"] and type == 1
- self.contents.font.color.alpha = 255
- enabled = true
- elsif $imported["ExtraEquipmentOptions"] and type == 2
- if @item.bonus_param[:hit] != 0 or @item.bonus_paramp[:hit] != 100
- self.contents.font.color.alpha = 255
- enabled = true
- else
- self.contents.font.color.alpha = 128
- enabled = false
- end
- elsif type == 1
- self.contents.font.color.alpha = 255
- enabled = true
- else
- self.contents.font.color.alpha = 128
- enabled = false
- end
- icon = YE::MENU::ITEM::ICON_HIT
- draw_icon(icon, 0, y, enabled)
- text = YE::MENU::ITEM::EQUIP_HIT
- self.contents.draw_text(24, y, sw/4-24, WLH, text, 0)
- self.contents.font.color = normal_color
- if !enabled
- self.contents.font.color.alpha = 128
- else
- self.contents.font.color.alpha = 255
- end
- value = 0
- value += @item.hit if type == 1
- if $imported["ExtraEquipmentOptions"]
- value += @item.bonus_param[:hit]
- value += @item.bonus_paramp[:hit] - 100
- end
- text = sprintf("%+d%%", value)
- self.contents.draw_text(sw/4, y, sw/4, WLH, text, 1)
- #---
- self.contents.font.color = text_color(@category_colour)
- if $imported["ExtraEquipmentOptions"] and type == 1
- if @item.bonus_param[:eva] != 0 or @item.bonus_paramp[:eva] != 100
- self.contents.font.color.alpha = 255
- enabled = true
- else
- self.contents.font.color.alpha = 128
- enabled = false
- end
- elsif $imported["ExtraEquipmentOptions"] and type == 2
- if @item.eva == 0 and @item.bonus_param[:eva] == 0 and
- @item.bonus_paramp[:eva] == 100
- self.contents.font.color.alpha = 128
- enabled = false
- else
- self.contents.font.color.alpha = 255
- enabled = true
- end
- elsif type == 2 and @item.eva != 0
- self.contents.font.color.alpha = 255
- enabled = true
- else
- self.contents.font.color.alpha = 128
- enabled = false
- end
- icon = YE::MENU::ITEM::ICON_EVA
- draw_icon(icon, sw/2, y, enabled)
- text = YE::MENU::ITEM::EQUIP_EVA
- self.contents.draw_text(sw/2+24, y, sw/4-24, WLH, text, 0)
- self.contents.font.color = normal_color
- if !enabled
- self.contents.font.color.alpha = 128
- else
- self.contents.font.color.alpha = 255
- end
- value = 0
- value += @item.eva if type == 2
- if $imported["ExtraEquipmentOptions"]
- value += @item.bonus_param[:eva]
- value += @item.bonus_paramp[:eva] - 100
- end
- text = sprintf("%+d%%", value)
- self.contents.draw_text(sw*3/4, y, sw/4, WLH, text, 1)
- #---CRI AND ODDS ROW---
- if $imported["ExtraEquipmentOptions"]
- y += WLH
- self.contents.font.color = text_color(@category_colour)
- if @item.bonus_param[:cri] == 0 and @item.bonus_paramp[:cri] == 100
- self.contents.font.color.alpha = 128
- enabled = false
- else
- self.contents.font.color.alpha = 255
- enabled = true
- end
- icon = YE::MENU::ITEM::ICON_CRI
- draw_icon(icon, 0, y, enabled)
- text = YE::MENU::ITEM::EQUIP_CRI
- self.contents.draw_text(24, y, sw/4-24, WLH, text, 0)
- self.contents.font.color = normal_color
- if !enabled
- self.contents.font.color.alpha = 128
- else
- self.contents.font.color.alpha = 255
- end
- value = @item.bonus_param[:cri]
- value += @item.bonus_paramp[:cri] - 100
- text = sprintf("%+d%%", value)
- self.contents.draw_text(sw/4, y, sw/4, WLH, text, 1)
- #---
- self.contents.font.color = text_color(@category_colour)
- if @item.bonus_param[:odds] == 0 and @item.bonus_paramp[:odds] == 100
- self.contents.font.color.alpha = 128
- enabled = false
- else
- self.contents.font.color.alpha = 255
- enabled = true
- end
- icon = YE::MENU::ITEM::ICON_ODDS
- draw_icon(icon, sw/2, y, enabled)
- text = YE::MENU::ITEM::EQUIP_ODDS
- self.contents.draw_text(sw/2+24, y, sw/4-24, WLH, text, 0)
- self.contents.font.color = normal_color
- if !enabled
- self.contents.font.color.alpha = 128
- else
- self.contents.font.color.alpha = 255
- end
- value = @item.bonus_param[:odds]
- value += @item.bonus_paramp[:odds] - 100
- text = sprintf("%+d", value)
- self.contents.draw_text(sw*3/4, y, sw/4, WLH, text, 1)
- end
- end # end make equip page
- #--------------------------------------------------------------------------
- # make class page
- #--------------------------------------------------------------------------
- def make_class_page(type)
- # Type 1 = weapon
- # Type 2 = armour
- # $data_classes
- query_classes = YE::MENU::ITEM::CLASS_HASH
- class_array = []
- all_class = []
- for key in query_classes
- class_id = key[0]
- next if class_id == 0
- next if $data_classes[class_id] == nil
- all_class.push(class_id)
- if type == 1
- equip_array = $data_classes[class_id].weapon_set
- else
- equip_array = $data_classes[class_id].armor_set
- end
- if equip_array.include?(@item.id)
- class_array.push(class_id)
- end
- end
- self.contents.font.color.alpha = 255
- self.contents.font.size = YE::MENU::ITEM::GEN_ITEM_FONT_SIZE
- self.contents.font.color = normal_color
- y = WLH
- x = 0
- sw = self.width - 32
- class_array = class_array.sort{ |xx,yy| xx <=> yy }
- all_class = all_class.sort{ |xx,yy| xx <=> yy }
- if class_array.size == (query_classes.size - 1) and
- YE::MENU::ITEM::USE_ALL_CLASS
- icon = query_classes[0]
- draw_icon(icon, x, y)
- text = YE::MENU::ITEM::ALL_CLASSES
- self.contents.draw_text(x+24, y, sw/2-24, WLH, text, 0)
- else
- if YE::MENU::ITEM::SHOW_UNEQUIPPABLE_CLASSES
- for class_id in all_class
- next if class_id == 0
- if x >= sw
- y += WLH
- x = 0
- end
- if class_array.include?(class_id)
- self.contents.font.color.alpha = 255
- enable = true
- else
- self.contents.font.color.alpha = 128
- enable = false
- end
- icon = query_classes[class_id]
- draw_icon(icon, x, y, enable)
- text = $data_classes[class_id].name
- self.contents.draw_text(x+24, y, sw/2-30, WLH, text, 0)
- x += sw / 2
- end
- else
- for class_id in class_array
- next if class_id == 0
- if x >= sw
- y += WLH
- x = 0
- end
- icon = query_classes[class_id]
- draw_icon(icon, x, y, true)
- text = $data_classes[class_id].name
- self.contents.draw_text(x+24, y, sw/2-30, WLH, text, 0)
- x += sw / 2
- end
- end
- end
- end
- #--------------------------------------------------------------------------
- # make_purchase_page
- #--------------------------------------------------------------------------
- def make_purchase_page(type)
- sw = self.width - 32
- dy = WLH
- dx = 0
- self.contents.font.color.alpha = 255
- case type
- when 0 # Item
- purchase_hash = $game_party.purchased_items[@item.id]
- when 1 # Weapon
- purchase_hash = $game_party.purchased_weapons[@item.id]
- when 2 # Armour
- purchase_hash = $game_party.purchased_armours[@item.id]
- end
- data = load_data("Data/MapInfos.rvdata")
- map_array = []
- for i in purchase_hash
- next if data[i] == nil
- text = data[i].name.gsub(/\[.*\]/) { "" }
- map_array.push(text)
- end
- self.contents.font.color = system_color
- self.contents.draw_text(dx, dy, sw, WLH, YE::MENU::ITEM::TEXT_PURCHASE, 1)
- self.contents.font.color = normal_color
- self.contents.font.size = YE::MENU::ITEM::PURCHASE_FSIZE
- dy += WLH
- for name in map_array.sort!
- next if name == ""
- self.contents.draw_text(dx, dy, sw/2-5, WLH, name)
- dy += WLH
- if dy + WLH > self.height - 32
- dy = WLH * 2
- dx = sw/2+5
- end
- end
- end # make_purchase_page
- #--------------------------------------------------------------------------
- # make_steal_page
- #--------------------------------------------------------------------------
- def make_steal_page(type)
- sw = self.width - 32
- dy = WLH
- dx = 0
- self.contents.font.color.alpha = 255
- case type
- when 0 # Item
- stolen_hash = $game_party.stolen_items[@item.id]
- when 1 # Weapon
- stolen_hash = $game_party.stolen_weapons[@item.id]
- when 2 # Armour
- stolen_hash = $game_party.stolen_armours[@item.id]
- end
- enemy_array = []
- for i in stolen_hash
- next if $data_enemies[i] == nil
- text = $data_enemies[i].name.gsub(/\[.*\]/) { "" }
- enemy_array.push(text)
- end
- self.contents.font.color = system_color
- self.contents.draw_text(dx, dy, sw, WLH, YE::MENU::ITEM::TEXT_STOLEN, 1)
- self.contents.font.color = normal_color
- self.contents.font.size = YE::MENU::ITEM::STOLEN_FSIZE
- dy += WLH
- for name in enemy_array.sort!
- next if name == ""
- self.contents.draw_text(dx, dy, sw/2-5, WLH, name)
- dy += WLH
- if dy + WLH > self.height - 32
- dy = WLH * 2
- dx = sw/2+5
- end
- end
- end # make_steal_page
- #--------------------------------------------------------------------------
- # make_drop_page
- #--------------------------------------------------------------------------
- def make_drop_page(type)
- sw = self.width - 32
- dy = WLH
- dx = 0
- self.contents.font.color.alpha = 255
- case type
- when 0 # Item
- stolen_hash = $game_party.dropped_items[@item.id]
- when 1 # Weapon
- stolen_hash = $game_party.dropped_weapons[@item.id]
- when 2 # Armour
- stolen_hash = $game_party.dropped_armours[@item.id]
- end
- enemy_array = []
- for i in stolen_hash
- next if $data_enemies[i] == nil
- text = $data_enemies[i].name.gsub(/\[.*\]/) { "" }
- enemy_array.push(text)
- end
- self.contents.font.color = system_color
- self.contents.draw_text(dx, dy, sw, WLH, YE::MENU::ITEM::TEXT_DROPPED, 1)
- self.contents.font.color = normal_color
- self.contents.font.size = YE::MENU::ITEM::DROPPED_FSIZE
- dy += WLH
- for name in enemy_array.sort!
- next if name == ""
- self.contents.draw_text(dx, dy, sw/2-5, WLH, name)
- dy += WLH
- if dy + WLH > self.height - 32
- dy = WLH * 2
- dx = sw/2+5
- end
- end
- end # make_drop_page
- #--------------------------------------------------------------------------
- # make notes item page
- #--------------------------------------------------------------------------
- def make_notes_item_page
- self.contents.font.color.alpha = 255
- self.contents.font.size = YE::MENU::ITEM::NOTE_PAGE_TEXT_SIZE
- self.contents.font.color = text_color(YE::MENU::ITEM::NOTE_PAGE_TEXT_COLOUR)
- y = 24
- txsize = YE::MENU::ITEM::NOTE_PAGE_TEXT_SIZE + 4
- text = YE::HASH::ITEM_NOTES[@item.id]
- nwidth = YE::MENU::ITEM::NOTE_PAGE_WIDTH
- buf = text.gsub(/\\N(\[\d+\])/i) { "\\__#{$1}" }
- lines = buf.split(/(?:[|]|\\n)/i)
- lines.each_with_index { |l, i|
- l.gsub!(/\\__(\[\d+\])/i) { "\\N#{$1}" }
- self.contents.draw_text(0, i * txsize + y, nwidth, WLH, l, 0)
- }
- end #end def
- #--------------------------------------------------------------------------
- # make notes weapon page
- #--------------------------------------------------------------------------
- def make_notes_weapon_page
- self.contents.font.color.alpha = 255
- self.contents.font.size = YE::MENU::ITEM::NOTE_PAGE_TEXT_SIZE
- self.contents.font.color = text_color(YE::MENU::ITEM::NOTE_PAGE_TEXT_COLOUR)
- y = 24
- txsize = YE::MENU::ITEM::NOTE_PAGE_TEXT_SIZE + 4
- text = YE::HASH::WEAPON_NOTES[@item.id]
- nwidth = YE::MENU::ITEM::NOTE_PAGE_WIDTH
- buf = text.gsub(/\\N(\[\d+\])/i) { "\\__#{$1}" }
- lines = buf.split(/(?:[|]|\\n)/i)
- lines.each_with_index { |l, i|
- l.gsub!(/\\__(\[\d+\])/i) { "\\N#{$1}" }
- self.contents.draw_text(0, i * txsize + y, nwidth, WLH, l, 0)
- }
- end #end def
- #--------------------------------------------------------------------------
- # make notes armour page
- #--------------------------------------------------------------------------
- def make_notes_armour_page
- self.contents.font.color.alpha = 255
- self.contents.font.size = YE::MENU::ITEM::NOTE_PAGE_TEXT_SIZE
- self.contents.font.color = text_color(YE::MENU::ITEM::NOTE_PAGE_TEXT_COLOUR)
- y = 24
- txsize = YE::MENU::ITEM::NOTE_PAGE_TEXT_SIZE + 4
- text = YE::HASH::ARMOUR_NOTES[@item.id]
- nwidth = YE::MENU::ITEM::NOTE_PAGE_WIDTH
- buf = text.gsub(/\\N(\[\d+\])/i) { "\\__#{$1}" }
- lines = buf.split(/(?:[|]|\\n)/i)
- lines.each_with_index { |l, i|
- l.gsub!(/\\__(\[\d+\])/i) { "\\N#{$1}" }
- self.contents.draw_text(0, i * txsize + y, nwidth, WLH, l, 0)
- }
- end #end def
- #--------------------------------------------------------------------------
- # create total pages
- #--------------------------------------------------------------------------
- def create_total_pages
- @contents = []
- #---
- if @item.is_a?(RPG::Item)
- @contents.push(100) if YE::MENU::ITEM::SHOW_PAGE_GEN_ITEM
- if YE::MENU::ITEM::SHOW_PURCHASE and !@item.hide_purchase
- $game_party.purchased_items[@item.id] = [] if
- $game_party.purchased_items[@item.id] == nil
- if $game_party.purchased_items[@item.id] != []
- @contents.push(105)
- end
- end
- if YE::MENU::ITEM::SHOW_STOLEN and !@item.hide_steal_page
- $game_party.stolen_items[@item.id] = [] if
- $game_party.stolen_items[@item.id] == nil
- if $game_party.stolen_items[@item.id] != []
- @contents.push(106)
- end
- end
- if YE::MENU::ITEM::SHOW_DROPPED and !@item.hide_drop_page
- $game_party.dropped_items[@item.id] = [] if
- $game_party.dropped_items[@item.id] == nil
- if $game_party.dropped_items[@item.id] != []
- @contents.push(107)
- end
- end
- if YE::MENU::ITEM::SHOW_PAGE_NOTES
- if YE::HASH::ITEM_NOTES.include?(@item.id)
- @contents.push(199)
- end
- end
- end
- #---
- if @item.is_a?(RPG::Weapon)
- @contents.push(200) if YE::MENU::ITEM::SHOW_PAGE_GEN_ITEM
- if YE::MENU::ITEM::SHOW_CLASSES and !@item.hide_class_page
- @contents.push(202)
- end
- if YE::MENU::ITEM::SHOW_PURCHASE and !@item.hide_purchase
- $game_party.purchased_weapons[@item.id] = [] if
- $game_party.purchased_weapons[@item.id] == nil
- if $game_party.purchased_weapons[@item.id] != []
- @contents.push(205)
- end
- end
- if YE::MENU::ITEM::SHOW_STOLEN and !@item.hide_steal_page
- $game_party.stolen_weapons[@item.id] = [] if
- $game_party.stolen_weapons[@item.id] == nil
- if $game_party.stolen_weapons[@item.id] != []
- @contents.push(206)
- end
- end
- if YE::MENU::ITEM::SHOW_DROPPED and !@item.hide_drop_page
- $game_party.dropped_weapons[@item.id] = [] if
- $game_party.dropped_weapons[@item.id] == nil
- if $game_party.dropped_weapons[@item.id] != []
- @contents.push(207)
- end
- end
- if YE::MENU::ITEM::SHOW_PAGE_NOTES
- if YE::HASH::WEAPON_NOTES.include?(@item.id)
- @contents.push(299)
- end
- end
- end
- #---
- if @item.is_a?(RPG::Armor)
- @contents.push(300) if YE::MENU::ITEM::SHOW_PAGE_GEN_ITEM
- if YE::MENU::ITEM::SHOW_CLASSES and !@item.hide_class_page
- @contents.push(302)
- end
- if YE::MENU::ITEM::SHOW_PURCHASE and !@item.hide_purchase
- $game_party.purchased_armours[@item.id] = [] if
- $game_party.purchased_armours[@item.id] == nil
- if $game_party.purchased_armours[@item.id] != []
- @contents.push(305)
- end
- end
- if YE::MENU::ITEM::SHOW_STOLEN and !@item.hide_steal_page
- $game_party.stolen_armours[@item.id] = [] if
- $game_party.stolen_armours[@item.id] == nil
- if $game_party.stolen_armours[@item.id] != []
- @contents.push(206)
- end
- end
- if YE::MENU::ITEM::SHOW_DROPPED and !@item.hide_drop_page
- $game_party.dropped_armours[@item.id] = [] if
- $game_party.dropped_armours[@item.id] == nil
- if $game_party.dropped_armours[@item.id] != []
- @contents.push(307)
- end
- end
- if YE::MENU::ITEM::SHOW_PAGE_NOTES
- if YE::HASH::ARMOUR_NOTES.include?(@item.id)
- @contents.push(399)
- end
- end
- end
- #---
- @total_pages = @contents.size
- return @total_pages
- end
- #--------------------------------------------------------------------------
- # case_page_name
- #--------------------------------------------------------------------------
- def case_page_name(pagecase)
- if pagecase == 100 or pagecase == 200 or pagecase == 300
- text = YE::MENU::ITEM::TITLE_GENERAL_ITEM
- elsif pagecase == 202 or pagecase == 302
- text = YE::MENU::ITEM::TITLE_CLASSES
- elsif pagecase == 105 or pagecase == 205 or pagecase == 305
- text = YE::MENU::ITEM::TITLE_PURCHASE
- elsif pagecase == 106 or pagecase == 206 or pagecase == 306
- text = YE::MENU::ITEM::TITLE_STOLEN
- elsif pagecase == 107 or pagecase == 207 or pagecase == 307
- text = YE::MENU::ITEM::TITLE_DROPPED
- elsif pagecase == 199
- text = YE::MENU::ITEM::TITLE_NOTES_ITEMS
- elsif pagecase == 299
- text = YE::MENU::ITEM::TITLE_NOTES_WEAPONS
- elsif pagecase == 399
- text = YE::MENU::ITEM::TITLE_NOTES_ARMOURS
- else
- text = YE::MENU::ITEM::TITLE_UNKNOWN
- end
- return text
- end
- #--------------------------------------------------------------------------
- # case_page_run
- #--------------------------------------------------------------------------
- def case_page_run(pagecase)
- if pagecase == 100
- make_first_item_page
- elsif pagecase == 200
- make_equip_page(1)
- elsif pagecase == 300
- make_equip_page(2)
- elsif pagecase == 202
- make_class_page(1)
- elsif pagecase == 302
- make_class_page(2)
- elsif pagecase == 199
- make_notes_item_page
- elsif pagecase == 299
- make_notes_weapon_page
- elsif pagecase == 399
- make_notes_armour_page
- elsif pagecase == 105
- make_purchase_page(0)
- elsif pagecase == 205
- make_purchase_page(1)
- elsif pagecase == 305
- make_purchase_page(2)
- elsif pagecase == 106
- make_steal_page(0)
- elsif pagecase == 206
- make_steal_page(1)
- elsif pagecase == 306
- make_steal_page(2)
- elsif pagecase == 107
- make_drop_page(0)
- elsif pagecase == 207
- make_drop_page(1)
- elsif pagecase == 307
- make_drop_page(2)
- end
- end
- end # Window Item Data
- #===============================================================================
- #
- # END OF FILE
- #
- #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement