示例#1
0
    /// <summary>
    /// 自分のターン 通常攻撃
    /// </summary>
    private void MyTurn_NormalAttack()
    {
        int    intBullet = int.Parse(OperatePlayerData.GetPlayerData("PlayerBullet"));
        string strBullet = Convert.ToString(intBullet - 1);

        OperatePlayerData.SetPlayerData(strBullet, "PlayerBullet");

        var query_Player = (from x in GameManager.xdoc_PlayerData.Descendants("Player")
                            select x).Single();
        var query_Enemy = (from x in GameManager.xdoc_BattleSheet.Descendants("Enemy")
                           where x.Element("BattleNo").Value == GameManager.TargetFlg
                           select x).Single();
        int PlayerAttackValue  = int.Parse(query_Player.Element("PlayerAttackValue_OnBattle").Value);
        int EnemyDiffenceValue = int.Parse(query_Enemy.Element("EnemyDiffenceValue").Value);

        GameManager.Text_MainWindow.text = OperatePlayerData.GetPlayerData("PlayerName") + "の攻撃!";

        StartCoroutine(GameManager.WaitTime_1());

        int Damage = CirculateParameter.DamageCirculate(PlayerAttackValue, EnemyDiffenceValue);

        GameManager.Text_MainWindow.text = GameManager.Text_MainWindow.text + "\n" + query_Enemy.Element("EnemyName").Value + "に" + Damage + "のダメージ!";

        StartCoroutine(GameManager.WaitTime_1());

        //攻撃結果ジャッジ
        if (ComparerParameter.JudgeDamageResult_Single_Player(Damage) == true)
        {
            ManageBattle.DeadEnemy_Single(GameManager.TargetFlg);
        }
    }
    /// <summary>
    /// 自分のターン パワーショット
    /// </summary>
    private void MyTurn_PowerShot()
    {
        int    intBullet = int.Parse(OperatePlayerData.GetPlayerData(GetXMLQueryKey_PlayerData.PlayerBullet()));
        string strBullet = Convert.ToString(intBullet - 2);

        OperatePlayerData.SetPlayerData(strBullet, GetXMLQueryKey_PlayerData.PlayerBullet());

        var query_Player = (from x in BattleStaticValiable.xdoc.Descendants("Player")
                            select x).Single();
        var query_Enemy = (from x in BattleStaticValiable.xdoc2.Descendants("Enemy")
                           where x.Element("BattleNo").Value == GameManager.TargetFlg
                           select x).Single();

        int PlayerAttackValue = int.Parse(query_Player.Element("PlayerAttackValue_OnBattle").Value) *
                                int.Parse(OperatePlayerSkill.GetPlayerSkillData(GetXMLQueryKey_PlayerSkill.PlayerSkill_DamagePercent(int.Parse(GameManager.SkillNoFlg)), int.Parse(GameManager.SkillNoFlg)));
        int EnemyDiffenceValue = int.Parse(query_Enemy.Element("EnemyDiffenceValue").Value);

        GameManager.Text_MainWindow.text = OperatePlayerData.GetPlayerData(GetXMLQueryKey_PlayerData.PlayerName()) + "はパワーショットを放った!";

        int Damage = CirculateParameter.DamageCirculate(PlayerAttackValue, EnemyDiffenceValue);

        GameManager.Text_MainWindow.text = GameManager.Text_MainWindow.text + "\n" + query_Enemy.Element("EnemyName").Value + "に" + Damage + "のダメージ!";

        StartCoroutine(GameManager.WaitTime_1());

        //攻撃結果ジャッジ
        if (ComparerParameter.JudgeDamageResult_Single_Player(Damage) == true)
        {
            ManageBattle.DeadEnemy_Single(GameManager.TargetFlg);
        }
    }
    private static void EnemyAttack(string BattleNo)
    {
        MonoBehaviour mono = new MonoBehaviour();

        var query_Enemy = (from x in BattleStaticValiable.xdoc2.Descendants("Enemy")
                           where x.Element("BattleNo").Value == BattleNo
                           select x).Single();
        var query_Player = (from x in BattleStaticValiable.xdoc.Descendants("Player")
                            select x).Single();

        int PutternNumber = UnityEngine.Random.Range(1, 100);

        //通常攻撃
        //デバッグ用---------------------------------------------------------↓
        int EnemyAttackValue    = int.Parse(query_Enemy.Element("EnemyAttackValue").Value);
        int PlayerDeffenceValue = int.Parse(query_Player.Element("PlayerDiffenceValue_OnBattle").Value);

        GameManager.Text_MainWindow.text = query_Enemy.Element("EnemyName").Value + "の攻撃!";

        mono.StartCoroutine(GameManager.WaitTime_1());

        int Damage = CirculateParameter.DamageCirculate(EnemyAttackValue, PlayerDeffenceValue);

        GameManager.Text_MainWindow.text = GameManager.Text_MainWindow.text + "\n" + query_Player.Element("PlayerName").Value + "に" + Damage + "のダメージ!";

        mono.StartCoroutine(GameManager.WaitTime_1());

        if (ComparerParameter.JudgeDamageResult_Single_Enemy(Damage) == true)
        {
            ManageBattle.DeadPlayer();
            //ゲームオーバー処理
            mono.StartCoroutine(GameManager.WaitTime_5());

            SceneManager.UnloadSceneAsync("BattleScene");
        }
        //デバッグ用---------------------------------------------------------↑

        ////敵の行動を制御
        //if(1 <= PutternNumber && PutternNumber <= 10)
        //{
        //    //スキル1攻撃
        //}
        //else if(11 <= PutternNumber && PutternNumber <= 20)
        //{
        //    //スキル2攻撃
        //}
        //else if(21 <= PutternNumber && PutternNumber <= 30)
        //{
        //    //スキル3攻撃
        //}
        //else if(31 <= PutternNumber && PutternNumber <= 100)
        //{
        //    //固有行動があれば書く
        //    switch (query_Enemy.Element("EnamyName").Value)
        //    {
        //        case "マメドローン":
        //            break;
        //        default:
        //            break;
        //    }

        //    //通常攻撃
        //    int EnemyAttackValue = int.Parse(query_Enemy.Element("EnemyAttackValue").Value);
        //    int PlayerDeffenceValue = int.Parse(query_Player.Element("PlayerDiffenceValue_OnBattle").Value);

        //    GameManager.Text_MainWindow.text = query_Enemy.Element("EnemyName").Value + "の攻撃!";

        //    int Damage = CirculateParameter.DamageCirculate(EnemyAttackValue, PlayerDeffenceValue);

        //    GameManager.Text_MainWindow.text = GameManager.Text_MainWindow.text + "\n" + query_Player.Element("PlayerName").Value + "に" + Damage + "のダメージ!";

        //    StartCoroutine(GameManager.WaitTime_1());

        //    if (ComparerParameter.JudgeDamageResult_Single_Enemy(Damage) == true)
        //    {
        //        ManageBattle.DeadPlayer();
        //    }
        //}
    }