class Game_Enemy < Game_Battler
  
  #--------------------------------------------------------------------------
  # ● 行動条件合致判定［ターン数］
  #--------------------------------------------------------------------------
  def conditions_met_turns?(param1, param2)
    n = @turn_count 
    if param2 == 0
      n == param1
    else
      n > 0 && n >= param1 && n % param2 == param1 % param2
    end
  end
  #--------------------------------------------------------------------------
  # ● 戦闘終了処理
  #--------------------------------------------------------------------------
  def on_battle_end
    @result.clear
    remove_battle_states
    remove_all_buffs
    clear_actions
    clear_tp unless preserve_tp?
  end
  
  #--------------------------------------------------------------------------
  # ● 戦闘行動の作成
  #--------------------------------------------------------------------------
  alias tako5454548989make_actions make_actions
  def make_actions
    tako5454548989make_actions ##unless state?($prepare_skill_state_id)
    if state?($prepare_skill_state_id)
      clear_actions
      execute_prepare_skill_actions
      @prepare_skill = [0,0]
      return
    end
    return unless @actions[0]
    pitem = @actions[0].item
    tindex = @actions[0].target_index
    if pitem.class == RPG::Skill && pitem.speed < 0
      clear_actions      
      @prepare_skill = [pitem.id , tindex]
      add_state($prepare_skill_state_id)     
    end  
  end  
  
end 