-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft: Add AutomaticallyUpgradesInProduction Unique #10654
Draft: Add AutomaticallyUpgradesInProduction Unique #10654
Conversation
...huh. ...maybe I'm missing something obvious, but why do we have both https://github.com/yairm210/Unciv/blob/master/core/src/com/unciv/logic/city/CityConstructions.kt#L416
? As I understand it, Meanwhile, separately, Aren't they redundant?
Right before Though, this does kind of make me wonder...this is getting way off into the weeds, but in principle the automatic-upgrade-in-production business could happen for other reasons, like acquiring Oil, not just because a tech is discovered. It could take a conditional. In which case Actually...hmm. They don't do quite the same thing. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Conflicts have been resolved. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
This PR was closed because it has been stalled for 10 days with no activity. |
That is to say, when a unit goes "obsolete", this has two effects: the unit can no longer be built, and any in-production units automatically upgrade for free if they have an upgrade and the upgrade is currently available to build.
These two effects are separable. Indeed they are separated, since not all units have an upgrade available at the time they go obsolete. (Notably, the Scout.)
There is not currently any case of the opposite in the base game, but it doesn't seem unreasonable for some mod to have that. In Civ V, Cavalry is no longer available after you research Combustion, and if you don't have Oil, well then you shouldn't have researched Combustion. But some mod might allow you to continue to build Cavalry. (In point of fact, horses were still used in war alongside combustion vehicles for quite some time.)
We might call a unit "presumptively obsolete" in this situation: continuing to build them isn't necessarily a good idea, and units that happen to be in-production will upgrade automatically if possible, but you can continue to build the old unit. But it's more explicit to skip terms like "presumptively obsolete" and spell out exactly what we mean: in-production units automatically upgrade for free, but there are no other direct effects.
This branch attempts to keep all new functionality in Uniques from the start. This branch is rough and inefficient (and will obviously need to change in light of forthcoming changes to
obsoleteTech
to support multiple obsoleting techs), but this gives you the basic idea.I'm thinking of shaping the rework of
obsoleteTech
to actually split into two functions, one for the part where you can't build the unit anymore, one for the part where the unit automatically upgrades. The legacy fieldobsoleteTech
of course implies both.