#==============================================================================
# TheoAllen - 状态伤害使用技能公式
# Version : 1.0
# Language : Informal Indonesian
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Contact :
#------------------------------------------------------------------------------
# *> [url]http://www.rpgmakerid.com[/url]
# *> [url]http://www.rpgmakervxace.net[/url]
# *> [url]http://theolized.blogspot.com[/url]
#==============================================================================
($imported ||= {})[:Theo_StateSkillDamage] = true
#==============================================================================
# Change Logs:
# -----------------------------------------------------------------------------
# 2013.09.24 - Finished
#==============================================================================
%Q{
=================
|| 介绍 ||
-----------------
想要设置状态伤害不只是数据库设定那样百分比掉血吗?而是通过技能来设定
状态伤害?想设置状态的伤害公式像攻击技能那样吗?
该脚本可以设定状态伤害使用指定的技能公式。
======================
|| 使用方法 ||
----------------------
插入到插件脚本之下,Main之上。
在状态的备注栏里备注 <skill damage: id>
id为指定技能的伤害的功能
例如:
<skill damage: 10>
===================
使用条款 :
署名脚本作者, TheoAllen. 你可以自由编辑此脚本,只要你不声明你是脚本的原作者
如果你想用此脚本于商业游戏,请和我共享收益.别忘了给我一份免费的游戏拷贝.
}
#==============================================================================
# 无设定部分
#==============================================================================
class RPG::State
# Store skill ID for formula damage
def skill_damage
if !@skill_damage
@skill_damage = 0
if note =~ /<skill[\s_]+damage\s*:\s*(\d+)>/i
@skill_damage = $1.to_i
end
end
return @skill_damage
end
end
class Game_Battler
alias theo_slipformula_clear_states clear_states
def clear_states
theo_slipformula_clear_states
@state_battler = {}
end
alias theo_slipformula_eff_add_state_attack item_effect_add_state_attack
def item_effect_add_state_attack(user, item, effect)
theo_slipformula_eff_add_state_attack(user, item, effect)
return unless @result.success
user.atk_states.each do |state_id|
if @states.include?(state_id)
@state_battler[state_id] = user
end
end
end
alias theo_slipformula_eff_add_state_normal item_effect_add_state_normal
def item_effect_add_state_normal(user, item, effect)
theo_slipformula_eff_add_state_normal(user, item, effect)
return unless @result.success
if @states.include?(effect.data_id)
@state_battler[effect.data_id] = user
end
end
alias theo_slipformula_erase_state erase_state
def erase_state(state_id)
theo_slipformula_erase_state(state_id)
@state_battler.delete(state_id)
end
alias theo_slipformula_turn_end on_turn_end
def on_turn_end
if alive?
perform_slip_damage_formula
end
theo_slipformula_turn_end
end
def perform_slip_damage_formula
@states.each do |state_id|
if $data_states[state_id].skill_damage > 0 && @state_battler[state_id]
skill = $data_skills[$data_states[state_id].skill_damage]
item_apply(@state_battler[state_id], skill)
self.animation_id = skill.animation_id
SceneManager.scene.log_window.display_action_results(self, skill)
if $imported["YEA-BattleEngine"] && !YEA::BATTLE::MSG_ADDED_STATES
SceneManager.scene.perform_collapse_check(self)
end
15.times {SceneManager.scene.update_basic}
end
end
end
end
class Scene_Battle
attr_reader :log_window
end