#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
#_/ â—†MP Consumption Options - KGC_MPCostAlter â—†VX â—â€
#_/ â—‡ Last update : 2008/02/06 â—‡
#_/ â—†Translation by Mr. Anonymous â—â€
#_/-----------------------------------------------------------------------------
#_/ This script allows you to alter the way MP is consumed.
#_/=============================================================================
#_/ â—†Instructions For Usage â—â€
#_/ To make use of these functions, you must insert the desired tag into the
#_/ "Notes" box located in the Skills section of the database. For
#_/ example, you want the Flame II skill to consume 24% of the character's
#_/ max MP. You would locate Flame II in the skills tab of the
#_/ database and insert "<MAXMPcost>" (without quotations) in the note box.
#_/ Simple, no?
#_/
#_/ â—‡ MP Percentile Consumption â—‡
#_/
#_/ <MPcost> OR <MAXMPcost>
#_/ Examples: <MPcost> MP cost is set to 10, therefore MP cost is
#_/ actually 10% ofthe character's remaining MP.
#_/ <MAXMPcost> MP cost is set to 25, therefore MP cost is
#_/ actually 25% ofthe character's total (Max) MP.
#_/
#_/ â—‡ Damage Proportionate to MP Consumption â—‡
#_/
#_/ <propMPdamage>
#_/ Example: The skill "Water" has a base damage of 300. Using this tag,
#_/ The base damage becomes a percentile, and the MP cost
#_/ effectively becomes the base damage.
#_/ Therefore, 300% of 6 MP(the skill's MP cost) would be 18.
#_/ (3 x 6 = 18)
#_/
#_/ â—‡ HP Consumption for Skills â—‡
#_/
#_/ <HPconsume>
#_/ Example: You wish for the skill "Darkness", which normally costs 40
#_/ MP to cost HP instead. You'd simply add <HPconsume> in the
#_/ Notes.
#_/
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
#===============================================================================
# ★ Customization ★
#===============================================================================
module KGC
module MPCostAlter
# This toggle allows you to consume HP (using <HPconsume>) all the way to 0.
# true : HP is able to be consumed all the way to 0.
# false : Skills that use <HPconsume> cannot be used if HP = 1.
PERMIT_ZERO_HP = false
# This toggle is used in conjuction with PERMIT_ZERO_HP
# true : When a skill that uses HP identifies HP as insufficient, the skill
# remains usable.
# false : When HP is insuffiecient, use of that skill is impossible
RELEASE_HP_LIMIT = false
end
end
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * #
# Unless you know what you're doing, it's best not to alter anything beyond #
# this point, as this only affects the tags used for "Notes" in database. #
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * #
# Whatever word(s) are after the separator ( | ) in the following lines are
# what are used to determine what is searched for in the "Notes" section.
$imported = {} if $imported == nil
$imported["MPCostAlter"] = true
module KGC::MPCostAlter
# Regular expressions defined.
module Regexp
# Base Skill Module
module Skill
# Consume HP tag string
CONSUME_HP = /<(?:CONSUME_HP|HPconsume)>/i
# MP Cost Rate tag string
MP_COST_RATE = /<(MAX)?(?:MP_COST_RATE|MPcost)>/i
# Proportional MP Damage tag string
MP_PROPORTIONAL_DAMAGE =
/<(?:MP_PROPORTIONAL_DAMAGE|propMPdamage)>/i
end
end
end
#==============================================================================
# â– RPG::Skill
#==============================================================================
class RPG::Skill < RPG::UsableItem
#--------------------------------------------------------------------------
# â—‹ Generate MP consumption remodelling cache
#--------------------------------------------------------------------------
def create_mp_cost_alter_cache
@__consume_hp = false
@__mp_cost_rate = false
@__max_mp_cost_rate = false
@__mp_proportional_damage = false
self.note.split(/[\r\n]+/).each { |prop|
case prop
when KGC::MPCostAlter::Regexp::Skill::CONSUME_HP
# HP Consumption
@__consume_hp = true
when KGC::MPCostAlter::Regexp::Skill::MP_COST_RATE
# MP Cost Rate
@__mp_cost_rate = true
@__max_mp_cost_rate = ($1 != nil)
when KGC::MPCostAlter::Regexp::Skill::MP_PROPORTIONAL_DAMAGE
# Proportional MP Damage
@__mp_proportional_damage = true
end
}
end
#--------------------------------------------------------------------------
# â—‹ HP Consumption
#--------------------------------------------------------------------------
def consume_hp
create_mp_cost_alter_cache if @__consume_hp == nil
return @__consume_hp
end
#--------------------------------------------------------------------------
# â—‹ MP Consumption Ratio
#--------------------------------------------------------------------------
def mp_cost_rate
create_mp_cost_alter_cache if @__mp_cost_rate == nil
return (@__mp_cost_rate ? self.mp_cost : -1)
end
#--------------------------------------------------------------------------
# â—‹ MaxMP Consumption Ratio
#--------------------------------------------------------------------------
def max_mp_cost_rate
create_mp_cost_alter_cache if @__max_mp_cost_rate == nil
return @__max_mp_cost_rate
end
#--------------------------------------------------------------------------
# â—‹ Proportional MP Damage Consumption Ratio
#--------------------------------------------------------------------------
def mp_proportional_damage
create_mp_cost_alter_cache if @__mp_proportional_damage == nil
return @__mp_proportional_damage
end
end
#==============================================================================
# â– Game_Battler
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# â—