Example #1
0
        public CollectionMap UpdateCompletedQuest(CollectionMap eventMap)
        {
            const QuestEventType type = QuestEventType.Complete;

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

            this.Subject    = subject;
            this.QuestEvent = questEvent;
            this.Object     = @object;
        }
Example #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();
        }
Example #4
0
 public static void SetEvent(QuestEventType ev, bool setTo = true)
 {
     if (setTo)
     {
         Data.WorldEvents.Add(ev);
     }
     else
     {
         Data.WorldEvents.Remove(ev);
     }
     TrackFileController.Write();
 }
Example #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);
Example #8
0
 public GeneralQuest(Dictionary serialized) : base(serialized)
 {
     Event = (QuestEventType)(int)((Integer)serialized["event"]).Value;
 }
Example #9
0
 public GeneralQuest(GeneralQuestSheet.Row data, QuestReward reward)
     : base(data, reward)
 {
     Event = data.Event;
 }
Example #10
0
 public override void Set(IReadOnlyList <string> fields)
 {
     base.Set(fields);
     Event = (QuestEventType)Enum.Parse(typeof(QuestEventType), fields[3]);
 }
Example #11
0
 public static QuestObject SetEventType(QuestEventType eventType)
 {
     CreateQuestObjectIfNull();
     questObject.QuestEvent = eventType;
     return(questObject);
 }
 public RemoveQuestEvent(QuestEventType ev) => type = ev;
 public QuestEvent(QuestEventType ev) => type = ev;