コード例 #1
0
ファイル: StageSimulator.cs プロジェクト: boscohyun/lib9c
        /// <summary>
        /// Do not use anymore since v100025.
        /// </summary>
        public StageSimulator(
            IRandom random,
            AvatarState avatarState,
            List <Guid> foods,
            int worldId,
            int stageId,
            StageSimulatorSheets stageSimulatorSheets,
            Model.Skill.Skill skill
            )
            : this(
                random,
                avatarState,
                foods,
                worldId,
                stageId,
                stageSimulatorSheets
                )
        {
            var stageSheet = stageSimulatorSheets.StageSheet;

            if (!stageSheet.TryGetValue(StageId, out var stageRow))
            {
                throw new SheetRowNotFoundException(nameof(stageSheet), StageId);
            }

            Exp       = StageRewardExpHelper.GetExp(avatarState.level, stageId);
            TurnLimit = stageRow.TurnLimit;

            if (!ReferenceEquals(skill, null))
            {
                Player.OverrideSkill(skill);
            }
        }
コード例 #2
0
ファイル: StageSimulator.cs プロジェクト: rheehot/lib9c
        public StageSimulator(
            IRandom random,
            AvatarState avatarState,
            List <Guid> foods,
            int worldId,
            int stageId,
            TableSheets tableSheets) : base(random, avatarState, foods, tableSheets)
        {
            _waves = new List <Wave>();

            WorldId   = worldId;
            StageId   = stageId;
            IsCleared = avatarState.worldInformation.IsStageCleared(StageId);

            var stageSheet = TableSheets.StageSheet;

            if (!stageSheet.TryGetValue(StageId, out var stageRow))
            {
                throw new SheetRowNotFoundException(nameof(stageSheet), StageId);
            }

            var stageWaveSheet = TableSheets.StageWaveSheet;

            if (!stageWaveSheet.TryGetValue(StageId, out var stageWaveRow))
            {
                throw new SheetRowNotFoundException(nameof(stageWaveSheet), StageId);
            }

            Exp       = StageRewardExpHelper.GetExp(avatarState.level, stageId);
            TurnLimit = stageRow.TurnLimit;

            SetWave(stageRow, stageWaveRow);
            _waveRewards = SetReward(stageRow, random, tableSheets);
        }
コード例 #3
0
ファイル: StageSimulator.cs プロジェクト: boscohyun/lib9c
        /// <summary>
        /// Do not use anymore since v100025.
        /// </summary>
        public StageSimulator(
            IRandom random,
            AvatarState avatarState,
            List <Guid> foods,
            int worldId,
            int stageId,
            StageSimulatorSheets stageSimulatorSheets
            )
            : base(
                random,
                avatarState,
                foods,
                stageSimulatorSheets
                )
        {
            _waves = new List <Wave>();

            WorldId         = worldId;
            StageId         = stageId;
            IsCleared       = avatarState.worldInformation.IsStageCleared(StageId);
            EnemySkillSheet = stageSimulatorSheets.EnemySkillSheet;

            var stageSheet = stageSimulatorSheets.StageSheet;

            if (!stageSheet.TryGetValue(StageId, out var stageRow))
            {
                throw new SheetRowNotFoundException(nameof(stageSheet), StageId);
            }

            var stageWaveSheet = stageSimulatorSheets.StageWaveSheet;

            if (!stageWaveSheet.TryGetValue(StageId, out var stageWaveRow))
            {
                throw new SheetRowNotFoundException(nameof(stageWaveSheet), StageId);
            }

            Exp       = StageRewardExpHelper.GetExp(avatarState.level, stageId);
            TurnLimit = stageRow.TurnLimit;

            SetWave(stageRow, stageWaveRow);
            var itemSelector = SetItemSelector(stageRow, Random);

            _waveRewards = SetReward(
                itemSelector,
                Random.Next(stageRow.DropItemMin, stageRow.DropItemMax + 1),
                Random,
                stageSimulatorSheets.MaterialItemSheet
                );
        }
コード例 #4
0
ファイル: StageSimulator.cs プロジェクト: boscohyun/lib9c
        public StageSimulator(
            IRandom random,
            AvatarState avatarState,
            List <Guid> foods,
            int worldId,
            int stageId,
            StageSimulatorSheets stageSimulatorSheets,
            int constructorVersion,
            int playCount
            )
            : base(
                random,
                avatarState,
                foods,
                stageSimulatorSheets
                )
        {
            _waves = new List <Wave>();

            WorldId         = worldId;
            StageId         = stageId;
            IsCleared       = avatarState.worldInformation.IsStageCleared(StageId);
            EnemySkillSheet = stageSimulatorSheets.EnemySkillSheet;

            var stageSheet = stageSimulatorSheets.StageSheet;

            if (!stageSheet.TryGetValue(StageId, out var stageRow))
            {
                throw new SheetRowNotFoundException(nameof(stageSheet), StageId);
            }

            var stageWaveSheet = stageSimulatorSheets.StageWaveSheet;

            if (!stageWaveSheet.TryGetValue(StageId, out var stageWaveRow))
            {
                throw new SheetRowNotFoundException(nameof(stageWaveSheet), StageId);
            }

            Exp       = StageRewardExpHelper.GetExp(avatarState.level, stageId);
            TurnLimit = stageRow.TurnLimit;

            SetWave(stageRow, stageWaveRow);
            var itemSelector = SetItemSelector(stageRow, Random);
            var maxCount     = Random.Next(stageRow.DropItemMin, stageRow.DropItemMax + 1);

            switch (constructorVersion)
            {
            case ConstructorVersionDefault:
                _waveRewards = SetReward(
                    itemSelector,
                    maxCount,
                    random,
                    MaterialItemSheet
                    );
                break;

            case ConstructorVersionV100025:
                _waveRewards = SetRewardV2(
                    itemSelector,
                    maxCount,
                    Random,
                    MaterialItemSheet
                    );
                break;

            case ConstructorVersionV100080:
                _waveRewards = new List <ItemBase>();
                for (var i = 0; i < playCount; i++)
                {
                    itemSelector = SetItemSelector(stageRow, Random);
                    var rewards = SetRewardV2(
                        itemSelector,
                        maxCount,
                        Random,
                        MaterialItemSheet
                        );

                    foreach (var reward in rewards)
                    {
                        _waveRewards.Add(reward);
                    }
                }
                break;
            }
        }