Skip to content

RFC: Status quo / possibilities when a unit has more than one FoundCity unique #9996

Closed as not planned
@SomeTroglodyte

Description

This is relevant only to weird mods... Imagine one where a Settler can gain a Promotion through - say, a Fountain-of-Youth-alike. That promotion grants Founds a new city <[3] times> <after which this unit is consumed>. The idea of course - make the unit better...

Status quo: The second Unique is ignored. That Settler can still only found once.
Expectation: The second Unique is of "higher quality" somehow and should take precedence.

Cause: The firstOrNull in getFoundCityAction, UnitActions.L183, goes by whatever order MapUnit.getMatchingUniques decides (UniqueMap addition order which is baseUnit, type, promotions)

Possible approaches:

  • Leave as is and drop a wiki hint somewhere
  • Fix by making that a maxByOrNull over a quality - complicated as that should take usagesLeft into account, and that a mod may decide the unit survives after using up the founding action - now if there is a 3 times + survival and another for 3 times + death - gets complicated a little, right?
  • Semi-Fix by nailing down the assumption promotions should always improve -> simply change UniqueMap addition order

Side comments:

  • MapUnit.updateUniques allocates and discards an ArrayList - sounds needless to me, or is there a reason?
  • Create improvement instantly works differently - there'll be more than one Action on the menu instead.
  • Looks like some conditional check styles repeat quite often - enough to warrant some more helpers like hasConditional(UniqueType)?

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions