Exemplo n.º 1
0
        private void creatEnemy()
        {
            int enemyId = EnemyHelper.getRandomEnemyFromLevel(level);

            int   blankRand = Random.Range(0, 2);
            float xBlank    = (blankRand == 0) ? 50 : 0;
            float zBlank    = (blankRand == 1) ? 50 : 0;

            float xPos  = Random.Range(0, 50);
            int   xRand = (Random.Range(0, 2) == 0) ? 1:-1;

            xPos  = (xPos + xBlank) * xRand;
            xPos += transform.position.x;

            float zPos  = Random.Range(0, 50);
            int   zRand = (Random.Range(0, 2) == 0) ? 1 : -1;

            zPos  = (zPos + zBlank) * zRand;
            zPos += transform.position.z;

            float yPos = Terrain.activeTerrain.terrainData.GetInterpolatedHeight(
                xPos / Terrain.activeTerrain.terrainData.size.x,
                zPos / Terrain.activeTerrain.terrainData.size.z
                );

            var enemy = EnemyMasterManager.getInstance().getEnemyFromId(enemyId);

            enemy.getContainer().transform.position = new Vector3(xPos, yPos, zPos);
        }
Exemplo n.º 2
0
        public ExterminationQuest(FlagList flags, Client client)
        {
            this.LEVEL  = client.Level;
            this.client = client;
            this.flags  = flags;

            this.TARGET_ID = EnemyHelper.getRandomEnemyFromLevel(LEVEL);

            this.INTERNAL_NUMBER = flags.getEnemyKilled(TARGET_ID);

            var compensationTypes    = Enum.GetValues(typeof(CompentionType));
            int compensationTypeRand = UnityEngine.Random.Range(0, compensationTypes.Length - 1);

            this.compentionType = (CompentionType)compensationTypes.GetValue(compensationTypeRand);

            EXTERMINATION_NUMBER = LEVEL + UnityEngine.Random.Range(2, 6);

            var targetName = EnemyMasterManager.getInstance().getEnemyBuilderFromId(TARGET_ID).getName();

            NAME        = "駆除依頼";
            DESCRIPTION = targetName + "を" + EXTERMINATION_NUMBER + "匹倒す";
            FLAVOR_TEXT = "最近問題になっている" + targetName + "を駆除しよう";
        }