设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 3847|回复: 8
打印 上一主题 下一主题

[已经解决] 怎么才能百分比耗蓝

[复制链接]

Lv3.寻梦者

梦石
0
星屑
3558
在线时间
1058 小时
注册时间
2009-10-3
帖子
185
跳转到指定楼层
1
 楼主| 发表于 2013-2-26 15:28:21 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
RT
怎么样才能使MP消耗百分比化。
比如说10%耗蓝
1 级  Maxmp500   耗蓝50
20级   Maxmp1000   耗蓝100

请教一下了  这个该怎么弄
自己给自己挖了一个坑,然后掉下去的我,竟然爬不上来了,呵呵(NMB)。

Lv2.观梦者

梦石
0
星屑
665
在线时间
194 小时
注册时间
2012-6-1
帖子
720
2
发表于 2013-2-26 15:53:20 | 只看该作者
事件消耗
死亡
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
567
在线时间
465 小时
注册时间
2009-10-11
帖子
407
3
发表于 2013-2-26 16:02:02 | 只看该作者
http://yanflychannel.wordpress.c ... skill-cost-manager/
腳本的話~我認為你可以參考看看!
因为现实太残酷、所以我们都在打造虚幻的天堂。如果现实不再残酷,也是因为有这快乐的天堂。
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3558
在线时间
1058 小时
注册时间
2009-10-3
帖子
185
4
 楼主| 发表于 2013-2-26 20:01:51 | 只看该作者
a000b1745 发表于 2013-2-26 16:02
http://yanflychannel.wordpress.com/rmvxa/gameplay-scripts/skill-cost-manager/
腳本的話~我認為你可以 ...

打不开~~~肿么办
自己给自己挖了一个坑,然后掉下去的我,竟然爬不上来了,呵呵(NMB)。
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
567
在线时间
465 小时
注册时间
2009-10-11
帖子
407
5
发表于 2013-2-27 02:27:49 | 只看该作者
[pre lang="ruby" line="1" file="腳本"]#==============================================================================
#
# ▼ Yanfly Engine Ace - Skill Cost Manager v1.03
# -- Last Updated: 2012.01.23
# -- Level: Normal, Hard, Lunatic
# -- Requires: n/a
#
#==============================================================================

$imported = {} if $imported.nil?
$imported["YEA-SkillCostManager"] = true

#==============================================================================
# ▼ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2012.08.06 - Restore SP-Paramater: TCR
# 2012.01.23 - Compatibility Update: Doppelganger
# 2011.12.11 - Started Script and Finished.
#            - Added max and min notetags.
#
#==============================================================================
# ▼ Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script adds more functionality towards skill costs. Skills can now cost
# HP, more MP, more TP, gold, and even have custom costs. The way the skill
# costs are drawn in the display windows are changed to deliver more effective
# and reliable information to the player. And if four skill costs aren't enough
# to satisfy you, you can even make your own custom skill costs.
#
#==============================================================================
# ▼ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
#
# -----------------------------------------------------------------------------
# Actor Notetags - These notetags go in the actors notebox in the database.
# -----------------------------------------------------------------------------
# <hp cost rate: x%>
# Allows the actor to drop the HP cost of skills to x%.
#
# <tp cost rate: x%>
# Allows the actor to drop the TP cost of skills to x%.
#
# <gold cost rate: x%>
# Allows the actor to drop the Gold cost of skills to x%.
#
# -----------------------------------------------------------------------------
# Class Notetags - These notetags go in the class notebox in the database.
# -----------------------------------------------------------------------------
# <hp cost rate: x%>
# Allows the class to drop the HP cost of skills to x%.
#
# <tp cost rate: x%>
# Allows the class to drop the TP cost of skills to x%.
#
# <gold cost rate: x%>
# Allows the class to drop the Gold cost of skills to x%.
#
# -----------------------------------------------------------------------------
# Skill Notetags - These notetags go in the skills notebox in the database.
# -----------------------------------------------------------------------------
# <hp cost: x>
# Sets the skill's HP cost to x. This function did not exist by default in
# RPG Maker VX Ace.
#
# <hp cost: x%>
# Sets the HP cost to a percentage of the actor's MaxHP. If a normal HP cost is
# present on the skill, too, then this value is added to the HP cost.
#
# <hp cost max: x>
# <hp cost min: x>
# Sets the maximum and minimum range of the HP Cost of the skill. If you do not
# use this tag, there will be no maximum and/or minimum range.
#
# <mp cost: x>
# Sets the skill's MP cost to x. Allows MP cost to exceed 9999, which is RPG
# Maker VX Ace's database editor's maximum limit.
#
# <mp cost: x%>
# Sets the MP cost to a percentage of the actor's MaxMP. If a normal MP cost is
# present on the skill, too, then this value is added to the MP cost.
#
# <mp cost max: x>
# <mp cost min: x>
# Sets the maximum and minimum range of the MP Cost of the skill. If you do not
# use this tag, there will be no maximum and/or minimum range.
#
# <tp cost: x>
# Sets the skill's TP cost to x. Allows TP cost to exceed 100, which is RPG
# Maker VX Ace's database editor's maximum limit.
#
# <tp cost: x%>
# Sets the TP cost to a percentage of the actor's MaxTP. If a normal TP cost is
# present on the skill, too, then this value is added to the TP cost.
#
# <tp cost max: x>
# <tp cost min: x>
# Sets the maximum and minimum range of the TP Cost of the skill. If you do not
# use this tag, there will be no maximum and/or minimum range.
#
# <gold cost: x>
# Sets the skill's gold cost to x. Enemies with skills that cost gold do not
# use gold. If the player does not have enough gold, the skill can't be used.
#
# <gold cost: x%>
# Sets the skill's gold cost equal to a percentage of the party's total gold.
# If both a regular gold cost and a percentile gold cost is used, the total of
# both values will be the skill's gold cost.
#
# <gold cost max: x>
# <gold cost min: x>
# Sets the maximum and minimum range of the Gold Cost of the skill. If you do
# not use this tag, there will be no maximum and/or minimum range.
#
# --- Making Your Own Custom Costs ---
#
# <custom cost: string>
# If you decide to have a custom cost for your game, insert this notetag to
# change what displays in the skill menu visually.
#
# <custom cost colour: x>
# This is the "Window" skin text colour used for the custom cost. By default,
# it is text colour 0, which is the white colour.
#
# <custom cost size: x>
# This is the text font size used for the custom cost in the display windows.
# By default, it is font size 20.
#
# <custom cost icon: x>
# If you wish to use an icon for your custom cost, replace x with the icon ID
# you wish to show in display windows. By default, it is 0 (and not shown).
#
# <custom cost requirement>
#  string
#  string
# </custom cost requirement>
# Sets the custom cost requirement of the skill with an eval function using the
# strings in between. The strings are a part of one line even if in the notebox
# they are on separate lines.
#
# <custom cost perform>
#  string
#  string
# </custom cost perform>
# Sets how the custom cost payment is done with an eval function using the
# strings in between. The strings are a part of one line even if in the notebox
# they are on separate lines.
#
# -----------------------------------------------------------------------------
# Weapon Notetags - These notetags go in the weapons notebox in the database.
# -----------------------------------------------------------------------------
# <hp cost rate: x%>
# Allows the weapon to drop the HP cost of skills to x% when worn.
#
# <tp cost rate: x%>
# Allows the weapon to drop the TP cost of skills to x% when worn.
#
# <gold cost rate: x%>
# Allows the weapon to drop the Gold cost of skills to x% when worn.
#
# -----------------------------------------------------------------------------
# Armour Notetags - These notetags go in the armours notebox in the database.
# -----------------------------------------------------------------------------
# <hp cost rate: x%>
# Allows the armour to drop the HP cost of skills to x% when worn.
#
# <tp cost rate: x%>
# Allows the armour to drop the TP cost of skills to x% when worn.
#
# <gold cost rate: x%>
# Allows the armour to drop the TP cost of skills to x% when worn.
#
# -----------------------------------------------------------------------------
# Enemy Notetags - These notetags go in the enemies notebox in the database.
# -----------------------------------------------------------------------------
# <hp cost rate: x%>
# Allows the enemy to drop the HP cost of skills to x%.
#
# <tp cost rate: x%>
# Allows the enemy to drop the TP cost of skills to x%.
#
# -----------------------------------------------------------------------------
# State Notetags - These notetags go in the states notebox in the database.
# -----------------------------------------------------------------------------
# <hp cost rate: x%>
# Allows the state to drop the HP cost of skills to x% when afflicted.
#
# <tp cost rate: x%>
# Allows the state to drop the TP cost of skills to x% when afflicted.
#
# <gold cost rate: x%>
# Allows the state to drop the Gold cost of skills to x% when afflicted.
#
#==============================================================================
# ▼ Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
# it will run with RPG Maker VX without adjusting.
#
#==============================================================================

module YEA
  module SKILL_COST
   
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - HP Cost Settings -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # New to this script are HP costs. HP costs require the battler to have
    # sufficient HP before being able to use the skill. The text colour that's
    # used, the suffix, or whether or not to use an icon. If you do not wish
    # to use an icon, set the icon to 0.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    HP_COST_COLOUR = 21         # Colour used from "Window" skin.
    HP_COST_SIZE   = 20         # Font size used for HP costs.
    HP_COST_SUFFIX = "%sHP"     # Suffix used for HP costs.
    HP_COST_ICON   = 0          # Icon used for HP costs. Set 0 to disable.
   
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - MP Cost Settings -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # Here, you can change the settings for MP costs: the text colour that's
    # used, the suffix, or whether or not to use an icon. If you do not wish
    # to use an icon, set the icon to 0.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    MP_COST_COLOUR = 23         # Colour used from "Window" skin. Default: 23
    MP_COST_SIZE   = 20         # Font size used for MP costs. Default: 24
    MP_COST_SUFFIX = "%sMP"     # Suffix used for MP costs. No suffix default.
    MP_COST_ICON   = 0          # Icon used for MP costs. Set 0 to disable.
   
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - TP Cost Settings -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # Here, you can change the settings for TP costs: the text colour that's
    # used, the suffix, or whether or not to use an icon. If you do not wish
    # to use an icon, set the icon to 0.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    TP_COST_COLOUR = 2          # Colour used from "Window" skin. Default: 29
    TP_COST_SIZE   = 20         # Font size used for TP costs. Default: 24
    TP_COST_SUFFIX = "%sTP"     # Suffix used for TP costs. No suffix default.
    TP_COST_ICON   = 0          # Icon used for TP costs. Set 0 to disable.
   
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Gold Cost Settings -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # New to this script are Gold costs. Gold costs require the party to have
    # enough gold before being able to use the skill. The text colour that's
    # used, the suffix, or whether or not to use an icon. If you do not wish
    # to use an icon, set the icon to 0.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    GOLD_COST_COLOUR = 6          # Colour used from "Window" skin.
    GOLD_COST_SIZE   = 20         # Font size used for Gold costs.
    GOLD_COST_SUFFIX = "%sGold"   # Suffix used for Gold costs.
    GOLD_COST_ICON   = 0          # Icon used for Gold costs. Set 0 to disable.
   
  end # SKILL_COST
end # YEA

#==============================================================================
# ▼ Editting anything past this point may potentially result in causing
# computer damage, incontinence, explosion of user's head, coma, death, and/or
# halitosis so edit at your own risk.
#==============================================================================

module YEA
  module REGEXP
  module BASEITEM
   
    HP_COST_RATE = /<(?:HP_COST_RATE|hp cost rate):[ ](\d+)([%%])>/i
    TP_COST_RATE = /<(?:TP_COST_RATE|tp cost rate):[ ](\d+)([%%])>/i
    GOLD_COST_RATE = /<(?:GOLD_COST_RATE|gold cost rate):[ ](\d+)([%%])>/i
   
  end # BASEITEM
  module SKILL
   
    HP_COST_SET = /<(?:HP_COST|hp cost):[ ](\d+)>/i
    HP_COST_PER = /<(?:HP_COST|hp cost):[ ](\d+)([%%])>/i
    MP_COST_SET = /<(?:MP_COST|mp cost):[ ](\d+)>/i
    MP_COST_PER = /<(?:MP_COST|mp cost):[ ](\d+)([%%])>/i
    TP_COST_SET = /<(?:TP_COST|tp cost):[ ](\d+)>/i
    TP_COST_PER = /<(?:TP_COST|tp cost):[ ](\d+)([%%])>/i
    GOLD_COST_SET = /<(?:GOLD_COST|gold cost):[ ](\d+)>/i
    GOLD_COST_PER = /<(?:GOLD_COST|gold cost):[ ](\d+)([%%])>/i
   
    CUSTOM_COST_TEXT = /<(?:CUSTOM_COST|custom cost):[ ](.*)>/i
    CUSTOM_COST_COLOUR =
      /<(?:CUSTOM_COST_COLOUR|custom cost colour|custom cost color):[ ](\d+)>/i
    CUSTOM_COST_SIZE = /<(?:CUSTOM_COST_SIZE|custom cost size):[ ](\d+)>/i
    CUSTOM_COST_ICON = /<(?:CUSTOM_COST_ICON|custom cost icon):[ ](\d+)>/i
    CUSTOM_COST_REQUIREMENT_ON =
      /<(?:CUSTOM_COST_REQUIREMENT|custom cost requirement)>/i
    CUSTOM_COST_REQUIREMENT_OFF =
      /<\/(?:CUSTOM_COST_REQUIREMENT|custom cost requirement)>/i
    CUSTOM_COST_PERFORM_ON =
      /<(?:CUSTOM_COST_PERFORM|custom cost perform)>/i
    CUSTOM_COST_PERFORM_OFF =
      /<\/(?:CUSTOM_COST_PERFORM|custom cost perform)>/i
   
    HP_COST_MIN = /<(?:HP_COST_MIN|hp cost min):[ ](\d+)>/i
    HP_COST_MAX = /<(?:HP_COST_MIN|hp cost max):[ ](\d+)>/i
    MP_COST_MIN = /<(?:MP_COST_MIN|mp cost min):[ ](\d+)>/i
    MP_COST_MAX = /<(?:MP_COST_MIN|mp cost max):[ ](\d+)>/i
    TP_COST_MIN = /<(?:TP_COST_MIN|tp cost min):[ ](\d+)>/i
    TP_COST_MAX = /<(?:TP_COST_MIN|tp cost max):[ ](\d+)>/i
    GOLD_COST_MIN = /<(?:GOLD_COST_MIN|gold cost min):[ ](\d+)>/i
    GOLD_COST_MAX = /<(?:GOLD_COST_MIN|gold cost max):[ ](\d+)>/i
   
  end # SKILL
  end # REGEXP
end # YEA

#==============================================================================
# ■ Icon
#==============================================================================

module Icon
  
  #--------------------------------------------------------------------------
  # self.mp_cost
  #--------------------------------------------------------------------------
  def self.mp_cost; return YEA::SKILL_COST::MP_COST_ICON; end
  
  #--------------------------------------------------------------------------
  # self.tp_cost
  #--------------------------------------------------------------------------
  def self.tp_cost; return YEA::SKILL_COST::TP_COST_ICON; end
  
  #--------------------------------------------------------------------------
  # self.hp_cost
  #--------------------------------------------------------------------------
  def self.hp_cost; return YEA::SKILL_COST::HP_COST_ICON; end
  
  #--------------------------------------------------------------------------
  # self.gold_cost
  #--------------------------------------------------------------------------
  def self.gold_cost; return YEA::SKILL_COST::GOLD_COST_ICON; end
   
end # Icon

#==============================================================================
# ■ Numeric
#==============================================================================

class Numeric
  
  #--------------------------------------------------------------------------
  # new method: group_digits
  #--------------------------------------------------------------------------
  unless $imported["YEA-CoreEngine"]
  def group; return self.to_s; end
  end # $imported["YEA-CoreEngine"]
   
end # Numeric

#==============================================================================
# ■ DataManager
#==============================================================================

module DataManager
  
  #--------------------------------------------------------------------------
  # alias method: load_database
  #--------------------------------------------------------------------------
  class <<self; alias load_database_scm load_database; end
  def self.load_database
    load_database_scm
    load_notetags_scm
  end
  
  #--------------------------------------------------------------------------
  # new method: load_notetags_scm
  #--------------------------------------------------------------------------
  def self.load_notetags_scm
    groups = [$data_actors, $data_classes, $data_skills, $data_weapons,
      $data_armors, $data_enemies, $data_states]
    for group in groups
      for obj in group
        next if obj.nil?
        obj.load_notetags_scm
      end
    end
  end
  
end # DataManager

#==============================================================================
# ■ RPG::BaseItem
#==============================================================================

class RPG::BaseItem
  
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :tp_cost_rate
  attr_accessor :hp_cost_rate
  attr_accessor :gold_cost_rate
  
  #--------------------------------------------------------------------------
  # common cache: load_notetags_scm
  #--------------------------------------------------------------------------
  def load_notetags_scm
    @tp_cost_rate = 1.0
    @hp_cost_rate = 1.0
    @gold_cost_rate = 1.0
    #---
    self.note.split(/[\r\n]+/).each { |line|
      case line
      #---
      when YEA::REGEXP::BASEITEM::TP_COST_RATE
        @tp_cost_rate = $1.to_i * 0.01
      when YEA::REGEXP::BASEITEM::HP_COST_RATE
        @hp_cost_rate = $1.to_i * 0.01
      when YEA::REGEXP::BASEITEM::GOLD_COST_RATE
        @gold_cost_rate = $1.to_i * 0.01
      #---
      end
    } # self.note.split
    #---
  end
  
end # RPG::BaseItem

#==============================================================================
# ■ RPG::Skill
#==============================================================================

class RPG::Skill < RPG::UsableItem
  
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :hp_cost
  attr_accessor :hp_cost_percent
  attr_accessor :mp_cost_percent
  attr_accessor :tp_cost_percent
  attr_accessor :gold_cost
  attr_accessor :gold_cost_percent
  
  attr_accessor :hp_cost_min
  attr_accessor :hp_cost_max
  attr_accessor :mp_cost_min
  attr_accessor :mp_cost_max
  attr_accessor :tp_cost_min
  attr_accessor :tp_cost_max
  attr_accessor :gold_cost_min
  attr_accessor :gold_cost_max
  
  attr_accessor :use_custom_cost
  attr_accessor :custom_cost_text
  attr_accessor :custom_cost_colour
  attr_accessor :custom_cost_size
  attr_accessor :custom_cost_icon
  attr_accessor :custom_cost_requirement
  attr_accessor :custom_cost_perform
  
  #--------------------------------------------------------------------------
  # common cache: load_notetags_scm
  #--------------------------------------------------------------------------
  def load_notetags_scm
    @hp_cost = 0
    @gold_cost = 0
    @hp_cost_percent = 0.0
    @mp_cost_percent = 0.0
    @tp_cost_percent = 0.0
    @gold_cost_percent = 0.0
   
    @custom_cost_text = "0"
    @custom_cost_colour = 0
    @custom_cost_size = 20
    @custom_cost_icon = 0
    @custom_cost_requirement = ""
    @custom_cost_perform = ""
   
    @use_custom_cost = false
    @custom_cost_req_on = false
    @custom_cost_per_on = false
    #---
    self.note.split(/[\r\n]+/).each { |line|
      case line
      #---
      when YEA::REGEXP::SKILL::MP_COST_SET
        @mp_cost = $1.to_i
      when YEA::REGEXP::SKILL::MP_COST_PER
        @mp_cost_percent = $1.to_i * 0.01
      when YEA::REGEXP::SKILL::TP_COST_SET
        @tp_cost = $1.to_i
      when YEA::REGEXP::SKILL::TP_COST_PER
        @tp_cost_percent = $1.to_i * 0.01
      when YEA::REGEXP::SKILL::HP_COST_SET
        @hp_cost = $1.to_i
      when YEA::REGEXP::SKILL::HP_COST_PER
        @hp_cost_percent = $1.to_i * 0.01
      when YEA::REGEXP::SKILL::GOLD_COST_SET
        @gold_cost = $1.to_i
      when YEA::REGEXP::SKILL::GOLD_COST_PER
        @gold_cost_percent = $1.to_i * 0.01
      #---
      when YEA::REGEXP::SKILL::HP_COST_MIN
        @hp_cost_min = $1.to_i
      when YEA::REGEXP::SKILL::HP_COST_MAX
        @hp_cost_max = $1.to_i
      when YEA::REGEXP::SKILL::MP_COST_MIN
        @mp_cost_min = $1.to_i
      when YEA::REGEXP::SKILL::MP_COST_MAX
        @mp_cost_max = $1.to_i
      when YEA::REGEXP::SKILL::TP_COST_MIN
        @tp_cost_min = $1.to_i
      when YEA::REGEXP::SKILL::TP_COST_MAX
        @tp_cost_max = $1.to_i
      when YEA::REGEXP::SKILL::GOLD_COST_MIN
        @gold_cost_min = $1.to_i
      when YEA::REGEXP::SKILL::GOLD_COST_MAX
        @gold_cost_max = $1.to_i
      #---
      when YEA::REGEXP::SKILL::CUSTOM_COST_TEXT
        @custom_cost_text = $1.to_s
      when YEA::REGEXP::SKILL::CUSTOM_COST_COLOUR
        @custom_cost_colour = $1.to_i
      when YEA::REGEXP::SKILL::CUSTOM_COST_SIZE
        @custom_cost_size = $1.to_i
      when YEA::REGEXP::SKILL::CUSTOM_COST_ICON
        @custom_cost_icon = $1.to_i
      when YEA::REGEXP::SKILL::CUSTOM_COST_REQUIREMENT_ON
        @custom_cost_req_on = true
        @use_custom_cost = true
      when YEA::REGEXP::SKILL::CUSTOM_COST_REQUIREMENT_OFF
        @custom_cost_req_on = false
        @use_custom_cost = true
      when YEA::REGEXP::SKILL::CUSTOM_COST_PERFORM_ON
        @custom_cost_per_on = true
        @use_custom_cost = true
      when YEA::REGEXP::SKILL::CUSTOM_COST_PERFORM_OFF
        @custom_cost_per_on = false
        @use_custom_cost = true
      else
        @custom_cost_requirement += line.to_s if @custom_cost_req_on
        @custom_cost_perform += line.to_s if @custom_cost_per_on
      #---
      end
    } # self.note.split
    #---
  end
  
end # RPG::Skill

#==============================================================================
# ■ Game_BattlerBase
#==============================================================================

class Game_BattlerBase
  
  #--------------------------------------------------------------------------
  # alias method: skill_cost_payable?
  #--------------------------------------------------------------------------
  alias game_battlerbase_skill_cost_payable_scm skill_cost_payable?
  def skill_cost_payable?(skill)
    return false if hp <= skill_hp_cost(skill)
    return false unless gold_cost_met?(skill)
    return false unless custom_cost_met?(skill)
    return game_battlerbase_skill_cost_payable_scm(skill)
  end
  
  #--------------------------------------------------------------------------
  # new method: gold_cost_met?
  #--------------------------------------------------------------------------
  def gold_cost_met?(skill)
    return true unless actor?
    return $game_party.gold >= skill_gold_cost(skill)
  end
  
  #--------------------------------------------------------------------------
  # new method: custom_cost_met?
  #--------------------------------------------------------------------------
  def custom_cost_met?(skill)
    return true unless skill.use_custom_cost
    return eval(skill.custom_cost_requirement)
  end
  
  #--------------------------------------------------------------------------
  # alias method: pay_skill_cost
  #--------------------------------------------------------------------------
  alias game_battlerbase_pay_skill_cost_scm pay_skill_cost
  def pay_skill_cost(skill)
    game_battlerbase_pay_skill_cost_scm(skill)
    self.hp -= skill_hp_cost(skill)
    $game_party.lose_gold(skill_gold_cost(skill)) if actor?
    pay_custom_cost(skill)
  end
  
  #--------------------------------------------------------------------------
  # new method: pay_custom_cost
  #--------------------------------------------------------------------------
  def pay_custom_cost(skill)
    return unless skill.use_custom_cost
    eval(skill.custom_cost_perform)
  end
  
  #--------------------------------------------------------------------------
  # alias method: skill_mp_cost
  #--------------------------------------------------------------------------
  alias game_battlerbase_skill_mp_cost_scm skill_mp_cost
  def skill_mp_cost(skill)
    n = game_battlerbase_skill_mp_cost_scm(skill)
    n += skill.mp_cost_percent * mmp * mcr
    n = [n.to_i, skill.mp_cost_max].min unless skill.mp_cost_max.nil?
    n = [n.to_i, skill.mp_cost_min].max unless skill.mp_cost_min.nil?
    return n.to_i
  end
  
  #--------------------------------------------------------------------------
  # alias method: skill_tp_cost
  #--------------------------------------------------------------------------
  alias game_battlerbase_skill_tp_cost_scm skill_tp_cost
  def skill_tp_cost(skill)
    n = game_battlerbase_skill_tp_cost_scm(skill) * tcr_y
    n += skill.tp_cost_percent * max_tp * tcr_y
    n = [n.to_i, skill.tp_cost_max].min unless skill.tp_cost_max.nil?
    n = [n.to_i, skill.tp_cost_min].max unless skill.tp_cost_min.nil?
    return n.to_i
  end
  
  #--------------------------------------------------------------------------
  # new method: tcr_y
  #--------------------------------------------------------------------------
  def tcr_y
    n = 1.0
    if actor?
      n *= self.actor.tp_cost_rate
      n *= self.class.tp_cost_rate
      for equip in equips
        next if equip.nil?
        n *= equip.tp_cost_rate
      end
    else
      n *= self.enemy.tp_cost_rate
      if $imported["YEA-Doppelganger"] && !self.class.nil?
        n *= self.class.tp_cost_rate
      end
    end
    for state in states
      next if state.nil?
      n *= state.tp_cost_rate
    end
    return n
  end
  
  #--------------------------------------------------------------------------
  # new method: skill_hp_cost
  #--------------------------------------------------------------------------
  def skill_hp_cost(skill)
    n = skill.hp_cost * hcr
    n += skill.hp_cost_percent * mhp * hcr
    n = [n.to_i, skill.hp_cost_max].min unless skill.hp_cost_max.nil?
    n = [n.to_i, skill.hp_cost_min].max unless skill.hp_cost_min.nil?
    return n.to_i
  end
  
  #--------------------------------------------------------------------------
  # new method: hcr
  #--------------------------------------------------------------------------
  def hcr
    n = 1.0
    if actor?
      n *= self.actor.hp_cost_rate
      n *= self.class.hp_cost_rate
      for equip in equips
        next if equip.nil?
        n *= equip.hp_cost_rate
      end
    else
      n *= self.enemy.hp_cost_rate
      if $imported["YEA-Doppelganger"] && !self.class.nil?
        n *= self.class.hp_cost_rate
      end
    end
    for state in states
      next if state.nil?
      n *= state.hp_cost_rate
    end
    return n
  end
  
  #--------------------------------------------------------------------------
  # new method: skill_gold_cost
  #--------------------------------------------------------------------------
  def skill_gold_cost(skill)
    n = skill.gold_cost * gcr
    n += skill.gold_cost_percent * $game_party.gold * gcr
    n = [n.to_i, skill.gold_cost_max].min unless skill.gold_cost_max.nil?
    n = [n.to_i, skill.gold_cost_min].max unless skill.gold_cost_min.nil?
    return n.to_i
  end
  
  #--------------------------------------------------------------------------
  # new method: gcr
  #--------------------------------------------------------------------------
  def gcr
    n = 1.0
    n *= self.actor.gold_cost_rate
    n *= self.class.gold_cost_rate
    for equip in equips
      next if equip.nil?
      n *= equip.gold_cost_rate
    end
    for state in states
      next if state.nil?
      n *= state.gold_cost_rate
    end
    return n
  end
  
end # Game_BattlerBase
  
#==============================================================================
# ■ Window_Base
#==============================================================================

class Window_Base < Window
  
  #--------------------------------------------------------------------------
  # overwrite methods: cost_colours
  #--------------------------------------------------------------------------
  def mp_cost_color; text_color(YEA::SKILL_COST::MP_COST_COLOUR); end;
  def tp_cost_color; text_color(YEA::SKILL_COST::TP_COST_COLOUR); end;
  def hp_cost_color; text_color(YEA::SKILL_COST::HP_COST_COLOUR); end;
  def gold_cost_color; text_color(YEA::SKILL_COST::GOLD_COST_COLOUR); end;
  
end # Window_Base

#==============================================================================
# ■ Window_SkillList
#==============================================================================

class Window_SkillList < Window_Selectable
  
  #--------------------------------------------------------------------------
  # overwrite method: draw_skill_cost
  #--------------------------------------------------------------------------
  def draw_skill_cost(rect, skill)
    draw_tp_skill_cost(rect, skill) unless $imported["YEA-BattleEngine"]
    draw_mp_skill_cost(rect, skill)
    draw_tp_skill_cost(rect, skill) if $imported["YEA-BattleEngine"]
    draw_hp_skill_cost(rect, skill)
    draw_gold_skill_cost(rect, skill)
    draw_custom_skill_cost(rect, skill)
  end
  
  #--------------------------------------------------------------------------
  # new method: draw_mp_skill_cost
  #--------------------------------------------------------------------------
  def draw_mp_skill_cost(rect, skill)
    return unless @actor.skill_mp_cost(skill) > 0
    change_color(mp_cost_color, enable?(skill))
    #---
    icon = Icon.mp_cost
    if icon > 0
      draw_icon(icon, rect.x + rect.width-24, rect.y, enable?(skill))
      rect.width -= 24
    end
    #---
    contents.font.size = YEA::SKILL_COST::MP_COST_SIZE
    cost = @actor.skill_mp_cost(skill)
    text = sprintf(YEA::SKILL_COST::MP_COST_SUFFIX, cost.group)
    draw_text(rect, text, 2)
    cx = text_size(text).width + 4
    rect.width -= cx
    reset_font_settings
  end
  
  #--------------------------------------------------------------------------
  # new method: draw_tp_skill_cost
  #--------------------------------------------------------------------------
  def draw_tp_skill_cost(rect, skill)
    return unless @actor.skill_tp_cost(skill) > 0
    change_color(tp_cost_color, enable?(skill))
    #---
    icon = Icon.tp_cost
    if icon > 0
      draw_icon(icon, rect.x + rect.width-24, rect.y, enable?(skill))
      rect.width -= 24
    end
    #---
    contents.font.size = YEA::SKILL_COST::TP_COST_SIZE
    cost = @actor.skill_tp_cost(skill)
    text = sprintf(YEA::SKILL_COST::TP_COST_SUFFIX, cost.group)
    draw_text(rect, text, 2)
    cx = text_size(text).width + 4
    rect.width -= cx
    reset_font_settings
  end
  
  #--------------------------------------------------------------------------
  # new method: draw_hp_skill_cost
  #--------------------------------------------------------------------------
  def draw_hp_skill_cost(rect, skill)
    return unless @actor.skill_hp_cost(skill) > 0
    change_color(hp_cost_color, enable?(skill))
    #---
    icon = Icon.hp_cost
    if icon > 0
      draw_icon(icon, rect.x + rect.width-24, rect.y, enable?(skill))
      rect.width -= 24
    end
    #---
    contents.font.size = YEA::SKILL_COST::HP_COST_SIZE
    cost = @actor.skill_hp_cost(skill)
    text = sprintf(YEA::SKILL_COST::HP_COST_SUFFIX, cost.group)
    draw_text(rect, text, 2)
    cx = text_size(text).width + 4
    rect.width -= cx
    reset_font_settings
  end
  
  #--------------------------------------------------------------------------
  # new method: draw_gold_skill_cost
  #--------------------------------------------------------------------------
  def draw_gold_skill_cost(rect, skill)
    return unless @actor.skill_gold_cost(skill) > 0
    change_color(gold_cost_color, enable?(skill))
    #---
    icon = Icon.gold_cost
    if icon > 0
      draw_icon(icon, rect.x + rect.width-24, rect.y, enable?(skill))
      rect.width -= 24
    end
    #---
    contents.font.size = YEA::SKILL_COST::GOLD_COST_SIZE
    cost = @actor.skill_gold_cost(skill)
    text = sprintf(YEA::SKILL_COST::GOLD_COST_SUFFIX, cost.group)
    draw_text(rect, text, 2)
    cx = text_size(text).width + 4
    rect.width -= cx
    reset_font_settings
  end
  
  #--------------------------------------------------------------------------
  # new method: draw_custom_skill_cost
  #--------------------------------------------------------------------------
  def draw_custom_skill_cost(rect, skill)
    return unless skill.use_custom_cost
    change_color(text_color(skill.custom_cost_colour), enable?(skill))
    icon = skill.custom_cost_icon
    if icon > 0
      draw_icon(icon, rect.x + rect.width-24, rect.y, enable?(skill))
      rect.width -= 24
    end
    contents.font.size = skill.custom_cost_size
    text = skill.custom_cost_text
    draw_text(rect, text, 2)
    cx = text_size(text).width + 4
    rect.width -= cx
    reset_font_settings
  end
  
end # Window_SkillList

#==============================================================================
#
# ▼ End of File
#
#==============================================================================[/pre]


然後我稍微說一下用法~ 在技能說明輸入以下指令
基本功能:
<mp cost: x> 消耗X點MP
<mp cost: x%> 消耗總MP的X%
<tp cost: x> 消耗X點TP
<hp cost: x> 消耗X點HP
<hp cost: x%> 消耗總HP的X%
<gold cost: x> 消耗金錢
<gold cost: x%> 消耗目前金錢的幾%

因為你問的是關於HP 我再跟你說兩個↓

<hp cost max: x>此技能消耗HP量最多上限
<hp cost min: x>此技能消耗HP量最少上限

例子:你設定技能"血魔法",而施法角色的HP=1800

<hp cost: 50%> 所以此技能消耗角色 900滴血!!
但是你覺得太多了,覺得最高上限600就好~ 免得HP高的角色吃虧,所以你加了
<hp cost max: 600>
那麼角色HP=1800時只會消耗600滴血~
也就是說角色的血量超過1200後固定只扣600滴血 {:2_282:}

還有很多指令你可以看腳本裡面的介紹~
我也正在學習看腳本
因为现实太残酷、所以我们都在打造虚幻的天堂。如果现实不再残酷,也是因为有这快乐的天堂。
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3558
在线时间
1058 小时
注册时间
2009-10-3
帖子
185
6
 楼主| 发表于 2013-2-27 12:02:59 | 只看该作者
a000b1745 发表于 2013-2-27 02:27
#==============================================================================
#
# ▼ Yanfly Engin ...

好厉害~~~
我去试试呢
自己给自己挖了一个坑,然后掉下去的我,竟然爬不上来了,呵呵(NMB)。
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3558
在线时间
1058 小时
注册时间
2009-10-3
帖子
185
7
 楼主| 发表于 2013-2-27 12:14:52 | 只看该作者
a000b1745 发表于 2013-2-27 02:27
#==============================================================================
#
# ▼ Yanfly Engin ...

[pre lang="ruby" line="1" file="腳本"]#=======
运行后 弹出这一行出错
自己给自己挖了一个坑,然后掉下去的我,竟然爬不上来了,呵呵(NMB)。
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
567
在线时间
465 小时
注册时间
2009-10-11
帖子
407
8
发表于 2013-2-27 14:26:13 | 只看该作者
我再貼一次.
你看覆蓋過去後會不會出現錯誤?
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Skill Cost Manager v1.03
  4. # -- Last Updated: 2012.01.23
  5. # -- Level: Normal, Hard, Lunatic
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================

  9. $imported = {} if $imported.nil?
  10. $imported["YEA-SkillCostManager"] = true

  11. #==============================================================================
  12. # ▼ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2012.08.06 - Restore SP-Paramater: TCR
  15. # 2012.01.23 - Compatibility Update: Doppelganger
  16. # 2011.12.11 - Started Script and Finished.
  17. #            - Added max and min notetags.
  18. #
  19. #==============================================================================
  20. # ▼ Introduction
  21. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  22. # This script adds more functionality towards skill costs. Skills can now cost
  23. # HP, more MP, more TP, gold, and even have custom costs. The way the skill
  24. # costs are drawn in the display windows are changed to deliver more effective
  25. # and reliable information to the player. And if four skill costs aren't enough
  26. # to satisfy you, you can even make your own custom skill costs.
  27. #
  28. #==============================================================================
  29. # ▼ Instructions
  30. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  31. # To install this script, open up your script editor and copy/paste this script
  32. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  33. #
  34. # -----------------------------------------------------------------------------
  35. # Actor Notetags - These notetags go in the actors notebox in the database.
  36. # -----------------------------------------------------------------------------
  37. # <hp cost rate: x%>
  38. # Allows the actor to drop the HP cost of skills to x%.
  39. #
  40. # <tp cost rate: x%>
  41. # Allows the actor to drop the TP cost of skills to x%.
  42. #
  43. # <gold cost rate: x%>
  44. # Allows the actor to drop the Gold cost of skills to x%.
  45. #
  46. # -----------------------------------------------------------------------------
  47. # Class Notetags - These notetags go in the class notebox in the database.
  48. # -----------------------------------------------------------------------------
  49. # <hp cost rate: x%>
  50. # Allows the class to drop the HP cost of skills to x%.
  51. #
  52. # <tp cost rate: x%>
  53. # Allows the class to drop the TP cost of skills to x%.
  54. #
  55. # <gold cost rate: x%>
  56. # Allows the class to drop the Gold cost of skills to x%.
  57. #
  58. # -----------------------------------------------------------------------------
  59. # Skill Notetags - These notetags go in the skills notebox in the database.
  60. # -----------------------------------------------------------------------------
  61. # <hp cost: x>
  62. # Sets the skill's HP cost to x. This function did not exist by default in
  63. # RPG Maker VX Ace.
  64. #
  65. # <hp cost: x%>
  66. # Sets the HP cost to a percentage of the actor's MaxHP. If a normal HP cost is
  67. # present on the skill, too, then this value is added to the HP cost.
  68. #
  69. # <hp cost max: x>
  70. # <hp cost min: x>
  71. # Sets the maximum and minimum range of the HP Cost of the skill. If you do not
  72. # use this tag, there will be no maximum and/or minimum range.
  73. #
  74. # <mp cost: x>
  75. # Sets the skill's MP cost to x. Allows MP cost to exceed 9999, which is RPG
  76. # Maker VX Ace's database editor's maximum limit.
  77. #
  78. # <mp cost: x%>
  79. # Sets the MP cost to a percentage of the actor's MaxMP. If a normal MP cost is
  80. # present on the skill, too, then this value is added to the MP cost.
  81. #
  82. # <mp cost max: x>
  83. # <mp cost min: x>
  84. # Sets the maximum and minimum range of the MP Cost of the skill. If you do not
  85. # use this tag, there will be no maximum and/or minimum range.
  86. #
  87. # <tp cost: x>
  88. # Sets the skill's TP cost to x. Allows TP cost to exceed 100, which is RPG
  89. # Maker VX Ace's database editor's maximum limit.
  90. #
  91. # <tp cost: x%>
  92. # Sets the TP cost to a percentage of the actor's MaxTP. If a normal TP cost is
  93. # present on the skill, too, then this value is added to the TP cost.
  94. #
  95. # <tp cost max: x>
  96. # <tp cost min: x>
  97. # Sets the maximum and minimum range of the TP Cost of the skill. If you do not
  98. # use this tag, there will be no maximum and/or minimum range.
  99. #
  100. # <gold cost: x>
  101. # Sets the skill's gold cost to x. Enemies with skills that cost gold do not
  102. # use gold. If the player does not have enough gold, the skill can't be used.
  103. #
  104. # <gold cost: x%>
  105. # Sets the skill's gold cost equal to a percentage of the party's total gold.
  106. # If both a regular gold cost and a percentile gold cost is used, the total of
  107. # both values will be the skill's gold cost.
  108. #
  109. # <gold cost max: x>
  110. # <gold cost min: x>
  111. # Sets the maximum and minimum range of the Gold Cost of the skill. If you do
  112. # not use this tag, there will be no maximum and/or minimum range.
  113. #
  114. # --- Making Your Own Custom Costs ---
  115. #
  116. # <custom cost: string>
  117. # If you decide to have a custom cost for your game, insert this notetag to
  118. # change what displays in the skill menu visually.
  119. #
  120. # <custom cost colour: x>
  121. # This is the "Window" skin text colour used for the custom cost. By default,
  122. # it is text colour 0, which is the white colour.
  123. #
  124. # <custom cost size: x>
  125. # This is the text font size used for the custom cost in the display windows.
  126. # By default, it is font size 20.
  127. #
  128. # <custom cost icon: x>
  129. # If you wish to use an icon for your custom cost, replace x with the icon ID
  130. # you wish to show in display windows. By default, it is 0 (and not shown).
  131. #
  132. # <custom cost requirement>
  133. #  string
  134. #  string
  135. # </custom cost requirement>
  136. # Sets the custom cost requirement of the skill with an eval function using the
  137. # strings in between. The strings are a part of one line even if in the notebox
  138. # they are on separate lines.
  139. #
  140. # <custom cost perform>
  141. #  string
  142. #  string
  143. # </custom cost perform>
  144. # Sets how the custom cost payment is done with an eval function using the
  145. # strings in between. The strings are a part of one line even if in the notebox
  146. # they are on separate lines.
  147. #
  148. # -----------------------------------------------------------------------------
  149. # Weapon Notetags - These notetags go in the weapons notebox in the database.
  150. # -----------------------------------------------------------------------------
  151. # <hp cost rate: x%>
  152. # Allows the weapon to drop the HP cost of skills to x% when worn.
  153. #
  154. # <tp cost rate: x%>
  155. # Allows the weapon to drop the TP cost of skills to x% when worn.
  156. #
  157. # <gold cost rate: x%>
  158. # Allows the weapon to drop the Gold cost of skills to x% when worn.
  159. #
  160. # -----------------------------------------------------------------------------
  161. # Armour Notetags - These notetags go in the armours notebox in the database.
  162. # -----------------------------------------------------------------------------
  163. # <hp cost rate: x%>
  164. # Allows the armour to drop the HP cost of skills to x% when worn.
  165. #
  166. # <tp cost rate: x%>
  167. # Allows the armour to drop the TP cost of skills to x% when worn.
  168. #
  169. # <gold cost rate: x%>
  170. # Allows the armour to drop the TP cost of skills to x% when worn.
  171. #
  172. # -----------------------------------------------------------------------------
  173. # Enemy Notetags - These notetags go in the enemies notebox in the database.
  174. # -----------------------------------------------------------------------------
  175. # <hp cost rate: x%>
  176. # Allows the enemy to drop the HP cost of skills to x%.
  177. #
  178. # <tp cost rate: x%>
  179. # Allows the enemy to drop the TP cost of skills to x%.
  180. #
  181. # -----------------------------------------------------------------------------
  182. # State Notetags - These notetags go in the states notebox in the database.
  183. # -----------------------------------------------------------------------------
  184. # <hp cost rate: x%>
  185. # Allows the state to drop the HP cost of skills to x% when afflicted.
  186. #
  187. # <tp cost rate: x%>
  188. # Allows the state to drop the TP cost of skills to x% when afflicted.
  189. #
  190. # <gold cost rate: x%>
  191. # Allows the state to drop the Gold cost of skills to x% when afflicted.
  192. #
  193. #==============================================================================
  194. # ▼ Compatibility
  195. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  196. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  197. # it will run with RPG Maker VX without adjusting.
  198. #
  199. #==============================================================================

  200. module YEA
  201.   module SKILL_COST
  202.    
  203.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  204.     # - HP Cost Settings -
  205.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  206.     # New to this script are HP costs. HP costs require the battler to have
  207.     # sufficient HP before being able to use the skill. The text colour that's
  208.     # used, the suffix, or whether or not to use an icon. If you do not wish
  209.     # to use an icon, set the icon to 0.
  210.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  211.     HP_COST_COLOUR = 21         # Colour used from "Window" skin.
  212.     HP_COST_SIZE   = 20         # Font size used for HP costs.
  213.     HP_COST_SUFFIX = "%sHP"     # Suffix used for HP costs.
  214.     HP_COST_ICON   = 0          # Icon used for HP costs. Set 0 to disable.
  215.    
  216.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  217.     # - MP Cost Settings -
  218.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  219.     # Here, you can change the settings for MP costs: the text colour that's
  220.     # used, the suffix, or whether or not to use an icon. If you do not wish
  221.     # to use an icon, set the icon to 0.
  222.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  223.     MP_COST_COLOUR = 23         # Colour used from "Window" skin. Default: 23
  224.     MP_COST_SIZE   = 20         # Font size used for MP costs. Default: 24
  225.     MP_COST_SUFFIX = "%sMP"     # Suffix used for MP costs. No suffix default.
  226.     MP_COST_ICON   = 0          # Icon used for MP costs. Set 0 to disable.
  227.    
  228.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  229.     # - TP Cost Settings -
  230.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  231.     # Here, you can change the settings for TP costs: the text colour that's
  232.     # used, the suffix, or whether or not to use an icon. If you do not wish
  233.     # to use an icon, set the icon to 0.
  234.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  235.     TP_COST_COLOUR = 2          # Colour used from "Window" skin. Default: 29
  236.     TP_COST_SIZE   = 20         # Font size used for TP costs. Default: 24
  237.     TP_COST_SUFFIX = "%sTP"     # Suffix used for TP costs. No suffix default.
  238.     TP_COST_ICON   = 0          # Icon used for TP costs. Set 0 to disable.
  239.    
  240.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  241.     # - Gold Cost Settings -
  242.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  243.     # New to this script are Gold costs. Gold costs require the party to have
  244.     # enough gold before being able to use the skill. The text colour that's
  245.     # used, the suffix, or whether or not to use an icon. If you do not wish
  246.     # to use an icon, set the icon to 0.
  247.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  248.     GOLD_COST_COLOUR = 6          # Colour used from "Window" skin.
  249.     GOLD_COST_SIZE   = 20         # Font size used for Gold costs.
  250.     GOLD_COST_SUFFIX = "%sGold"   # Suffix used for Gold costs.
  251.     GOLD_COST_ICON   = 0          # Icon used for Gold costs. Set 0 to disable.
  252.    
  253.   end # SKILL_COST
  254. end # YEA

  255. #==============================================================================
  256. # ▼ Editting anything past this point may potentially result in causing
  257. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  258. # halitosis so edit at your own risk.
  259. #==============================================================================

  260. module YEA
  261.   module REGEXP
  262.   module BASEITEM
  263.    
  264.     HP_COST_RATE = /<(?:HP_COST_RATE|hp cost rate):[ ](\d+)([%%])>/i
  265.     TP_COST_RATE = /<(?:TP_COST_RATE|tp cost rate):[ ](\d+)([%%])>/i
  266.     GOLD_COST_RATE = /<(?:GOLD_COST_RATE|gold cost rate):[ ](\d+)([%%])>/i
  267.    
  268.   end # BASEITEM
  269.   module SKILL
  270.    
  271.     HP_COST_SET = /<(?:HP_COST|hp cost):[ ](\d+)>/i
  272.     HP_COST_PER = /<(?:HP_COST|hp cost):[ ](\d+)([%%])>/i
  273.     MP_COST_SET = /<(?:MP_COST|mp cost):[ ](\d+)>/i
  274.     MP_COST_PER = /<(?:MP_COST|mp cost):[ ](\d+)([%%])>/i
  275.     TP_COST_SET = /<(?:TP_COST|tp cost):[ ](\d+)>/i
  276.     TP_COST_PER = /<(?:TP_COST|tp cost):[ ](\d+)([%%])>/i
  277.     GOLD_COST_SET = /<(?:GOLD_COST|gold cost):[ ](\d+)>/i
  278.     GOLD_COST_PER = /<(?:GOLD_COST|gold cost):[ ](\d+)([%%])>/i
  279.    
  280.     CUSTOM_COST_TEXT = /<(?:CUSTOM_COST|custom cost):[ ](.*)>/i
  281.     CUSTOM_COST_COLOUR =
  282.       /<(?:CUSTOM_COST_COLOUR|custom cost colour|custom cost color):[ ](\d+)>/i
  283.     CUSTOM_COST_SIZE = /<(?:CUSTOM_COST_SIZE|custom cost size):[ ](\d+)>/i
  284.     CUSTOM_COST_ICON = /<(?:CUSTOM_COST_ICON|custom cost icon):[ ](\d+)>/i
  285.     CUSTOM_COST_REQUIREMENT_ON =
  286.       /<(?:CUSTOM_COST_REQUIREMENT|custom cost requirement)>/i
  287.     CUSTOM_COST_REQUIREMENT_OFF =
  288.       /<\/(?:CUSTOM_COST_REQUIREMENT|custom cost requirement)>/i
  289.     CUSTOM_COST_PERFORM_ON =
  290.       /<(?:CUSTOM_COST_PERFORM|custom cost perform)>/i
  291.     CUSTOM_COST_PERFORM_OFF =
  292.       /<\/(?:CUSTOM_COST_PERFORM|custom cost perform)>/i
  293.    
  294.     HP_COST_MIN = /<(?:HP_COST_MIN|hp cost min):[ ](\d+)>/i
  295.     HP_COST_MAX = /<(?:HP_COST_MIN|hp cost max):[ ](\d+)>/i
  296.     MP_COST_MIN = /<(?:MP_COST_MIN|mp cost min):[ ](\d+)>/i
  297.     MP_COST_MAX = /<(?:MP_COST_MIN|mp cost max):[ ](\d+)>/i
  298.     TP_COST_MIN = /<(?:TP_COST_MIN|tp cost min):[ ](\d+)>/i
  299.     TP_COST_MAX = /<(?:TP_COST_MIN|tp cost max):[ ](\d+)>/i
  300.     GOLD_COST_MIN = /<(?:GOLD_COST_MIN|gold cost min):[ ](\d+)>/i
  301.     GOLD_COST_MAX = /<(?:GOLD_COST_MIN|gold cost max):[ ](\d+)>/i
  302.    
  303.   end # SKILL
  304.   end # REGEXP
  305. end # YEA

  306. #==============================================================================
  307. # ■ Icon
  308. #==============================================================================

  309. module Icon
  310.   
  311.   #--------------------------------------------------------------------------
  312.   # self.mp_cost
  313.   #--------------------------------------------------------------------------
  314.   def self.mp_cost; return YEA::SKILL_COST::MP_COST_ICON; end
  315.   
  316.   #--------------------------------------------------------------------------
  317.   # self.tp_cost
  318.   #--------------------------------------------------------------------------
  319.   def self.tp_cost; return YEA::SKILL_COST::TP_COST_ICON; end
  320.   
  321.   #--------------------------------------------------------------------------
  322.   # self.hp_cost
  323.   #--------------------------------------------------------------------------
  324.   def self.hp_cost; return YEA::SKILL_COST::HP_COST_ICON; end
  325.   
  326.   #--------------------------------------------------------------------------
  327.   # self.gold_cost
  328.   #--------------------------------------------------------------------------
  329.   def self.gold_cost; return YEA::SKILL_COST::GOLD_COST_ICON; end
  330.    
  331. end # Icon

  332. #==============================================================================
  333. # ■ Numeric
  334. #==============================================================================

  335. class Numeric
  336.   
  337.   #--------------------------------------------------------------------------
  338.   # new method: group_digits
  339.   #--------------------------------------------------------------------------
  340.   unless $imported["YEA-CoreEngine"]
  341.   def group; return self.to_s; end
  342.   end # $imported["YEA-CoreEngine"]
  343.    
  344. end # Numeric

  345. #==============================================================================
  346. # ■ DataManager
  347. #==============================================================================

  348. module DataManager
  349.   
  350.   #--------------------------------------------------------------------------
  351.   # alias method: load_database
  352.   #--------------------------------------------------------------------------
  353.   class <<self; alias load_database_scm load_database; end
  354.   def self.load_database
  355.     load_database_scm
  356.     load_notetags_scm
  357.   end
  358.   
  359.   #--------------------------------------------------------------------------
  360.   # new method: load_notetags_scm
  361.   #--------------------------------------------------------------------------
  362.   def self.load_notetags_scm
  363.     groups = [$data_actors, $data_classes, $data_skills, $data_weapons,
  364.       $data_armors, $data_enemies, $data_states]
  365.     for group in groups
  366.       for obj in group
  367.         next if obj.nil?
  368.         obj.load_notetags_scm
  369.       end
  370.     end
  371.   end
  372.   
  373. end # DataManager

  374. #==============================================================================
  375. # ■ RPG::BaseItem
  376. #==============================================================================

  377. class RPG::BaseItem
  378.   
  379.   #--------------------------------------------------------------------------
  380.   # public instance variables
  381.   #--------------------------------------------------------------------------
  382.   attr_accessor :tp_cost_rate
  383.   attr_accessor :hp_cost_rate
  384.   attr_accessor :gold_cost_rate
  385.   
  386.   #--------------------------------------------------------------------------
  387.   # common cache: load_notetags_scm
  388.   #--------------------------------------------------------------------------
  389.   def load_notetags_scm
  390.     @tp_cost_rate = 1.0
  391.     @hp_cost_rate = 1.0
  392.     @gold_cost_rate = 1.0
  393.     #---
  394.     self.note.split(/[\r\n]+/).each { |line|
  395.       case line
  396.       #---
  397.       when YEA::REGEXP::BASEITEM::TP_COST_RATE
  398.         @tp_cost_rate = $1.to_i * 0.01
  399.       when YEA::REGEXP::BASEITEM::HP_COST_RATE
  400.         @hp_cost_rate = $1.to_i * 0.01
  401.       when YEA::REGEXP::BASEITEM::GOLD_COST_RATE
  402.         @gold_cost_rate = $1.to_i * 0.01
  403.       #---
  404.       end
  405.     } # self.note.split
  406.     #---
  407.   end
  408.   
  409. end # RPG::BaseItem

  410. #==============================================================================
  411. # ■ RPG::Skill
  412. #==============================================================================

  413. class RPG::Skill < RPG::UsableItem
  414.   
  415.   #--------------------------------------------------------------------------
  416.   # public instance variables
  417.   #--------------------------------------------------------------------------
  418.   attr_accessor :hp_cost
  419.   attr_accessor :hp_cost_percent
  420.   attr_accessor :mp_cost_percent
  421.   attr_accessor :tp_cost_percent
  422.   attr_accessor :gold_cost
  423.   attr_accessor :gold_cost_percent
  424.   
  425.   attr_accessor :hp_cost_min
  426.   attr_accessor :hp_cost_max
  427.   attr_accessor :mp_cost_min
  428.   attr_accessor :mp_cost_max
  429.   attr_accessor :tp_cost_min
  430.   attr_accessor :tp_cost_max
  431.   attr_accessor :gold_cost_min
  432.   attr_accessor :gold_cost_max
  433.   
  434.   attr_accessor :use_custom_cost
  435.   attr_accessor :custom_cost_text
  436.   attr_accessor :custom_cost_colour
  437.   attr_accessor :custom_cost_size
  438.   attr_accessor :custom_cost_icon
  439.   attr_accessor :custom_cost_requirement
  440.   attr_accessor :custom_cost_perform
  441.   
  442.   #--------------------------------------------------------------------------
  443.   # common cache: load_notetags_scm
  444.   #--------------------------------------------------------------------------
  445.   def load_notetags_scm
  446.     @hp_cost = 0
  447.     @gold_cost = 0
  448.     @hp_cost_percent = 0.0
  449.     @mp_cost_percent = 0.0
  450.     @tp_cost_percent = 0.0
  451.     @gold_cost_percent = 0.0
  452.    
  453.     @custom_cost_text = "0"
  454.     @custom_cost_colour = 0
  455.     @custom_cost_size = 20
  456.     @custom_cost_icon = 0
  457.     @custom_cost_requirement = ""
  458.     @custom_cost_perform = ""
  459.    
  460.     @use_custom_cost = false
  461.     @custom_cost_req_on = false
  462.     @custom_cost_per_on = false
  463.     #---
  464.     self.note.split(/[\r\n]+/).each { |line|
  465.       case line
  466.       #---
  467.       when YEA::REGEXP::SKILL::MP_COST_SET
  468.         @mp_cost = $1.to_i
  469.       when YEA::REGEXP::SKILL::MP_COST_PER
  470.         @mp_cost_percent = $1.to_i * 0.01
  471.       when YEA::REGEXP::SKILL::TP_COST_SET
  472.         @tp_cost = $1.to_i
  473.       when YEA::REGEXP::SKILL::TP_COST_PER
  474.         @tp_cost_percent = $1.to_i * 0.01
  475.       when YEA::REGEXP::SKILL::HP_COST_SET
  476.         @hp_cost = $1.to_i
  477.       when YEA::REGEXP::SKILL::HP_COST_PER
  478.         @hp_cost_percent = $1.to_i * 0.01
  479.       when YEA::REGEXP::SKILL::GOLD_COST_SET
  480.         @gold_cost = $1.to_i
  481.       when YEA::REGEXP::SKILL::GOLD_COST_PER
  482.         @gold_cost_percent = $1.to_i * 0.01
  483.       #---
  484.       when YEA::REGEXP::SKILL::HP_COST_MIN
  485.         @hp_cost_min = $1.to_i
  486.       when YEA::REGEXP::SKILL::HP_COST_MAX
  487.         @hp_cost_max = $1.to_i
  488.       when YEA::REGEXP::SKILL::MP_COST_MIN
  489.         @mp_cost_min = $1.to_i
  490.       when YEA::REGEXP::SKILL::MP_COST_MAX
  491.         @mp_cost_max = $1.to_i
  492.       when YEA::REGEXP::SKILL::TP_COST_MIN
  493.         @tp_cost_min = $1.to_i
  494.       when YEA::REGEXP::SKILL::TP_COST_MAX
  495.         @tp_cost_max = $1.to_i
  496.       when YEA::REGEXP::SKILL::GOLD_COST_MIN
  497.         @gold_cost_min = $1.to_i
  498.       when YEA::REGEXP::SKILL::GOLD_COST_MAX
  499.         @gold_cost_max = $1.to_i
  500.       #---
  501.       when YEA::REGEXP::SKILL::CUSTOM_COST_TEXT
  502.         @custom_cost_text = $1.to_s
  503.       when YEA::REGEXP::SKILL::CUSTOM_COST_COLOUR
  504.         @custom_cost_colour = $1.to_i
  505.       when YEA::REGEXP::SKILL::CUSTOM_COST_SIZE
  506.         @custom_cost_size = $1.to_i
  507.       when YEA::REGEXP::SKILL::CUSTOM_COST_ICON
  508.         @custom_cost_icon = $1.to_i
  509.       when YEA::REGEXP::SKILL::CUSTOM_COST_REQUIREMENT_ON
  510.         @custom_cost_req_on = true
  511.         @use_custom_cost = true
  512.       when YEA::REGEXP::SKILL::CUSTOM_COST_REQUIREMENT_OFF
  513.         @custom_cost_req_on = false
  514.         @use_custom_cost = true
  515.       when YEA::REGEXP::SKILL::CUSTOM_COST_PERFORM_ON
  516.         @custom_cost_per_on = true
  517.         @use_custom_cost = true
  518.       when YEA::REGEXP::SKILL::CUSTOM_COST_PERFORM_OFF
  519.         @custom_cost_per_on = false
  520.         @use_custom_cost = true
  521.       else
  522.         @custom_cost_requirement += line.to_s if @custom_cost_req_on
  523.         @custom_cost_perform += line.to_s if @custom_cost_per_on
  524.       #---
  525.       end
  526.     } # self.note.split
  527.     #---
  528.   end
  529.   
  530. end # RPG::Skill

  531. #==============================================================================
  532. # ■ Game_BattlerBase
  533. #==============================================================================

  534. class Game_BattlerBase
  535.   
  536.   #--------------------------------------------------------------------------
  537.   # alias method: skill_cost_payable?
  538.   #--------------------------------------------------------------------------
  539.   alias game_battlerbase_skill_cost_payable_scm skill_cost_payable?
  540.   def skill_cost_payable?(skill)
  541.     return false if hp <= skill_hp_cost(skill)
  542.     return false unless gold_cost_met?(skill)
  543.     return false unless custom_cost_met?(skill)
  544.     return game_battlerbase_skill_cost_payable_scm(skill)
  545.   end
  546.   
  547.   #--------------------------------------------------------------------------
  548.   # new method: gold_cost_met?
  549.   #--------------------------------------------------------------------------
  550.   def gold_cost_met?(skill)
  551.     return true unless actor?
  552.     return $game_party.gold >= skill_gold_cost(skill)
  553.   end
  554.   
  555.   #--------------------------------------------------------------------------
  556.   # new method: custom_cost_met?
  557.   #--------------------------------------------------------------------------
  558.   def custom_cost_met?(skill)
  559.     return true unless skill.use_custom_cost
  560.     return eval(skill.custom_cost_requirement)
  561.   end
  562.   
  563.   #--------------------------------------------------------------------------
  564.   # alias method: pay_skill_cost
  565.   #--------------------------------------------------------------------------
  566.   alias game_battlerbase_pay_skill_cost_scm pay_skill_cost
  567.   def pay_skill_cost(skill)
  568.     game_battlerbase_pay_skill_cost_scm(skill)
  569.     self.hp -= skill_hp_cost(skill)
  570.     $game_party.lose_gold(skill_gold_cost(skill)) if actor?
  571.     pay_custom_cost(skill)
  572.   end
  573.   
  574.   #--------------------------------------------------------------------------
  575.   # new method: pay_custom_cost
  576.   #--------------------------------------------------------------------------
  577.   def pay_custom_cost(skill)
  578.     return unless skill.use_custom_cost
  579.     eval(skill.custom_cost_perform)
  580.   end
  581.   
  582.   #--------------------------------------------------------------------------
  583.   # alias method: skill_mp_cost
  584.   #--------------------------------------------------------------------------
  585.   alias game_battlerbase_skill_mp_cost_scm skill_mp_cost
  586.   def skill_mp_cost(skill)
  587.     n = game_battlerbase_skill_mp_cost_scm(skill)
  588.     n += skill.mp_cost_percent * mmp * mcr
  589.     n = [n.to_i, skill.mp_cost_max].min unless skill.mp_cost_max.nil?
  590.     n = [n.to_i, skill.mp_cost_min].max unless skill.mp_cost_min.nil?
  591.     return n.to_i
  592.   end
  593.   
  594.   #--------------------------------------------------------------------------
  595.   # alias method: skill_tp_cost
  596.   #--------------------------------------------------------------------------
  597.   alias game_battlerbase_skill_tp_cost_scm skill_tp_cost
  598.   def skill_tp_cost(skill)
  599.     n = game_battlerbase_skill_tp_cost_scm(skill) * tcr_y
  600.     n += skill.tp_cost_percent * max_tp * tcr_y
  601.     n = [n.to_i, skill.tp_cost_max].min unless skill.tp_cost_max.nil?
  602.     n = [n.to_i, skill.tp_cost_min].max unless skill.tp_cost_min.nil?
  603.     return n.to_i
  604.   end
  605.   
  606.   #--------------------------------------------------------------------------
  607.   # new method: tcr_y
  608.   #--------------------------------------------------------------------------
  609.   def tcr_y
  610.     n = 1.0
  611.     if actor?
  612.       n *= self.actor.tp_cost_rate
  613.       n *= self.class.tp_cost_rate
  614.       for equip in equips
  615.         next if equip.nil?
  616.         n *= equip.tp_cost_rate
  617.       end
  618.     else
  619.       n *= self.enemy.tp_cost_rate
  620.       if $imported["YEA-Doppelganger"] && !self.class.nil?
  621.         n *= self.class.tp_cost_rate
  622.       end
  623.     end
  624.     for state in states
  625.       next if state.nil?
  626.       n *= state.tp_cost_rate
  627.     end
  628.     return n
  629.   end
  630.   
  631.   #--------------------------------------------------------------------------
  632.   # new method: skill_hp_cost
  633.   #--------------------------------------------------------------------------
  634.   def skill_hp_cost(skill)
  635.     n = skill.hp_cost * hcr
  636.     n += skill.hp_cost_percent * mhp * hcr
  637.     n = [n.to_i, skill.hp_cost_max].min unless skill.hp_cost_max.nil?
  638.     n = [n.to_i, skill.hp_cost_min].max unless skill.hp_cost_min.nil?
  639.     return n.to_i
  640.   end
  641.   
  642.   #--------------------------------------------------------------------------
  643.   # new method: hcr
  644.   #--------------------------------------------------------------------------
  645.   def hcr
  646.     n = 1.0
  647.     if actor?
  648.       n *= self.actor.hp_cost_rate
  649.       n *= self.class.hp_cost_rate
  650.       for equip in equips
  651.         next if equip.nil?
  652.         n *= equip.hp_cost_rate
  653.       end
  654.     else
  655.       n *= self.enemy.hp_cost_rate
  656.       if $imported["YEA-Doppelganger"] && !self.class.nil?
  657.         n *= self.class.hp_cost_rate
  658.       end
  659.     end
  660.     for state in states
  661.       next if state.nil?
  662.       n *= state.hp_cost_rate
  663.     end
  664.     return n
  665.   end
  666.   
  667.   #--------------------------------------------------------------------------
  668.   # new method: skill_gold_cost
  669.   #--------------------------------------------------------------------------
  670.   def skill_gold_cost(skill)
  671.     n = skill.gold_cost * gcr
  672.     n += skill.gold_cost_percent * $game_party.gold * gcr
  673.     n = [n.to_i, skill.gold_cost_max].min unless skill.gold_cost_max.nil?
  674.     n = [n.to_i, skill.gold_cost_min].max unless skill.gold_cost_min.nil?
  675.     return n.to_i
  676.   end
  677.   
  678.   #--------------------------------------------------------------------------
  679.   # new method: gcr
  680.   #--------------------------------------------------------------------------
  681.   def gcr
  682.     n = 1.0
  683.     n *= self.actor.gold_cost_rate
  684.     n *= self.class.gold_cost_rate
  685.     for equip in equips
  686.       next if equip.nil?
  687.       n *= equip.gold_cost_rate
  688.     end
  689.     for state in states
  690.       next if state.nil?
  691.       n *= state.gold_cost_rate
  692.     end
  693.     return n
  694.   end
  695.   
  696. end # Game_BattlerBase
  697.   
  698. #==============================================================================
  699. # ■ Window_Base
  700. #==============================================================================

  701. class Window_Base < Window
  702.   
  703.   #--------------------------------------------------------------------------
  704.   # overwrite methods: cost_colours
  705.   #--------------------------------------------------------------------------
  706.   def mp_cost_color; text_color(YEA::SKILL_COST::MP_COST_COLOUR); end;
  707.   def tp_cost_color; text_color(YEA::SKILL_COST::TP_COST_COLOUR); end;
  708.   def hp_cost_color; text_color(YEA::SKILL_COST::HP_COST_COLOUR); end;
  709.   def gold_cost_color; text_color(YEA::SKILL_COST::GOLD_COST_COLOUR); end;
  710.   
  711. end # Window_Base

  712. #==============================================================================
  713. # ■ Window_SkillList
  714. #==============================================================================

  715. class Window_SkillList < Window_Selectable
  716.   
  717.   #--------------------------------------------------------------------------
  718.   # overwrite method: draw_skill_cost
  719.   #--------------------------------------------------------------------------
  720.   def draw_skill_cost(rect, skill)
  721.     draw_tp_skill_cost(rect, skill) unless $imported["YEA-BattleEngine"]
  722.     draw_mp_skill_cost(rect, skill)
  723.     draw_tp_skill_cost(rect, skill) if $imported["YEA-BattleEngine"]
  724.     draw_hp_skill_cost(rect, skill)
  725.     draw_gold_skill_cost(rect, skill)
  726.     draw_custom_skill_cost(rect, skill)
  727.   end
  728.   
  729.   #--------------------------------------------------------------------------
  730.   # new method: draw_mp_skill_cost
  731.   #--------------------------------------------------------------------------
  732.   def draw_mp_skill_cost(rect, skill)
  733.     return unless @actor.skill_mp_cost(skill) > 0
  734.     change_color(mp_cost_color, enable?(skill))
  735.     #---
  736.     icon = Icon.mp_cost
  737.     if icon > 0
  738.       draw_icon(icon, rect.x + rect.width-24, rect.y, enable?(skill))
  739.       rect.width -= 24
  740.     end
  741.     #---
  742.     contents.font.size = YEA::SKILL_COST::MP_COST_SIZE
  743.     cost = @actor.skill_mp_cost(skill)
  744.     text = sprintf(YEA::SKILL_COST::MP_COST_SUFFIX, cost.group)
  745.     draw_text(rect, text, 2)
  746.     cx = text_size(text).width + 4
  747.     rect.width -= cx
  748.     reset_font_settings
  749.   end
  750.   
  751.   #--------------------------------------------------------------------------
  752.   # new method: draw_tp_skill_cost
  753.   #--------------------------------------------------------------------------
  754.   def draw_tp_skill_cost(rect, skill)
  755.     return unless @actor.skill_tp_cost(skill) > 0
  756.     change_color(tp_cost_color, enable?(skill))
  757.     #---
  758.     icon = Icon.tp_cost
  759.     if icon > 0
  760.       draw_icon(icon, rect.x + rect.width-24, rect.y, enable?(skill))
  761.       rect.width -= 24
  762.     end
  763.     #---
  764.     contents.font.size = YEA::SKILL_COST::TP_COST_SIZE
  765.     cost = @actor.skill_tp_cost(skill)
  766.     text = sprintf(YEA::SKILL_COST::TP_COST_SUFFIX, cost.group)
  767.     draw_text(rect, text, 2)
  768.     cx = text_size(text).width + 4
  769.     rect.width -= cx
  770.     reset_font_settings
  771.   end
  772.   
  773.   #--------------------------------------------------------------------------
  774.   # new method: draw_hp_skill_cost
  775.   #--------------------------------------------------------------------------
  776.   def draw_hp_skill_cost(rect, skill)
  777.     return unless @actor.skill_hp_cost(skill) > 0
  778.     change_color(hp_cost_color, enable?(skill))
  779.     #---
  780.     icon = Icon.hp_cost
  781.     if icon > 0
  782.       draw_icon(icon, rect.x + rect.width-24, rect.y, enable?(skill))
  783.       rect.width -= 24
  784.     end
  785.     #---
  786.     contents.font.size = YEA::SKILL_COST::HP_COST_SIZE
  787.     cost = @actor.skill_hp_cost(skill)
  788.     text = sprintf(YEA::SKILL_COST::HP_COST_SUFFIX, cost.group)
  789.     draw_text(rect, text, 2)
  790.     cx = text_size(text).width + 4
  791.     rect.width -= cx
  792.     reset_font_settings
  793.   end
  794.   
  795.   #--------------------------------------------------------------------------
  796.   # new method: draw_gold_skill_cost
  797.   #--------------------------------------------------------------------------
  798.   def draw_gold_skill_cost(rect, skill)
  799.     return unless @actor.skill_gold_cost(skill) > 0
  800.     change_color(gold_cost_color, enable?(skill))
  801.     #---
  802.     icon = Icon.gold_cost
  803.     if icon > 0
  804.       draw_icon(icon, rect.x + rect.width-24, rect.y, enable?(skill))
  805.       rect.width -= 24
  806.     end
  807.     #---
  808.     contents.font.size = YEA::SKILL_COST::GOLD_COST_SIZE
  809.     cost = @actor.skill_gold_cost(skill)
  810.     text = sprintf(YEA::SKILL_COST::GOLD_COST_SUFFIX, cost.group)
  811.     draw_text(rect, text, 2)
  812.     cx = text_size(text).width + 4
  813.     rect.width -= cx
  814.     reset_font_settings
  815.   end
  816.   
  817.   #--------------------------------------------------------------------------
  818.   # new method: draw_custom_skill_cost
  819.   #--------------------------------------------------------------------------
  820.   def draw_custom_skill_cost(rect, skill)
  821.     return unless skill.use_custom_cost
  822.     change_color(text_color(skill.custom_cost_colour), enable?(skill))
  823.     icon = skill.custom_cost_icon
  824.     if icon > 0
  825.       draw_icon(icon, rect.x + rect.width-24, rect.y, enable?(skill))
  826.       rect.width -= 24
  827.     end
  828.     contents.font.size = skill.custom_cost_size
  829.     text = skill.custom_cost_text
  830.     draw_text(rect, text, 2)
  831.     cx = text_size(text).width + 4
  832.     rect.width -= cx
  833.     reset_font_settings
  834.   end
  835.   
  836. end # Window_SkillList

  837. #==============================================================================
  838. #
  839. # ▼ End of File
  840. #
  841. #==============================================================================
复制代码

评分

参与人数 1梦石 +1 收起 理由
迷糊的安安 + 1 认可答案 附赠66RPG提供的精美好人卡一张^^.

查看全部评分

因为现实太残酷、所以我们都在打造虚幻的天堂。如果现实不再残酷,也是因为有这快乐的天堂。
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3558
在线时间
1058 小时
注册时间
2009-10-3
帖子
185
9
 楼主| 发表于 2013-2-27 22:42:55 | 只看该作者
a000b1745 发表于 2013-2-27 14:26
我再貼一次.
你看覆蓋過去後會不會出現錯誤?

OK!~
解决了,你太厉害力
自己给自己挖了一个坑,然后掉下去的我,竟然爬不上来了,呵呵(NMB)。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-11-19 00:21

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表