Ejemplo n.º 1
0
    void Damage()
    {
        character.animator.CrossFade("AngierIdle", 0.1f);
        character.animator.SetBool("isIdle", true);
        character.animator.SetBool("isWalking", false);
        //character.animator.SetBool("isAttact", true);
        //character.animator.Play("AngierIdle");
        if (SetTargetInfo())
        {
            switch (ACTION)
            {
            case "Attact":
                //character.animator.Play("AngierAttact");
                BattleInfo.enemies_hp[ENEMY] -= BattleInfo.characters_inbattle[now_character].AT.At * 10;
                Debug.Log(BattleInfo.characters_inbattle[now_character].AT.At * 10);
                break;

            case "Hattact":
                if (EnemyActioncontroller.enemies_moving[ENEMY])
                {
                    EnemyActioncontroller.enemies_timer[ENEMY]  = 0;
                    EnemyActioncontroller.enemies_moving[ENEMY] = false;
                    Debug.Log("enemies_timer[" + ENEMY + "] 歸零");
                }
                else
                {
                    EnemyActioncontroller.enemies_timer[ENEMY] -= 1;
                }
                BattleInfo.enemies_hp[ENEMY] -= BattleInfo.characters_inbattle[now_character].AT.At / 2 * 10;
                break;

            default:
                Debug.Log("error5");
                break;
            }
        }
        else
        {
            Debug.Log("找不到目標");
        }
        for (int i = 0; i < BattleInfo.enemies_hp.Count; i++)
        {
            Debug.Log("剩餘血量 : " + BattleInfo.enemies_inbattle[i].name + " " + BattleInfo.enemies_hp[i]);
        }
        hpcontroller.SendMessage("Death");
    }
    void Damage()
    {
        if (CheckTarget())
        {
            switch (now_action)
            {
            case "Attact":
                BattleInfo.characters_hp[now_target] -= BattleInfo.enemies_inbattle[now_enemy].At * 10;
                break;

            case "Hattact":
                //if (EnemyActioncontroller.enemies_moving[enemy])
                //{
                //    EnemyActioncontroller.enemies_timer[enemy] = 0;
                //    EnemyActioncontroller.enemies_moving[enemy] = false;
                //    Debug.Log("enemies_timer[" + enemy + "] 歸零");
                //}
                //BattleInfo.characters_inbattle[now_target].Hp -= BattleInfo.characters_inbattle[now_enemy].At * 10;
                break;

            default:
                Debug.Log("error5");
                break;
            }
        }
        else
        {
            Debug.Log("找不到目標");
        }
        for (int i = 0; i < BattleInfo.characters_inbattle.Count; i++)
        {
            Debug.Log("剩餘血量 : " + BattleInfo.characters_inbattle[i].Name + " " + BattleInfo.characters_hp[i]);
        }
        Resettimer();
        SwitchEnemyMoving();
        hpcontroller.SendMessage("Death");
    }