Example #1
0
    public ItemDropManager(E_GameModeType gameModeType, int defaultTier)
    {
        this.gameModeType = gameModeType;
        this.defaultTier = defaultTier;

        {
            groupedTables = new Dictionary<E_CousumableGroupType, HashSet<ConsumableEntity>>();
            var table = TableLoader.GetTable<ConsumableEntity>();
            foreach (var entity in table.Values)
            {
                if (!groupedTables.ContainsKey(entity.ConsumableGroupType))
                {
                    groupedTables.Add(entity.ConsumableGroupType, new HashSet<ConsumableEntity>());
                }
                groupedTables[entity.ConsumableGroupType].Add(entity);
            }
        }

        {
            var table = TableLoader.GetTable<ConsumableGroupDrop>();
            var groupTable = table.GetMany(gameModeType);
            groupDart = new Dart<E_CousumableGroupType>();
            foreach (var entity in groupTable)
            {
                groupDart.Add(entity.Value.DropChance, entity.Value.CousumableGroupType);
            }
        }
    }
Example #2
0
    public PuzzlePanel(Rect rect, E_HeroType heroType, E_GameModeType gameModeType, PuzzleRecord record, TimeClient timeClient)
    {
        this.timeClient = timeClient;
        this.record = record;

        if (box == null)
        {
            Rect captureRect = new Rect(1000, 1000, PuzzleOption.BlockCountX, PuzzleOption.BlockCountY);
            box = new CameraBox("PuzzleCamera", captureRect, rect, -1, 2, 2, null, CullingLayer, timeClient);
            box.GetLayer(1).coord.SetScale(new Vector3(1, -1, 1));
            box.GetLayer(1).coord.Move(new Vector2(-(PuzzleOption.BlockCountX - 1) / 2f, (PuzzleOption.BlockCountY - 1) / 2f));

            //feverGuageBack
            {
                int layer = LayerMask.NameToLayer("Field");
                camera2 = new CameraBox("PuzzleCamera2", captureRect, rect, -1, 2, 1, null, layer, timeClient);
                feverGuageBack = GameObject.Instantiate(Resources.Load("vfx50021_GUI_Summongauge01")) as GameObject;
                feverGuageBack.transform.parent = camera2.transform;
                GameObjectTool.SetLayerRecursively(feverGuageBack.transform, layer);
                SetFeverGuageRatio(0f);
            }
        }

        board = new Board(rect, this, heroType, OnMatching, OnMatchStart, OnMatchFinish, timeClient);

        AddAction(Action.E_Type.Transform_Attack1,
            delegate(float value, GameInstance firer, string[] param)
            {
                board.ChangeBlock(ArrayTool.Create(E_BlockType.Item, E_BlockType.Gather), E_BlockType.Attack1, OnChangeBlock);
                return new ActionHandler.Result(null, value);
            }
        );
        AddAction(Action.E_Type.Transform_Attack2,
            delegate(float value, GameInstance firer, string[] param)
            {
                board.ChangeBlock(ArrayTool.Create(E_BlockType.Item, E_BlockType.Gather), E_BlockType.Attack2, OnChangeBlock);
                return new ActionHandler.Result(null, value);
            }
        );
        AddAction(Action.E_Type.Remove_Ability,
            delegate(float value, GameInstance firer, string[] param)
            {
                board.RemoveAll(E_BlockType.Ability, OnRemoveBlock);
                return new ActionHandler.Result(null, value);
            }
        );
        AddAction(Action.E_Type.Remove_Defend,
            delegate(float value, GameInstance firer, string[] param)
            {
                board.RemoveAll(E_BlockType.Defend, OnRemoveBlock);
                return new ActionHandler.Result(null, value);
            }
        );
        AddAction(Action.E_Type.Remove_Item,
            delegate(float value, GameInstance firer, string[] param)
            {
                board.RemoveAll(E_BlockType.Item, OnRemoveBlock);
                return new ActionHandler.Result(null, value);
            }
        );
        AddAction(Action.E_Type.Remove_Gather,
            delegate(float value, GameInstance firer, string[] param)
            {
                board.RemoveAll(E_BlockType.Gather, OnRemoveBlock);
                return new ActionHandler.Result(null, value);
            }
        );

        /*
        Stat<BlockSpawn> stat = StatLoader.Instance.GetStatTable<E_GameModeType, BlockSpawn>("GameModeType").Get(gameModeType);
        status = new Status(null, stat, null);
        AddAction(Action.E_Type.Buff,
            delegate(float value, GameInstance firer, string[] param)
            {
                Buff.Handle onBuff = null;
                Buff.Handle onDebuff = null;
                int? buffID = Cast.To<int>(value);
                status.AddBuff(buffID.Value, firer.Stat, onBuff, onDebuff);
                return new ActionHandler.Result(null, value);
            }
        );
        AddAction(Action.E_Type.Shuffle,
            delegate(float value, GameInstance firer, string[] param)
            {
                board.Shuffle();
                return new ActionHandler.Result(null, value);
            }
        );
         * */
    }