723Studio / OpenXcom_FTA

Fork of OXCE project with additions to support From the Ashes project
http://x-comfromtheashes.tilda.ws/
GNU General Public License v3.0
14 stars 18 forks source link

Energy management for xcom base #177

Open Finnik723 opened 1 year ago

Finnik723 commented 1 year ago

Step 1 minimal functions

Add energy integer value (default 0) to RuleBaseFacility If value is positive - facility generates energy, if negative - consumes On facility construction, if facility's energy != 0 check base's energy budget, update BaseView::getPlacementError, new display with "low energy" error. On facility dismantle or upgrade, if it's energy > 0, check if base's budget will be positive after it, otherwise show error. If facility's energy != 0, show its value in ArticleStateBaseFacility Show total base energy in BaseInfoState if isFtA == true (equal _game->getMod()->isFTAGame()) in place of _txtHangars, _numHangars and _barHangars.

Step 2

Respect lack of energy due to facility destruction. Develop new facility status - disabled due to energy. Show it with sprite above facility in BaseView (load sprite Surface from Mod) Replace existing facility disabling code. After base defense check, if base energy budget >0, else disable most expensive facilities.

Brauny74 commented 1 year ago

I'll take it