Пример #1
0
 public void SwitchPos(FloorInfo cellA, FloorInfo cellB)
 {
     allFloors[cellA.posY].RemoveAt(cellA.posX);
     allFloors[cellA.posY].Insert(cellA.posX, cellB);
     allFloors[cellB.posY].RemoveAt(cellB.posX);
     allFloors[cellB.posY].Insert(cellB.posX, cellA);
 }
Пример #2
0
    public void Test()
    {
        int       floorId = 20101;
        FloorInfo info    = GameTable.FloorInfoTableAsset.LookUp(floorId);

        if (null == info)
        {
            Debug.Log("OnChooseFloor FloorInfo info==null" + floorId);
            return;
        }

        SM.RandomRoomLevel.Singleton.m_curFloorId = floorId;

        //
        if (StageMenu.Singleton.m_isReqHelpData)
        {
            // 请求数据前 清空下数据
            User.Singleton.HelperList.Clear();
            // 发送服务器 请求战友列表
            //int msgID = MiniServer.Singleton.req_battleHelperList();

            //RegisterRespondFuncByMessageID(msgID, OnHelperCallback);

            HideFloor();
            UpdateHelper();
        }
        else
        {
            HideFloor();
            UpdateHelper();
        }
    }
Пример #3
0
    public void SpecialMark(Vector2 coord)
    {
        //Get the coordinates of the special cube that was activated
        int xCoord = (int)coord.x;
        int yCoord = (int)coord.y;

        //Cycle through the 9 coords surrounding and including the pos of the special cube
        for (int yPos = yCoord - 1; yPos < yCoord + 2; yPos++)
        {
            for (int xPos = xCoord - 1; xPos < xCoord + 2; xPos++)
            {
                Vector2 tempCoord = new Vector2(xPos, yPos);
                foreach (GameObject floor in floorCubes)
                {
                    //If there is a floor cube in the coord mark it as a special tile
                    FloorInfo floorInfo = floor.GetComponent <FloorInfo>();
                    if (floorInfo.GetCoord() == tempCoord)
                    {
                        floorInfo.SpecialMarkTile();
                        //Add the coord to a list so that it can be used to find blocks above the floor tiles to activate
                        if (!gameManager.specialBlockCoords.Contains(tempCoord))
                        {
                            gameManager.specialBlockCoords.Add(tempCoord);
                        }
                    }
                }
            }
        }
    }
            public WildPokemonInfo(IReadOnlyBinaryDataAccessor accessor)
            {
                var sir0 = new Sir0(accessor);

                int pokemonStatsCount  = sir0.SubHeader.ReadInt32(0x00);
                int pokemonStatsOffset = sir0.SubHeader.ReadInt32(0x08);

                Stats = new StatsEntry[pokemonStatsCount];
                for (int i = 0; i < pokemonStatsCount; i++)
                {
                    var offset = sir0.Data.ReadInt64(pokemonStatsOffset + i * sizeof(long));
                    Stats[i] = new StatsEntry(i, sir0.Data.Slice(offset, 16));
                }

                int floorCount = sir0.SubHeader.ReadInt32(0x10);

                Floors = new FloorInfo[floorCount];
                for (int i = 0; i < floorCount; i++)
                {
                    Floors[i] = new FloorInfo(pokemonStatsCount);
                    var offset = sir0.SubHeader.ReadInt64(0x18 + i * sizeof(long));
                    for (int j = 0; j < pokemonStatsCount; j++)
                    {
                        Floors[i].Entries[j] = new FloorInfo.Entry(sir0.Data.Slice(offset + j * 16, 16));
                    }
                }
            }
Пример #5
0
    public override void Init(int SceneID, LifeMCore Core, Life Parent)
    {
        FloorType type = FloorType.Normal;

        if (Parent == null)
        {
            return;
        }
        base.Init(SceneID, Core, Parent);
        if (Parent is IggFloor)
        {
            type            = (Parent as IggFloor).m_FloorType;
            m_BuildRoomAttr = GetBuildRoomAttr(type, (Parent as IggFloor).Layer, (Parent as IggFloor).StartUnit);
        }
        else
        {
            m_BuildRoomAttr.Add(GetBuildRoomAttr(Parent, (Parent as IggWall).Layer, (Parent as IggWall).StartUnit));
        }
        FloorInfo info = CmCarbon.GetFloor();

        if (info == null)
        {
            m_FullHp = 999999999;
            return;
        }
        m_FullHp       = info.m_hp;
        m_IsDamage     = true;
        m_phy_defend   = info.m_phydefend;
        m_magic_defend = info.m_magicdefend;
    }
    private void ActivateMarkedCube(Vector2 markedCoord, bool isSpecial)
    {
        //Check if there is a cube above the marked tile and if there is deactivate it
        //find cube above marked tile
        CubeInfo cube = gameManager.GetCubeAboveMarkedTile(markedCoord);

        //If there is a cube above it Deactivate the cube
        if (cube != null)
        {
            StartCoroutine(gameManager.DeactivateCube(cube));
            gameManager.addedPauseTime += 0.8f;
        }
        //If it isn't a special trigger then unmark normally
        if (!isSpecial)
        {
            markedTile.UnmarkTile();
            markedTile = null;
            tileMarked = false;
        }
        else//Otherwise unmark as special
        {
            floorCreation.UnmarkAllSpecialBlocks();
            gameManager.specialBlockCoords.Clear();
        }
    }
Пример #7
0
 public Floor(int number)
 {
     this.number      = -1;
     this.transform   = null;
     FloorInfo        = new FloorInfo();
     transitionFloors = new List <Floor>();
     this.collider2D  = null;
 }
Пример #8
0
 public FloorInfo ClearFloor(FloorInfo floorInfo)
 {
     if (floorInfo.IsNull() == false)
     {
         floorInfo.SetConfig(0);
     }
     return(floorInfo);
 }
Пример #9
0
    public void SwitchPos(FloorInfo cellInfo)
    {
        FloorInfo cellCopy = cellInfo.Copy();

        cellInfo.posX = posX;
        cellInfo.posY = posY;
        posX          = cellCopy.posX;
        posY          = cellCopy.posY;
    }
Пример #10
0
 public Floor(Transform transform, Collider2D collider2D, int number)
 {
     this.number      = number;
     this.transform   = transform;
     FloorInfo        = new FloorInfo();
     transitionFloors = new List <Floor>();
     this.collider2D  = collider2D;
     UpdateFloorInfo(collider2D);
 }
Пример #11
0
    public void AddAnim(FloorInfo floorInfo, CellAnimType animationType = CellAnimType.clear)
    {
        List <FloorAnimInfo> stepMoves = anims[anims.Count - 1];
        FloorAnimInfo        animInfo  = new FloorAnimInfo();

        animInfo.startFrame = anims.Count;
        animInfo.floorInfo  = floorInfo;
        stepMoves.Add(animInfo);
    }
Пример #12
0
    //从逻辑坐标获取世界坐标
    static Vector3 GetPositionFromPos(FloorInfo l_floorInfo)
    {
        Vector3 position = new Vector3();

        position.x = PosToPosition(l_floorInfo.x);
        position.z = PosToPosition(l_floorInfo.z);
        position.y = 0;

        return(position);
    }
Пример #13
0
 /// <summary>
 /// Load floor info when the game start
 /// </summary>
 /// <param name="info">Floor informations</param>
 public void LoadInfo(FloorInfo info)
 {
     //Instantiate every citizens the floor had when saved
     foreach (CitizenInfo citizenInfo in info.citizenInFloor)
     {
         //citizenInfo.
         Citizen theCitizen = Instantiate(CitizenManager.instance.Citizen, new Vector3(waypoints[0].transform.position.x, waypoints[0].transform.position.y, waypoints[0].transform.position.z), Quaternion.identity);
         theCitizen.info = citizenInfo;
     }
 }
Пример #14
0
 private void swap(FloorInfo s)
 {
     this.m_deck_id     = s.m_deck_id;
     this.m_level       = s.m_level;
     this.m_material_id = s.m_material_id;
     this.m_hp          = s.m_hp;
     this.m_phydefend   = s.m_phydefend;
     this.m_magicdefend = s.m_magicdefend;
     this.m_magicdefend = s.m_magicdefend;
 }
Пример #15
0
    static DungeonList()
    {
        for (int i = 0; i < maxNumTutorialFloors; i++)
        {
            string floorName = "tutorial_" + (i + 1).ToString();
            arr_tutorialFloorNames[i] = floorName;
        }

        //populate the first floor
        arr_corpsePerFloor[0] = 2;
        // p sure the default value is 0, but just in case
        for (int i = 1; i < maxNumFloors; i++)
        {
            arr_corpsePerFloor[i] = 0;
        }

        arr_intro1FloorNames[0] = "intro_1";
        for (int i = 1; i < maxNumIntro1Scenes; i++)
        {
            string floorName = "intro_1_" + (i).ToString();
            arr_intro1FloorNames[i] = floorName;
        }

        //arr_intro2FloorNames[0] = "intro_2";
        for (int i = 0; i < maxNumIntro2Scenes; i++)
        {
            string floorName = "intro_2_" + (i).ToString();
            arr_intro2FloorNames[i] = floorName;
        }



        //make the first floor
        //unlocked by default
        arr_floorInfo[0] = new FloorInfo("scene_floor_0", 0, 0, true);         //Floor_0/
        //the next amount of gold (starting amount)
        float nextAmountOfGold = 30.0f;
        float scaleAmount      = 1.5f;

        for (int i = 1; i < maxNumFloors; i++)
        {
            string floorName = "scene_floor_" + i.ToString();             // "Floor_" + i.ToString() +
            int    floorNum  = i;
            //floor 1: 30 + (30*1.5) = 75
            //floor 2: 75 + (75*1.5) = 187
            //floor 3: 187 + (187 * 1.5) = 467
            //floor 4: 467 + (467 * 1.5) = 1167
            //floor 5: 1167 + (1167 * 1.5) = 2917

            nextAmountOfGold = (nextAmountOfGold + (nextAmountOfGold * scaleAmount));
            int goldToUnlock = (int)nextAmountOfGold;

            arr_floorInfo[i] = new FloorInfo(floorName, floorNum, goldToUnlock, false);
        }
    }
Пример #16
0
        /// <summary>
        /// 修改页面
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult FloorUpdate(int id)
        {
            //根据传过来的id获取选中账号的信息,并把查到的数据赋值给viewbag,以便页面绑定数据
            FloorInfo model = FloorInfoService.GetModelByID(id);

            if (model != null)
            {
                ViewBag.model = model;
            }
            return(View());
        }
Пример #17
0
 /// <summary>
 /// 计算加班血量
 /// </summary>
 public void AddFlooHp()
 {
     if (m_lFloor != null || m_lFloor.Count > 0)
     {
         FloorInfo f = CmCarbon.GetFloor();
         if (f != null)
         {
             m_Floorhp = f.m_hp;
         }
     }
 }
Пример #18
0
    public string GetFloorCondition()
    {
        FloorInfo floorInfo = GameTable.FloorInfoTableAsset.LookUp(StageMenu.Singleton.m_curFloorId);

        if (null == floorInfo)
        {
            UnityEngine.Debug.Log("Pause GetFloorName FloorInfo floorInfo == null m_floorId:" + StageMenu.Singleton.m_curFloorId);
            return("");
        }
        return(floorInfo.m_conditions);
    }
Пример #19
0
    public FloorInfo LookUp(int id)
    {
        FloorInfo info = null;

        if (m_map.TryGetValue(id, out info))
        {
            return(info);
        }

        return(null);
    }
Пример #20
0
 // Constructor
 public void Setup(int maxRoomsPerFloor)
 {
     MAX_ROOMS_PER_FLOOR     = maxRoomsPerFloor;
     MAX_ENEMIES_PER_FLOOR   = 3;
     MAX_OBSTACLES_PER_FLOOR = 8;
     // Set up floor logic
     currentFloorInfo = new FloorInfo(new Room(0));
     numberOfRooms    = 1;
     CreateFloorLogic(MAX_ROOMS_PER_FLOOR);
     currentRoom = currentFloorInfo.getStartRoom();
     PrintFloor();
 }
Пример #21
0
    // 获得经验 的基数
    public float GetBaseExp()
    {
        FloorInfo floorInfo = GameTable.FloorInfoTableAsset.LookUp(StageMenu.Singleton.m_curFloorId);

        if (null == floorInfo)
        {
            UnityEngine.Debug.Log("BattleSummary GetExp FloorInfo floorInfo == null m_floorId=" + StageMenu.Singleton.m_curFloorId);
            return(0);
        }
        Debug.Log("GetBaseExp:" + floorInfo.m_expBase);
        return(floorInfo.m_expBase);
    }
Пример #22
0
        /// <summary>
        /// 楼栋信息添加
        /// </summary>
        /// <param name="inputEntity"></param>
        /// <returns></returns>
        public bool DTOAdd(FloorInfoInputDTO inputEntity)
        {
            FloorInfo dataModel = Mapper.Map <FloorInfoInputDTO, FloorInfo>(inputEntity);

            if (floorInfoDAL.AddAndSaveChange(dataModel) > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #23
0
        /// <summary>
        /// 检查楼栋编号是否已存在
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public bool CheckRepeat(string value)
        {
            FloorInfo model = floorInfoDAL.LoadEntities(u => u.FloorID == value).FirstOrDefault();

            if (model != null)
            {
                return(true);//说明用户编号已存在
            }
            else
            {
                return(false);
            }
        }
            public WildPokemonInfo()
            {
                Stats = new StatsEntry[(int)CreatureIndex.END];
                for (int i = 0; i < (int)CreatureIndex.END; i++)
                {
                    Stats[i] = new StatsEntry();
                }

                Floors = new FloorInfo[99];
                for (int i = 0; i < 99; i++)
                {
                    Floors[i] = new FloorInfo((int)CreatureIndex.END);
                }
            }
    public void Should_Add_Floor()
    {
        //Arrange
        string floorName = "First Floor";
        var    floor     = new FloorInfo {
            Name = floorName
        };
        var subject = new FloorManager();

        //Act
        subject.Add(floor);
        //Assert - FluentAssertions
        subject.Floors.Should().HaveCount(1);
    }
Пример #26
0
 public void UnmarkAllSpecialBlocks()
 {
     foreach (GameObject floor in floorCubes)
     {
         FloorInfo floorInfo = floor.GetComponent <FloorInfo>();
         if (floorInfo != null)
         {
             if (floorInfo.isSpecialMarked)
             {
                 floorInfo.SpecialUnmarkTile();
             }
         }
     }
 }
Пример #27
0
    void AddWindowsToFloor(GameObject floor, FloorInfo floorInfo)
    {
        if (floorInfo.hasWindows)
        {
            for (int i = 0; i < 4; i++)
            {
                Vector3    windowPosition = floor.transform.position + windowPositions[i];
                Quaternion windowRotation = floor.transform.rotation * windowRotations[i];

                GameObject newWindow = (GameObject)Instantiate(window, windowPosition, windowRotation);
                newWindow.transform.parent = floor.transform;
            }
        }
    }
Пример #28
0
    //И┤ок
    public FloorInfo Copy()
    {
        FloorInfo floorInfo = new FloorInfo();

        floorInfo.runId = runId;
        //if (config != null)
        //{
        //    floorInfo.config = (config_cell_item)config.Copy();
        //}
        floorInfo.config = config;
        floorInfo.posX   = posX;
        floorInfo.posY   = posY;

        return(floorInfo);
    }
Пример #29
0
    public override void ShowList()
    {
        base.ShowList();

        int i;

        for (i = 0; i < FloorModel.Instance.allFloors.Count; i++)
        {
            for (int j = 0; j < FloorModel.Instance.allFloors[0].Count; j++)
            {
                FloorInfo floorInfo = FloorModel.Instance.allFloors[i][j];
                CreateFloorItem(j, i, floorInfo);
            }
        }
    }
Пример #30
0
    public void RollCut(int cutNum)
    {
        crtBattle.RollCut(cutNum);

        int i;

        for (i = 0; i < cutNum; i++)
        {
            MonsterModel.Instance.allMonsters.RemoveAt(0);
            FloorModel.Instance.allFloors.RemoveAt(0);
            CellModel.Instance.allCells.RemoveAt(0);
            WallModel.Instance.allWalls.RemoveAt(0);
            CoverModel.Instance.allCovers.RemoveAt(0);
        }

        for (i = 0; i < crtBattle.battle_height; i++)
        {
            List <MonsterInfo>      yMonsters = MonsterModel.Instance.allMonsters[i];
            List <FloorInfo>        yFloors   = FloorModel.Instance.allFloors[i];
            List <CellInfo>         yCells    = CellModel.Instance.allCells[i];
            List <List <WallInfo> > yWalls    = WallModel.Instance.allWalls[i];
            List <CoverInfo>        yCovers   = CoverModel.Instance.allCovers[i];

            for (int j = 0; j < crtBattle.battle_width; j++)
            {
                MonsterInfo monsterInfo = yMonsters[j];
                monsterInfo.posY -= cutNum;

                FloorInfo floorInfo = yFloors[j];
                floorInfo.posY -= cutNum;

                CellInfo cellInfo = yCells[j];
                cellInfo.posY -= cutNum;

                List <WallInfo> xWalls = yWalls[j];
                for (int n = 0; n < xWalls.Count; n++)
                {
                    WallInfo wallInfo = xWalls[n];
                    wallInfo.posY -= cutNum;
                }

                CoverInfo coverInfo = yCovers[j];
                coverInfo.posY -= cutNum;
            }
        }

        SkillModel.Instance.InitFightingEntitys();
    }