#敌人自带不可选中
class RPG::Enemy
def can_select?
!@note.include?("<不可选中>")
end
end
class Window_BattleEnemy
def item_max
$game_troop.alive_select_members.size
end
def enemy
$game_troop.alive_select_members[@index]
end
def draw_item(index)
change_color(normal_color)
name = $game_troop.alive_select_members[index].name
draw_text(item_rect_for_text(index), name)
end
end
class Game_Troop
def alive_select_members
members.select {|member| member.alive? && member.enemy.can_select?}
end
end
class Scene_Battle
alias mf240915on_enemy_ok on_enemy_ok
def on_enemy_ok
return @enemy_window.activate unless @enemy_window.enemy
mf240915on_enemy_ok
end
end
#——————————————————————————————————
#不可选中的状态
class Game_Enemy
def add_state(state_id)
if state_addable?(state_id)
add_new_state(state_id) unless state?(state_id)
reset_state_counts(state_id)
@result.added_states.push(state_id).uniq!
change_select(false) if $data_states[state_id].note.include?("<不可选中>")
end
end
def remove_state(state_id)
if state?(state_id)
revive if state_id == death_state_id
erase_state(state_id)
refresh
@result.removed_states.push(state_id).uniq!
change_select(true) if $data_states[state_id].note.include?("<不可选中>")
end
end
def change_select(can_select)
can_select ? enemy.note.sub!(/<不可选中>/,'') : enemy.note += "<不可选中>"
end
end