Commit Graph

3862 Commits

Author SHA1 Message Date
b2e6612c0e Added a UI for viewing the religions inside a city (#4904)
* Added a UI for viewing the religions inside a city

* Rewrote large parts of the UI, implementing @SomeTroglodyte's great advice
2021-08-20 08:59:13 +03:00
970259a0ea WorkerAutomation cached per Civ - BFS cached (#4868)
* WorkerAutomation cached per Civ - BFS cached

* WorkerAutomation cached per Civ - more linting
2021-08-20 01:25:41 +03:00
d856efac06 Implemented almost all missing founder & follower beliefs (#4890)
* Implemented almost all missing founder & follower beliefs

* Added missing negator

* Implemented requested changes
2021-08-20 01:24:28 +03:00
cb1c70f73b Resolved #4769 - City-states grant copies of their resources, even if they're in use 2021-08-19 23:43:32 +03:00
a4e61d65c2 Fixes crashes from loading mods without an eras.json file (#4910) 2021-08-19 20:44:11 +03:00
c7265c79b6 Reverted 6a32d6 2021-08-19 20:43:47 +03:00
5223caf390 Resolved crash for mods with no eras defined 2021-08-19 20:41:26 +03:00
af92fdc1d2 Expander tab persist (#4905)
* ExpanderTabs remember state

* ExpanderTabs remember state - city constructions dynamic

* ExpanderTabs remember state - city screen portrait
2021-08-19 10:06:52 +03:00
0f5f3366ed Small changes to city screen (#4902) 2021-08-19 09:51:26 +03:00
ef5483e9d5 Removed the civ introduction trade option (#4888)
* Removed the civ introduction trade option

Left in the minimum amount of code to ensure that saves with a pending
introduction trade do not break (any such pending trades are cancelled).
The left-in introduction trade code can be fully removed in a later
version.

* Added back civ introduction trades as a mod option

Also made the gold value of introducation trades moddable.

* Made civ introduction trade invalid if receiver already knows the civ

This prevents players from sending two AI civs introduction trades for
each other in the same turn and profiting from both. This therefore
fixes #4272.

* Applied requested changes

* Removed a spurious space
2021-08-19 09:45:03 +03:00
4114296cbe Made water oil wells require the Refrigeration tech (#4889)
* Made water oil wells require the Refrigeration tech

Oil wells can now only be created on water with the refrigeration
technology.

This is not the ideal solution: it would be preferable to support
multiple improvements for a single resource, to add offshore platforms
as a separate improvement for coastal oil that requires refrigeration
and to disable building oil wells on coast. Allowing multiple
improvements for a resource would however be a much more significant
refactor.

* Added back "terrainsCanBeBuiltOn": ["Coast"]
2021-08-18 12:19:08 +03:00
b60c2c71dd Unit action constants and worker unique cleanup (#4815)
* Unit action constants and worker unique cleanup

* Replace unit action constants with enum properties - patch1

* Replace unit action constants with enum properties - patch2
2021-08-18 12:18:02 +03:00
03981c6242 CityScreen Buy button rework (#4843)
* CityScreen Buy button rework
- e.g. "Buy" for Missionary
- Info pane staying even when building no longer offered
- Purchase Prompt a little prettier

* Urgent Fix - noMods switch default

* CityScreen Buy button rework - patch1
2021-08-18 12:17:40 +03:00
dcc6ad8562 updateNumberOfFollowers _is_ called one last time after a city has been raZed to the grOund (#4892) 2021-08-17 23:24:24 +03:00
8cc25a74a7 Urgent Fix - noMods switch default (#4893) 2021-08-17 23:23:31 +03:00
ecd6cd92a4 City screen purchasable constructions prettier (#4822)
* City screen purchasable constructions prettier

* City screen purchasable constructions prettier - patch1

* City screen purchasable constructions prettier - mad modder edition
2021-08-17 14:00:01 +03:00
607e40a712 Fixed some bugs with spreading of religion (#4851)
* Fixed some bugs with spreading of religion

* Implemented requested changes
2021-08-17 13:58:19 +03:00
74a1da8e17 CS bonuses graded according to relationship level (#4664)
* city-state bonuses graded depending on friend or ally

* siam militaristic UP, cleaned up presentation

* fix strings

* move city state modifiers to json

* city-state bonuses graded depending on friend or ally

* siam militaristic UP, cleaned up presentation

* fix strings

* move city state modifiers to json

* Restructure eras.json

* reduce indentation in DiplomacyManager.kt

* Add fallback values in cas of missing json definitions

* review edits

* fix conflicts???

Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
2021-08-17 13:55:02 +03:00
076128a37e Unit test catching un-annotated lazies (#4886) 2021-08-17 13:52:41 +03:00
0ce033b3a9 Disabled pillaging your own tiles (#4882) 2021-08-17 09:10:21 +03:00
8d49a84f78 Fixed crash from conquering cities (#4877) 2021-08-16 16:58:53 +03:00
df31fb2f05 Fix DOS attack perpetrated by CityInfoReligionManager on Json Serializer (#4870)
Fixes #4867
2021-08-16 11:26:06 +03:00
201648a680 Zone of Control (#4085)
* Implemented Zone of Control

* Implemented "move after attacking" ZoC exception

Units that can move after attacking are not affected by zone of control
if they move because of defeating a unit.

* Implemented all missing special ZoC cases

As described in:
https://forums.civfanatics.com/resources/understanding-the-zone-of-control-vanilla.25582/

* Slightly optimized ZoC logic

* Modified the "possible optimization" comment

Added the knowledge gained from SomeTroglodyte's tests.

* Added "Ignores Zone of Control" unique

Implemented the unique and gave it to the Helicopter Gunship.
2021-08-15 21:42:47 +03:00
8fdff9a940 Stats optimization (#4830)
* Stats rework part 1

* Stats rework part 1 -patch1

* Stats rework part 1 - documentation
2021-08-15 20:52:55 +03:00
4daa22ddea BFS cleanup (#4859)
* BFS cleanup
- Kotlin ArrayDeque is no longer experimental
- Client code sidestepped class API even where API existed -> closed it down
- nextStep when already ended now no-op instead of crash, suits usecases
- predicate test very likely to be more expensive than tilesReached lookup
- getPathTo only used asSequence() - why not a Sequence in the first place
- Compleat documentation. This is very low level, so better help future coders to understand.
- Lint: One annoying hardcoded conditional breakpoint, one unhelpful exception

* BFS cleanup - patch1
2021-08-15 19:44:31 +03:00
5d249ee673 Implemented religious pressure (#4863)
* Implemented religious pressure: cities now can have more than one religion in them and religions spread between nearby cities over time.

* Implemented proposed changes

* Implemented requested changes & minor changes I forgot to include last time

* All pantheons not founded by you are now removed when you gain a new city (found this somewhere in the source code of the original, don't know if it's documented anywhere online)
2021-08-15 18:53:01 +03:00
6a18a33674 Fix units not entering cities upon capture (#4839)
* Renamed and added doc comments for some some can-pass-through functions

* Moved a city-state pass-through exception to a lower-level function

Moved the exception that players (but not AI) can always pass through
city-states from TileInfo.canCivPassThrough to
CivilizationInfo.canPassThroughTiles (which is called by the former).
This makes the behavior of the latter function accurate to its name, and
makes the code more understandable overall.

A side-effect of this change is that functions that used the lower-level
CivilizationInfo.canPassThroughTiles function directly now consider the
aforementioned exception. For example, if a city-state expands its
border, it should now no longer push out units of a player civilization.

It may make even more sense to move the exception to the "canMoveTo"
logic, since AI should probably be able to pass through city-state tiles
even when they don't want to end on them. That might however affect the
AI more significantly.

* Fixed bug where units would not enter a city upon capture

As listed in #4697.

* Fixed a bug where captured units were pushed out of captured cities

Before, capturing a city with a civilian unit in it would cause the
capturing military unit to enter the city but also cause the civilian
unit to leave the city. Now, the civilian unit stays in the city as
well.
2021-08-13 11:30:45 +03:00
2ee4598e70 Ruleset checks allow for unit types to be defined in default ruleset, since it's copied to all complex rulesets if no unit types are there 2021-08-12 20:45:15 +03:00
fb266b07b2 Fixed compile error from branch merging 2021-08-11 21:15:04 +03:00
0d041ab1ef Civilopedia - Difficulty (#4789)
* Civilopedia - Difficulty

* Civilopedia - Difficulty - patch2

* Civilopedia - Difficulty - patch3
2021-08-11 21:03:43 +03:00
6146cc834a Merge branch 'temp'
# Conflicts:
#	core/src/com/unciv/logic/civilization/CivilizationInfo.kt
2021-08-11 20:55:21 +03:00
a08a0e1489 Added ruleset check for units whose type is not defined in the unitTypes 2021-08-11 20:40:44 +03:00
85ecddad2f Fixed crash with diplomacy screen and city-states with no cities
(cherry picked from commit 7c1c585801)
2021-08-11 20:30:00 +03:00
421cce0a43 Fixed crash when selecting certain buildings in the civilopedia (#4819)
(cherry picked from commit 6d04bf424b)
2021-08-11 20:29:25 +03:00
7c1c585801 Fixed crash with diplomacy screen and city-states with no cities 2021-08-11 19:53:21 +03:00
4aed0f0f80 Added founder beliefs, updates to pantheon spreading (#4827)
* Added founder beliefs, minor changes to pantheons

* Fixed the tests

* Implemented recommended chances

* Implemented requested changes
2021-08-11 09:56:36 +03:00
3c4bb1a558 City screen stats double separators (#4821) 2021-08-09 15:32:30 +03:00
e59db3ada3 Unit rename UI (#4804)
* Rework Yes/No and OK/Close

* Apply Yes/No and OK/Close constants

* Clean up and decorate RenameUnitPopup
2021-08-09 13:59:30 +03:00
6d04bf424b Fixed crash when selecting certain buildings in the civilopedia (#4819) 2021-08-09 13:57:13 +03:00
92728e9007 Added an overview screen for religions (#4808)
* Added an overview screen for religions

* Missed a thing

* Implemented requested changes
2021-08-08 23:46:39 +03:00
1aa9eecf85 Fixed crashing Diplomatic victory bug 2021-08-08 23:08:07 +03:00
55d32e1bcb Added follower beliefs for buying religious buildings (#4793)
* Added follower beliefs for buying religious buildings

* Implemented recommended changes
2021-08-08 22:23:22 +03:00
eab42c0a93 MapGenerator optimization (#4805)
* MapGenerator cleanup

* MapGenerator cleanup - lint

* MapGenerator cleanup - tuning

* MapGenerator cleanup - patch1
2021-08-08 22:20:53 +03:00
b649427415 Hides 'automate' unit action and unhides 'stop exploring' unit action (#4810) 2021-08-08 22:06:57 +03:00
b6ee4c0b1c Common interface for Unique-collections in ruleset objects (#4788) 2021-08-08 18:21:04 +03:00
92d3fa65e3 Ruins now have their own file (#4771)
* Ruins now have their own file

* Added religious rewards

* Added an option for only enabling rewards after a certain amount of turns

* You can now weigh rewards making some more likely than others

* Cleaned up some code

* Make new changes compatible with old mods

* Implemented proposed changes

* Implemented requested changes

* Implemented requested changes
2021-08-08 17:31:08 +03:00
58a3dfdda3 Diplomacy: City State resource UI, improvement gift effect (#4782)
* CS Resources shown in Diplomacy linked

* CS Improvement gift updates resources immediately

* CS Improvement gift updates resources immediately - patch1
2021-08-08 15:21:44 +03:00
6d5fe2ff7a Fixed bug where units could still be purchased if they used a depleted resource (#4798) 2021-08-07 23:44:53 +03:00
0c1a21f6ae Fixed crash when borrowing names (#4800)
* Fixed crash when borrowing names

* Fix potential mod error allowed by the previous fix
2021-08-07 23:44:16 +03:00
386095a9d0 One with nature yield for spain is now doubled (#4794) 2021-08-07 23:43:04 +03:00