Beispiel #1
0
    public void readyForBattle()
    {
        _curRound   = -1;
        _actionTime = 0;
        _isWin      = false;

        _star  = 0;
        _score = 0;

        _gold  = 0;
        _paper = 0;

        SolaEngine engine = SolaEngine.getInstance();
        PartnerMgr pMgr   = (PartnerMgr)engine.getMgr(typeof(PartnerMgr));

        _partners = new Dictionary <int, BattleHeroModel> ();
        Dictionary <int, HeroModel> partner = pMgr.getPartners();

        foreach (int pos in partner.Keys)
        {
            HeroModel       model   = partner[pos];
            BattleHeroModel bhModel = new BattleHeroModel();
            bhModel.setModel(model, false, new Vector3(0, 0, 0));
            bhModel.formatModel();

            _partners.Add(pos, bhModel);
            bhModel.HERO_DIED += _onPartnerDeath;
        }

        MissionModel missionModel = _missionModel;

        _curBattleInfos = missionModel.getBattleInfos();
    }
Beispiel #2
0
    public bool nextRound()
    {
        _curRound++;

        if (_curRound >= _curBattleInfos.Length)
        {
            _isWin = true;
            _star  = 3;

            _missionModel.setStatus(MissionModel.status.FINISHED);
            return(true);
        }

        BattleInfoModel        infoModel = _curBattleInfos [_curRound];
        List <BattleHeroModel> monster   = infoModel.getMonsters();

        _monsters = new List <BattleHeroModel> ();
        for (int i = 0; i < monster.Count; i++)
        {
            BattleHeroModel model = monster [i];
            model.formatModel();
            _monsters.Add(model);
        }

        foreach (BattleHeroModel model in _monsters)
        {
            model.HERO_DIED += _onMonsterDeath;
        }

        List <BattleHeroModel> totalModel = new List <BattleHeroModel> ();

        foreach (BattleHeroModel model in _monsters)
        {
            totalModel.Add(model);
        }

        foreach (BattleHeroModel model in _partners.Values)
        {
            totalModel.Add(model);
        }

        _totalModel = totalModel;

        BattleEvent.NEXT_ROUND();
        return(false);
    }