using System.Collections.Generic; using System.Text.Json.Serialization; using Cthangover.Core.Factories; namespace Cthangover.Mods.Rpg { /// /// One tile map of the RPG world. The map id is also the name of the logical /// scene that shows it: entering scene X (any switch_scene X, a /// teleport, the return from a battle, loading a save) mounts map X /// over the shell. Because the scene stays an ordinary scene, everything the /// engine attaches to scenes works on a map unchanged — entry /// scenarios, ambience and music from scenes/X.json, the default /// background (which also becomes the backdrop of battles started here), /// saving rules. /// /// Files declare "Kind": "rpg_map". Layers are parsed by /// ; a dependent mod replaces a whole map by id, the /// usual entity override. /// [EntityKind("rpg_map")] public class RpgMap : IIdentifiable { /// Map id = logical scene name. [JsonPropertyName("Id")] public string ID { get; set; } /// Locale key of the map's display name. public string Name { get; set; } /// Id of the the indices refer to. public string Tileset { get; set; } /// Columns. public int Width { get; set; } /// Rows. public int Height { get; set; } /// Screen pixels per tile pixel; pixel art is scaled by a whole number. public int Zoom { get; set; } = 2; /// The three drawn layers. public RpgMapLayers Layers { get; set; } = new(); /// Rows of codes, one character per cell; may be empty. public List Collision { get; set; } = new(); /// Where the player appears when entering the map without a teleport target. public RpgTeleport Spawn { get; set; } = new(); /// Events placed on the map. public List Events { get; set; } = new(); /// Random battles; null for a safe map. public RpgEncounterTable Encounters { get; set; } } }