Project

General

Profile

Actions

Feature #1399

closed

Lua API: specialists control

Added by Alexandr Ignatiev 29 days ago. Updated 4 days ago.

Status:
Closed
Priority:
Normal
Category:
Scripting API
Target version:
Start date:
05/17/2025
Due date:
% Done:

0%

Estimated time:

Description

Continuation of #1375. The following methods are needed: * (City):settle_specialist(Specialist s, int num = 1) - adds a specialist or several; for normal specialist, also increases city size. Respects s's reqs. Returns number of specialists added. * (City):num_specialists(Specialist s?) - counts specialists of given type in the city, without parameter, counts all specialists (normal and super). Maybe add functions for counting all normal and all super specialists? * (City):reduce_specialist(Specialist s, int num = 1) - for superspecialist, just removes them, for normal specialist, toggles them cyclically (does not place workers or change city size), returns number of toggled/removed ones. * (City):can_use(Specialist s) - checks reqs (specialist can be still not addable due to 255 limit) * Player:can_use(Specialist s) - checks Player+-ranged reqs. Maybe rename these functions to sth more specific like can_employ but actually we have polymorphism.


Files

lua-superspecialists-edit.patch (18.8 KB) lua-superspecialists-edit.patch Alexandr Ignatiev, 06/05/2025 01:04 AM

Related issues 3 (0 open3 closed)

Blocked by Feature #1451: Lua API: specialist classClosedMarko Lindqvist05/26/2025

Actions
Blocked by Feature #1375: Introduce superspecialistsClosedMarko Lindqvist05/08/2025

Actions
Blocked by Feature #1464: Lua API: minimal specialist controlClosedMarko Lindqvist05/28/2025

Actions
Actions

Also available in: Atom PDF