public void AttackBtnClick() { if (battle_main_.UserList[0].State != BattlerBase.ActionState.Ready) { return; } AttackAction action = new AttackAction(); action.Entity = battle_main_.UserList[0]; action.Target = battle_main_.EnemyList[0]; battle_main_.AddAction(action); }
// Update is called once per frame void Update() { List <Enemy> enemy_list = GetEnemyList(); foreach (Enemy enemy in enemy_list) { if (enemy.State == Enemy.ActionState.Ready) { enemy.State = Enemy.ActionState.Action; AIBase ai = enemy.AI; ai_setting_.Entity = enemy; List <AIActionBase> exec_action_list = ai.SelectAI(ai_setting_); foreach (AIActionBase exec_action in exec_action_list) { battle_main_.AddAction(exec_action.Action(ai_setting_)); } } } }
public void SkillOrderClick() { // スキルの待ち時間がある場合 if (skill_info_.CurrentWaitTurn > 0) { return; } if (skill_style_ == 1) { //instance skillAction SkillAction skill_action = this.gameObject.AddComponent <SkillAction>(); //impleachment parcticle /* GameObject skill_effect_go = Instantiate(skill_effect_prehab_, skill_effect_trans_); * skill_effect_go.transform.localPosition = Vector3.zero; * skill_effect_go.transform.localRotation = new Quaternion(); */ //スキルの効果を発動 skill_action.Setuo(skill_info_); skill_action.Setvalue(skill_damage_); skill_action.Entity = battle_main_.UserList[0]; skill_action.Target = battle_main_.UserList[0]; battle_main_.AddAction(skill_action); } else if (skill_style_ == 2) { SkillDefence skill_deffence = this.gameObject.AddComponent <SkillDefence>(); //スキルの効果を発動 skill_deffence.Setuo(skill_info_); skill_deffence.Setvalue(skill_damage_); skill_deffence.Entity = battle_main_.UserList[0]; skill_deffence.Target = battle_main_.UserList[0]; battle_main_.AddAction(skill_deffence); } else if (skill_style_ == 3) { SkillDebuff skill_debuff = this.gameObject.AddComponent <SkillDebuff>(); /*GameObject skill_effect_go = Instantiate(skill_effect_prehab_, skill_effect_trans_); * skill_effect_go.transform.localPosition = Vector3.zero; * skill_effect_go.transform.localRotation = new Quaternion(); */ //スキルの効果を発動 skill_debuff.Setuo(skill_info_); skill_debuff.Setvalue(skill_damage_); skill_debuff.Entity = battle_main_.EnemyList[0]; skill_debuff.Target = battle_main_.EnemyList[0]; battle_main_.AddAction(skill_debuff); } else if (skill_style_ == 4) { SkillHeal skill_heal = this.gameObject.AddComponent <SkillHeal>(); skill_heal.Setuo(skill_info_); skill_heal.Entity = battle_main_.UserList[0]; skill_heal.Target = battle_main_.UserList[0]; battle_main_.AddAction(skill_heal); } else if (skill_style_ == 0) { Debug.Log("null!"); } if (skill_set_callback_ != null) { skill_set_callback_(); } // スキル実行後はスキルの待機時間を設定 skill_info_.CurrentWaitTurn = skill_info_.WaitTurn; }