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(); }
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; }
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); } }
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; } }