Commit graph

1198 commits

Author SHA1 Message Date
Yair Morgenstern
20450250bd Resolved #778 - AI construction would generate too many workers late-game 2019-05-18 23:30:52 +03:00
Brian Gainor
081ed9dc4a Check terrain requirements for buildings first
If a city isn't next to a mountain, it shouldn't show Observatory with
"Needs a Library".
2019-05-18 23:22:51 +03:00
sulai
73e397c2c2 Improved city button (#771)
* improved CityButton

* keep city button out of the way if a unit on the city tile is selected

* fixed city button to be clickable always. however this hides units behind it

* added click area for city buttons in an own layer, so the units render in front and the city button click area handles the clicks

* city button: simplified code
2019-05-18 23:09:02 +03:00
Yair Morgenstern
054b3b000d Resolved #752 - Added big friendship penalty for betraying declaration of friendship 2019-05-17 15:00:24 +03:00
Yair Morgenstern
0e54a1b91c City button now looks normal when being razed or in resistance - before the health bar positioning ade the entire button totally out of whack 2019-05-17 14:26:07 +03:00
Yair Morgenstern
c98a6fc4d7 Resolved #758 - water melee units can now take cities (apparently this is a Vanilla vs G&K difference, I'll go with the G&K because it causes more interesting gameplay options) 2019-05-17 14:15:52 +03:00
Yair Morgenstern
862c714b47 Added city-state icon to diplomacy screen, so you know who's a city state and who's a major civ at a glance 2019-05-17 13:03:59 +03:00
Yair Morgenstern
2e16a96c4d Can no longer gift city states with gold you don't have 2019-05-16 22:08:45 +03:00
martin
5e97d32898 keep city button out of the way if a unit on the city tile is selected 2019-05-16 19:42:34 +03:00
martin
e8a9157a65 improved CityButton 2019-05-16 19:42:34 +03:00
sulai
9ce7959d32 more ui improvements (#757)
* unit action: when an exclusive decision is made, deselect unit

* clicking on the unit information in the UnitTable will show that unit + minor fixes

* siege units won't show movement hints when set up, while packing up does not cost any movement points

* workers: highlight button when constructing an improvement, won't sleep then

* fixed broken saved game

* show messages if exploring is done or WorkerAutomation is done

* Revert "siege units won't show movement hints when set up, while packing up does not cost any movement points"

This reverts commit b805993a
2019-05-16 17:54:58 +03:00
Yair Morgenstern
59e30529c4 Resolved #753 - can no longer pillage tiles of allied civs (that's an act of war) 2019-05-14 20:47:21 +03:00
martin
157e6e81a8 don't flood the player with similar messages about spotted enemies. instead cycle through units by clicking the message multiple times. 2019-05-14 17:07:01 +03:00
martin
c11915c978 highlight unit action buttons to show their current action (sleep, fortify, set up)
- works especially well for fortification, will not show that state in the unitTable any more where it caused a layout problem
- in case of set up it's now very clear if a unit is set up or not
2019-05-14 17:07:01 +03:00
martin
1c3b44af16 idle unit buttons: set due=false and select the right unit in case of 2 units per tile 2019-05-14 17:07:01 +03:00
martin
462dc26460 made on-map windows touchable, so you can't "touch through" them on the map 2019-05-14 17:07:01 +03:00
Yair Morgenstern
48af218795 Strategic resources cost more in trade from a civ who's at war and can use them for units 2019-05-13 22:23:30 +03:00
martin
12f1b41784 fixed next turn button by updating it on main thread 2019-05-13 17:17:27 +03:00
martin
eaa0a9dbad when a unit is selected, use the ? button to read about it in the Civilopedia 2019-05-13 17:17:27 +03:00
martin
0ce55feb39 added a ? to the unit panel in the lower left and fixed jumping ui elements there 2019-05-13 17:17:27 +03:00
martin
dcb7daaabd minor ui fixes 2019-05-13 17:17:27 +03:00
etourdot
995ebb5cf8 #742: fix options screen bug when language changed 2019-05-13 17:09:11 +03:00
Yair Morgenstern
c9bd56da95 Resolved #732 - don't change peace negotiation deals depending on how much you dislike the enemy 2019-05-12 22:29:22 +03:00
Yair Morgenstern
a9a1962cec Continuation of #738 - readability, and solves case where 2 civs have unique buildings to the same base building (say Royal Library and Paper Maker)
#729 - AddCultureBuilding now adds civ-specific building (e.g. Burial Tomb), not just checks to see if it's built
2019-05-12 22:24:11 +03:00
Yair Morgenstern
42a0e2e771 Continuation of d2541e6, to better fit coding standards (everything worked fine)
I reallly like the way you did this, so I'm making it enabled by default =D
2019-05-12 19:29:02 +03:00
sulai
d2541e6c4a improved "next turn" - button (#741)
* as long as there are units due to be checked by the player, replace "next turn" button by "next unit" button

* fixed the next-turn button to update within WorldScreen.update()

* moved due methods to CivilizationInfo.kt

* "next turn" button will also show "pick a tech" and "pick a policy" when needed

* added "check for idle units" to the game settings

* "check for idle units" - default to false
2019-05-12 19:20:06 +03:00
Yair Morgenstern
cf9194f767 Other civ you're at war with is always at least Enemy, if not Unforgivable 2019-05-11 23:39:00 +03:00
Yair Morgenstern
24a71b16f2 Trade button changed to "Negotiate Peace" when at war, and peace treaties are a must when "trading" in this situation 2019-05-11 23:32:12 +03:00
lishaoxia1985
20d05aa8e0 all chinese font will show well (#739)
* update some diplomacy words in chinese

* all chinese font can be show well

* Update Fonts.kt

* update chinese language
2019-05-11 22:20:41 +03:00
Duan Tao
0e68a23d29 Fix crash. 2019-05-11 22:13:41 +03:00
Duan Tao
4ab118273b Transfer unique bulidings properly. 2019-05-11 22:13:41 +03:00
lishaoxia1985
656246cd10 all chinese font can be show well 2019-05-10 18:20:27 +03:00
Duan Tao
3b30daf852 Code cleanup. 2019-05-10 18:20:07 +03:00
Duan Tao
91baeddde2 Fix crash from diplomacy screen. 2019-05-10 18:20:07 +03:00
lishaoxia1985
c37983667c move some words into other translation files,the city name can be changed with setting
although the city name can be changed with setting,it's only correct when you build a new city or start a new game.if you change the game language in game progress it will miss some font.
2019-05-09 23:16:47 +03:00
Duan Tao
2ac654e26b Fix first contact popup. 2019-05-09 18:54:43 +03:00
Duan Tao
c221d50e01 Add 2 more type of city-states. 2019-05-09 18:54:43 +03:00
Duan Tao
0b6422f9e7 Better check for culture buildings. 2019-05-09 18:04:05 +03:00
Duan Tao
029ab965d1 Legalism checks replaced culture building correctly. 2019-05-09 18:04:05 +03:00
Yair Morgenstern
b3a4ed4c4f Declaration of Friendship is go!
I'm sure there's stuff I've forgotten but there is just so much that happens in diplomacy that is dependant on these declarations
2019-05-08 18:48:36 +03:00
Yair Morgenstern
f8a4f15f33 Separated City-state and Major civ diplomacy tables, because they're more different than similar at this point
Centralized nation leader name
2019-05-08 17:58:49 +03:00
Yair Morgenstern
75bdced3c6 Added Declaration of Friendship logic
@ninjatao - I changed your BorderConflict into a DiplomacyFlag, and so all the logic of "removing every turn and deleting if 0" is built-in =)
2019-05-08 17:24:56 +03:00
Yair Morgenstern
8ce1613559 Resolved #698 - Added Heal Instantly 'promotion' 2019-05-08 16:03:01 +03:00
Duan Tao
ff508f22b0 Add border conflict counter for periodly popup. 2019-05-08 13:32:23 +03:00
Duan Tao
06f25b5b5b Fix peace popup with city-state. 2019-05-08 13:32:23 +03:00
Duan Tao
1434ca3f30 Update city-state related icons and popups. 2019-05-08 13:32:23 +03:00
Yair Morgenstern
9ab02c8d22 Organized json files, split translation file into several smaller files for organizational purposes 2019-05-07 21:59:34 +03:00
Duan Tao
cb867f0066 Code improvement for city state border conflict. 2019-05-07 15:23:08 +03:00
Duan Tao
ad54fb3c56 Invading city-state border will damage relationship. 2019-05-07 13:55:11 +03:00
Duan Tao
30531316d2 Player can enter city-state borders. 2019-05-07 13:55:11 +03:00
Duan Tao
ef7b73ad5f Unlock city states. 2019-05-07 13:55:11 +03:00
lishaoxia1985
79daad778f update some chinese language (#712)
* Update Translations.json

* Update Translations.json

* Update Tutorials_Simplified_Chinese.json

* Update Tutorials_Simplified_Chinese.json

* Update Translations.json

* Update Tutorials_Simplified_Chinese.json

* Update Translations.json

* Update Translations.json

* Update Translations.json

* Update Translations.json

* Update Tutorials_Simplified_Chinese.json

* Update Translations.json

* Update Translations.json

* Update Tutorials_Simplified_Chinese.json

* Update Tutorials_Simplified_Chinese.json

* Update Tutorials_Simplified_Chinese.json

* Add files via upload

* Update Tutorials_Simplified_Chinese.json

* Update Translations.json

* Update Translations.json

* Update Tutorials_Simplified_Chinese.json

* Update Translations.json

* Update Translations.json

* Update BasicHelp_Simplified_Chinese.json

* Update Translations.json

* Update Translations.json

* Update Tutorials_Simplified_Chinese.json

* Chinese traslation, i have test it,but app may get corruption.

* constructing buildings and wonders in the city the language shows normally according to language setting

* Update Translations.json

* Update Translations.json

* Update Translations.json

* Update Translations.json

* change chinese font with WenQuanYiMicroHei

* Update Translations.json

* nation.json in chinese(no completed)

* Update Nations_Simplified_Chinese.json

* Update Nations.json

* Update Translations.json

* Update Translations.json

* Update Nations_Simplified_Chinese.json

* Update WorldScreenTopBar.kt

* update

* Update Translations.json

* update

* Update Nations_Italian.json

* updated(nation.json in Chinese also cannot runs well)

* updated(nation.json in Chinese also cannot runs well)

* Update TileImprovement.kt

* Update TileResource.kt

* Update Terrain.kt

* Update Terrain.kt

* updated(nation.json in Chinese also cannot runs well)

* Update Terrain.kt

* CivilopediaScreen language can be changed with setting

* CivilopediaScreen language can be changed with setting

* CivilopediaScreen language can be changed with setting

* chinese language update

* Update Translations.json

* Update Translations.json

* Update Translations.json

* Update BaseUnit.kt

* delete some word with "Nations.json"
2019-05-07 08:40:36 +03:00
Yair Morgenstern
89902bef95 Added Medic, Medic II promotions - #698 2019-05-06 23:01:28 +03:00
Yair Morgenstern
cf2580b8ed Solved #670 - civ starting locations are given as much space as possible 2019-05-06 20:46:48 +03:00
Yair Morgenstern
9e03893e60 Added Woodsman promotion - #698 2019-05-05 23:22:59 +03:00
lishaoxia1985
3318f26a33 CivilopediaScreen language can be changed with setting (#706)
* Update Translations.json

* Update Translations.json

* Update Tutorials_Simplified_Chinese.json

* Update Tutorials_Simplified_Chinese.json

* Update Translations.json

* Update Tutorials_Simplified_Chinese.json

* Update Translations.json

* Update Translations.json

* Update Translations.json

* Update Translations.json

* Update Tutorials_Simplified_Chinese.json

* Update Translations.json

* Update Translations.json

* Update Tutorials_Simplified_Chinese.json

* Update Tutorials_Simplified_Chinese.json

* Update Tutorials_Simplified_Chinese.json

* Add files via upload

* Update Tutorials_Simplified_Chinese.json

* Update Translations.json

* Update Translations.json

* Update Tutorials_Simplified_Chinese.json

* Update Translations.json

* Update Translations.json

* Update BasicHelp_Simplified_Chinese.json

* Update Translations.json

* Update Translations.json

* Update Tutorials_Simplified_Chinese.json

* Chinese traslation, i have test it,but app may get corruption.

* constructing buildings and wonders in the city the language shows normally according to language setting

* Update Translations.json

* Update Translations.json

* Update Translations.json

* Update Translations.json

* change chinese font with WenQuanYiMicroHei

* Update Translations.json

* nation.json in chinese(no completed)

* Update Nations_Simplified_Chinese.json

* Update Nations.json

* Update Translations.json

* Update Translations.json

* Update Nations_Simplified_Chinese.json

* Update WorldScreenTopBar.kt

* update

* Update Translations.json

* update

* Update Nations_Italian.json

* updated(nation.json in Chinese also cannot runs well)

* updated(nation.json in Chinese also cannot runs well)

* Update TileImprovement.kt

* Update TileResource.kt

* Update Terrain.kt

* Update Terrain.kt

* updated(nation.json in Chinese also cannot runs well)

* Update Terrain.kt

* CivilopediaScreen language can be changed with setting

* CivilopediaScreen language can be changed with setting

* CivilopediaScreen language can be changed with setting
2019-05-05 22:51:26 +03:00
Duan Tao
4d3e04baa0 Special diplomacy window for city states. 2019-05-05 16:20:23 +03:00
Duan Tao
1865f53c42 City states no longer build national wonders. 2019-05-05 16:20:23 +03:00
Duan Tao
fc4f62f555 City state icon. 2019-05-05 16:20:23 +03:00
Duan Tao
3292e41977 Fix city state diplomacy popup title. 2019-05-05 16:20:23 +03:00
Yair Morgenstern
2263f0c098 Map editing tools organized 2019-05-04 23:09:08 +03:00
Yair Morgenstern
5ea62f24d0 Tile icons in the map editor now look like the real tiles would 2019-05-04 22:40:19 +03:00
Yair Morgenstern
32ea37d4ec Added "Clear Map" button to Map Editor 2019-05-04 22:09:07 +03:00
Yair Morgenstern
d8fd48b4ce Workers can now remove Roads and Railroads 2019-05-04 21:55:31 +03:00
lishaoxia1985
fabb4e922a nations in Chinese (#696)
* Update Translations.json

* Update Translations.json

* Update Tutorials_Simplified_Chinese.json

* Update Tutorials_Simplified_Chinese.json

* Update Translations.json

* Update Tutorials_Simplified_Chinese.json

* Update Translations.json

* Update Translations.json

* Update Translations.json

* Update Translations.json

* Update Tutorials_Simplified_Chinese.json

* Update Translations.json

* Update Translations.json

* Update Tutorials_Simplified_Chinese.json

* Update Tutorials_Simplified_Chinese.json

* Update Tutorials_Simplified_Chinese.json

* Add files via upload

* Update Tutorials_Simplified_Chinese.json

* Update Translations.json

* Update Translations.json

* Update Tutorials_Simplified_Chinese.json

* Update Translations.json

* Update Translations.json

* Update BasicHelp_Simplified_Chinese.json

* Update Translations.json

* Update Translations.json

* Update Tutorials_Simplified_Chinese.json

* Chinese traslation, i have test it,but app may get corruption.

* constructing buildings and wonders in the city the language shows normally according to language setting

* Update Translations.json

* Update Translations.json

* Update Translations.json

* Update Translations.json

* change chinese font with WenQuanYiMicroHei

* Update Translations.json

* nation.json in chinese(no completed)

* Update Nations_Simplified_Chinese.json

* Update Nations.json

* Update Translations.json

* Update Translations.json

* Update Nations_Simplified_Chinese.json

* Update WorldScreenTopBar.kt

* update

* Update Translations.json

* update

* Update Nations_Italian.json

* updated(nation.json in Chinese also cannot runs well)

* updated(nation.json in Chinese also cannot runs well)

* Update TileImprovement.kt

* Update TileResource.kt

* Update Terrain.kt

* Update Terrain.kt

* updated(nation.json in Chinese also cannot runs well)

* Update Terrain.kt
2019-05-04 21:17:18 +03:00
Brian Gainor
7ab0267376 Don't show already-built national wonders in build menu
Should check whether wonder is already built *first*, before we check
whether prereqs are satisfied.
2019-05-04 20:46:17 +03:00
Duan Tao
cecce008b1 Lock city states. 2019-05-03 17:04:18 +03:00
Yair Morgenstern
cdfdbb40b8 More massive performance boosts 2019-05-03 16:59:46 +03:00
Yair Morgenstern
7400f6e874 Performance boost - moved TileInfo.isLand and .isWater to transient bools instead of functions, since the base terrain doesn't change
isBarbarianCivilization performance boost - called A LOT!
2019-05-02 23:15:22 +03:00
Yair Morgenstern
827d24c778 Resolved #694, and another crashing bug 2019-05-02 23:06:34 +03:00
Yair Morgenstern
e8f27c4ef4 Diplomacy is ready to be unleashed upon the unsuspecting public! 2019-05-02 00:11:32 +03:00
Yair Morgenstern
b4fc129a9b Added "relationship" dependant on the modifiers - this will be the main way we apply user actions to AI consequences 2019-05-01 00:13:41 +03:00
Yair Morgenstern
5952056518 Resolved #506 - Added real diplomatic relations!
Doesn't affect much now, but the platform is there to add what we want!
2019-04-30 23:56:47 +03:00
Yair Morgenstern
2ab8caeaea City states option locked away, so it doesn't affect users yet 2019-04-30 21:21:45 +03:00
Yair Morgenstern
0eb6b91957 Ibrushed up on the rules and there are ways to have influence decrease in quantities less than 1, so you were right, it is a float 2019-04-30 20:45:09 +03:00
Yair Morgenstern
de9ae3da54 City state type is now an enum
Attitude is now Influence and is an Int, not a float
Can no longer trade with city states
(All as per original Civ)
2019-04-30 19:52:27 +03:00
Duan Tao
f2333b5839 Added City states (#681)
* Add Milan as 1st city state. Choose box for number of city states.

* City states don't get settlers.

* Added diplomancy relationship. Now increase by gift and decreases every turn.

* Friendly culture city states provides culture bonus.

* 0 city states by default.

* Disable many trade items for city states.

* Fix part 1.

* Fix diplomacy screen and pop-ups.

* City state doesn't build world wonders.

* City states destroy city when conquering.

* Fixed : Trying to move into border of uncountered civs caused crash.

* City states don't exchange tech or declare war on others.

* Fix a very strange problem : you could trade introduction of AI to itself.

* City states automatically get all invented techs.

* Pops defeat msg before AI founds any city.

* Fix conquest victory with city states.

* Fixed : AI city under seige change production every turn.
2019-04-30 19:33:32 +03:00
Duan Tao
307aea1cc0 Fixed : AI city under seige change production every turn. 2019-04-29 06:54:08 +03:00
Yair Morgenstern
d5b247e2c1 Human players can no longer see each other's construction info 2019-04-29 00:36:08 +03:00
Yair Morgenstern
2b8946f5e7 DiplomacyManager.flagsCountdown is now a Hashmap<String, Int> because of deserialization bullshit
Solved a silly bug in the Diplomacy overview
2019-04-29 00:25:02 +03:00
lishaoxia1985
c8ea9f1a27 change chinese font to "WenQuanYiMicroHei" (#691)
* Update Translations.json

* Update Translations.json

* Update Tutorials_Simplified_Chinese.json

* Update Tutorials_Simplified_Chinese.json

* Update Translations.json

* Update Tutorials_Simplified_Chinese.json

* Update Translations.json

* Update Translations.json

* Update Translations.json

* Update Translations.json

* Update Tutorials_Simplified_Chinese.json

* Update Translations.json

* Update Translations.json

* Update Tutorials_Simplified_Chinese.json

* Update Tutorials_Simplified_Chinese.json

* Update Tutorials_Simplified_Chinese.json

* Add files via upload

* Update Tutorials_Simplified_Chinese.json

* Update Translations.json

* Update Translations.json

* Update Tutorials_Simplified_Chinese.json

* Update Translations.json

* Update Translations.json

* Update BasicHelp_Simplified_Chinese.json

* Update Translations.json

* Update Translations.json

* Update Tutorials_Simplified_Chinese.json

* Chinese traslation, i have test it,but app may get corruption.

* constructing buildings and wonders in the city the language shows normally according to language setting

* Update Translations.json

* Update Translations.json

* Update Translations.json

* Update Translations.json

* change chinese font with WenQuanYiMicroHei

* Update Translations.json
2019-04-28 08:14:35 +03:00
Duan Tao
28cc905bb5 Pops defeat msg before AI founds any city. 2019-04-28 08:11:14 +03:00
Yair Morgenstern
292297e02d Resolved #685 - loading game would clear resistance counters 2019-04-27 23:36:35 +03:00
lishaoxia1985
7eb8c03d24 Basic Help in Chinese and Some Updates (#683)
* Update Translations.json

* Update Translations.json

* Update Tutorials_Simplified_Chinese.json

* Update Tutorials_Simplified_Chinese.json

* Update Translations.json

* Update Tutorials_Simplified_Chinese.json

* Update Translations.json

* Update Translations.json

* Update Translations.json

* Update Translations.json

* Update Tutorials_Simplified_Chinese.json

* Update Translations.json

* Update Translations.json

* Update Tutorials_Simplified_Chinese.json

* Update Tutorials_Simplified_Chinese.json

* Update Tutorials_Simplified_Chinese.json

* Add files via upload

* Update Tutorials_Simplified_Chinese.json

* Update Translations.json

* Update Translations.json

* Update Tutorials_Simplified_Chinese.json

* Update Translations.json

* Update Translations.json

* Update BasicHelp_Simplified_Chinese.json

* Update Translations.json

* Update Translations.json

* Update Tutorials_Simplified_Chinese.json

* Chinese traslation, i have test it,but app may get corruption.

* constructing buildings and wonders in the city the language shows normally according to language setting

* Update Translations.json

* Update Translations.json

* Update Translations.json
2019-04-27 21:09:53 +03:00
Duan Tao
884c7b7bb8 Fixed : Trying to move into border of uncountered civs caused crash. 2019-04-27 20:54:58 +03:00
Yair Morgenstern
68c2763ea7 Code cleanup 2019-04-25 10:37:46 +03:00
Yair Morgenstern
931f485a8e Kotlin'D Counter class, apparently it's been Java this whole time and I didn't even notice 2019-04-25 10:28:46 +03:00
Yair Morgenstern
aea2e3efcf AIs no longer exchange techs below Prince difficulty 2019-04-24 22:13:37 +03:00
Yair Morgenstern
d8c238bf97 Added a popup for people who try to create a game and fail 2019-04-24 21:14:53 +03:00
Yair Morgenstern
143d4422e8 When purchasing a building, the buildings list (on the left) is immediately updated to reflect that 2019-04-24 21:03:33 +03:00
Yair Morgenstern
c3a00a0f5e All trades are now cancelled when a civ is defeated 2019-04-24 20:48:32 +03:00
Yair Morgenstern
bda375f441 Declaring war now cancels all prior trade agreements 2019-04-24 12:15:30 +03:00
Yair Morgenstern
8a600ea07d Moved hasOpenBorders to a transient bool for "next turn" performance reasons 2019-04-24 11:58:03 +03:00
Yair Morgenstern
07a8b97ed2 Open Borders is now only available with Civil Service, as per Civ V 2019-04-24 11:31:50 +03:00
Yair Morgenstern
c81c81fe8f Resolved #525 - Added Open Borders agreement 2019-04-24 10:19:47 +03:00
Duan Tao
21398c96a1 Building type check normalized. 2019-04-24 07:37:00 +03:00
Am-per-Sand
cb951da53e Fix negative turnsToNewPopulation while razing
missing bracket, sorry I will never compile any programmes in my life, I will never learn Kotlin and will have a happy life. I wrote it by hand in the textarea on github.com 😎
2019-04-23 23:13:48 +03:00
Am-per-Sand
42624f5bac Fix negative turnsToNewPopulation while razing
Now when razing, city's food storage is carried over from the stage when city's population was +1 larger and FoodToNextPopulation was respectively larger. If a player would like to stop razing, such city would spring up immediately growing next turn or further on. Another side effect is negative turnsToNewPopulation in the city screen.

The same surplus cut off could be done to production if a Great Engineer speeds wonder production the same way and if negative turnsToComplete is possible (but have not spotted this line yet).
2019-04-23 23:13:48 +03:00
Yair Morgenstern
0e8decfd07 AI won't propose peace for 10 turns after war has been declared 2019-04-23 18:34:20 +03:00
Yair Morgenstern
11db5524dd AI now waits a certain number of turns between offering the same trade again - 20 turns for luxury exchange, 5 turns for peace 2019-04-23 18:02:07 +03:00