示例#1
0
    void NextMonster()
    {
        if (currentWave >= maxWave)
        {
            WinCondition(true);
            return;
        }

        currentWave++;
        propsNode = FSDataNodeTable <ActivityPropsNode> .GetSingleton().FindDataByType(currentWave);

        GetMonsterType(difficulty);
        SceneUIManager.instance.TowerDefence.RefreshWave(propsNode.interval, currentWave - rate, maxWave - rate);
        Invoke("CreatMonster", propsNode.interval);
    }
示例#2
0
    void SetMaxWave(int current)
    {
        switch (state)
        {
        case ActivityType.power:
            if (current >= POWERCOUNT)
            {
                return;
            }
            break;

        case ActivityType.agile:
            if (current >= AGILECOUNT)
            {
                return;
            }
            break;

        case ActivityType.intelligence:
            if (current >= INTELCOUNT)
            {
                return;
            }
            break;
        }

        ActivityPropsNode node = FSDataNodeTable <ActivityPropsNode> .GetSingleton().FindDataByType(current);

        if (MonsterIsNull(node))
        {
            maxWave++;
            SetMaxWave(maxWave);
        }
        else
        {
            maxWave--;
            return;
        }
    }
示例#3
0
    public override void InitScene()
    {
        base.InitScene();



        Globe.isFB = true;

        sn = FSDataNodeTable <SceneNode> .GetSingleton().FindDataByType(GameLibrary.dungeonId);

        if (sn != null)
        {
            switch (sn.bigmap_id)
            {
            case 30300: state = ActivityType.power; break;

            case 30400: state = ActivityType.agile; break;

            case 30500: state = ActivityType.intelligence; break;
            }

            switch (state)
            {
            case ActivityType.power: sceneType = SceneType.ACT_POWER; break;

            case ActivityType.agile: sceneType = SceneType.ACT_AGILE; break;

            case ActivityType.intelligence: sceneType = SceneType.ACT_INTEL; break;
            }

            switch (GameLibrary.dungeonId - sn.bigmap_id)
            {
            case 1: difficulty = DifficultyType.simple; break;

            case 2: difficulty = DifficultyType.ordinary; break;

            case 3: difficulty = DifficultyType.difficult; break;

            case 4: difficulty = DifficultyType.great; break;

            case 5: difficulty = DifficultyType.nightmare; break;

            case 6: difficulty = DifficultyType.abyss; break;
            }
        }

        GetTypeData(state);
        SetMaxWave(maxWave);

        SceneUIManager.instance.TowerDefence.ShowUI(false);
        CreateMainHero();
        escortNPC = player;

        ThirdCamera.instance._flatAngle = 270;

        propsNode = FSDataNodeTable <ActivityPropsNode> .GetSingleton().FindDataByType(currentWave);

        if (null == propsNode)
        {
            Debug.LogError("Loading jsonData is null.");
            return;
        }

        GetMonsterType(difficulty);

        Invoke("CreatMonster", propsNode.interval);

        SceneUIManager.instance.TowerDefence.RefreshWave(propsNode.interval, currentWave - rate, maxWave - rate);

        player.OnDead += (CharacterState cs) =>
        {
            WinCondition(false);
            playerDeadNum++;
        };

        SceneNode sceneNode = FSDataNodeTable <SceneNode> .GetSingleton().FindDataByType(GameLibrary.dungeonId);

        BattleCDandScore.instance.StartCD(null != sceneNode && sceneNode.time_limit != 0 ? (int)sceneNode.time_limit : 300);
        BattleCDandScore.instance.cd.OnRemove += (int count, long id) =>
        {
            if (player.isDie && BattleCDandScore.instance.cd.Id != id)
            {
                return;
            }
            WinCondition(false);
        };
    }
示例#4
0
    bool MonsterIsNull(ActivityPropsNode node)
    {
        switch (difficulty)
        {
        case DifficultyType.simple:
            if (null == node.monster_simple || node.monster_simple.Length <= 0)
            {
                return(false);
            }
            else
            {
                return(true);
            }

        case DifficultyType.ordinary:
            if (null == node.monster_ordinary || node.monster_ordinary.Length <= 0)
            {
                return(false);
            }
            else
            {
                return(true);
            }

        case DifficultyType.difficult:
            if (null == node.monster_difficult || node.monster_difficult.Length <= 0)
            {
                return(false);
            }
            else
            {
                return(true);
            }

        case DifficultyType.great:
            if (null == node.monster_great || node.monster_great.Length <= 0)
            {
                return(false);
            }
            else
            {
                return(true);
            }

        case DifficultyType.nightmare:
            if (null == node.monster_nightmare || node.monster_nightmare.Length <= 0)
            {
                return(false);
            }
            else
            {
                return(true);
            }

        case DifficultyType.abyss:
            if (null == node.monster_abyss || node.monster_abyss.Length <= 0)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
        return(false);
    }