#42684: Lua: vision checking and editing Open Date: 2021-07-30 20:51 Last Update: 2021-10-03 00:30 URL for this Ticket: https://osdn.net//projects/freeciv/ticket/42684 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=42684 --------------------------------------------------------------------- Last Changes/Comment on this Ticket: 2021-10-03 00:30 Updated by: cazfi Comment: I've split #42973 ( Tile:show() & Tile:hide() ) and #42974 (default.lua hut code to reveal map) from this. --------------------------------------------------------------------- Ticket Status: Reporter: ihnatus Owner: (None) Type: Feature Requests Status: Open Priority: 5 - Medium MileStone: S3_1 d3f Component: General Severity: 5 - Medium Resolution: None --------------------------------------------------------------------- Ticket details: Sub-task of #42501 but has a separate meaning, in commercial games we can get territory map from a hut (see http://forum.freeciv.org/f/viewtopic.php?f=13&t=91188). Common API: int (Unit_Type).vision_radius_sq Client API: bool (Tile).is_seen (known can be checked by .terrain ~= nil but may et a special method) Server API: bool (Player):can_see(Tile tile, string vlayer = NULL) -- normal vision by default, may supply "Subsurface" or "Stealth" bool (Player):can_see(Unit unit) -- Maybe these two can_see() methods should go to common code but in clients they will lie a lot bool (Player):knows_map(Tile tile) void (Player):give_map_radius_sq(Tile tile, int radius = 1) void (Player):give_map(Tile tile, int dist = 1) void (Player):forget_map_radius_sq(Tile tile, int radius = 1) void (Player):forget_map(Tile tile, int dist = 1) -- Ticket information of Freeciv project Freeciv Project is hosted on OSDN Project URL: https://osdn.net/projects/freeciv/ OSDN: https://osdn.net URL for this Ticket: https://osdn.net/projects/freeciv/ticket/42684 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=42684