Commit Graph

4029 Commits

Author SHA1 Message Date
Aron de Jong
c3242f37f2
Add looping minimap viewport if worldwrap enabled (#5349)
The viewport now also appears on the other side of the minimap when
viewing the border of the world with worldwrap enabled.
2021-10-03 11:50:50 +03:00
Xander Lenstra
88bcf5d514
Fixed bug where 'mandate of heaven' policy wouldn't work (#5380) 2021-10-03 11:50:03 +03:00
Xander Lenstra
238cbb782a
Added icons to resource trades & war declarations (#5376) 2021-10-03 11:46:27 +03:00
Xander Lenstra
091622612c
Added default values for supply to fix almost all mods being broken (#5373) 2021-10-03 11:46:04 +03:00
SomeTroglodyte
057f9b3f7b
Reduce Mod checker messages for a set of deprecated UniqueTypes (#5370) 2021-10-03 11:45:50 +03:00
SimonCeder
9016385f30
Barbarian spawning and camp placements (#5354)
* barbarian camp placement, spawn countdowns

* separate file

* raging barbarians

* faster spawn when attacked

* Barbarian AI

* works on old saves

* template.properties

* fix percent

* no improvements unique

* fix test fail

* reviews

* reviews pt 2
2021-10-03 11:45:02 +03:00
SimonCeder
344c96319b
Fix Fountain of Youth (#5355)
* fix fountain of youth

* fix test fail

* reviews

* reviews
2021-10-01 15:51:30 +03:00
SomeTroglodyte
03f374b058
Currently playing music track displayed under Options-Sound (#5357) 2021-09-30 06:35:20 +03:00
SomeTroglodyte
6cfc0a82d8
Deprecation message options only (#5352)
* Do not show RulesetErrorSeverity.WarningOptionsOnly on new game screen

* Do not show RulesetErrorSeverity.WarningOptionsOnly on new game screen - fresh atlas
2021-09-29 21:25:44 +03:00
SomeTroglodyte
fb30a76e85
Civilopedia category icons and keyboard navigation (#5341)
* Civilopedia category icons and keyboard navigation

* Civilopedia category icons - white alternative
2021-09-29 17:39:02 +03:00
SomeTroglodyte
4c87d98aaa
Fix Mod unpack folder move (#5346)
* Fix Mod unpack folder move

* Fix Mod unpack folder move - comment
2021-09-29 12:34:58 +03:00
Xander Lenstra
bb5825a325
First step into unifying strength bonuses using conditionals (#5345) 2021-09-29 08:35:37 +03:00
SomeTroglodyte
8ee36d43d7
Allow Deciv Redux start with >0 City States (#5348) 2021-09-29 06:19:49 +03:00
SomeTroglodyte
070c41592f
Fix era of Wonders without tech in Wonder overview (#5347) 2021-09-29 06:19:28 +03:00
SomeTroglodyte
d3868dae62
Rework game start again (continents) (#5335)
Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
2021-09-28 23:48:06 +03:00
SimonCeder
8e3d2a1b87
Fix Polynesian vision when embarked (#5325)
* fix polynesia unique

* fix polynesia unique

* Update MapUnit.kt
2021-09-28 22:44:54 +03:00
Xander Lenstra
861a42e881
Moved the check for conditionals applying to getMatchingUniques functions; rewrote civInfo.getMatchingUniques (#5342)
* Moved the check for conditionals applying to `getMatchingUniques` functions. Rewrote `civInfo.getMatchingUniques`.

* Clarified comment
2021-09-28 22:42:18 +03:00
SomeTroglodyte
0aea74d3a9
Fix right side of player nation picker no longer entirely clickable (#5338) 2021-09-27 17:29:47 +03:00
SomeTroglodyte
a487c2c373
Fix new game Mod nation icons on first open (#5334) 2021-09-27 17:28:26 +03:00
SimonCeder
e0e701058d
Proper great general points (#5329) 2021-09-27 13:38:42 +03:00
SomeTroglodyte
2e72fd52c8
Double movement unique parameterized (#5319)
* Double movement unique parameterized

* Double movement unique - all filters
2021-09-27 12:35:38 +03:00
yairm210
96511e16ef Merge remote-tracking branch 'origin/master' 2021-09-26 17:17:04 +03:00
yairm210
bb8c9d3175 More unique typing 2021-09-26 17:16:50 +03:00
Xander Lenstra
d07eed31b8
Added the Byzantine empire (#5299)
* Added Byzantine Empire as a nation

* Added unique units

* Implemented unique ability

* Refactored out the beliefContainer

* Implemented reviews

* Credits

* Enumified the uniques & added missing translatable strings
2021-09-26 16:58:24 +03:00
SomeTroglodyte
e1b2814b5d
Mini-UI to see Religion info on foreign cities (#5321) 2021-09-26 11:04:33 +03:00
SomeTroglodyte
3a858a7051
Oversight - "base hurry cost" in pedia should be multiple of 10 (#5320) 2021-09-26 10:54:38 +03:00
SomeTroglodyte
8d33dacc3c
Softcode Fountain of Youth (#5308)
* Softcode Rejuvenation

* Softcode Rejuvenation - comments
2021-09-25 22:15:03 +03:00
SomeTroglodyte
a4c38174b6
Extra embarrassing fix - Textures missing on Android (#5313) 2021-09-25 22:08:37 +03:00
Yair Morgenstern
8d631254aa
Unified many implementations of common interfaces into abstract classes (#5312)
* Unified many implementations of common interfaces into abstract classes

* RulesetObject interface
2021-09-24 17:48:06 +03:00
yairm210
ed47f16c6e Added modder warning for deprecated fields 2021-09-24 16:35:22 +03:00
SomeTroglodyte
c05bf0a2a6
Fix a Nation Picker crash (#5311) 2021-09-24 15:49:56 +03:00
Yair Morgenstern
12302deef6
Precursor to mod target check - (#5303)
* Precursor to mod target check -
Define acceptable targets for each unique holder

* Warn for bad unique targets, and divide between different types of beliefs

* Moved the belief type logic into the class, rather than being external

* Added comment that getUniqueTarget is currently unneeded, but planned for future use
2021-09-24 15:02:41 +03:00
SimonCeder
fa813f8f5e
Quests fixes and additions (#5301)
* enable all quests

* implement more quests

* weighting for quests

* global quests

* fixes

* fixes

* Update template.properties

* general string

* reviews
2021-09-24 10:05:30 +03:00
SomeTroglodyte
e9e0f2c55f
World and Natural Wonders Overview (#5297)
* World and Natural Wonders Overview

* World and Natural Wonders Overview - icon

* World and Natural Wonders Overview - groups and tuning

* World and Natural Wonders Overview - atlas

* World and Natural Wonders Overview - lint
2021-09-24 10:04:30 +03:00
SomeTroglodyte
8ef84d785e
Music controller - Fix pause (#5307) 2021-09-24 10:00:46 +03:00
yairm210
bae8bd2468 Mod error detection improvements!
Separated Warning vs Error, show "options only" warning in options only, color warnings by severity
2021-09-23 12:04:16 +03:00
SimonCeder
2e8934af17
Newly Allied city states declare war on your enemies, even unmet ones (#5298)
* new allies dow, unmet civs meet first and then dow

* no gifts for bad people
2021-09-23 11:31:36 +03:00
SomeTroglodyte
4a83bed4ba
Nation Picker visual help where to click (#5287)
* Nation Picker visual help where to click

* Nation Picker visual help where to click - circles
2021-09-23 11:23:40 +03:00
SomeTroglodyte
a5a8ea1338
Natural Wonders un-hardcoded (#5279)
* Natural Wonders un-hardcoded

* Natural Wonders un-hardcoded - oops testing change revert

* Natural Wonders un-hardcoded - tests OK

* Natural Wonders un-hardcoded - requests

* Natural Wonders un-hardcoded - hide from pedia

* Natural Wonders un-hardcoded - readable unique
2021-09-23 11:21:08 +03:00
SomeTroglodyte
8161da26de
Texture pack/load for mods also distributes by Images.*X* (#5296) 2021-09-22 22:11:39 +03:00
yairm210
66b0ddb25a Mod error detection improvements!
Separated Warning vs Error, show "options only" warning in options only, color warnings by severity
2021-09-22 21:28:19 +03:00
SimonCeder
0bb565fdc6
Can't trade resources from other trades or city-states (#5252)
* can't trade resources from city-states

* display untradeable sources in trade screen

* Update template.properties

template string

* Update Swedish.properties

* Spelling, better buttons
2021-09-22 20:21:41 +03:00
yairm210
98f14523ed Add all cityFilter strings from the 'source of truth', since many were missing from translation file 2021-09-22 19:47:31 +03:00
SomeTroglodyte
d1005327e7
Lint a few warnings and typos (#5293) 2021-09-22 19:32:25 +03:00
yairm210
5d6765a879 Resolved crash in unit civilopedia lines that depended on unitType being initialized 2021-09-22 18:32:16 +03:00
SomeTroglodyte
5e4aff90e9
Music controller with fade-over and mod capabilities. (#5273)
* Music controller with fade-over and mod capabilities.
- Preparation for music following game situations
- Minimal in-game hooks for now
- Already allows mods providing music, will play randomly

* Music controller - template
2021-09-22 09:35:33 +03:00
Xander Lenstra
b7467d3467
Added support for conditionals to some more uniques (#5280)
* Added support for conditionals to some more uniques

* Implemented a new conditional

* Added the new conditional to the translations file

* Fixed tests

* Implemented requested changes
2021-09-22 09:24:16 +03:00
Xander Lenstra
4343137b82
Save the sources of uniques with the uniques themselves (#5281) 2021-09-21 20:26:14 +03:00
Yair Morgenstern
05394f627d
Using reflection to find and report deprecated uniques (#5276)
* Using reflection to find and report deprecated uniques

* No kotlin reflection needed thank you very much
2021-09-21 20:26:05 +03:00
Xander Lenstra
7a59cbcbe8
Fixed bug where a unit auto-exploring ancient ruins would in some cases disappear after upgrading (#5285) 2021-09-21 20:18:02 +03:00
yairm210
eedfbe0235 Specify acceptable uses of this unique
Later we'll be able to check this in checkRuleset to warn against incorrect usages
2021-09-20 16:26:36 +03:00
Xander Lenstra
ce5a82c763
Fix translation tests and wrongly translated conditionals (#5272) 2021-09-20 16:04:51 +03:00
yairm210
bd7824cdb9 More UniqueType-ing, discovering an overlap this time 2021-09-19 21:33:26 +03:00
yairm210
5fc7d1ce46 Gain free building uniqueType'D 2021-09-19 21:18:56 +03:00
yairm210
bdefb7894c cityInfo.getMAtchingUniques accepts uniqueType 2021-09-19 21:15:26 +03:00
yairm210
aee087ec01 tileResource unique fully replaceable by uniques 2021-09-19 20:58:17 +03:00
Xander Lenstra
f47f427b05
Adds conditionals to most of the uniques currently in the enum (#5270)
* Moved uniques to their own folder

* Added support for conditionals to most of the uniques in the current enum

* Deprecation > removal, of course

* Fixed tests & added `.removeConditionals` before checking for placeholders
2021-09-19 18:43:32 +03:00
Xander Lenstra
62e3dbe014
Moved uniques to their own folder (#5269) 2021-09-19 18:03:41 +03:00
Xander Lenstra
cb4feb29ed
Fixed a few bugs relating to earning great prophets (#5267)
* Fixed bug where great prophets gifted by city-states wouldn't have a religion

* Fixed bug where earning/buying great prophets whithout having founded a religion would result in great prophets of your pantheon, regardless of the religious state of the city
2021-09-19 17:56:38 +03:00
SimonCeder
027057874d
Update and generalize Siam UP (#5237)
* refactor and generalize Siam UP, display correct values in diplo screen

* enable preferred diplomatic victory

* allow compatibility mode

* revisions, restore timesInPlace

* don't change game.png

* don't change game.png

* objectify and enum city state bonuses

* objectify and enum city state bonuses

* template.properties

* refactored city state bonuses into Unique

* further enumization, fix toStringWithDecimals

* reviews
2021-09-19 06:28:10 +03:00
Xander Lenstra
ba679191f8
Fixed intercept chance being invertes (#5259)
Edit made on mobile and as such untested
2021-09-18 23:42:10 +03:00
SomeTroglodyte
ec0801ccef
Nation picker portraits (#5250)
* New game nation picker spruce-up

* New game nation picker spruce-up - Ctext icon control
2021-09-18 23:31:03 +03:00
Xander Lenstra
01bfd17594
Implementation of conditionals, but better than before (#5187)
* Implementation of conditionals, but better than before

* Updated the unique while I was at it

* Fixed bug where conditionals would never apply

* Capitalization

* Minor code cleaning

* Better documentation & variable names

* Changed translation strategy

* Added missing import?
2021-09-18 23:07:53 +03:00
SomeTroglodyte
8cff3fda49
Start preference Avoid shown with red X (#5253) 2021-09-18 23:05:14 +03:00
yairm210
81a12920df Merge branch 'temp' 2021-09-18 23:03:00 +03:00
SimonCeder
803575665d fix bug on capturing capital (#5263)
(cherry picked from commit 47d1a5c009)
2021-09-18 23:02:04 +03:00
SimonCeder
8eb24ac273
Carthage civ (#5224)
* Add Carthage

* Implement uniques

* performance improvement, better elephant

* AI avoids taking too much damage from mountains

* more performance

* better AI

* can't settle cities on mountains

* AI improvement

* AI improvement

* revisions, damagePerTurn in Terrains.json

* terrain damage stored as unique in json, damage also works for terrain features

* don't change game.png
2021-09-18 20:28:12 +03:00
yairm210
7e05a56e37 Tile resource uniques now work to provide stat bonuses 2021-09-17 16:05:21 +03:00
yairm210
54ea0c89a8 Ruleset check finds errors in uniques of all kinds! 2021-09-17 14:47:03 +03:00
yairm210
fa462d830f Use enum to generate parameter names when translating - more accurate than auto-detect by parameter name! 2021-09-17 14:10:40 +03:00
SimonCeder
c2fa1366bb
Add a fixed base strength to motivationToAttack (#5248) 2021-09-17 13:23:03 +03:00
yairm210
38231bf937 More reorg, first unique with cityFilter 2021-09-17 10:53:03 +03:00
yairm210
55a77096c1 Added city filter as parameter type, some reorg 2021-09-17 10:48:16 +03:00
yairm210
2f8de2d196 Added Stats as unique parameter type 2021-09-17 10:43:03 +03:00
yairm210
af9e691102 Ease of deprecation, brought to you by unique types!
*Visible*, locatable deprecated uniques!
Stated replacement uniques!
2021-09-17 10:33:53 +03:00
yairm210
1f05239275 Unit filtering actually comes in 2 flavors - one for "unit templates", BaseUnit, and one for "actual units in the field", MapUnit. This should be reflected in the parameter names. 2021-09-17 10:14:05 +03:00
yairm210
fa939e15d9 getMatchingUnique for UniqueType - will allow us to convert most of the uniques painlessly 2021-09-17 09:55:57 +03:00
Yair Morgenstern
34cb48aa31
Unique enum compliance detection (#5226)
* Added basic functionality for uniques enum

* Added unique type to Unique class for faster enum comparisons

* And Elvis operator for unknown parameter type

* Resolved #5162 - AI much less motivated to attack city-states

* Whoops, wrong branch

* New unique checks, with enum.

* Fixed Trog's comments
2021-09-17 09:35:01 +03:00
Xander Lenstra
b73b81a313 Fix bugs and crashes (#5245)
* Fixed crash when liberating city-states

* Fixed crash & building duplication from 'legalism' policy

(cherry picked from commit b0dff6a71c)
2021-09-17 09:13:39 +03:00
Xander Lenstra
b0dff6a71c
Fix bugs and crashes (#5245)
* Fixed crash when liberating city-states

* Fixed crash & building duplication from 'legalism' policy
2021-09-17 08:44:48 +03:00
SomeTroglodyte
340bedc7ea
Implemented Unit Supply by r3versi, not by me (#5234)
* Implemented Unit Supply

Unit Supply is a soft cap to number of units. If the number of units of a civilization exceeds the total supply, a production malus (capped at 70%) is applied.

* Warning icon & message for supply deficit

* Implemented Unit Supply - atlas merge

* Unit Supply: Malus->Penalty, lint, sumOf

* Unit Supply: Fresh atlas

Co-authored-by: r3versi <fluo392@gmail.com>
2021-09-16 22:50:49 +03:00
SomeTroglodyte
3d9c5bcc34
Mod TranslationFileWriter re-work (#5219)
* Mod TranslationFileWriter re-work

* Mod TranslationFileWriter re-work - style and existing in base treatment

* Mod TranslationFileWriter re-work - style and existing in base treatment
2021-09-16 20:59:50 +03:00
SomeTroglodyte
a61efa65c9
Ask before resetting game setup to defaults (#5231) 2021-09-16 20:56:54 +03:00
Xander Lenstra
eb665a9158
Embarked units only have 1 vision (except marines) (#5215)
* Embarked units only have 1 vision

* Embarked units always only have 1 vision, unless they don't
2021-09-16 20:55:33 +03:00
SomeTroglodyte
5fd04f6e32
Modmanager sort and filter (#5186)
* Mod manager portrait mode

* Mod manager portrait and auto scroll

- MM switches to stacked expanders in portrait.
- Use AutoScrollPanes.
- Disable the enter/leave listener of AutoScrollPane in Pickers which disable the default ScrollPane to roll their own - helps all such pickers.
- No expander open/close persistence on purpose.
- PickerScreen a bit cleaned 'cuz I needed to understand something.
- Marked mods from the kill-list that are already installed.
- Button sync now OK when counterpart missing (deselects other column).

* Mod Manager sorts and filters - WIP 1

* Mod Manager sorts and filters - WIP 2

* Mod Manager sorts and filters - WIP 2a

* Mod Manager sorts and filters - WIP 3

* Mod Manager sorts and filters - atlas

* Mod Manager sorts and filters - tip
2021-09-16 20:54:47 +03:00
Yair Morgenstern
6d26a28619
Added basic functionality for uniques enum (#5222)
* Added basic functionality for uniques enum

* Added unique type to Unique class for faster enum comparisons

* And Elvis operator for unknown parameter type

* Resolved #5162 - AI much less motivated to attack city-states

* Whoops, wrong branch
2021-09-16 20:52:06 +03:00
Xander Lenstra
51bfd927c1
Fixed crash when providing free buildings (#5230) 2021-09-15 16:56:43 +03:00
yairm210
ce8dd40c60 #4963 - All city-state influences recalculate ally civ, which recalculates resources, which recalculates stats. 2021-09-15 01:47:17 +03:00
yairm210
b7eb21b606 Merge remote-tracking branch 'origin/master' 2021-09-15 00:59:40 +03:00
yairm210
f60464201b Resolved #5162 - AI much less motivated to attack city-states 2021-09-15 00:59:28 +03:00
SimonCeder
672d2a3c34
Fix Khan unit (#5207)
* fix khan unique

* fix adjacent healing bonus

* plus

* Khan heals itself also

* nerf medic
2021-09-15 00:35:16 +03:00
SomeTroglodyte
86bbf54cc0
Civilopedia quickie: Units show other direction of upgrade path (#5209)
* Civilopedia quickie: Units show other direction of upgrade path

* Civilopedia quickie: Units show other direction of upgrade path - spacing
2021-09-15 00:34:20 +03:00
Xander Lenstra
fe60c100fa
Simplified check for enabled religion and added it in more places (#5218)
* Reworked `hasReligionEnabled`

* Added more checks for enabled religion

* Consistisized spelling
2021-09-14 17:34:04 +03:00
Xander Lenstra
fe3220299c
Fixed a few spots using the name of a religion instead of its displayName (#5216) 2021-09-14 17:33:06 +03:00
SimonCeder
7bd555ac95
City-States Influence rates; Wary status; Proximity calculations (#5198)
* Rates for natural influence change

* Minor civ wariness, proximity calculation

* CS can declare permanent war

* CS can in fact not declare permanent war

* adjustments, template.properties

* neater code

* fix failing test? .

* move proximity code, for reals fix failing check

* now?

* revisions

* BFS only once, better check for water map

* assign continents on pre-made maps as well

* now works on all pre-made maps
2021-09-14 11:01:43 +03:00
Interdice
297618706c
Adding religous city states to unciv! (#5136)
* Adding religous city states to unciv!

* Adding religous city states to unciv!

* Adding religous city states to unciv!

* Adding religous city states to unciv!

* Adding religous city states to unciv!

* Adding religous city states to unciv!

* Adding religous city states to unciv!

* Adding religous city states to unciv!

* Adding religous city states to unciv!

* Adding religous city states to unciv!

* Adding religous city states to unciv!

* Adding religous city states to unciv!

* Adding religous city states to unciv!

* Adding religous city states to unciv!

* Adding religous city states to unciv!

* Adding religous city states to unciv!

* Adding religous city states to unciv!

* Adding religous city states to unciv!

* Adding religous city states to unciv!

* Adding religous city states to unciv!

* Adding religous city states to unciv!

* Adding religous city states to unciv!

* Adding religous city states to unciv!

* Adding religous city states to unciv!

* Adding religous city states to unciv!

* Adding religous city states to unciv!

* Adding religous city states to unciv!

* Adding religous city states to unciv!

* Adding religous city states to unciv!

* Adding religous city states to unciv!

* Adding religous city states to unciv!

* Adding religous city states to unciv!
2021-09-14 10:49:38 +03:00
Xander Lenstra
0f805fbac4
Made CN tower functional, and free buildings are removed on capture (#5206)
* Refactored free buildings from civ.policies to civ.constructions

* Made CN tower function like in the base game

* Fixed random buildings being marked culture buildings
2021-09-14 10:12:08 +03:00
ravignir
893f41a0ed
Add missing Natural Wonders (#5204)
* Add files via upload

* Add files via upload

* Add files via upload

* Update Terrains.json

* Update Constants.kt

* Update Constants.kt

* Update NaturalWonderGenerator.kt

* Update Constants.kt

* Update NaturalWonderGenerator.kt

* Natural Wonders generation fixes.
2021-09-13 20:49:46 +03:00
Xander Lenstra
9c66154a44
Updated piety policy tree (#5195)
* Added piety policy tree

* Misread an ability

* Fixed filter
2021-09-12 21:48:28 +03:00
Xander Lenstra
a4c520fd26
Added "Consumes [amount] [resource]" for improvements (#5129)
* Added "Consumes [amount] [resource]" for improvements

* It now also works for placeable improvements

* Made construction grayed out instead of disappear when no resources available
2021-09-12 21:21:46 +03:00
SomeTroglodyte
af20124e5d
Handle maps with invalid mapSize more gracefully (#5190)
* Handle maps with invalid mapSize more gracefully

* Handle maps with invalid mapSize more gracefully - new game exception handling

* Handle maps with invalid mapSize more gracefully - moved version save init
2021-09-12 19:15:21 +03:00
Xander Lenstra
03a7288656
Fixed sqrt of negative number (#5193) 2021-09-12 19:07:33 +03:00
Xander Lenstra
b002e53eba
Fixed some bugs (#5178)
* Fixed bug where moving a unit stopped automation

* Fixed bug where chosing an icon last in the religion screen would not enable the 'found religion' button

* Fixed bug where buying units with an increasing cost would deduct the wrong amount

* Fixed bug making it impossible to pick free techs
2021-09-11 23:09:43 +03:00
yairm210
db78bcf00d Fixed another crash when mod game had religion enabled but had no great prophet unit 2021-09-11 23:07:39 +03:00
yairm210
619dfc5e09 Fixed crash when mod game had religion enabled but had no great prophet unit
Also slight deprecation
2021-09-11 23:05:07 +03:00
SimonCeder
d59fe45f51
Proper implementation of pledge to protect (#5165)
* penalties for attacking

* proper timers on penalties

* template.properties

* space

* Player can pick sides when protected civs attacked/bullied
Protect gives resting point 10 for influence

* correct string
2021-09-11 21:10:45 +03:00
SomeTroglodyte
45e87688cf
Guard against crash in getNumThreateningBarbarians without barbs (#5173)
* Guard against crash in getNumThreateningBarbarians without barbs

* Guard against crash in getNumThreateningBarbarians without barbs - missing inits
2021-09-11 21:09:45 +03:00
yairm210
00e962c9ac Resolved #4977 - can no longer fast-tap to confuse the policy/construction screens 2021-09-10 13:51:01 +03:00
yairm210
66d7e8cbd0 Minor improvements 2021-09-10 13:42:37 +03:00
yairm210
3103984250 Merge remote-tracking branch 'origin/master' 2021-09-09 21:55:45 +03:00
yairm210
d8d94cb6bd Deprecation 2021-09-09 21:55:25 +03:00
SimonCeder
83050c2b11
Militaristic city states can give unique unit; refactor city state initialization (#5147)
* Pick unique unit for militaristic CS

* Provide unique unit when able

* refactor some code

* remove debug

* template.properties

* fix failing build

* Add variance to spawning rate, add ≈ to string, better formatting.
2021-09-09 21:30:12 +03:00
SomeTroglodyte
f1f4def7f0
Fix Denunceation typo, reorg compatibility code (#5156)
* Fix Denunceation typo, reorg compatibility code

* Fix Denunceation typo - lint
2021-09-09 21:29:13 +03:00
SimonCeder
cbd3c2910e
Icons for city states (#5160)
* Add city state icons

* Add the icons

* Get filename from cityStateType.name

* less padding

* Icon names in enum, icons in diplomacy screen
2021-09-09 21:28:30 +03:00
SomeTroglodyte
df5540442f
Fix crash entering mod management (#5158) 2021-09-09 20:06:37 +03:00
SomeTroglodyte
612ad0ab55
Fix era notification (#5161) 2021-09-09 20:03:51 +03:00
Xander Lenstra
7b6e57d3b5
Religion goes from alpha into beta: available from stat screen immediately (#5149) 2021-09-09 07:24:56 +03:00
SomeTroglodyte
bebfe92fb1
Mod manager portrait and auto scroll (#5138)
* Mod manager portrait mode

* Mod manager portrait and auto scroll

- MM switches to stacked expanders in portrait.
- Use AutoScrollPanes.
- Disable the enter/leave listener of AutoScrollPane in Pickers which disable the default ScrollPane to roll their own - helps all such pickers.
- No expander open/close persistence on purpose.
- PickerScreen a bit cleaned 'cuz I needed to understand something.
- Marked mods from the kill-list that are already installed.
- Button sync now OK when counterpart missing (deselects other column).

* Mod manager portrait - template
2021-09-09 07:24:00 +03:00
SomeTroglodyte
ffdc289611
Civilopedia remove migration-only interface elements (#5150) 2021-09-09 07:18:26 +03:00
Xander Lenstra
9c876ad84e
Wrote an extensive tutorial documenting most of religion (#5130)
* Wrote an extensive tutorial documenting most of religion

* Fixed spelling and improved clarity

* Fixed typo (Thanks for noticing!)

* Reworded and split up tutorials, fixed grammer/spelling mistakes

* Added missing quote mark
2021-09-09 06:22:43 +03:00
SomeTroglodyte
8b210fb798
Kotlin 1.5 new warnings - the rest (#5151) 2021-09-09 06:21:44 +03:00
ravignir
ac5122741b
deleting the annoying part of misimplemeted pledge to protect mechanic. (#5146)
Maybe poll this on discord.
2021-09-08 23:35:20 +03:00
yairm210
1530389507 3.16.13 2021-09-08 23:19:07 +03:00
Alex25820
022b55e937
Adds support for opening debug menu on MacOS (#5142) 2021-09-08 21:50:20 +03:00
Xander Lenstra
d247cacbca
Added "in other cities" as a cityFilter (#5131) 2021-09-08 21:41:57 +03:00
Xander Lenstra
3722fab38d
From the indstrial era onwards, things change in religion (#5095)
* Improved redability

* From the industrial era onwards, religion goes into 'second phase'

* Fixed tests

* Fixed formula for buying great prophets starting from the industrial era

* Added `getMatchingUniques`, `hasUnique` to `IHasUniques`, cleaned up some code

* Fix compilation errors
2021-09-08 21:24:26 +03:00
SomeTroglodyte
366ce4b89b
Kotlin 1.5 new warnings - partial (#5121) 2021-09-08 21:15:32 +03:00
SomeTroglodyte
1785c1f78e
No right-click on Android (#5125) 2021-09-08 21:13:43 +03:00
Xander Lenstra
4cfdfee301
Added "Incompatible with [promotionName]" unique (#5128) 2021-09-08 21:12:57 +03:00
Xander Lenstra
e2a1e44282
Fixed bugs with unit movement (#5126)
* Fixed bugs with unit movement

* Optimized function call

* Cleaning up some code

* Removed comments that are no longer applicable
2021-09-08 21:11:59 +03:00
SimonCeder
7297139594
CS vulnerable to ally unhappiness (#5134) 2021-09-08 21:02:34 +03:00
SomeTroglodyte
ab5083173d
Kotlin 1.5 new warnings - partial (#5120) 2021-09-08 20:48:24 +03:00
SimonCeder
8b6881c76b
checks for protection, delays (#5133) 2021-09-08 20:47:23 +03:00
SomeTroglodyte
e0fe788e28
Add a "Reset to defaults" button to the Newgame screen (#5141)
* Add a reset to defaults button to the new game screen

* Add a reset to defaults button to the new game screen - template
2021-09-08 20:46:18 +03:00
Xander Lenstra
d1135f3d20
Fixes incorrect default paramter for starting era (#5119) 2021-09-08 20:44:50 +03:00
Xander Lenstra
a1f7721878
Fixes #5113 (#5122)
* Fixed #5113

* Better check
2021-09-08 20:42:58 +03:00
Xander Lenstra
9a29ce8422
Fixed all renamed units being called 'instanceName' (#5140)
* Fixed all renamed units being called 'instanceName'

* Removed extreneous square brackets resulting in incorrect translations

* Fixed translation problems
2021-09-08 20:42:27 +03:00
SomeTroglodyte
7118e9779c
GameStarter wrap and shape aware (#5107)
- Starting locations code aware of wrap and map shape
- RiverGenerator wrap aware
- RiverGenerator guard against endless loop
2021-09-06 18:32:12 +03:00
SomeTroglodyte
7f386da2bc
Kotlin 1.5 new warnings - partial (#5108)
* Kotlin 1.5 new warnings - partial

* Kotlin 1.5 new warnings - partial
2021-09-06 18:28:20 +03:00
SimonCeder
2ca42a705f
Force ranking, bullying improvements (#5102)
* Proper demand tribute thresholds

* Proper calculation for Force rankings

* debug strings

* use new force ranking for AI threatAssessment

* use new force ranking for AI threatAssessment, pt 2
2021-09-06 15:50:39 +03:00
Xander Lenstra
486e2a7a8a
Deprecate all mods without an eras.json file (#4809)
* Enforce the existence of an eras.json file for mods

* Merged `getEra()` and `getEraObject()`

* Hide mods we have deemed outdated

* Fixed compile errors that I didn't notice before

* Fixed unit tests
2021-09-06 14:50:38 +03:00
Xander Lenstra
8079a8dc7b
Fix bugs (#5103)
* Fixed a bug where moving a unit through ancient ruins spawning another unit would duplicate units

* Fixed a bug where automatically exploring units upgrading from ancient ruins would not upgrade

* Fixed a bug where city state influence could go lower than the minimum
2021-09-06 14:35:31 +03:00
SimonCeder
c7264556ea
City state intrusion anger (#5090)
* move functions, greece UP

* CS influence from killing barbs

* Greece healing in CS territory

* move diplomacy bonuses into CityStateFunctions.kt

* Split filter in Battle.kt, nicer code
2021-09-05 21:22:02 +03:00
Xander Lenstra
f016012e39
Fixed a bug where no icon would display in city religion UI for pantheons (#5094) 2021-09-05 14:58:02 +03:00
yairm210
5170a27e07 Fixed crash where deleting mods meant you could never start a game again
If the last game you created used a mod that you later removed from the the device it could never be removed from the new game parameters
Caught exceptions from quickstart failing
2021-09-05 14:57:21 +03:00
yairm210
5f0afffe5a Resolved #4344 - can no longer enter city-screen that is not yours 2021-09-05 14:04:49 +03:00
yairm210
194c69a633 Deprecation 2021-09-05 13:18:51 +03:00
yairm210
194eb5299e Readability improvements 2021-09-05 12:53:12 +03:00
SimonCeder
ad50e9d2fc
implement locale for proper sorting on certain screens (#5082)
* implement locale for sorting

* persian, centralize Collator.getInstance

* fall back to default instead of english

* fix failing build
2021-09-05 12:12:18 +03:00
Xander Lenstra
a20baca7c2
You can now input distinct numbers when trading gold (#5072)
* Type amount of gold in trade requests

* Remove extraneous spaces in template.properties

* Implemented proposed changes

* Fixed tests
2021-09-05 12:10:57 +03:00
Xander Lenstra
980f0f4611
Fixed crash when viewing the name of a religion (#5092) 2021-09-05 12:05:54 +03:00
Yair Morgenstern
f3a8188cb1
Kotlin 1.5.30 test (#5089)
* Kotlin bump to 1.5.30

* Needed change due to (correct!) new compile error
2021-09-05 00:28:21 +03:00
yairm210
a1fdb612a9 Merge remote-tracking branch 'origin/master' 2021-09-04 21:40:41 +03:00
yairm210
48092b09b1 Resolved #4478 - spectator cannot take over player diplomacy options 2021-09-04 21:40:30 +03:00
SomeTroglodyte
6bc58ab5a3
Tabbed options (#5081)
* Tabbed Options Screen

* Tabbed Options Screen - atlas
2021-09-04 21:30:39 +03:00
SomeTroglodyte
84f7d4f56b
Fix map setTransients throwing exception from map generator on some map sizes (#5084) 2021-09-04 21:27:13 +03:00
yairm210
60abae5d1a Better check for units with no unitType defined 2021-09-04 21:13:01 +03:00
SomeTroglodyte
2069f227c4
Newgame Mod incompatibility toast (#5076) 2021-09-03 12:26:38 +03:00
SimonCeder
8cb464c9f7
Correct year shown when starting in later eras (#5070)
* json, getEquivalentTurn

* WorldScreenTopBar.kt

* affects shown year only
2021-09-03 00:13:58 +03:00
Xander Lenstra
df853504ae
Great Prophets now always have your religion as their religion (#5052)
* Great Prophets now always have your religion as their religion

* Reworded unique for clarity
2021-09-02 20:52:24 +03:00
SimonCeder
34eb4758ff
Rework City State functions into separate file (#5043)
* cut+paste new file

* rewrite functions

* wrapper functions

* rewrite function calls

* influenceGainedByGift

* keep instantiated CityStateFunctions as Transient

* use setter functions for influence
2021-09-02 20:50:18 +03:00
yairm210
c116b9ba94 Linting 2021-09-02 20:48:29 +03:00
yairm210
e418f1b8ca Merge remote-tracking branch 'origin/master' 2021-09-02 20:38:16 +03:00
Xander Lenstra
9575b5bf66
Implemented renaming of religions (#5057)
* Implemented renaming of religions

* Made AskForText display error on invalid input, implemented recommended changes

* Almost forgot the translatable strings in the new popup
2021-09-02 17:40:10 +03:00
yairm210
15335f3f7c Made city-state bonuses immutable to avoid future problems a la #5050 2021-09-02 17:37:52 +03:00
yairm210
d0dbb27e00 Resolved crash due to evaluating distance to city state when we have no cities 2021-09-02 17:21:46 +03:00
Xander Lenstra
fcc335b78a
Refactor more code, hopefully increasing maintainability (#5062)
* Fixed great person gift formula, confusing boolean, "great person" filter

* Refactored getRejectionReason to return a hashSet of reasons instead of a random one
2021-09-02 16:37:40 +03:00
Xander Lenstra
2e43637144
Fixed a bug where cities founding after creating a pantheon would not have that pantheon (#5053) 2021-09-01 19:21:41 +03:00
Xander Lenstra
186d06faf0
When spreading a religion with a great prophet, other religions are now removed (#5055) 2021-09-01 19:21:09 +03:00
Xander Lenstra
b347366d50
Refactored some code and uniques (#5051)
* Refactored some code and uniques

* Fixed compilation errors, tests and crashes

* Moved influence bounds check from add to set
2021-09-01 19:20:04 +03:00
Xander Lenstra
cffe8e441e
Finishing the later five policy trees now allows you to buy great people with faith (#5038) 2021-09-01 09:46:27 +03:00
Xander Lenstra
634f4a3533
Added Religious wonders (#5041)
* Added Grand Temple and Great Mosque of Djenne buildings

* Added uniques for Grand Temple

* Added uniques for Mosque of Djenne, refactored ability uses system to count down isntead of up
2021-08-31 22:23:02 +03:00
SimonCeder
cd7bd8fcfd
fix duplicated city-state bonus bug (#5042)
* fix city-state bug

* pt 2
2021-08-31 22:18:58 +03:00
Xander Lenstra
248145cf8f
Fixed bug making enhancing religions impossible (#5040) 2021-08-31 18:22:39 +03:00
Xander Lenstra
9450fac423
Added UI to show what cities are holy cities to the player (#5039) 2021-08-31 16:55:29 +03:00
SimonCeder
a7c4895985
Add Austrian civ (#5026)
* Json definition for nation, images

* Jsons, Hussar and Coffee House

* Diplomatic Marriage Button

* Implement Marriage

* AI Marriage

* template.properties

* Popups etc

* Strings

* reviews

* reviews pt 2
2021-08-30 23:21:02 +03:00
Xander Lenstra
1771604a4a
AI will now found & enhance religions -- minor improvement to civilian AI (#5031)
* AI will now found & enhance religions -- improvements to civilian AI

* This is a better order imo

* Implemented requested changes
2021-08-30 21:41:18 +03:00
SomeTroglodyte
06c7f049b7
Diplomacy Screen Nation relation indicator (#5032) 2021-08-30 20:25:13 +03:00
yairm210
b0e3aa326b Mass deprecation 2021-08-30 19:52:57 +03:00
yairm210
b554a6db93 Deprecated Stats as viable values for Great Person points 2021-08-30 19:35:50 +03:00
SimonCeder
7e0b7f0007
units get promotions and xp bonuses from CS buildings (#5012)
* units get promotions and xp bonuses from CS buildings

* fix siam
2021-08-30 14:17:59 +03:00
SimonCeder
a01a6270fc
Demanding tribute from city states (#4976)
* tribute willingness calculations

* implement demanding gold and workers

* Revisions

* unit power calculation

* show modifiers in the diplo screen

* template.properties

* G&K modifiers

* promotions start at 0

* notiifications, AI

* conflict

* conflict?

* template and translation, failing test?

* another missing string

* missing space

* afraid relationship status

* missing space 2

* Slight optimization

* optimization pt 2

* reviews
2021-08-30 14:17:20 +03:00
SomeTroglodyte
9c3e621b15
Atlas reorg - packer to loader via json (#5014) 2021-08-29 23:29:24 +03:00
SomeTroglodyte
3b5489a3b4
Persistent new game setup (#5016)
* Persistent new game setup

* Persistent new game setup - comments
2021-08-29 20:40:13 +03:00
SomeTroglodyte
5a6a9c9759
Anti-Armor, negative tile yield, LoadScreen (#5018)
* Harden against negative yields, Anti-Armor

* Anti-Armor bad unitType, LoadScreen
2021-08-29 11:33:20 +03:00
Xander Lenstra
1cc90a3953
Implemented the enhancing of religions (#4965)
* Generalize the concept of founding religions in preparation of enhancing

* Implemented enhancing religions

* Added all enhancer beliefs (mostly correctly, mostly tested)

* You can now found a religion without a pantheon, requiring you to choose a pantheon as well

* Parameterized 'enhance religion' action, fixed tests

* Implemented requested changes & simplified beliefContainer a lot

* Fixed rename

* Updated code to include features added in the meantime

* Merge branch 'master' into enhanceReligions

Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
2021-08-28 22:36:11 +03:00
SomeTroglodyte
3e22a36bbf
Fix Civilopedia resource to Wonder links (#5011) 2021-08-28 22:27:25 +03:00
SomeTroglodyte
ef7fc36c80
Harden automateImprovementPlacer and detect Mod problems with these (#5010) 2021-08-28 22:26:00 +03:00
yairm210
8779ca7147 Mass deprecation 2021-08-28 22:21:35 +03:00
Xander Lenstra
85e4a68ea1
Submarines are now visible to adjacent units, and once turned visible, can be attacked by all enemy units (#5001)
* Submarines are now visible to adjacent units, and once turned visible, can attack be all enemy units

* Deprecation & translation of unique saving
2021-08-27 17:00:12 +03:00
Xander Lenstra
7dd7e0b278
Fixed a unique & better credits (#4998) 2021-08-27 16:27:17 +03:00
SomeTroglodyte
7085ea95cc
Fix: Legacy maps with starting locations not playable (#5000)
* Fix: legacy maps with starting locations not playable

* Fix: legacy maps with starting locations not playable - ruleset
2021-08-27 16:26:45 +03:00
SomeTroglodyte
bf2ee91b67
Civilopedia Phase X (#5003)
* Civilopedia Phase X - Show Policies

* Civilopedia Phase X - Show City States

* Civilopedia - Loop-driven init and Cleanup

* Civilopedia - City States

* Civilopedia Phase X - Remove spurious comments
2021-08-27 16:24:23 +03:00
SomeTroglodyte
448b04fab8
Civilopedia - Tweaks (#4990)
- Icon for BeliefType.Founder
- Religion icons inverted in Civilopedia
- Terrain icons in links and entry header centered
2021-08-26 17:29:55 +03:00
Xander Lenstra
86d1f143d9
Conquering a city destroys buildings inside the city (#4995)
* When conquering a city, some buildings are now destroyed

* Added missing translation for uniques
2021-08-26 17:09:55 +03:00
yairm210
59f8a0eebf Hardcoded image atlases for it to work from within a .jar - #4993 2021-08-26 16:51:38 +03:00
SomeTroglodyte
9df58ed240
Stats rework part 2 (#4983)
- Nicer iterators
- Callers adapted to simpler syntax
- CityStats changed to non-serializable
2021-08-25 19:02:42 +03:00
SomeTroglodyte
5d95dd1c7b
Multiple Start Locations per tile nicer display (#4982) 2021-08-24 22:56:05 +03:00
SomeTroglodyte
cdc63f71e8
Multi-Atlas / Image packer redo (#4959)
* Atlas reorg

* Atlas reorg - resulting atlases 1

* Atlas reorg - resulting atlases 2

* Atlas reorg - merge
2021-08-24 07:31:21 +03:00
SomeTroglodyte
a53cb82034
StartingLocation-Improvements-be-gone phase 2 (#4975) 2021-08-23 23:15:04 +03:00