Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- #
- # Yanfly Engine RD - Display Skill Query
- # Last Date Updated: 2009.06.23
- # Level: Easy, Normal, Hard, Lunatic
- #
- # Sometimes with all the features I add to skills, there's always the question
- # of what stat affects what. There's also questions of how long some skills will
- # take to charge and all the other fun stuff. Well, hopefully this script will
- # provide a solution to that.
- #
- # This script adds a new window to your skill menu both in battle and outside of
- # battle. When pressing Shift (or whatever button you bind it to), the skill
- # query window will appear and list various information about the skill. The
- # information provided ranges from base damage to MP costs to status changes,
- # and elements. If you have some other Yanfly Engine ReDux scripts, there are
- # even more pages that will appear.
- #
- # For the users who fear giving too much information to their players, users can
- # disable parts of the script and prevent certain pages from appear at all. For
- # users who have lots of custom skills and are afraid that the skills won't
- # reflect properly, there are tags they can add to the skills' noteboxes to
- # force reflect information and data properly.
- #
- #===============================================================================
- # Updates:
- # ----------------------------------------------------------------------------
- # o 2009.06.23 - Fixed menu-help-message bug.
- # o 2009.05.28 - Compatibility update with Custom Skill Effects.
- # o 2009.05.11 - Added Subclass and Skill Slot pages.
- # o 2009.04.30 - Updated for Yanfly Subclass Selection System compatibility.
- # o 2009.04.26 - Regexp clean up
- # Bugfix for nil skill query.
- # o 2009.04.20 - Efficieny fix.
- # o 2009.04.16 - Finished and publicized script.
- # o 2009.04.15 - Started script.
- #===============================================================================
- # How to Use: Normal Mode
- #===============================================================================
- #
- # Modify the module down below to adjust the icons to what you'd prefer the
- # skill query window to use. If you're using other Yanfly Engine ReDux scripts
- # and they have icons choosen already, those will take priority over these.
- #
- #===============================================================================
- # How to Use: Hard Mode
- #===============================================================================
- #
- # For those like me who use custom damage formulas for the most part, the query
- # window might not display the information you'd like it to when it comes to
- # that. So when that happens, you can throw these tags into that skill's notebox
- # and manually make the query window show what you'd like for it to.
- #
- # <query basedmg x> Shows x as base damage in query window.
- # <query accuracy x> Shows x as accuracy in query window.
- #
- # <query hp_f x> Shows x as HP_F in query window.
- # <query mp_f x> Shows x as MP_F in query window.
- # <query atk_f x> Shows x as ATK_F in query window.
- # <query def_f x> Shows x as DEF_F in query window.
- # <query spi_f x> Shows x as SPI_F in query window.
- # <query agi_f x> Shows x as AGI_F in query window.
- #
- # <query physical> Shows skill as a physical skill in query window.
- # <query mpdamage> Shows skill as dealing MP damage in query window.
- # <query absorb> Shows skill as an absorbing skill in query window.
- # <query ignore def> Shows skill as ignoring defense in query window.
- #
- # <query hide aggro> Prevents aggro data from showing.
- # <query hide grudge> Prevents grudge data from showing.
- #
- # <query hide elements> Prevents elemental properties from being shown.
- # <query add element x> Shows x in the elemental properties page.
- # <query sub element x> Prevents x in the elemental properties from being shown.
- #
- # <query hide state apply> Prevents added states from being shown.
- # <query hide state erase> Prevents removed states from being shown.
- # <query add state apply x> Adds x to the added states shown.
- # <query sub state apply x> Removes x from the added states shown.
- # <query add state erase x> Adds x to the removed states shown.
- # <query sub state erase x> Removes x from the removed states shown.
- #
- #===============================================================================
- #
- # Compatibility
- # - Works With: KGC_HelpExtension
- # - Alias: Scene_Battle, create_info_viewport, terminate, update_skill_selection
- # - Alias: Scene_Skill, start, terminate, update, hide_target_window
- # - Alias: Scene_Skill, update_skill_selection
- #
- #===============================================================================
- $imported = {} if $imported == nil
- $imported["DisplaySkillQuery"] = true
- module YE
- module MENU
- module SKILL
- # This is the button pressed to trigger the query window in battle.
- SKILL_QUERY_BATTLE_BUTTON = Input::A
- # This allows you to adjust the Help Info Window's properties when
- # participating in battle.
- BATTLE_HELP_SHOW = true # If true, it'll appear in battle.
- BATTLE_HELP_INFO = "Shift: Details" # This is what appears in the window.
- BATTLE_HELP_ICON = 1
- BATTLE_HELP_X = 352 # This is where the X position is.
- BATTLE_HELP_Y = 0 # This is where the Y position is.
- BATTLE_HELP_W = 192 # This is what width the window is.
- BATTLE_HELP_O = 200 # This is the window's opacity level.
- # This is the button pressed to trigger the query window in skill menu.
- SKILL_QUERY_MENU_BUTTON = Input::A
- # This allows you to adjust the Help Info Window's properties when
- # viewing the Skill Menu.
- MENU_HELP_SHOW = false # If true, it'll show in skill menu.
- MENU_HELP_INFO = "Press Shift to view skill query." # What will appear.
- # 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 = "Seite %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.
- # 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 = nil #RPG::SE.new("Wind7", 80, 125)
- # This is the query window general settings.
- FONT_SIZE = 16 # This sets the default font size for query data.
- DATA_WIDTH = 24 # This sets text width for query data.
- DATA_ALIGN = 1 # This sets alignment. 0=left. 1=center. 2=right.
- # 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 = "Information"
- # This here is the icon data. Note that if you have imported other Yanfly
- # Engine ReDux scripts, those will take priority over these.
- ICON_MP = 100 # Used for MP (unless CustomSkillEffects).
- ICON_INIT = 158 # Used for skill/speed initiative.
- ICON_CHARGE = 133 # Used for charge (for CustomSkillEffects).
- ICON_PREPARE = 145 # Used for prepare (for CustomSkillEffects).
- ICON_FATIGUE = 116 # Used for fatigue (for CustomSkillEffects).
- 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.
- ICON_AGGRO = 137 # Used for aggro (for BattlerStatAggro).
- ICON_GRUDGE = 137 # Used for aggro (for BattlerStatAggro).
- # 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 = "General Info"
- SHOW_PAGE_GEN = false
- 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 flags attributes.
- DATA_FALSE = "N"
- # This is the string data for page 2's Skill Cost and Charge query.
- # Change the terms accordingly if desired.
- # Page 2 is always available for every skill unless you change SHOW_PAGE.
- TITLE_SKILL_COST = "Cost & Charge"
- SHOW_PAGE_COSTS = false
- MSG_FREE = "No Cost"
- MSG_MP_COST = "MP Cost"
- MSG_MP_VALUE = "%d MP"
- MSG_INITIATIVE = "Initiative"
- # This is for all the custom extras you get from Custom Skill Effects.
- MSG_MAXMP_COST = "MaxMP Cost"
- MSG_MAXMP_VALUE = "%d%% MP"
- MSG_HP_COST = "HP Cost"
- MSG_MAXHP_COST = "MaxHP Cost"
- MSG_MAXHP_VALUE = "%d%% HP"
- MSG_GOLD_COST = "Gold Cost"
- MSG_MGOLD_COST = "MaxGold Cost"
- MSG_RAGE_COST = "Rage Cost"
- MSG_CUSTOM_COST = "%s Cost"
- MSG_RAGE_BOOST = "Rage Boost"
- MSG_RAGE_VALUE = "+%d"
- MSG_CHARGE = "Cast for"
- MSG_RECHARGE = "Cooldown"
- MSG_PREPARE = "Warm Up"
- MSG_FATIGUE = "Fatigue for "
- MSG_USAGE = "Battle Uses"
- MSG_USAGE_VALUE = "%d Uses"
- MSG_USAGE_VALUE1 = "%d Use"
- # This is the string data for page 3's Damage information.
- # Change the terms accordingly if desired.
- # This page is only available if base damage is something other than 0
- # unless you change SHOW_PAGE.
- TITLE_DAMAGE = "Damage Data"
- TITLE_HEALING = "Healing Data"
- SHOW_PAGE_DMG = false
- MSG_BASE_DAMAGE = "Base Damage"
- MSG_BASE_HEALING = "Base Healing"
- MSG_HP_F = "HP Multiplier"
- MSG_MP_F = "MP Multiplier"
- MSG_ATK_F = "ATK Multiplier"
- MSG_DEF_F = "DEF Multiplier"
- MSG_SPI_F = "SPI Multiplier"
- MSG_AGI_F = "AGI Multiplier"
- # This is the string data for page 4's aggro/grudge information.
- # Change the terms accordingly if desired. This page requires Battler
- # Stat Aggro and will only show if aggro or grudge is affected.
- TITLE_AGGRO = "Aggro Data"
- SHOW_PAGE_AGGRO = false
- MSG_AGGRO_TERM = "Aggro"
- MSG_GRUDGE_TERM = "Grudge"
- MSG_AGGRO_SET = "Sets %s to"
- MSG_AGGRO_SETVAL = "=%d"
- MSG_AGGRO_MUL = "Multiplies %s"
- MSG_AGGRO_MULVAL = "*%d"
- MSG_AGGRO_DIV = "Divides %s"
- MSG_AGGRO_DIVVAL = "/%d"
- MSG_AGGRO_ADD = "Increases %s"
- MSG_AGGRO_ADDVAL = "+%d"
- MSG_AGGRO_SUB = "Decreases %s"
- MSG_AGGRO_SUBVAL = "-%d"
- # This is the string data for the elements data page. Change the terms
- # accordingly if desired. This page will only show if there's an element
- # choosen or unless you force query an element to show. Also, elements
- # not in the SHOWN_ELEMENTS will not appear.
- TITLE_ELEMENTS = "Elements"
- SHOW_PAGE_ELEM = false
- SHOWN_ELEMENTS = [
- ] # Do not remove this.
- ELEMENT_ICONS = {
- } # Do not remove this.
- MSG_ELEMENTS = "Elemental Traits"
- # This is the string data for the status changes data page. Change the
- # terms accordingly if desired. This page will only show if there's any
- # status-effect related changes.
- TITLE_STATUS = "Status Effects"
- SHOW_PAGE_STATUS = false
- MSG_STATUS_ADD = "Applied Status Effects"
- MSG_STATUS_SUB = "Removed Status Effects"
- # This is the page regulating the various data used for the Yanfly
- # Subclass Selection System. This data will not be shown if the script
- # is not imported.
- TITLE_JP = "Learning Data"
- SHOW_JP_PAGE = false
- TEXT_JP_COST = "JP Cost"
- TEXT_LVL_REQ = "Required LV"
- TEXT_SKILL_R = "Required Skills"
- # This part regulates the data used for Yanfly Equip Skill Slots. This
- # data will not be shown if the script is not imported.
- TITLE_EQUIP_STATS = "Equip Skill Data"
- SHOW_EQUIP_STATS = false
- # This is the string data for the miscellaneous data page.
- # Change the terms accordingly if desired.
- # This page will always show unless you turn off SHOW_PAGE.
- TITLE_MISC = "Miscellaneous"
- SHOW_PAGE_MISC = false
- MSG_ACCURACY = "Accuracy"
- MSG_ACCURACY_VAL = "%d%%"
- MSG_MISC_PHYS = "Physical Skill"
- MSG_MISC_MPDMG = "Deals MP Damage"
- MSG_MISC_ABSORB = "Absorbs Damage"
- MSG_MISC_IGDEF = "Ignores Defense"
- MSG_MISC_YES = "Yes"
- MSG_MISC_NO = "No"
- # This will adjust whether or not you'd like for the custom notes to show.
- # To actually modify what shows up under custom notes, go to the Lunatic
- # Mode down below. That will allow you to change and customize whatever
- # you'd like to write for custom notes.
- TITLE_NOTES = "nil"
- SHOW_PAGE_NOTES = true
- NOTE_PAGE_WIDTH = 240
- NOTE_PAGE_TEXT_SIZE = 16
- NOTE_PAGE_TEXT_COLOUR = 0
- end #module SKILL
- end #module MENU
- end #module 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 skills that are listed in the note hash beneath the
- # Lunatic Mode section.
- #
- # The process is pretty simple. Just follow the template below.
- #
- # SKILL_NOTES ={
- # skill.id => "This would be the first line| and this would be the next!",
- # } # Do not remove this.
- #
- # Enter the skill's ID number where "skill.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
- SKILL_NOTES ={
- #-------------------
- # Nello
- #-------------------
- # Jump
- 500 =>
- "Dauer: 1 Runde|Erhöhter Schaden: +25%|Teffer: 1|Trefferquote: 100%|Geschwindigkeit: -1 SPD|Werte: +25% AGI, -25% DEF",
- #5 Reihen
- # Fauna Obscura 2
- 501 =>
- "Erhöhter Schaden: +25%|Teffer: 1|Geschwindigkeit: -1 SPD",
- } # 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
- # Put this in if you want to force query to show these numbers.
- 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_RAGE_BOOST = /<(?:QUERY_RAGE_BOOST|query rage boost)[ ]*(\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
- # Put this in if you want to hide grudge or aggro.
- QUERY_HIDE_AGGRO = /<(?:QUERY_HIDE_AGGRO|query hide aggro)>/i
- QUERY_HIDE_GRUDGE = /<(?:QUERY_HIDE_GRUDGE|query hide grudge)>/i
- # These affect element traits.
- 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
- end
- end
- #===============================================================================
- # RPG::BaseItem
- #===============================================================================
- class RPG::BaseItem
- #--------------------------------------------------------------------------
- # yanfly cache dsq
- #--------------------------------------------------------------------------
- def yanfly_cache_dsq
- @query_basedmg = 0; @query_accuracy = 0; @query_rage_boost = 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_aggro = false; @query_hide_grudge = 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::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_RAGE_BOOST
- @query_rage_boost = $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_AGGRO
- @query_hide_aggro = true
- when YE::REGEXP::BASEITEM::QUERY_HIDE_GRUDGE
- @query_hide_grudge = 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
- #--------------------------------------------------------------------------
- # query base damage
- #--------------------------------------------------------------------------
- def query_basedmg
- yanfly_cache_dsq if @query_basedmg == nil
- return @query_basedmg
- end
- #--------------------------------------------------------------------------
- # query accuracy
- #--------------------------------------------------------------------------
- def query_accuracy
- yanfly_cache_dsq if @query_accuracy == nil
- return @query_accuracy
- end
- #--------------------------------------------------------------------------
- # query rage boost
- #--------------------------------------------------------------------------
- def query_rage_boost
- yanfly_cache_dsq if @query_rage_boost == nil
- return @query_rage_boost
- end
- #--------------------------------------------------------------------------
- # query hp_f
- #--------------------------------------------------------------------------
- def query_hp_f
- yanfly_cache_dsq if @query_hp_f == nil
- return @query_hp_f
- end
- #--------------------------------------------------------------------------
- # query mp_f
- #--------------------------------------------------------------------------
- def query_mp_f
- yanfly_cache_dsq if @query_mp_f == nil
- return @query_mp_f
- end
- #--------------------------------------------------------------------------
- # query atk_f
- #--------------------------------------------------------------------------
- def query_atk_f
- yanfly_cache_dsq if @query_atk_f == nil
- return @query_atk_f
- end
- #--------------------------------------------------------------------------
- # query def_f
- #--------------------------------------------------------------------------
- def query_def_f
- yanfly_cache_dsq if @query_def_f == nil
- return @query_def_f
- end
- #--------------------------------------------------------------------------
- # query spi_f
- #--------------------------------------------------------------------------
- def query_spi_f
- yanfly_cache_dsq if @query_spi_f == nil
- return @query_spi_f
- end
- #--------------------------------------------------------------------------
- # query agi_f
- #--------------------------------------------------------------------------
- def query_agi_f
- yanfly_cache_dsq if @query_agi_f == nil
- return @query_agi_f
- end
- #--------------------------------------------------------------------------
- # query_physical
- #--------------------------------------------------------------------------
- def query_physical
- yanfly_cache_dsq if @query_physical == nil
- return @query_physical
- end
- #--------------------------------------------------------------------------
- # query_mpdamage
- #--------------------------------------------------------------------------
- def query_mpdamage
- yanfly_cache_dsq if @query_mpdamage == nil
- return @query_mpdamage
- end
- #--------------------------------------------------------------------------
- # query_absorb
- #--------------------------------------------------------------------------
- def query_absorb
- yanfly_cache_dsq if @query_absorb == nil
- return @query_absorb
- end
- #--------------------------------------------------------------------------
- # query_ignore_def
- #--------------------------------------------------------------------------
- def query_ignore_def
- yanfly_cache_dsq if @query_ignore_def == nil
- return @query_ignore_def
- end
- #--------------------------------------------------------------------------
- # query_hide_aggro
- #--------------------------------------------------------------------------
- def query_hide_aggro
- yanfly_cache_dsq if @query_hide_aggro == nil
- return @query_hide_aggro
- end
- #--------------------------------------------------------------------------
- # query_hide_grudge
- #--------------------------------------------------------------------------
- def query_hide_grudge
- yanfly_cache_dsq if @query_hide_grudge == nil
- return @query_hide_grudge
- end
- #--------------------------------------------------------------------------
- # query_hide_elements
- #--------------------------------------------------------------------------
- def query_hide_elements
- yanfly_cache_dsq if @query_hide_elements == nil
- return @query_hide_elements
- end
- #--------------------------------------------------------------------------
- # query add elements
- #--------------------------------------------------------------------------
- def query_add_elements
- yanfly_cache_dsq if @query_add_elements == nil
- return @query_add_elements
- end
- #--------------------------------------------------------------------------
- # query sub elements
- #--------------------------------------------------------------------------
- def query_sub_elements
- yanfly_cache_dsq if @query_sub_elements == nil
- return @query_sub_elements
- end
- #--------------------------------------------------------------------------
- # query_hide_state_apply
- #--------------------------------------------------------------------------
- def query_hide_state_apply
- yanfly_cache_dsq if @query_hide_state_apply == nil
- return @query_hide_state_apply
- end
- #--------------------------------------------------------------------------
- # query_hide_state_erase
- #--------------------------------------------------------------------------
- def query_hide_state_erase
- yanfly_cache_dsq if @query_hide_state_erase == nil
- return @query_hide_state_erase
- end
- #--------------------------------------------------------------------------
- # query add state apply
- #--------------------------------------------------------------------------
- def query_add_state_apply
- yanfly_cache_dsq if @query_add_state_apply == nil
- return @query_add_state_apply
- end
- #--------------------------------------------------------------------------
- # query sub state apply
- #--------------------------------------------------------------------------
- def query_sub_state_apply
- yanfly_cache_dsq if @query_sub_state_apply == nil
- return @query_sub_state_apply
- end
- #--------------------------------------------------------------------------
- # query add state erase
- #--------------------------------------------------------------------------
- def query_add_state_erase
- yanfly_cache_dsq if @query_add_state_erase == nil
- return @query_add_state_erase
- end
- #--------------------------------------------------------------------------
- # query sub state erase
- #--------------------------------------------------------------------------
- def query_sub_state_erase
- yanfly_cache_dsq if @query_sub_state_erase == nil
- return @query_sub_state_erase
- end
- end
- #===============================================================================
- # Scene_Battle
- #===============================================================================
- class Scene_Battle < Scene_Base
- #--------------------------------------------------------------------------
- # alias start
- #--------------------------------------------------------------------------
- alias create_info_viewport_dsq create_info_viewport unless $@
- def create_info_viewport
- create_info_viewport_dsq
- 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
- @skill_data_window = Window_Skill_Data.new(0, sdy, 272, sdh)
- @skill_data_window.visible = false
- @skill_data_window.active = false
- hix = YE::MENU::SKILL::BATTLE_HELP_X
- hiy = YE::MENU::SKILL::BATTLE_HELP_Y
- hiw = YE::MENU::SKILL::BATTLE_HELP_W
- text = YE::MENU::SKILL::BATTLE_HELP_INFO
- icon = YE::MENU::SKILL::BATTLE_HELP_ICON
- @help_info_window = Window_Base.new(hix, hiy, hiw, 56)
- @help_info_window.back_opacity = YE::MENU::SKILL::BATTLE_HELP_O
- @help_info_window.draw_icon(icon, 0, 0)
- @help_info_window.contents.draw_text(16, 0, hiw - 40, 24, text, 1) #edit
- @help_info_window.visible = false
- end
- #--------------------------------------------------------------------------
- # alias terminate
- #--------------------------------------------------------------------------
- alias terminate_dsq terminate unless $@
- def terminate
- @help_info_window.dispose if @help_info_window != nil
- @skill_data_window.dispose if @skill_data_window != nil
- terminate_dsq
- end
- #--------------------------------------------------------------------------
- # Update Skill Query
- #--------------------------------------------------------------------------
- def update_skill_query
- @skill_data_window.update
- if Input.trigger?(Input::B) #end1
- Sound.play_cancel
- @skill_data_window.disappear
- if $imported["CustomSkillEffects"] and @mix_item_window != nil
- @mix_item_window.active = true
- elsif $imported["CustomSkillEffects"] and @chain_window != nil
- @chain_window.active = true
- elsif $imported["CustomSkillEffects"] and @subskill_window != nil
- @subskill_window.active = true
- else
- @skill_window.active = true
- end
- elsif Input.trigger?(Input::LEFT) or Input.trigger?(Input::UP)
- @skill_data_window.previous_page
- elsif Input.trigger?(Input::RIGHT) or Input.trigger?(Input::DOWN)
- @skill_data_window.next_page
- elsif Input.trigger?(Input::L)
- @skill_data_window.top_page
- elsif Input.trigger?(Input::R)
- @skill_data_window.bottom_page
- end
- end
- #--------------------------------------------------------------------------
- # Update Skill Selection
- #--------------------------------------------------------------------------
- alias update_skill_selection_dsq update_skill_selection unless $@
- def update_skill_selection
- if YE::MENU::SKILL::BATTLE_HELP_SHOW
- if @skill_data_window.active
- @help_info_window.visible = false
- elsif @skill_window.active
- @help_info_window.visible = true
- else
- @help_info_window.visible = false
- end
- else
- @help_info_window.visible = false
- end
- #------------------------------------------
- # If the Skill Data Window is active
- #------------------------------------------
- if @skill_data_window != nil and @skill_data_window.active
- update_skill_query
- #------------------------------------------
- # If the Skill Window is Active
- #------------------------------------------
- else
- if Input.trigger?(Input::B)
- @help_info_window.visible = false
- elsif Input.trigger?(Input::C)
- @skill = @skill_window.skill
- @help_info_window.visible = false
- elsif Input.trigger?(YE::MENU::SKILL::SKILL_QUERY_BATTLE_BUTTON)
- skill = @skill_window.skill
- if allow_skill_query?
- Sound.play_decision
- @skill_data_window.appear(skill, @skill_window, @active_battler)
- @skill_window.active = false
- elsif @skill_window.visible
- Sound.play_buzzer
- end
- end
- update_skill_selection_dsq
- #---------
- end
- end #end start skill selection
- #--------------------------------------------------------------------------
- # allow_skill_query
- #--------------------------------------------------------------------------
- def allow_skill_query?
- skill = @skill_window.skill
- return false if skill == nil
- return false if $imported["CustomSkillEffects"] and @mix_item_window != nil
- return true
- end
- end # Scene_Battle
- #===============================================================================
- # Window_Skill_Data
- #===============================================================================
- class Window_Skill_Data < Window_Base
- #--------------------------------------------------------------------------
- # initialize
- #--------------------------------------------------------------------------
- def initialize(x, y, width, height)
- super(x, y, width, 170) #PENTA
- self.back_opacity = 200
- @page = 1
- @skill_window = nil
- @actor = nil
- self.z = 200
- self.visible = false
- end
- #--------------------------------------------------------------------------
- # appear
- #--------------------------------------------------------------------------
- def appear(skill, window, actor, condition = 0)
- @skill = skill
- @skill_window = window
- @actor = actor
- if $imported["CustomSkillEffects"]
- if @skill_window.index % YE::BATTLE::WINCOLUMN == 0
- self.x = 272
- else
- self.x = 0
- end
- else
- if @skill_window.index % 2 == 0
- self.x = 272
- else
- self.x = 0
- end
- end
- if condition == 1
- self.x = 0
- elsif condition == 2
- self.x = 272
- end
- @page = 1
- @total_pages = create_total_pages
- setup(@page)
- self.openness = 128
- @opening = true
- self.active = true
- self.visible = true
- end
- def disappear
- self.active = false
- self.visible = false
- end
- #--------------------------------------------------------------------------
- # setup
- #--------------------------------------------------------------------------
- def setup(page)
- 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::SKILL::DATA_CATEGORY_COLOUR
- #--------------------
- pagecase = @contents[page - 1]
- if @page == 1 and !YE::MENU::SKILL::REPLACE_PAGE_MSG
- text1 = ""
- else
- text1 = YE::MENU::SKILL::DATA_LEFT
- end
- if YE::MENU::SKILL::REPLACE_PAGE_MSG #--------------------------------------
- text2 = case_page_name(pagecase)
- else #----------------------------------------------------------------------
- text2 = sprintf(YE::MENU::SKILL::DATA_PAGES, @page, @total_pages)
- end
- if @page == @total_pages and !YE::MENU::SKILL::REPLACE_PAGE_MSG
- text3 = ""
- else
- text3 = YE::MENU::SKILL::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 @skill != nil
- case_page_run(pagecase)
- end
- end
- #--------------------------------------------------------------------------
- # page switching
- #--------------------------------------------------------------------------
- def next_page
- if @page != @total_pages
- @page += 1
- else
- @page = 1
- end
- turn_sound
- setup(@page)
- end
- def previous_page
- if @page != 1
- @page -= 1
- else
- @page = @total_pages
- end
- turn_sound
- setup(@page)
- end
- def top_page
- @page = 1
- turn_sound
- setup(@page)
- end
- def bottom_page
- @page = @total_pages
- turn_sound
- setup(@page)
- end
- #--------------------------------------------------------------------------
- # turn sound
- #--------------------------------------------------------------------------
- def turn_sound
- unless YE::MENU::SKILL::PAGE_SOUND == nil
- sound = YE::MENU::SKILL::PAGE_SOUND
- sound.play
- end
- end
- #--------------------------------------------------------------------------
- # calculate cost
- #--------------------------------------------------------------------------
- def calc_cost
- if @skill.cost_custom > 0
- skillcost = @actor.cost_custom(@skill, 3)
- elsif @skill.cur_mp_cost > 0
- skillcost = @skill.cur_mp_cost
- elsif @skill.max_mp_cost > 0
- skillcost = @skill.max_mp_cost
- @percentile = true
- elsif @skill.cur_hp_cost > 0
- skillcost = @skill.cur_hp_cost
- elsif @skill.max_hp_cost > 0
- skillcost = @skill.max_hp_cost
- @percentile = true
- elsif @skill.gold_cost > 0
- skillcost = @skill.gold_cost
- elsif @skill.maxgold_cost > 0
- skillcost = @skill.maxgold_cost
- @percentile = true
- elsif @skill.rage_cost > 0
- skillcost = @skill.rage_cost
- else
- skillcost = @skill.mp_cost
- end
- return skillcost
- end
- #--------------------------------------------------------------------------
- # draw_category
- #--------------------------------------------------------------------------
- def draw_category(y, text, nt)
- self.contents.font.color = text_color(@category_colour)
- self.contents.draw_text(24, y, 216, WLH, text, 0)
- self.contents.font.color = normal_color
- self.contents.draw_text(24, y, 216, WLH, nt, 2)
- end
- #--------------------------------------------------------------------------
- # make first page
- #--------------------------------------------------------------------------
- def make_first_page
- y = WLH
- # 1st Row --------------------------------------
- self.contents.font.size = Font.default_size
- draw_item_name(@skill, 0, WLH*1)
- @percentile = false
- if $imported["CustomSkillEffects"]
- costicon = @actor.create_cost_icon(@skill)
- skillcost = calc_cost
- unless @skill.cost_custom > 0
- costicon = 0 if skillcost == 0
- end
- else
- costicon = YE::MENU::SKILL::ICON_MP
- skillcost = @actor.calc_mp_cost(@skill)
- costicon = 0 if skillcost == 0
- end
- draw_icon(costicon, 216, y, true)
- skillcost = sprintf("%d%%", skillcost) if @percentile
- skillcost = "" if skillcost == 0
- self.contents.font.color.alpha = 255
- self.contents.draw_text(2, y, 214, WLH, skillcost, 2)
- self.contents.font.size = YE::MENU::SKILL::FONT_SIZE
- # 2nd Row --------------------------------------
- tw = YE::MENU::SKILL::DATA_WIDTH
- ta = YE::MENU::SKILL::DATA_ALIGN
- y += WLH
- if $scene.is_a?(Scene_Battle) and $imported["HelpExtension"]
- y += WLH if KGC::HelpExtension::ROW_MAX < 3
- else
- y += WLH
- end
- if @skill.speed > 0
- draw_icon(YE::MENU::SKILL::ICON_INIT, 0, y, true)
- text = sprintf("+%d",@skill.speed)
- self.contents.font.color.alpha = 255
- elsif @skill.speed < 0
- draw_icon(YE::MENU::SKILL::ICON_INIT, 0, y, true)
- text = @skill.speed
- self.contents.font.color.alpha = 255
- else
- draw_icon(YE::MENU::SKILL::ICON_INIT, 0, y, false)
- text = YE::MENU::SKILL::ZERO_INITIATIVE
- self.contents.font.color.alpha = 128
- end
- self.contents.draw_text(24, y, tw, WLH, text, ta)
- if $imported["CustomSkillEffects"]
- #---Cast Time
- if @skill.cast_time > 0
- draw_icon(YE::MENU::SKILL::ICON_CHARGE, 60, y, true)
- self.contents.font.color.alpha = 255
- self.contents.draw_text(84, y, tw, WLH, @skill.cast_time, ta)
- else
- draw_icon(YE::MENU::SKILL::ICON_CHARGE, 60, y, false)
- self.contents.font.color.alpha = 128
- self.contents.draw_text(84, y, tw, WLH, YE::MENU::SKILL::DATA_NIL, ta)
- end
- #---Recharge
- if @skill.recharge > 0
- draw_icon(YE::BATTLE::RECHARGE_ICON, 120, y, true)
- self.contents.font.color.alpha = 255
- self.contents.draw_text(144, y, tw, WLH, @skill.recharge, ta)
- else
- draw_icon(YE::BATTLE::RECHARGE_ICON, 120, y, false)
- self.contents.font.color.alpha = 128
- self.contents.draw_text(144, y, tw, WLH, YE::MENU::SKILL::DATA_NIL, ta)
- end
- #---Use Total
- if @skill.usage > 0
- draw_icon(YE::BATTLE::USAGE_ICON, 180, y, true)
- self.contents.font.color.alpha = 255
- self.contents.draw_text(204, y, tw, WLH, @skill.usage, ta)
- else
- draw_icon(YE::BATTLE::USAGE_ICON, 180, y, false)
- self.contents.font.color.alpha = 128
- self.contents.draw_text(204, y, tw, WLH, YE::MENU::SKILL::DATA_NIL, ta)
- end
- end
- # 3rd Row --------------------------------------
- y += WLH
- #---Base Damage
- if @skill.base_damage != 0 or @skill.query_basedmg != 0
- textno = @skill.base_damage
- textno = @skill.query_basedmg if @skill.query_basedmg != 0
- if @skill.base_damage < 0 or @skill.query_basedmg < 0
- textno *= -1
- draw_icon(YE::MENU::SKILL::ICON_BASEHEAL, 0, y, true)
- else
- draw_icon(YE::MENU::SKILL::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::SKILL::ICON_BASEDMG, 0, y, false)
- self.contents.font.color.alpha = 128
- self.contents.draw_text(24, y, tw, WLH, YE::MENU::SKILL::DATA_NIL, ta)
- end
- if $imported["CustomDmgFormulaRD"]
- #---Accuracy
- draw_icon(YE::MENU::SKILL::ICON_ACCURACY, 60, y, true)
- self.contents.font.color.alpha = 255
- acchit = @skill.hit
- acchit = @skill.query_accuracy if @skill.query_accuracy > 0
- textno = sprintf("%d%%", acchit)
- self.contents.draw_text(84, y, tw, WLH, textno, ta)
- #---HP Hi/Lo/F
- if @skill.hp_hi > 0 or @skill.hp_lo > 0 or @skill.query_hp_f > 0
- draw_icon(YE::MENU::SKILL::ICON_HP_F, 120, y, true)
- self.contents.font.color.alpha = 255
- num = @skill.hp_hi if @skill.hp_hi > 0
- num = @skill.hp_lo if @skill.hp_lo > 0
- num = @skill.query_hp_f if @skill.query_hp_f > 0
- textno = sprintf("%d%%", num)
- self.contents.draw_text(144, y, tw, WLH, textno, ta)
- else
- draw_icon(YE::MENU::SKILL::ICON_HP_F, 120, y, false)
- self.contents.font.color.alpha = 128
- self.contents.draw_text(144, y, tw, WLH, YE::MENU::SKILL::DATA_NIL, ta)
- end
- #---MP Hi/Lo/F
- if @skill.mp_hi > 0 or @skill.mp_lo > 0 or @skill.query_mp_f > 0
- draw_icon(YE::MENU::SKILL::ICON_MP_F, 180, y, true)
- self.contents.font.color.alpha = 255
- num = @skill.mp_hi if @skill.mp_hi > 0
- num = @skill.mp_lo if @skill.mp_lo > 0
- num = @skill.query_mp_f if @skill.query_mp_f > 0
- textno = sprintf("%d%%", num)
- self.contents.draw_text(204, y, tw, WLH, textno, ta)
- else
- draw_icon(YE::MENU::SKILL::ICON_MP_F, 180, y, false)
- self.contents.font.color.alpha = 128
- self.contents.draw_text(204, y, tw, WLH, YE::MENU::SKILL::DATA_NIL, ta)
- end
- else
- #---Accuracy
- draw_icon(YE::MENU::SKILL::ICON_ACCURACY, 120, y, true)
- self.contents.font.color.alpha = 255
- acchit = @skill.hit
- acchit = @skill.query_accuracy if @skill.query_accuracy > 0
- textno = sprintf("%d%%", acchit)
- self.contents.draw_text(144, y, tw, WLH, textno, ta)
- end
- # 4th Row --------------------------------------
- y += WLH
- if $imported["CustomDmgFormulaRD"]
- #---Attack F
- if @skill.atk_f > 0 or @skill.newatk_f > 0 or @skill.query_atk_f > 0
- draw_icon(YE::MENU::SKILL::ICON_ATK_F, 0, y, true)
- self.contents.font.color.alpha = 255
- num = @skill.atk_f
- num = @skill.newatk_f if @skill.newatk_f > 0
- num = @skill.query_atk_f if @skill.query_atk_f > 0
- textno = sprintf("%d%%", num)
- self.contents.draw_text(24, y, tw, WLH, textno, ta)
- else
- draw_icon(YE::MENU::SKILL::ICON_ATK_F, 0, y, false)
- self.contents.font.color.alpha = 128
- self.contents.draw_text(24, y, tw, WLH, YE::MENU::SKILL::DATA_NIL, ta)
- end
- #---Defense F
- if @skill.def_f > 0 or @skill.query_def_f > 0
- draw_icon(YE::MENU::SKILL::ICON_DEF_F, 60, y, true)
- self.contents.font.color.alpha = 255
- num = @skill.def_f
- num = @skill.query_def_f if @skill.query_def_f > 0
- textno = sprintf("%d%%", num)
- self.contents.draw_text(84, y, tw, WLH, textno, ta)
- else
- draw_icon(YE::MENU::SKILL::ICON_DEF_F, 60, y, false)
- self.contents.font.color.alpha = 128
- self.contents.draw_text(84, y, tw, WLH, YE::MENU::SKILL::DATA_NIL, ta)
- end
- #---Spirit F
- if @skill.spi_f > 0 or @skill.newspi_f > 0 or @skill.query_spi_f > 0
- draw_icon(YE::MENU::SKILL::ICON_SPI_F, 120, y, true)
- self.contents.font.color.alpha = 255
- num = @skill.spi_f
- num = @skill.newspi_f if @skill.newspi_f > 0
- num = @skill.query_spi_f if @skill.query_spi_f > 0
- textno = sprintf("%d%%", num)
- self.contents.draw_text(144, y, tw, WLH, textno, ta)
- else
- draw_icon(YE::MENU::SKILL::ICON_SPI_F, 120, y, false)
- self.contents.font.color.alpha = 128
- self.contents.draw_text(144, y, tw, WLH, YE::MENU::SKILL::DATA_NIL, ta)
- end
- #---Agility F
- if @skill.agi_f > 0 or @skill.query_agi_f > 0
- draw_icon(YE::MENU::SKILL::ICON_AGI_F, 180, y, true)
- self.contents.font.color.alpha = 255
- num = @skill.agi_f
- num = @skill.query_agi_f if @skill.query_agi_f > 0
- textno = sprintf("%d%%", num)
- self.contents.draw_text(204, y, tw, WLH, textno, ta)
- else
- draw_icon(YE::MENU::SKILL::ICON_AGI_F, 180, y, false)
- self.contents.font.color.alpha = 128
- self.contents.draw_text(204, y, tw, WLH, YE::MENU::SKILL::DATA_NIL, ta)
- end
- else
- #---Attack F
- if @skill.atk_f > 0 or @skill.query_atk_f > 0
- draw_icon(YE::MENU::SKILL::ICON_ATK_F, 0, y, true)
- self.contents.font.color.alpha = 255
- num = @skill.atk_f
- num = @skill.query_atk_f if @skill.query_atk_f > 0
- textno = sprintf("%d%%", num)
- self.contents.draw_text(24, y, tw, WLH, textno, ta)
- else
- draw_icon(YE::MENU::SKILL::ICON_ATK_F, 0, y, false)
- self.contents.font.color.alpha = 128
- self.contents.draw_text(24, y, tw, WLH, YE::MENU::SKILL::DATA_NIL, ta)
- end
- #---Spirit F
- if @skill.spi_f > 0 or @skill.query_spi_f > 0
- draw_icon(YE::MENU::SKILL::ICON_SPI_F, 120, y, true)
- self.contents.font.color.alpha = 255
- num = @skill.spi_f
- num = @skill.query_spi_f if @skill.query_spi_f > 0
- textno = sprintf("%d%%", num)
- self.contents.draw_text(144, y, tw, WLH, textno, ta)
- else
- draw_icon(YE::MENU::SKILL::ICON_SPI_F, 120, y, false)
- self.contents.font.color.alpha = 128
- self.contents.draw_text(144, y, tw, WLH, YE::MENU::SKILL::DATA_NIL, ta)
- end
- end
- # 5th Row --------------------------------------
- y += WLH
- #---Physical Attack
- if @skill.physical_attack or @skill.query_physical
- draw_icon(YE::MENU::SKILL::ICON_PHYS, 0, y, true)
- self.contents.font.color.alpha = 255
- textflag = YE::MENU::SKILL::DATA_TRUE
- else
- draw_icon(YE::MENU::SKILL::ICON_PHYS, 0, y, false)
- self.contents.font.color.alpha = 128
- textflag = YE::MENU::SKILL::DATA_FALSE
- end
- self.contents.draw_text(24, y, tw, WLH, textflag, ta)
- #---Damage to MP
- if @skill.damage_to_mp or @skill.query_mpdamage
- draw_icon(YE::MENU::SKILL::ICON_MPDMG, 60, y, true)
- self.contents.font.color.alpha = 255
- textflag = YE::MENU::SKILL::DATA_TRUE
- else
- draw_icon(YE::MENU::SKILL::ICON_MPDMG, 60, y, false)
- self.contents.font.color.alpha = 128
- textflag = YE::MENU::SKILL::DATA_FALSE
- end
- self.contents.draw_text(84, y, tw, WLH, textflag, ta)
- #---Absorb Damage
- if @skill.absorb_damage or @skill.query_absorb
- draw_icon(YE::MENU::SKILL::ICON_ABSORB, 120, y, true)
- self.contents.font.color.alpha = 255
- textflag = YE::MENU::SKILL::DATA_TRUE
- else
- draw_icon(YE::MENU::SKILL::ICON_ABSORB, 120, y, false)
- self.contents.font.color.alpha = 128
- textflag = YE::MENU::SKILL::DATA_FALSE
- end
- self.contents.draw_text(144, y, tw, WLH, textflag, ta)
- #---Ignore Defense?
- if @skill.ignore_defense or @skill.query_ignore_def
- draw_icon(YE::MENU::SKILL::ICON_IGDEF, 180, y, true)
- self.contents.font.color.alpha = 255
- textflag = YE::MENU::SKILL::DATA_TRUE
- else
- draw_icon(YE::MENU::SKILL::ICON_IGDEF, 180, y, false)
- self.contents.font.color.alpha = 128
- textflag = YE::MENU::SKILL::DATA_FALSE
- end
- self.contents.draw_text(204, y, tw, WLH, textflag, ta)
- end
- #--------------------------------------------------------------------------
- # make cost page
- #--------------------------------------------------------------------------
- def make_cost_page
- y = WLH #--- 1st ROW ---------------------------------------
- self.contents.font.size = Font.default_size
- self.contents.font.color.alpha = 255
- if $imported["CustomSkillEffects"]
- skillcost = calc_cost
- costicon = @actor.create_cost_icon(@skill)
- if @skill.cost_custom > 0
- nt1 = @actor.cost_custom(@skill, 3)
- nt2 = @actor.cost_custom(@skill, 2)
- nt = sprintf("%d %s", nt1, nt2)
- text = @actor.cost_custom(@skill, 5)
- elsif @skill.cur_mp_cost > 0
- nt = sprintf(YE::BATTLE::MP_COST, @skill.cur_mp_cost)
- text = YE::MENU::SKILL::MSG_MP_COST
- elsif @skill.max_mp_cost > 0
- nt = sprintf(YE::MENU::SKILL::MSG_MAXMP_VALUE, @skill.max_mp_cost)
- text = YE::MENU::SKILL::MSG_MAXMP_COST
- elsif @skill.cur_hp_cost > 0
- nt = sprintf(YE::BATTLE::HP_COST, @skill.cur_hp_cost)
- text = YE::MENU::SKILL::MSG_HP_COST
- elsif @skill.max_hp_cost > 0
- nt = sprintf(YE::MENU::SKILL::MSG_MAXHP_VALUE, @skill.max_hp_cost)
- text = YE::MENU::SKILL::MSG_MAXHP_COST
- elsif @skill.gold_cost > 0
- nt = sprintf(YE::BATTLE::GOLD_COST, @skill.gold_cost)
- text = YE::MENU::SKILL::MSG_GOLD_COST
- elsif @skill.maxgold_cost > 0
- nt = sprintf(YE::BATTLE::MGOLD_COST, @skill.gold_cost)
- text = YE::MENU::SKILL::MSG_MGOLD_COST
- elsif @skill.rage_cost > 0
- nt = sprintf(YE::BATTLE::RAGE_COST, @skill.rage_cost)
- text = YE::MENU::SKILL::MSG_RAGE_COST
- else
- nt = sprintf(YE::BATTLE::MP_COST, @skill.mp_cost)
- text = YE::MENU::SKILL::MSG_MP_COST
- unless @skill.cost_custom > 0
- if skillcost == 0
- nt = ""
- text = YE::MENU::SKILL::MSG_FREE
- costicon = 0
- end
- end
- end
- else
- nt = sprintf(YE::MENU::SKILL::MSG_MP_VALUE, @skill.mp_cost)
- text = YE::MENU::SKILL::MSG_MP_COST
- skillcost = @actor.calc_mp_cost(@skill)
- costicon = YE::MENU::SKILL::ICON_MP
- if skillcost == 0
- nt = ""
- text = YE::MENU::SKILL::MSG_FREE
- costicon = 0
- end
- end
- draw_icon(costicon, 0, y, true)
- draw_category(y, text, nt)
- y += WLH #--- 2nd ROW ---------------------------------------
- draw_icon(YE::MENU::SKILL::ICON_INIT, 0, y, true)
- if @skill.speed > 0
- nt = sprintf("+%d",@skill.speed)
- elsif @skill.speed == 0
- nt = YE::MENU::SKILL::ZERO_INITIATIVE
- else
- nt = @skill.speed
- end
- text = YE::MENU::SKILL::MSG_INITIATIVE
- draw_category(y, text, nt)
- if $imported["CustomSkillEffects"]
- if @skill.cast_time > 0 #--- 3rd ROW ---------------------------------------
- y += WLH
- draw_icon(YE::MENU::SKILL::ICON_CHARGE, 0, y, true)
- if @skill.cast_time == 1
- nt = sprintf(YE::BATTLE::RECHARGE_MSG1,@skill.cast_time)
- else
- nt = sprintf(YE::BATTLE::RECHARGE_MSG,@skill.cast_time)
- end
- text = YE::MENU::SKILL::MSG_CHARGE
- draw_category(y, text, nt)
- end
- if @skill.prepare > 0 #--- 4th ROW ---------------------------------------
- y += WLH
- draw_icon(YE::MENU::SKILL::ICON_PREPARE, 0, y, true)
- if @skill.prepare == 1
- nt = sprintf(YE::BATTLE::RECHARGE_MSG1,@skill.prepare)
- else
- nt = sprintf(YE::BATTLE::RECHARGE_MSG,@skill.prepare)
- end
- text = YE::MENU::SKILL::MSG_PREPARE
- draw_category(y, text, nt)
- end
- if @skill.recharge > 0 #--- 5th ROW ---------------------------------------
- y += WLH
- draw_icon(YE::BATTLE::RECHARGE_ICON, 0, y, true)
- if @skill.recharge == 1
- nt = sprintf(YE::BATTLE::RECHARGE_MSG1,@skill.recharge)
- else
- nt = sprintf(YE::BATTLE::RECHARGE_MSG,@skill.recharge)
- end
- text = YE::MENU::SKILL::MSG_RECHARGE
- draw_category(y, text, nt)
- end
- if @skill.fatigue > 0 #--- 6th ROW ---------------------------------------
- y += WLH
- draw_icon(YE::MENU::SKILL::ICON_FATIGUE, 0, y, true)
- if @skill.fatigue == 1
- nt = sprintf(YE::BATTLE::RECHARGE_MSG1,@skill.fatigue)
- else
- nt = sprintf(YE::BATTLE::RECHARGE_MSG,@skill.fatigue)
- end
- text = YE::MENU::SKILL::MSG_FATIGUE
- draw_category(y, text, nt)
- end
- if @skill.usage > 0 #--- 7th ROW ---------------------------------------
- y += WLH
- draw_icon(YE::BATTLE::USAGE_ICON, 0, y, true)
- if @skill.usage == 1
- nt = sprintf(YE::MENU::SKILL::MSG_USAGE_VALUE1,@skill.usage)
- else
- nt = sprintf(YE::MENU::SKILL::MSG_USAGE_VALUE,@skill.usage)
- end
- text = YE::MENU::SKILL::MSG_USAGE
- draw_category(y, text, nt)
- end
- end
- end #end def
- #--------------------------------------------------------------------------
- # make dmg page
- #--------------------------------------------------------------------------
- def make_dmg_page
- y = WLH #--- 1st ROW ---------------------------------------
- self.contents.font.size = Font.default_size
- self.contents.font.color.alpha = 255
- nt = @skill.base_damage
- nt = @skill.query_basedmg if @skill.query_basedmg != 0
- if @skill.base_damage < 0 or @skill.query_basedmg < 0
- nt *= -1
- draw_icon(YE::MENU::SKILL::ICON_BASEHEAL, 0, y, true)
- text = YE::MENU::SKILL::MSG_BASE_HEALING
- else
- draw_icon(YE::MENU::SKILL::ICON_BASEDMG, 0, y, true)
- text = YE::MENU::SKILL::MSG_BASE_DAMAGE
- end
- draw_category(y, text, nt)
- if $imported["CustomDmgFormulaRD"]
- if @skill.hp_hi > 0 or @skill.hp_lo > 0 or @skill.query_hp_f > 0
- y += WLH #--- HP ROW ---------------------------------------
- draw_icon(YE::MENU::SKILL::ICON_HP_F, 0, y, true)
- text = YE::MENU::SKILL::MSG_HP_F
- num = @skill.hp_hi if @skill.hp_hi > 0
- num = @skill.hp_lo if @skill.hp_lo > 0
- num = @skill.query_hp_f if @skill.query_hp_f > 0
- nt = sprintf("%d%%", num)
- draw_category(y, text, nt)
- end
- if @skill.mp_hi > 0 or @skill.mp_lo > 0 or @skill.query_mp_f > 0
- y += WLH #--- MP ROW ---------------------------------------
- draw_icon(YE::MENU::SKILL::ICON_MP_F, 0, y, true)
- text = YE::MENU::SKILL::MSG_MP_F
- num = @skill.mp_hi if @skill.mp_hi > 0
- num = @skill.mp_lo if @skill.mp_lo > 0
- num = @skill.query_mp_f if @skill.query_mp_f > 0
- nt = sprintf("%d%%", num)
- draw_category(y, text, nt)
- end
- if @skill.atk_f > 0 or @skill.newatk_f > 0 or @skill.query_atk_f > 0
- y += WLH #--- Atk ROW ---------------------------------------
- draw_icon(YE::MENU::SKILL::ICON_ATK_F, 0, y, true)
- text = YE::MENU::SKILL::MSG_ATK_F
- num = @skill.atk_f
- num = @skill.newatk_f if @skill.newatk_f > 0
- num = @skill.query_atk_f if @skill.query_atk_f > 0
- nt = sprintf("%d%%", num)
- draw_category(y, text, nt)
- end
- if @skill.def_f > 0 or @skill.query_def_f > 0
- y += WLH #--- Def ROW ---------------------------------------
- draw_icon(YE::MENU::SKILL::ICON_DEF_F, 0, y, true)
- text = YE::MENU::SKILL::MSG_DEF_F
- num = @skill.def_f
- num = @skill.query_def_f if @skill.query_def_f > 0
- nt = sprintf("%d%%", num)
- draw_category(y, text, nt)
- end
- if @skill.spi_f > 0 or @skill.newspi_f > 0 or @skill.query_spi_f > 0
- y += WLH #--- Spi ROW ---------------------------------------
- draw_icon(YE::MENU::SKILL::ICON_SPI_F, 0, y, true)
- text = YE::MENU::SKILL::MSG_SPI_F
- num = @skill.spi_f
- num = @skill.newspi_f if @skill.newspi_f > 0
- num = @skill.query_spi_f if @skill.query_spi_f > 0
- nt = sprintf("%d%%", num)
- draw_category(y, text, nt)
- end
- if @skill.agi_f > 0 or @skill.query_agi_f > 0
- y += WLH #--- Agi ROW ---------------------------------------
- draw_icon(YE::MENU::SKILL::ICON_AGI_F, 0, y, true)
- text = YE::MENU::SKILL::MSG_AGI_F
- num = @skill.agi_f
- num = @skill.query_agi_f if @skill.query_agi_f > 0
- nt = sprintf("%d%%", num)
- draw_category(y, text, nt)
- end
- else
- if @skill.atk_f > 0 or @skill.query_atk_f > 0
- y += WLH #--- Atk ROW ---------------------------------------
- draw_icon(YE::MENU::SKILL::ICON_ATK_F, 0, y, true)
- text = YE::MENU::SKILL::MSG_ATK_F
- num = @skill.atk_f
- num = @skill.query_atk_f if @skill.query_atk_f > 0
- nt = sprintf("%d%%", num)
- draw_category(y, text, nt)
- end
- if @skill.spi_f > 0 or @skill.query_spi_f > 0
- y += WLH #--- Spi ROW ---------------------------------------
- draw_icon(YE::MENU::SKILL::ICON_SPI_F, 0, y, true)
- text = YE::MENU::SKILL::MSG_SPI_F
- num = @skill.spi_f
- num = @skill.query_spi_f if @skill.query_spi_f > 0
- nt = sprintf("%d%%", num)
- draw_category(y, text, nt)
- end
- end
- end #end def
- #--------------------------------------------------------------------------
- # make aggro page
- #--------------------------------------------------------------------------
- def make_aggro_page
- y = 0 #--- Initiate ---------------------------------------
- self.contents.font.size = Font.default_size
- self.contents.font.color.alpha = 255
- if not @skill.query_hide_aggro
- if @skill.aggro_set > 0
- y += WLH #--- Row 1 ---------------------------------------
- draw_icon(YE::MENU::SKILL::ICON_AGGRO, 0, y, true)
- lt = YE::MENU::SKILL::MSG_AGGRO_TERM
- text = sprintf(YE::MENU::SKILL::MSG_AGGRO_SET,lt)
- num = @skill.aggro_set
- nt = sprintf(YE::MENU::SKILL::MSG_AGGRO_SETVAL, num)
- draw_category(y, text, nt)
- end
- if @skill.aggro_mul > 0
- y += WLH #--- Row 2 ---------------------------------------
- draw_icon(YE::MENU::SKILL::ICON_AGGRO, 0, y, true)
- lt = YE::MENU::SKILL::MSG_AGGRO_TERM
- text = sprintf(YE::MENU::SKILL::MSG_AGGRO_MUL,lt)
- num = @skill.aggro_mul
- nt = sprintf(YE::MENU::SKILL::MSG_AGGRO_MULVAL, num)
- draw_category(y, text, nt)
- end
- if @skill.aggro_div > 0
- y += WLH #--- Row 3 ---------------------------------------
- draw_icon(YE::MENU::SKILL::ICON_AGGRO, 0, y, true)
- lt = YE::MENU::SKILL::MSG_AGGRO_TERM
- text = sprintf(YE::MENU::SKILL::MSG_AGGRO_DIV,lt)
- num = @skill.aggro_div
- nt = sprintf(YE::MENU::SKILL::MSG_AGGRO_DIVVAL, num)
- draw_category(y, text, nt)
- end
- if @skill.aggro_add > 0
- y += WLH #--- Row 4 ---------------------------------------
- draw_icon(YE::MENU::SKILL::ICON_AGGRO, 0, y, true)
- lt = YE::MENU::SKILL::MSG_AGGRO_TERM
- text = sprintf(YE::MENU::SKILL::MSG_AGGRO_ADD,lt)
- num = @skill.aggro_add
- nt = sprintf(YE::MENU::SKILL::MSG_AGGRO_ADDVAL, num)
- draw_category(y, text, nt)
- end
- if @skill.aggro_sub > 0
- y += WLH #--- Row 5 ---------------------------------------
- draw_icon(YE::MENU::SKILL::ICON_AGGRO, 0, y, true)
- lt = YE::MENU::SKILL::MSG_AGGRO_TERM
- text = sprintf(YE::MENU::SKILL::MSG_AGGRO_SUB,lt)
- num = @skill.aggro_sub
- nt = sprintf(YE::MENU::SKILL::MSG_AGGRO_SUBVAL, num)
- draw_category(y, text, nt)
- end
- end
- if not @skill.query_hide_grudge
- if @skill.grudge_set > 0
- y += WLH #--- Row 6 ---------------------------------------
- draw_icon(YE::MENU::SKILL::ICON_GRUDGE, 0, y, true)
- lt = YE::MENU::SKILL::MSG_GRUDGE_TERM
- text = sprintf(YE::MENU::SKILL::MSG_AGGRO_SET,lt)
- num = @skill.grudge_set
- nt = sprintf(YE::MENU::SKILL::MSG_AGGRO_SETVAL, num)
- draw_category(y, text, nt)
- end
- if @skill.grudge_mul > 0
- y += WLH #--- Row 7 ---------------------------------------
- draw_icon(YE::MENU::SKILL::ICON_GRUDGE, 0, y, true)
- lt = YE::MENU::SKILL::MSG_GRUDGE_TERM
- text = sprintf(YE::MENU::SKILL::MSG_AGGRO_MUL,lt)
- num = @skill.grudge_mul
- nt = sprintf(YE::MENU::SKILL::MSG_AGGRO_MULVAL, num)
- draw_category(y, text, nt)
- end
- if @skill.grudge_div > 0
- y += WLH #--- Row 7 ---------------------------------------
- draw_icon(YE::MENU::SKILL::ICON_GRUDGE, 0, y, true)
- lt = YE::MENU::SKILL::MSG_GRUDGE_TERM
- text = sprintf(YE::MENU::SKILL::MSG_AGGRO_DIV,lt)
- num = @skill.grudge_div
- nt = sprintf(YE::MENU::SKILL::MSG_AGGRO_DIVVAL, num)
- draw_category(y, text, nt)
- end
- if @skill.grudge_add > 0
- y += WLH #--- Row 7 ---------------------------------------
- draw_icon(YE::MENU::SKILL::ICON_GRUDGE, 0, y, true)
- lt = YE::MENU::SKILL::MSG_GRUDGE_TERM
- text = sprintf(YE::MENU::SKILL::MSG_AGGRO_ADD,lt)
- num = @skill.grudge_add
- nt = sprintf(YE::MENU::SKILL::MSG_AGGRO_ADDVAL, num)
- draw_category(y, text, nt)
- end
- if @skill.grudge_sub > 0
- y += WLH #--- Row 7 ---------------------------------------
- draw_icon(YE::MENU::SKILL::ICON_GRUDGE, 0, y, true)
- lt = YE::MENU::SKILL::MSG_GRUDGE_TERM
- text = sprintf(YE::MENU::SKILL::MSG_AGGRO_SUB,lt)
- num = @skill.grudge_sub
- nt = sprintf(YE::MENU::SKILL::MSG_AGGRO_SUBVAL, num)
- draw_category(y, text, nt)
- end
- end
- end #end def
- #--------------------------------------------------------------------------
- # make misc page
- #--------------------------------------------------------------------------
- def make_misc_page
- self.contents.font.size = Font.default_size
- self.contents.font.color.alpha = 255
- y = WLH #--- 1st Row -------------------------------------------
- draw_icon(YE::MENU::SKILL::ICON_ACCURACY, 0, y, true)
- text = YE::MENU::SKILL::MSG_ACCURACY
- nth = @skill.hit
- nth = @skill.query_accuracy if @skill.query_accuracy > 0
- nt = sprintf(YE::MENU::SKILL::MSG_ACCURACY_VAL, nth)
- draw_category(y, text, nt)
- if $imported["CustomSkillEffects"]
- if @skill.rage_boost > 0 or @skill.query_rage_boost > 0
- #--- 2nd Row -------------------------------------------
- y += WLH
- draw_icon(YE::BATTLE::RAGE_ICON, 0, y, true)
- num = @skill.rage_boost
- num = @skill.query_rage_boost if @skill.query_rage_boost > 0
- nt = sprintf(YE::MENU::SKILL::MSG_RAGE_VALUE,num)
- text = YE::MENU::SKILL::MSG_RAGE_BOOST
- draw_category(y, text, nt)
- end
- end
- y += WLH #--- 3rd Row -------------------------------------------
- draw_icon(YE::MENU::SKILL::ICON_PHYS, 0, y, true)
- text = YE::MENU::SKILL::MSG_MISC_PHYS
- if @skill.physical_attack or @skill.query_physical
- nt = YE::MENU::SKILL::MSG_MISC_YES
- else
- nt = YE::MENU::SKILL::MSG_MISC_NO
- end
- draw_category(y, text, nt)
- y += WLH #--- 4th Row -------------------------------------------
- draw_icon(YE::MENU::SKILL::ICON_MPDMG, 0, y, true)
- text = YE::MENU::SKILL::MSG_MISC_MPDMG
- if @skill.damage_to_mp or @skill.query_mpdamage
- nt = YE::MENU::SKILL::MSG_MISC_YES
- else
- nt = YE::MENU::SKILL::MSG_MISC_NO
- end
- draw_category(y, text, nt)
- y += WLH #--- 5th Row -------------------------------------------
- draw_icon(YE::MENU::SKILL::ICON_ABSORB, 0, y, true)
- text = YE::MENU::SKILL::MSG_MISC_ABSORB
- if @skill.absorb_damage or @skill.query_absorb
- nt = YE::MENU::SKILL::MSG_MISC_YES
- else
- nt = YE::MENU::SKILL::MSG_MISC_NO
- end
- draw_category(y, text, nt)
- y += WLH #--- 6th Row -------------------------------------------
- draw_icon(YE::MENU::SKILL::ICON_IGDEF, 0, y, true)
- text = YE::MENU::SKILL::MSG_MISC_IGDEF
- if @skill.ignore_defense or @skill.query_ignore_def
- nt = YE::MENU::SKILL::MSG_MISC_YES
- else
- nt = YE::MENU::SKILL::MSG_MISC_NO
- end
- draw_category(y, text, nt)
- end #end def
- #--------------------------------------------------------------------------
- # make element page
- #--------------------------------------------------------------------------
- def make_element_page
- self.contents.font.size = Font.default_size
- self.contents.font.color.alpha = 255
- self.contents.font.color = normal_color
- y = WLH
- self.contents.font.color = text_color(@category_colour)
- text = YE::MENU::SKILL::MSG_ELEMENTS
- self.contents.draw_text(0, y, 240, WLH, text, 1)
- y += WLH
- ix = 0
- element_list = YE::MENU::SKILL::SHOWN_ELEMENTS
- element_set = @skill.element_set
- element_set += @skill.query_add_elements
- element_set.uniq
- element_set -= @skill.query_sub_elements
- element_set.uniq
- for ele in element_list
- if element_set.include?(ele)
- icon = YE::MENU::SKILL::ELEMENT_ICONS[ele]
- draw_icon(icon, ix, y, true)
- if ix == 216
- ix = 0
- y += WLH
- else
- ix += 24
- end
- end
- end
- y += WLH
- end #end def
- #--------------------------------------------------------------------------
- # make status page
- #--------------------------------------------------------------------------
- def make_status_page
- self.contents.font.size = Font.default_size
- self.contents.font.color.alpha = 255
- self.contents.font.color = normal_color
- y = 0
- ix = 0
- state_add_list = []
- state_add_list += @skill.plus_state_set
- state_add_list += @skill.query_add_state_apply
- state_add_list -= @skill.query_sub_state_apply
- state_add_list = invisible_states(state_add_list)
- state_add_list.uniq
- state_add_list.sort{ |ax,ay| ay <=> ax }
- state_sub_list = []
- state_sub_list += @skill.minus_state_set
- state_sub_list += @skill.query_add_state_erase
- state_sub_list -= @skill.query_sub_state_erase
- state_sub_list = invisible_states(state_sub_list)
- state_sub_list.uniq
- state_sub_list.sort{ |ax,ay| ay <=> ax }
- if state_add_list != [] and !@skill.query_hide_state_apply
- y += WLH
- ix = 0
- self.contents.font.color = text_color(@category_colour)
- text = YE::MENU::SKILL::MSG_STATUS_ADD
- self.contents.draw_text(0, y, 240, WLH, text, 1)
- y += WLH
- for state_id in state_add_list
- icon = $data_states[state_id].icon_index
- unless icon == 0
- draw_icon(icon, ix, y)
- if ix == 216
- ix = 0
- y += WLH
- else
- ix += 24
- end
- end
- end
- end
- if state_sub_list != [] and !@skill.query_hide_state_erase
- y += WLH
- ix = 0
- self.contents.font.color = text_color(@category_colour)
- text = YE::MENU::SKILL::MSG_STATUS_SUB
- self.contents.draw_text(0, y, 240, WLH, text, 1)
- y += WLH
- for state_id in state_sub_list
- icon = $data_states[state_id].icon_index
- unless icon == 0
- draw_icon(icon, ix, y)
- if ix == 216
- ix = 0
- y += WLH
- else
- ix += 24
- end
- end
- end
- end
- end #end def
- #--------------------------------------------------------------------------
- # 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 jp page
- #--------------------------------------------------------------------------
- def make_jp_page
- self.contents.font.size = Font.default_size
- self.contents.font.color.alpha = 255
- sw = self.width - 32
- y = WLH #--- 1st Row -------------------------------------------
- icon = YE::SUBCLASS::JP_ICON
- draw_icon(icon, 0, y)
- text = YE::MENU::SKILL::TEXT_JP_COST
- self.contents.font.color = text_color(@category_colour)
- self.contents.draw_text(24, y, sw-104, WLH, text, 0)
- self.contents.font.color = normal_color
- text = sprintf(YE::SUBCLASS::JP_DEFINITION, @skill.jp_cost)
- self.contents.draw_text(sw-80, y, 80, WLH, text, 2)
- #------------------------------------------------------------------------
- if @skill.require_level > 0
- y += WLH
- icon = YE::SUBCLASS::JP_ICON
- draw_icon(icon, 0, y)
- self.contents.font.color = text_color(@category_colour)
- text = YE::MENU::SKILL::TEXT_LVL_REQ
- self.contents.draw_text(24, y, sw-104, WLH, text, 0)
- self.contents.font.color = normal_color
- text = sprintf(YE::SUBCLASS::REQUIRE_LEVEL, @skill.require_level)
- self.contents.draw_text(sw-80, y, 80, WLH, text, 2)
- end
- #------------------------------------------------------------------------
- if @skill.require_skill != []
- y += WLH
- self.contents.font.color = text_color(@category_colour)
- text = YE::MENU::SKILL::TEXT_SKILL_R
- self.contents.draw_text(0, y, sw, WLH, text, 1)
- self.contents.font.color = normal_color
- y += WLH
- for skill_id in @skill.require_skill
- skill = $data_skills[skill_id]
- icon = skill.icon_index
- draw_icon(icon, 0, y)
- text = skill.name
- self.contents.draw_text(24, y, sw-104, WLH, text, 0)
- if skill.jp_cost > 0
- text = sprintf(YE::SUBCLASS::JP_DEFINITION, skill.jp_cost)
- self.contents.draw_text(sw-80, y, 80, WLH, text, 2)
- end
- y += WLH
- end
- end
- end #end def
- #--------------------------------------------------------------------------
- # make equip slot page
- #--------------------------------------------------------------------------
- def make_equip_slot_page
- self.contents.font.size = Font.default_size
- self.contents.font.color.alpha = 255
- sw = self.width - 32
- y = WLH
- self.contents.font.color = text_color(@category_colour)
- for i in 0..5
- icon = YE::EQUIPSKILL::STAT_ICONS[i]
- draw_icon(icon, 0, y)
- text = YE::EQUIPSKILL::STAT_PARAM[i]
- self.contents.draw_text(24, y, sw/2-24, WLH, text, 0)
- y += WLH
- end
- y = WLH
- for i in 0..5
- case i
- when 0; value1 = @skill.equip_hp_per; value2 = @skill.equip_hp_set
- when 1; value1 = @skill.equip_mp_per; value2 = @skill.equip_mp_set
- when 2; value1 = @skill.equip_atk_per; value2 = @skill.equip_atk_set
- when 3; value1 = @skill.equip_def_per; value2 = @skill.equip_def_set
- when 4; value1 = @skill.equip_spi_per; value2 = @skill.equip_spi_set
- when 5; value1 = @skill.equip_agi_per; value2 = @skill.equip_agi_set
- end
- value1 -= 100
- if value1 > 0
- self.contents.font.color = power_up_color
- elsif value1 < 0
- self.contents.font.color = power_down_color
- else
- self.contents.font.color = normal_color
- end
- text = sprintf("%+d%%", value1)
- self.contents.draw_text(sw/2, y, sw/4, WLH, text, 2)
- if value2 > 0
- self.contents.font.color = power_up_color
- elsif value2 < 0
- self.contents.font.color = power_down_color
- else
- self.contents.font.color = normal_color
- end
- text = sprintf("%+d", value2)
- self.contents.draw_text(sw*3/4, y, sw/4, WLH, text, 2)
- y += WLH
- end
- end # end def
- #--------------------------------------------------------------------------
- # make notes page
- #--------------------------------------------------------------------------
- def make_notes_page
- self.contents.font.color.alpha = 255
- self.contents.font.size = YE::MENU::SKILL::NOTE_PAGE_TEXT_SIZE
- self.contents.font.color = text_color(YE::MENU::SKILL::NOTE_PAGE_TEXT_COLOUR)
- y = 24
- txsize = YE::MENU::SKILL::NOTE_PAGE_TEXT_SIZE + 4
- text = YE::HASH::SKILL_NOTES[@skill.id]
- nwidth = YE::MENU::SKILL::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
- #--------------------------------------------------------------------------
- # total pages
- #--------------------------------------------------------------------------
- def create_total_pages
- @contents = []
- @contents.push(0) if YE::MENU::SKILL::SHOW_PAGE_GEN
- @contents.push(1) if YE::MENU::SKILL::SHOW_PAGE_COSTS
- #----------------
- if @skill.base_damage != 0 or @skill.query_basedmg != 0
- @contents.push(2) if YE::MENU::SKILL::SHOW_PAGE_DMG
- end
- #----------------
- if $imported["BattlerStatAggro"] and YE::MENU::SKILL::SHOW_PAGE_AGGRO
- if @skill.aggro_set > 0 and !@skill.query_hide_aggro
- @contents.push(3)
- elsif @skill.aggro_add > 0 and !@skill.query_hide_aggro
- @contents.push(3)
- elsif @skill.aggro_sub > 0 and !@skill.query_hide_aggro
- @contents.push(3)
- elsif @skill.aggro_mul > 0 and !@skill.query_hide_aggro
- @contents.push(3)
- elsif @skill.aggro_div > 0 and !@skill.query_hide_aggro
- @contents.push(3)
- elsif @skill.grudge_set > 0 and !@skill.query_hide_grudge
- @contents.push(3)
- elsif @skill.grudge_add > 0 and !@skill.query_hide_grudge
- @contents.push(3)
- elsif @skill.grudge_sub > 0 and !@skill.query_hide_grudge
- @contents.push(3)
- elsif @skill.grudge_mul > 0 and !@skill.query_hide_grudge
- @contents.push(3)
- elsif @skill.grudge_div > 0 and !@skill.query_hide_grudge
- @contents.push(3)
- end
- end
- #----------------
- if YE::MENU::SKILL::SHOW_PAGE_ELEM and !@skill.query_hide_elements
- element_list = YE::MENU::SKILL::SHOWN_ELEMENTS
- element_set = @skill.element_set
- element_set += @skill.query_add_elements
- element_set.uniq
- element_set -= @skill.query_sub_elements
- element_set.uniq
- for ele in element_list
- if element_set.include?(ele)
- @contents.push(4)
- break
- end
- end
- end
- #----------------
- if YE::MENU::SKILL::SHOW_PAGE_STATUS
- state_show = false
- if !@skill.query_hide_state_apply
- state_list = []
- state_list += @skill.plus_state_set
- state_list += @skill.query_add_state_apply
- state_list -= @skill.query_sub_state_apply
- state_list = invisible_states(state_list)
- state_show = true if state_list != []
- end
- if !@skill.query_hide_state_erase
- state_list = []
- state_list += @skill.minus_state_set
- state_list += @skill.query_add_state_erase
- state_list -= @skill.query_sub_state_erase
- state_list = invisible_states(state_list)
- state_show = true if state_list != []
- end
- @contents.push(5) if state_show
- end
- #----------------
- if YE::MENU::SKILL::SHOW_JP_PAGE and $imported["SubclassSelectionSystem"]
- if @skill.jp_cost > 0 and YE::SUBCLASS::USE_JP_SYSTEM
- @contents.push(10)
- end
- end
- #----------------
- if YE::MENU::SKILL::SHOW_EQUIP_STATS and $imported["EquipSkillSlots"]
- @contents.push(15)
- end
- #----------------
- @contents.push(90) if YE::MENU::SKILL::SHOW_PAGE_MISC
- #----------------
- if YE::MENU::SKILL::SHOW_PAGE_NOTES
- if YE::HASH::SKILL_NOTES.include?(@skill.id)
- @contents.push(100)
- end
- end
- #----------------
- n = @contents.size
- return n
- end
- #--------------------------------------------------------------------------
- # case_page_name
- #--------------------------------------------------------------------------
- def case_page_name(pagecase)
- text = YE::MENU::SKILL::TITLE_UNKNOWN
- case pagecase
- when 0
- text = YE::MENU::SKILL::TITLE_GENERAL
- when 1
- text = YE::MENU::SKILL::TITLE_SKILL_COST
- when 2
- if @skill.base_damage < 0 or @skill.query_basedmg < 0
- text = YE::MENU::SKILL::TITLE_HEALING
- else
- text = YE::MENU::SKILL::TITLE_DAMAGE
- end
- when 3
- text = YE::MENU::SKILL::TITLE_AGGRO
- when 4
- text = YE::MENU::SKILL::TITLE_ELEMENTS
- when 5
- text = YE::MENU::SKILL::TITLE_STATUS
- when 10
- text = YE::MENU::SKILL::TITLE_JP
- when 15
- text = YE::MENU::SKILL::TITLE_EQUIP_STATS
- when 90
- text = YE::MENU::SKILL::TITLE_MISC
- when 100
- text = @skill.name#YE::MENU::SKILL::TITLE_NOTES #PENTA
- end
- return text
- end
- #--------------------------------------------------------------------------
- # case_page_run
- #--------------------------------------------------------------------------
- def case_page_run(pagecase)
- case pagecase
- when 0
- make_first_page
- when 1
- make_cost_page
- when 2
- make_dmg_page
- when 3
- make_aggro_page
- when 4
- make_element_page
- when 5
- make_status_page
- when 10
- make_jp_page
- when 15
- make_equip_slot_page
- when 90
- make_misc_page
- when 100
- make_notes_page
- end
- end
- end
- #===============================================================================
- #
- # END OF FILE
- #
- #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement