Пример #1
0
 public FloorInfo ClearFloor(FloorInfo floorInfo)
 {
     if (floorInfo.IsNull() == false)
     {
         floorInfo.SetConfig(0);
     }
     return(floorInfo);
 }
Пример #2
0
    public void InitFight()
    {
        FightModel.Instance.InitFightInfo();
        CellInfo.start_x = crtBattle.start_x;

        MonsterModel.Instance.Destroy();
        FloorModel.Instance.Destroy();
        CellModel.Instance.Destroy();
        WallModel.Instance.Destroy();
        CoverModel.Instance.Destroy();
        InvadeModel.Instance.Destroy();

        int i;

        for (i = 0; i < crtBattle.battle_height; i++)
        {
            List <MonsterInfo>      yMonsters = new List <MonsterInfo>();
            List <FloorInfo>        yFloors   = new List <FloorInfo>();
            List <CellInfo>         yCells    = new List <CellInfo>();
            List <List <WallInfo> > yWalls    = new List <List <WallInfo> >();
            List <CoverInfo>        yCovers   = new List <CoverInfo>();

            MonsterModel.Instance.allMonsters.Add(yMonsters);
            FloorModel.Instance.allFloors.Add(yFloors);
            CellModel.Instance.allCells.Add(yCells);
            WallModel.Instance.allWalls.Add(yWalls);
            CoverModel.Instance.allCovers.Add(yCovers);

            for (int j = 0; j < crtBattle.battle_width; j++)
            {
                BattleCellInfo battleCellInfo = crtBattle.allCells[i][j];

                MonsterInfo monsterInfo = new MonsterInfo();
                monsterInfo.configId = battleCellInfo.monster_id;
                monsterInfo.SetConfig(battleCellInfo.monster_id);
                monsterInfo.posX = j;
                monsterInfo.posY = i;
                yMonsters.Add(monsterInfo);

                FloorInfo floorInfo = new FloorInfo();
                floorInfo.SetConfig(battleCellInfo.floor_id);
                floorInfo.posX = j;
                floorInfo.posY = i;
                yFloors.Add(floorInfo);

                CellInfo cellInfo = new CellInfo();
                cellInfo.SetConfig(battleCellInfo.cell_id);
                cellInfo.posX = j;
                cellInfo.posY = i;
                yCells.Add(cellInfo);

                if (cellInfo.isBlank == false && cellInfo.config.cell_type == (int)CellType.changer)
                {
                    cellInfo.changer = cellInfo.config.icon;
                    cellInfo.SetConfig(cellInfo.config.hide_id);
                    cellInfo.originalConfigId = cellInfo.config.hide_id;
                }

                if (cellInfo.config != null)
                {
                    if (cellInfo.config.cell_type == (int)CellType.invade || cellInfo.config.id == 10007)
                    {
                        InvadeModel.Instance.AddInvade(cellInfo);
                    }
                }

                CoverInfo coverInfo = new CoverInfo();
                coverInfo.SetConfig(battleCellInfo.cover_id);
                coverInfo.posX = j;
                coverInfo.posY = i;
                yCovers.Add(coverInfo);

                List <WallInfo> xWalls = new List <WallInfo>();
                for (int n = 0; n < 3; n++)
                {
                    WallInfo wallInfo = new WallInfo();
                    wallInfo.SetConfig(battleCellInfo.walls[n]);
                    wallInfo.posX = j;
                    wallInfo.posY = i;
                    wallInfo.posN = n;
                    xWalls.Add(wallInfo);
                }
                yWalls.Add(xWalls);
            }
        }
        MonsterModel.Instance.RandomPos();
        MonsterModel.Instance.HoldAll();
        HideModel.Instance.LoadHider();
    }