#==============================================================================
# module BlizzCFG
#==============================================================================
module BlizzCFG
def self.demi_database(id)
case id
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Demi Database
#
# Use following template to create Demi skills:
#
# when ID then return RATE
#
# ID - ID of the skill in the database
# RATE - percentage of how much of the remaining HP should be taken away
#
# Example:
#
# when 88 then return 25
#
# Skill with ID 88 will do damage equal to 25% of the enemies' remaining HP.
#
# Note that using values equal to or greater than 100 will kill instantly.
# Negative values will heal instead.
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
when 88 then return 25
when 89 then return 50
when 58 then return 50
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Demi Database
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
end
return 0
end
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# Define which skill IDs will use the enemy's Max HP value instead of their
# current HP (e.g. a skill that does 25% damage will kill a target after 4 uses)
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
DEMI_USE_MAX_HP = [88, 89]
end
#==============================================================================
# Game_Battler
#==============================================================================
class Game_Battler
alias skill_effect_demi_skill_later skill_effect
def skill_effect(user, skill)
last_hp = self.hp
last_sr = self.sr if $crls && self.is_a?(Game_Actor)
result = skill_effect_demi_skill_later(user, skill)
if $game_system.DEMI_SKILL
rate = BlizzCFG.demi_database(skill.id)
if rate != 0
if result && elements_correct(skill.element_set) <= 0
self.damage = "No effect!"
else
self.hp = last_hp
self.hp = self.hp
self.sr = last_sr if $crls && self.is_a?(Game_Actor)
if result || self.damage.is_a?(Numeric)
val = BlizzCFG::DEMI_USE_MAX_HP.include?(skill.id) ? self.maxhp : last_hp
self.damage = val * rate / 100
self.hp -= self.damage
end
end
end
end
return result
end
end