待辦事項 #42502

Lua: player:give_bulbs() method

啟用日期: 2021-06-10 02:54 最後更新: 2021-11-29 15:26

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

細節

There are requests for things like giving some profit to a target player of "Enter Marketplace" action, or we may make tech stealth effectivity more even with a custom action, or something. Let's make a method that provides player with a given amount of bulbs; by default, commit them to the current research stock, in multiresearch mode let it be possible to specify a tech to commit to (that better needs also a function to test the current progress and cost of a tech for the player).

Ticket History (3/6 Histories)

2021-06-10 02:54 Updated by: ihnatus
  • New Ticket "Lua: player:give_bulbs() method" created
2021-10-12 04:33 Updated by: cazfi
  • 元件 Update from General to Scripting API
2021-10-15 07:57 Updated by: cazfi
評語

I've been thinking about the corner-cases when reducing the amount of bulbs (we do that for tech upkeep, so it's possible). Maybe the wisest course of action is to have this method with the restriction that only positive values are allowed. That should make it safe to implement to 3.1 already. We can always add separate take_bulbs() method in later versions, if we want.

2021-11-11 14:50 Updated by: cazfi
  • 處理結果 Update from to Accepted
評語

Reply To cazfi

I've been thinking about the corner-cases when reducing the amount of bulbs (we do that for tech upkeep, so it's possible). Maybe the wisest course of action is to have this method with the restriction that only positive values are allowed. That should make it safe to implement to 3.1 already. We can always add separate take_bulbs() method in later versions, if we want.

Now I looked at it, and it might be a lot easier than I thought. Lower level code should do everything right even when we add very simple function to implement the lua API. So, the amount of bulbs is a signed value in the attached patch, after all.

2021-11-29 15:26 Updated by: cazfi
  • 狀態 Update from 開啟 to 關閉
  • 負責人 Update from (無) to cazfi
  • 處理結果 Update from Accepted to 修正

編輯

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » 登入