Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        ep = Squid.GetComponent <EnemyParameter>();


        if (ep.hp <= (SquidSc.GetHp() / 2))
        {
            material.SetFloat(propID_h, 0.45f);
        }



        Tentacle_Y += i;
        if (Tentacle_Y > 5.0f)
        {
            // 反転
            i = -0.12f;
        }
        if (Tentacle_Y < -7.0f)
        {
            Destroy(this.gameObject);
        }

        this.gameObject.transform.position = new Vector3(this.transform.position.x, Tentacle_Y, this.transform.position.z);
    }
Esempio n. 2
0
 void OnStartCautionCount(EnemyParameter param_)
 {
     // 参数设置和计算的开始
     Debug.Log("OnStartCautionCount");
     param    = param_;
     waitTime = param.cautionWaitMax;
     StartCount(true);
 }
Esempio n. 3
0
 void OnStartCautionCount(EnemyParameter param_)
 {
     // パラメータセットと、カウンタ開始.
     Debug.Log("OnStartCautionCount");
     param    = param_;
     waitTime = param.cautionWaitMax;
     StartCount(true);
 }
Esempio n. 4
0
 public EnemyParameter(EnemyParameter param_)
 {
     scoreMax           = param_.scoreMax;
     scoreMin           = param_.scoreMin;
     cautionWaitMax     = param_.cautionWaitMax;
     cautionWaitMin     = param_.cautionWaitMin;
     cautionWaitLimit   = param_.cautionWaitLimit;
     sonarHitAddCaution = param_.sonarHitAddCaution;
     sneaking           = param_.sneaking;
 }
        /// <summary>
        /// 表示サンプルデータを生成する。
        /// </summary>
        /// <returns>敵情報のリスト</returns>
        public List <EnemyParameter> CreateSampleData()
        {
            var ret = new List <EnemyParameter>();

            // 10件データ生成
            Enumerable.Range(1, 10).ToList().ForEach(i => {
                var enemy = new EnemyParameter($"enemy{i}", 100 * i, ((i % 5) == 0));
                ret.Add(enemy);
            });

            return(ret);
        }
        /// <summary>
        /// CSVにエクスポートする。
        /// </summary>
        /// <param name="targetList">出力対象データ</param>
        /// <param name="filePath">ファイルパス</param>
        public async Task ExportAsync(DataTable targetDT, string filePath)
        {
            // DataTableをListに変換
            var list = new List <EnemyParameter>();

            targetDT.Rows.OfType <DataRow>().ToList().ForEach(dr => {
                var enemy = new EnemyParameter(dr["name"].ToString() ?? "", Convert.ToInt32(dr["hp"]), (Convert.ToByte(dr["boss_flag"]) == 1));

                list.Add(enemy);
            });

            await this.ExportAsync(list, filePath);
        }
Esempio n. 7
0
    void Start()
    {
        FPSCon    = GameObject.Find("FPSController");
        DamageFlg = false;

        // 弾じゃなかったらそのまま攻撃力を取得
        if (BulletFlg == false)
        {
            ep = GetComponent <EnemyParameter>();

            // パラメータから攻撃力を取得
            enemyatkpow = ep.atk;
        }
    }
Esempio n. 8
0
    public void LoadMonsterParameterFromXML(string monName, EnemyParameter m_Parameter)
    {
        m_Parameter.level       = dicMonster[monName].Level;
        m_Parameter.Current_HP  = dicMonster[monName].Max_HP;
        m_Parameter.Max_HP      = dicMonster[monName].Max_HP;
        m_Parameter.Attack_Min  = dicMonster[monName].Attack_Min;
        m_Parameter.Attack_Max  = dicMonster[monName].Attack_Max;
        m_Parameter.Defense     = dicMonster[monName].Defence;
        m_Parameter.Exp         = dicMonster[monName].Exp;
        m_Parameter.RewardMoney = dicMonster[monName].RewardMoney;
        m_Parameter.Monster_ID  = dicMonster[monName].Monster_ID;

        Debug.Log("LoadMonsterParameterFromXML : " + monName);
    }
Esempio n. 9
0
    /// <summary>
    /// 初始化蜘蛛的参数
    /// </summary>
    private void Init()
    {
        _enemyManager.enemyType  = EnemyType;
        _enemyParameterEnemyType = _enemyManager.EnemyParameterSet();

        hp             = _enemyParameterEnemyType.hp;
        _maxHp         = _enemyParameterEnemyType.hp;
        attackRate     = _enemyParameterEnemyType.attackRate;
        moveSeed       = _enemyParameterEnemyType.moveSeed;
        attackDistance = _enemyParameterEnemyType.attackDistance;
        walkDistance   = _enemyParameterEnemyType.walkDistance;
        damage         = _enemyParameterEnemyType.damage;
        score          = _enemyParameterEnemyType.Score;
    }
Esempio n. 10
0
    // Start is called before the first frame update
    void Start()
    {
        // エネミー情報取得
        enemy = this.gameObject;


        // ヒットマテリアル挿入
        hitmaterial = enemy.GetComponent <SpriteRenderer>().material;


        // エネミーパラメータ
        ep = GetComponent <EnemyParameter>();
        // ヒットエフェクト用
        propID = Shader.PropertyToID("_Brightness");
    }
Esempio n. 11
0
    private void Start()
    {
        e_Ani = GetComponent <EnemyAni>();
        ChangeState(M_State.Idle, EnemyAni.Idle);

        player = GameObject.FindGameObjectWithTag("Player").transform;

        e_Parameter = GetComponent <EnemyParameter>();
        e_Parameter.DeadEvent.AddListener(CallDeadEvent);
        p_Parameter = player.gameObject.GetComponent <PlayerParameter>();

        GetComponent <ObjectData>().Obj_ID = e_Parameter.Monster_ID;

        controller = GetComponent <CharacterController>();

        HideSelection();
    }
Esempio n. 12
0
    void OnInstantiatedChild(GameObject target)
    {
        // 生成されたオブジェクトに対して設定
        float t = 0;
        if(duration > 0) t = (Time.timeSinceLevelLoad - timeStamp) / duration;
        //        Debug.Log("EnemyParamSetter: t=" + t);

        EnemyParameter param = new EnemyParameter();
        param.scoreMax = (int)Mathf.Lerp(fromParam.scoreMax, toParam.scoreMax, t);
        param.scoreMin = (int)Mathf.Lerp(fromParam.scoreMin, toParam.scoreMin, t);
        param.cautionWaitMax = Mathf.Lerp(fromParam.cautionWaitMax, toParam.cautionWaitMax, t);
        param.cautionWaitMin = Mathf.Lerp(fromParam.cautionWaitMin, toParam.cautionWaitMin, t);
        param.sonarHitAddCaution = (int)Mathf.Lerp(fromParam.sonarHitAddCaution, toParam.sonarHitAddCaution, t);
        param.sneaking = Mathf.Lerp(fromParam.sneaking, toParam.sneaking, t);
        // 生成時からカウンタをはじめる
        target.SendMessage("OnStartCautionCount", param);
    }
Esempio n. 13
0
    public EnemyParameter EnemyParameterSet()
    {
        switch (enemyType)
        {
        case EnemyType.Enemy_little:
            enemyParameter_EnemyType = new EnemyParameter()
            {
                hp = 100, attackRate = 1f, moveSeed = 0.5f, attackDistance = 0.8f, walkDistance = 107, damage = 2, Score = 1
            };
            break;

        case EnemyType.Enemy_mormal:
            enemyParameter_EnemyType = new EnemyParameter()
            {
                hp = 150, attackRate = 2.0f, moveSeed = 0.3f, attackDistance = 1.5f, walkDistance = 104, damage = 7, Score = 1
            };
            break;

        case EnemyType.Enemy_fly:
            enemyParameter_EnemyType = new EnemyParameter()
            {
                hp = 150, attackRate = 2f, moveSeed = 0.4f, attackDistance = 1.5f, walkDistance = 106, damage = 7, Score = 1
            };
            break;

        case EnemyType.Enemy_fly_suspension:
            enemyParameter_EnemyType = new EnemyParameter()
            {
                hp = 150, attackRate = 2f, moveSeed = 0.4f, attackDistance = 1.5f, walkDistance = 106, damage = 7, Score = 1
            };
            break;

        case EnemyType.Enemy_Boss:
            enemyParameter_EnemyType = new EnemyParameter()
            {
                hp = 6000, attackRate = 2f, moveSeed = 0, attackDistance = 6f, walkDistance = 4f, damage = 15, Score = 66
            };
            break;

        default:
            break;
        }

        return(enemyParameter_EnemyType);
    }
Esempio n. 14
0
    //データをロードしてパラメータを作成
    public static EnemyParameter getEnemyParameter(int number)
    {
        var parameter = new EnemyParameter();

        XmlNodeList nodes = XMLReader.Instance.enemyNodes;
        XmlNode tempNode = searchNode(number, nodes);

        parameter.id = number;
        foreach (XmlNode node in tempNode.ChildNodes)
        {
            if (node.Name == "cName") { parameter.cName = node.InnerText; }
            if (node.Name == "maxHp") { parameter.maxHp = int.Parse(node.InnerText); }
            if (node.Name == "atk") { parameter.atk = int.Parse(node.InnerText); }
        }
        parameter.hp = parameter.maxHp;

        return parameter;
    }
Esempio n. 15
0
    // Start is called before the first frame update
    void Start()
    {
        Squid   = GameObject.Find("Squid");
        SquidSc = Squid.GetComponent <Squid>();

        ep = Squid.GetComponent <EnemyParameter>();
        // マテリアル
        material = this.gameObject.GetComponent <SpriteRenderer>().material;
        propID_h = Shader.PropertyToID("_Hue");


        Tentacle_Y = -7.0f;
        i          = 0.3f;

        GameObject smoke = Instantiate(Smoke) as GameObject;

        smoke.transform.position = new Vector3(this.transform.position.x, 0, this.transform.position.z);
        Destroy(smoke, 4.0f);
    }
Esempio n. 16
0
    void OnInstantiatedChild(GameObject target)
    {
        // 生成されたオブジェクトに対して設定.
        float t = 0;

        if (duration > 0)
        {
            t = (Time.timeSinceLevelLoad - timeStamp) / duration;
        }
//        Debug.Log("EnemyParamSetter: t=" + t);

        EnemyParameter param = new EnemyParameter();

        param.scoreMax           = (int)Mathf.Lerp(fromParam.scoreMax, toParam.scoreMax, t);
        param.scoreMin           = (int)Mathf.Lerp(fromParam.scoreMin, toParam.scoreMin, t);
        param.cautionWaitMax     = Mathf.Lerp(fromParam.cautionWaitMax, toParam.cautionWaitMax, t);
        param.cautionWaitMin     = Mathf.Lerp(fromParam.cautionWaitMin, toParam.cautionWaitMin, t);
        param.sonarHitAddCaution = (int)Mathf.Lerp(fromParam.sonarHitAddCaution, toParam.sonarHitAddCaution, t);
        param.sneaking           = Mathf.Lerp(fromParam.sneaking, toParam.sneaking, t);
        // 生成時からカウンタをはじめる.
        target.SendMessage("OnStartCautionCount", param);
    }
Esempio n. 17
0
    public void AttackEnemy(GameObject Enemy)
    {
        if (CurrentEnemy != null && CurrentEnemy == Enemy)
        {
            return;
        }

        e_Parameter = Enemy.GetComponent <EnemyParameter>();

        if (e_Parameter.isDead == false)
        {
            CurrentEnemy     = Enemy;
            CurrentTargetPos = CurrentEnemy.transform.position;

            GameManager.Getinstance().ChangeCurrentTarget(CurrentEnemy);

            ChangeState(State.Walk, PlayerAni.Ani_Walk);
        }
        else
        {
            e_Parameter = null;
        }
    }
    void Start()
    {
        if (isServer) {
            scoreObject = GameObject.FindGameObjectWithTag("DataSource");
            transform.rotation = Quaternion.identity;
            transform.position = new Vector3(0, 0, 0);
            waves = 0;
            currentTime = 0;
            GameObject[] players = GameObject.FindGameObjectsWithTag("Player");

            int input_rank = 0;

            int min = 1000, max = 0, ave = 0, count = 0;
            foreach (GameObject player in players)
            {
                if (player != null) {
                    min = Mathf.Min(player.GetComponent<PlayerController>().rank, min);
                    max = Mathf.Max(player.GetComponent<PlayerController>().rank, max);
                    count++;
                    ave += player.GetComponent<PlayerController>().rank;
                }
            }
            ave /= count;

            if (NetworkManagerCustom.SingletonNM.selectedDifficulty == LevelEnum.Easy){
                if (ave <= min + 3)
                    input_rank = Mathf.Max(1, min - 2);
                else
                    input_rank = min;
            }
            else if (NetworkManagerCustom.SingletonNM.selectedDifficulty == LevelEnum.Medium) {
                if(ave == min)
                    input_rank = ave + 1;
                else
                    input_rank = ave;
            }
            else {
                if (ave >= max - 3)
                    input_rank = max + 2;
                else
                    input_rank = max;
            }

            Debug.Log("input+rank " + input_rank);

            enemyParameter = scoreObject.GetComponent<EnemyParameter>().getEnemys(input_rank);

            bossBlood = (input_rank + 5) * 120;

            max_wave = enemyParameter.enemyWave;
            enemyNumbers = enemyParameter.enemyNumbers;
            enemyData = enemyParameter.enemyDatas;

            maxEnemyNum = 0;
            curEnemyNum = 0;
            for(int i = 0; i < max_wave; i++) {
                maxEnemyNum += enemyNumbers[i];
            }

            NetworkManagerCustom.SingletonNM.SetCurrentEnemyWave(0);

            StartCoroutine("PlayingTimeCountDown");

            isReadyForNewWave = true;

            countDown = -1;
            //StartCoroutine(GenerateEnemyInGroup(enemyNumbers[waves]));

        }
    }
Esempio n. 19
0
 void Start()
 {
     enemyParameter = GetComponent<EnemyParameter>();
     EnemyAttributeStatusGeneration();
 }
Esempio n. 20
0
    void Start()
    {
        // プレイヤー情報取得
        player = GameObject.Find("FPSController");

        //GetComponentを用いてコンポーネントを取り出す.
        // アニメータ
        animator = this.gameObject.GetComponent <Animator>();
        // マテリアル
        material = this.gameObject.GetComponent <SpriteRenderer>().material;
        // エネミーパラメータ
        ep = this.gameObject.GetComponent <EnemyParameter>();
        // エネミーヒットエフェクト
        eh = this.gameObject.GetComponent <EnemyHitEffect>();
        // ダメージナンバーエフェクト
        dn = this.gameObject.GetComponent <DamageNumEffect>();
        // ライト
        plight = this.gameObject.GetComponent <Light>();



        // レベル情報取得
        AILevel = ep.GetLevel();


        // レベル処理
        propID_h = Shader.PropertyToID("_Hue");
        propID_s = Shader.PropertyToID("_Saturation");
        propID_c = Shader.PropertyToID("_Contrast");

        if (AILevel == 1)
        {
            // マテリアル
            material.SetFloat(propID_h, 0.0f);
            material.SetFloat(propID_s, 0.5f);
            material.SetFloat(propID_c, 0.5f);

            // パラメータ
            ep.hp       = 20;
            ep.atk      = 10;
            ep.def      = 0;
            ep.speed    = 0;
            ep.startrot = 60;

            // ポイントライト
            plight.color = new Color(0.5f, 0.5f, 1.0f, 1.0f);


            // 弾取得
            bullet = Resources.Load("GhostBulletRed") as GameObject;
        }
        else if (AILevel == 2)
        {
            material.SetFloat(propID_h, 0.45f);
            material.SetFloat(propID_s, 1.0f);
            material.SetFloat(propID_c, 0.7f);

            ep.hp       = 30;
            ep.atk      = 15;
            ep.def      = 10;
            ep.speed    = 0;
            ep.startrot = 60;

            plight.color = new Color(1.0f, 0.5f, 0.5f, 1.0f);

            bullet = Resources.Load("GhostBulletBlue") as GameObject;
        }
        else if (AILevel == 3)
        {
            material.SetFloat(propID_h, 0.3f);
            material.SetFloat(propID_s, 0.4f);
            material.SetFloat(propID_c, 1.0f);

            ep.hp       = 40;
            ep.atk      = 25;
            ep.def      = 20;
            ep.speed    = 0;
            ep.startrot = 60;

            plight.color = new Color(1.0f, 0.5f, 1.0f, 1.0f);

            bullet = Resources.Load("GhostBulletGreen") as GameObject;
        }
    }
Esempio n. 21
0
 void OnStartCautionCount(EnemyParameter param_)
 {
     // パラメータセットと、カウンタ開始
     Debug.Log("OnStartCautionCount");
     param = param_;
     waitTime = param.cautionWaitMax;
     StartCount(true);
 }
Esempio n. 22
0
    void Start()
    {
        // プレイヤー情報取得
        player = GameObject.Find("FPSController");

        //GetComponentを用いてコンポーネントを取り出す.
        // アニメータ
        animator = this.gameObject.GetComponent <Animator>();
        // マテリアル
        material = this.gameObject.GetComponent <SpriteRenderer>().material;
        // カラー
        color = this.gameObject.GetComponent <SpriteRenderer>().color;
        // エネミーパラメータ
        ep = this.gameObject.GetComponent <EnemyParameter>();
        // エネミーヒットエフェクト
        eh = this.gameObject.GetComponent <EnemyHitEffect>();
        // ダメージナンバーエフェクト
        dn = this.gameObject.GetComponent <DamageNumEffect>();
        // ライト
        //plight = this.gameObject.GetComponent<Light>();


        // レベル情報取得
        AILevel = ep.GetLevel();

        // 行動時間調整
        ActionTime = 120;


        // レベル処理
        propID_h = Shader.PropertyToID("_Hue");
        propID_s = Shader.PropertyToID("_Saturation");
        propID_c = Shader.PropertyToID("_Contrast");

        if (AILevel == 1)
        {
            // マテリアル
            material.SetFloat(propID_h, 0.0f);
            material.SetFloat(propID_s, 0.5f);
            material.SetFloat(propID_c, 0.5f);

            // パラメータ
            ep.hp  = 20;
            ep.atk = 10;
            ep.def = 0;
            //ep.speed = 1.0f;
            ep.startrot = 60;

            // ポイントライト
            //plight.color = new Color(0.5f,0.5f,1.0f,1.0f);

            SquidHp = ep.hp;
        }
        else if (AILevel == 2)
        {
            material.SetFloat(propID_h, 0.45f);
            material.SetFloat(propID_s, 1.0f);
            material.SetFloat(propID_c, 0.7f);

            //ep.hp = 10;
            ep.atk = 20;
            ep.def = 10;
            //ep.speed = 1.3f;
            ep.startrot = 60;

            //plight.color = new Color(1.0f,0.5f,0.5f,1.0f);
        }
    }