class Game_Battler
STATE_20140727 = {
[4,5,6,7,8] => 3, # 4,5,6,7,8 号状态只能出现 3 个
[9,10,11] => 2,
}
alias cs_20140727 clear_states
def clear_states
cs_20140727
@states_by_time = []
end
alias as_20140727 add_state
def add_state(state_id)
@states_by_time.push(state_id)
as_20140727(state_id)
STATE_20140727.each do |list, max|
if list.count {|id| state?(id) } > max
remove_state(@states_by_time.find {|id| list.include?(id) })
end
end
end
alias rs_20140727 remove_state
def remove_state(state_id)
@states_by_time.delete(state_id)
rs_20140727(state_id)
end
end
class Game_Battler
STATE_20140727 = {
[4,5,6,7,8] => 3, # 4,5,6,7,8 号状态只能出现 3 个
[9,10,11] => 2,
}
alias cs_20140727 clear_states
def clear_states
cs_20140727
@states_by_time = []
end
alias as_20140727 add_state
def add_state(state_id)
@states_by_time.push(state_id)
as_20140727(state_id)
STATE_20140727.each do |list, max|
if list.count {|id| state?(id) } > max
remove_state(@states_by_time.find {|id| list.include?(id) })
end
end
end
alias rs_20140727 remove_state
def remove_state(state_id)
@states_by_time.delete(state_id)
rs_20140727(state_id)
end
end