待辦事項 #42684

Lua: vision checking and editing

啟用日期: 2021-07-31 02:51 最後更新: 2024-05-26 05:30

回報者:
負責人:
類型:
狀態:
關閉
元件:
里程碑:
優先權:
5 - 中
嚴重程度:
5 - 中
處理結果:
修正
檔案:
1

細節

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 History (3/7 Histories)

2021-07-31 02:51 Updated by: ihnatus
  • New Ticket "Lua: vision checking and editing" created
2021-10-03 06:30 Updated by: cazfi
評語

I've split #42973 ( Tile:show() & Tile:hide() ) and #42974 (default.lua hut code to reveal map) from this.

2022-04-09 07:14 Updated by: cazfi
2024-05-07 00:29 Updated by: cazfi
  • 負責人 Update from (無) to cazfi
  • 處理結果 Update from to Accepted
評語

Attached patch adds Tile:known(player) and Tile:seen(player)

From the requested features this leaves only unit visibility check out. One can of course check if unit's tile is seen, but that doesn't tell if unit is within a transport, city, or hiding base. That should be a new ticket.

2024-05-17 14:58 Updated by: cazfi
評語

Reply To cazfi

From the requested features this leaves only unit visibility check out. One can of course check if unit's tile is seen, but that doesn't tell if unit is within a transport, city, or hiding base. That should be a new ticket.

-> https://redmine.freeciv.org/issues/630

2024-05-26 05:30 Updated by: cazfi
  • 狀態 Update from 開啟 to 關閉
  • 處理結果 Update from Accepted to 修正

編輯

Please login to add comment to this ticket » 登入