예제 #1
0
파일: Quest.cs 프로젝트: rheehot/lib9c
        public CollectionMap UpdateCompletedQuest(CollectionMap eventMap)
        {
            const QuestEventType type = QuestEventType.Complete;

            eventMap[(int)type] = _quests.Count(i => i.Complete);
            return(UpdateGeneralQuest(new[] { type }, eventMap));
        }
예제 #2
0
        public QuestObject(int questFulfillCount, AssetReference subject, QuestEventType questEvent, AssetReference @object)
        {
            this.questFulfillCount = questFulfillCount;

            this.Subject    = subject;
            this.QuestEvent = questEvent;
            this.Object     = @object;
        }
예제 #3
0
        public AvatarState(Address address,
                           Address agentAddress,
                           long blockIndex,
                           TableSheets sheets,
                           GameConfigState gameConfigState,
                           string name = null) : base(address)
        {
            if (address == null)
            {
                throw new ArgumentNullException(nameof(address));
            }

            this.name         = name ?? string.Empty;
            characterId       = GameConfig.DefaultAvatarCharacterId;
            level             = 1;
            exp               = 0;
            inventory         = new Inventory();
            worldInformation  = new WorldInformation(blockIndex, sheets.WorldSheet, GameConfig.IsEditor);
            updatedAt         = DateTimeOffset.UtcNow;
            this.agentAddress = agentAddress;
            questList         = new QuestList(
                sheets.QuestSheet,
                sheets.QuestRewardSheet,
                sheets.QuestItemRewardSheet,
                sheets.EquipmentItemRecipeSheet,
                sheets.EquipmentItemSubRecipeSheet
                );
            mailBox         = new MailBox();
            this.blockIndex = blockIndex;
            actionPoint     = gameConfigState.ActionPointMax;
            stageMap        = new CollectionMap();
            monsterMap      = new CollectionMap();
            itemMap         = new CollectionMap();
            const QuestEventType createEvent = QuestEventType.Create;
            const QuestEventType levelEvent  = QuestEventType.Level;

            eventMap = new CollectionMap
            {
                new KeyValuePair <int, int>((int)createEvent, 1),
                new KeyValuePair <int, int>((int)levelEvent, level),
            };
            combinationSlotAddresses = new List <Address>(CombinationSlotCapacity);
            for (var i = 0; i < CombinationSlotCapacity; i++)
            {
                var slotAddress = address.Derive(
                    string.Format(
                        CultureInfo.InvariantCulture,
                        CombinationSlotState.DeriveFormat,
                        i
                        )
                    );
                combinationSlotAddresses.Add(slotAddress);
            }
            UpdateGeneralQuest(new[] { createEvent, levelEvent });
            UpdateCompletedQuest();

            PostConstructor();
        }
예제 #4
0
 public static void SetEvent(QuestEventType ev, bool setTo = true)
 {
     if (setTo)
     {
         Data.WorldEvents.Add(ev);
     }
     else
     {
         Data.WorldEvents.Remove(ev);
     }
     TrackFileController.Write();
 }
예제 #5
0
        public void Clear()
        {
            if (EmptyReference.Instance == null | ReferenceCenter.Instance == null)
            {
                return;
            }

            var emptyReference = ReferenceCenter.Instance.emptyReference;

            this.Subject    = emptyReference;
            this.QuestEvent = QuestEventType.None;
            this.Object     = emptyReference;
        }
 public static bool Have(this QuestEventType at) => UberGet.value(at.State()).Bool;
 // extensions! C:
 public static UberId State(this QuestEventType at) => new UberId(6, 2000 + (int)at);
예제 #8
0
 public GeneralQuest(Dictionary serialized) : base(serialized)
 {
     Event = (QuestEventType)(int)((Integer)serialized["event"]).Value;
 }
예제 #9
0
 public GeneralQuest(GeneralQuestSheet.Row data, QuestReward reward)
     : base(data, reward)
 {
     Event = data.Event;
 }
예제 #10
0
 public override void Set(IReadOnlyList <string> fields)
 {
     base.Set(fields);
     Event = (QuestEventType)Enum.Parse(typeof(QuestEventType), fields[3]);
 }
예제 #11
0
 public static QuestObject SetEventType(QuestEventType eventType)
 {
     CreateQuestObjectIfNull();
     questObject.QuestEvent = eventType;
     return(questObject);
 }
예제 #12
0
 public RemoveQuestEvent(QuestEventType ev) => type = ev;
예제 #13
0
 public QuestEvent(QuestEventType ev) => type = ev;