チケット #42682

Lua: basic unit editing API

登録: 2021-07-31 01:24 最終更新: 2024-08-26 07:27

報告者:
担当者:
(未割り当て)
チケットの種類:
状況:
オープン
コンポーネント:
マイルストーン:
優先度:
5 - 中
重要度:
5 - 中
解決法:
なし
ファイル:
なし

詳細

Sub-ticket of #42501. Veteranship editing is noted under #42666 and just doubled here. Unit editing API should include methods:

  • int :add_mf(int value) -- adds movement fragments, returns resulting fragments left that can't be below 0 (any upper cap?)
  • int :add_mp(int value) -- wrapper over :add_mf(SINGLE_MOVE * value) / SINGLE_MOVE
  • int :add_fuel(int value) -- clipped by 0 and unit type's full fuel
  • void :set_moved(bool moved) -- will this unit be considered unmoved
  • void :set_done_moving(bool done_moving) -- used in the client and maybe somewhere by AI, don't understand good but edithand.c changes it
  • int :set_hp(int value) -- sets unit hitpoints and returns resulted health that is clipped from 1 (does not kill the unit) to unit type hp
  • int :promote(int levels) -- gives levels veteran levels, returns resulting veteranship that is clipped by the unit's veteran system (also needed in #42666)
  • void :set_stay(bool stay)

We should make game.SINGLE_MOVE ruleset constant accessible. Common unit API should include:

  • int .veteran
  • string .veteran_name -- calculated property
  • int .mf_left -- moves_left in fragments
  • float .mp_left -- calculated property
  • int .hp
  • bool .moved, .done_moving, .stay

Also, Unit_Type API should include:

  • int .veteran_max
  • string :veteran_name(int veteran)
  • for better control, also int :veteran_mf_bonus(int veteran) fragments and :veteran_power_fact(int veteran) percents

At server (as that is not sent to clients), unit type API should also for better control have :veteran_raise_chance(int veteran) and :veteran_work_raise_chance(int veteran). Method for a unit combat veteranship should also be defined, the prototype depends on willl anything be done in HRM 804347 or not.

チケットの履歴 (3 件中 3 件表示)

2021-07-31 01:24 更新者: ihnatus
  • 新しいチケット "Lua: basic unit editing API" が作成されました
2022-04-09 07:13 更新者: cazfi
2024-08-26 07:27 更新者: cazfi

添付ファイルリスト

添付ファイルはありません

編集

このチケットにコメントを追加するには、ログインが必要です » ログインする