class Game_Battler
STATE_UPGRADE = {
28 => [28, 29, 30], # 28、29、30号状态为三个等级。通过添加28号状态来升级
31 => [31, 32]
}
alias as_20141212 add_state
def add_state(id)
levels = STATE_UPGRADE[id]
return as_20141212(id) unless levels
index = levels.index { |state| state?(state) } # 当前等级
return as_20141212(id) unless index
return if index == levels.size - 1 # 已经达到最高等级
remove_state levels[index]
as_20141212 levels[index + 1]
end
end
class Game_Battler
STATE_UPGRADE = {
28 => [28, 29, 30], # 28、29、30号状态为三个等级。通过添加28号状态来升级
31 => [31, 32]
}
alias as_20141212 add_state
def add_state(id)
levels = STATE_UPGRADE[id]
return as_20141212(id) unless levels
index = levels.index { |state| state?(state) } # 当前等级
return as_20141212(id) unless index
return if index == levels.size - 1 # 已经达到最高等级
remove_state levels[index]
as_20141212 levels[index + 1]
end
end