任务单 #42684

Lua: vision checking and editing

开放日期: 2021-07-31 02:51 最后更新: 2024-05-26 05:30

报告人:
属主:
状态:
关闭
组件:
里程碑:
优先:
5 - Medium
严重性:
5 - Medium
处理结果:
Fixed
文件:
1

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)

任务单历史 (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 Fixed

编辑

Please login to add comment to this ticket » 登录名