Пример #1
0
        public RegionSpawner(DynamicJson json, JsonSerializerOptions options) : base(json, options)
        {
            json.GetProperty("map", options, out Map map);
            json.GetProperty("region", options, out string spawnRegion);

            m_SpawnRegion = Region.Find(spawnRegion, map) as BaseRegion;
            m_SpawnRegion?.InitRectangles();
        }
Пример #2
0
        public ProximitySpawner(DynamicJson json, JsonSerializerOptions options) : base(json, options)
        {
            json.GetProperty("triggerRange", options, out int triggerRange);
            json.GetProperty("spawnMessage", options, out TextDefinition spawnMessage);
            json.GetProperty("instant", options, out bool instant);

            TriggerRange = triggerRange;
            SpawnMessage = spawnMessage;
            InstantFlag  = instant;
        }
Пример #3
0
        public BaseSpawner(DynamicJson json, JsonSerializerOptions options) : base(0x1f13)
        {
            if (!json.GetProperty("guid", options, out _guid))
            {
                _guid = Guid.NewGuid();
            }

            if (json.GetProperty("name", options, out string name))
            {
                Name = name;
            }

            json.GetProperty("count", options, out int amount);
            json.GetProperty("minDelay", options, out TimeSpan minDelay);
            json.GetProperty("maxDelay", options, out TimeSpan maxDelay);
            json.GetProperty("team", options, out int team);
            json.GetProperty("homeRange", options, out int homeRange);
            json.GetProperty("walkingRange", options, out int walkingRange);
            m_WalkingRange = walkingRange;

            InitSpawn(amount, minDelay, maxDelay, team, homeRange);

            json.GetProperty("entries", options, out List <SpawnerEntry> entries);

            foreach (var entry in entries)
            {
                AddEntry(entry.SpawnedName, entry.SpawnedProbability, entry.SpawnedMaxCount, false);
            }
        }
Пример #4
0
        public DungeonRegion(DynamicJson json, JsonSerializerOptions options) : base(json, options)
        {
            if (json.GetProperty("map", options, out Map map))
            {
                EntranceMap = map;
            }

            if (json.GetProperty("entrance", options, out Point3D entrance))
            {
                EntranceLocation = entrance;
            }
        }