Commit Graph

2974 Commits

Author SHA1 Message Date
9kgsofrice
ea11c3fdf3
getResourceModifier for resources modified by uniques (#3372)
* added function getResourceModifier to civinfo and tied into cityInfo resource checks
pared down getTileResourceAmount function

* simplified function usage
2020-11-30 21:54:54 +02:00
Yair Morgenstern
f59c9a8593 Resolved #3364 - Fixed certain battle modifiers not activating 2020-11-26 14:51:29 +02:00
Yair Morgenstern
c86d6e7b69 Fixed broken tests 2020-11-26 14:27:14 +02:00
Yair Morgenstern
fd646f6b06 Resolved #3347 - units spawned by buildings are spawned in the city the building was built in 2020-11-24 22:12:03 +02:00
Yair Morgenstern
eb0776005f Added mod checks that combat units have strength and ranged units have rangedStrength 2020-11-24 21:43:00 +02:00
Yair Morgenstern
f6f95a7c53 More framerate savers! Now only cityButtonGroups that actually contain a cityButton will be rendered, giving us another massive performance boost!
We're up to 28-29 fps on Android while zoomed!
2020-11-24 21:38:04 +02:00
Yair Morgenstern
01ee6cc768 A large part of the rendering time was dedicated to trying to run actions on TileGroup groups, most of which can never have actions to begin with!
So now their act() does nothing, greatly improving framerate!
2020-11-24 00:08:39 +02:00
Yair Morgenstern
9dd7b2abf3 More texture switch savings in the CityButton 2020-11-23 23:21:51 +02:00
Yair Morgenstern
7b0bb55045 Can now handle units upgrading to units with no required tech 2020-11-23 22:25:17 +02:00
Yair Morgenstern
114effe1ae Resolved #3360 - notify peace treaty to all commmon known civs 2020-11-23 20:01:58 +02:00
Yair Morgenstern
101fa9903e Fixed unit icons not getting deleted when unit exits tile 2020-11-23 19:20:23 +02:00
Yair Morgenstern
eb7a064019 Resolved #3335 - Removed all unecessary spaces and colons 2020-11-22 22:48:38 +02:00
Yair Morgenstern
3d1e1d7936 Removed some confusing and pointless ": " at the end of translations - #3335 2020-11-22 22:41:12 +02:00
Yair Morgenstern
6d7d698dad Prepacked flag, unit and building images in altas files, so they'll be readable from the jar files 2020-11-22 21:47:46 +02:00
9kgsofrice
038ac1e48b
Units/buildings with "Will not be displayed in Civilopedia" now will not show in tech tree (#3359)
* adds unique "Will not be displayed in Tech Tree"

* Changed "Will not be displayed in Tech Tree" to "Will not be displayed in Civilopedia", avoiding bloat
2020-11-22 20:52:50 +02:00
givehub99
072226ff9a
Added "All [] Cities get a free []" unique. (#3352)
* Added "All [] Cities get a free []" unique.

The first parameter is for city type. Currently "new" and "coastal" are supported.
"new" matches every city and "coastal" matches cities on a coastal tile.
"new" and "coastal" were added to template.properties for translation.

Upon city founding, the second parameter building is added to the city.

In civ 5 G&K, Carthage gets a free harbor for every coastal city.

* -Syntax changed to "Get a free [] []"
First paramater is the building and second is the city filter.
Supports "in every city" and "in every coastal city"

-new and coastal was removed from template.properties
-in every coastal city was added to template.properties

* Changed syntax to "Gain a free [] []"
2020-11-22 11:55:34 +02:00
Yair Morgenstern
2d2117936e Whoops wrong field 2020-11-20 13:45:45 +02:00
Yair Morgenstern
f40c0ad8b3 AI settlers can no longer settle after movement with no movement points 2020-11-20 11:52:14 +02:00
Yair Morgenstern
6158802bb3 3.11.4 2020-11-19 23:53:34 +02:00
jnecus
c338afc7f3
Hide hotkeys on devices without keyboard (#3350)
* Hide hotkeys on devices without keyboard

* Test for peripheral keyboard
2020-11-19 23:43:29 +02:00
Yair Morgenstern
378c8ab511 Separated the unit image rendering from the background rendering to avoid texture swapping when rendering unit + background 2020-11-19 23:34:03 +02:00
Yair Morgenstern
223da7f531 More framerate improvement tricks - this was more than enough to offset the harm of the building and unit images, and went the other way!
The framerate started out before the image games as ~17-18 on the tested game, dropped to ~14-15 with the image changes, and is now at ~20-21~
2020-11-19 23:04:09 +02:00
Yair Morgenstern
2e668ddeb5 Made sure that labels are rendered after each other in the city button, so save on texture switches between the font and the image textures 2020-11-19 22:29:50 +02:00
Yair Morgenstern
35554f3ec6 Resolved #3330 - Texture is back to 2048*2048, by taking flags buldings and units out of the main image.
The cost is that there are texture swaps, and so framerate is hurt.
2020-11-19 21:44:09 +02:00
Yair Morgenstern
3176cd147a We now check compatibility of newly selected mods to the existing mod ruleset 2020-11-16 21:18:17 +02:00
Yair Morgenstern
03193e4f61 Resolved #3071 - Disabled annoying camera momentum on Desktop 2020-11-16 20:42:24 +02:00
Yair Morgenstern
952e4cb958 Resolved #3341 - City-state diplomacy screen is shown properly when entering from a city button 2020-11-15 21:58:16 +02:00
Yair Morgenstern
f7a1633c33 Probably solved the Mysterious Disappearing C's this time for realz! #3327 2020-11-15 20:38:52 +02:00
Yair Morgenstern
9b2c1b2ace We now try to load the last tturn-autosave whn loading the regular autosaves failed (e.g. when the save file is corrupt) 2020-11-14 22:58:05 +02:00
Yair Morgenstern
89751ca6ec 3.11.12 2020-11-14 22:55:19 +02:00
Yair Morgenstern
bf4216578a 3.11.12 2020-11-14 22:35:12 +02:00
Yair Morgenstern
fa887cf206 Spectator can handle free-policy-giving techs 2020-11-14 22:14:54 +02:00
Yair Morgenstern
96269c5c29 AI no longer nukes single units
Nuking is considered a declaration of war from the attacker, not the defender
2020-11-13 00:04:23 +02:00
Yair Morgenstern
62c42851ed Can right-click to attack when a unit is selected 2020-11-12 21:13:24 +02:00
Yair Morgenstern
961579fd3d City states can now conquer cities, as per Civ V 2020-11-12 19:41:48 +02:00
Yair Morgenstern
82fb9ee9fc Mods can now remove promotions between versions without breaking existing saves 2020-11-12 19:35:52 +02:00
Yair Morgenstern
d3aabfb669 Fixed archaeological dig being built by workers in Civ V expansion mod 2020-11-11 23:48:07 +02:00
Yair Morgenstern
582cbeb932 Fixed key shortcuts in improvement picker screen 2020-11-11 21:52:48 +02:00
Yair Morgenstern
e8e9c97c92 AI won't declare war if it doesn't know the location of any enemy city 2020-11-11 21:22:15 +02:00
Yair Morgenstern
9693bf0dd6 Resolved #3324 - Great Person units no longer require a military unit to accompany them if they're close enough to the destination 2020-11-09 21:45:58 +02:00
Yair Morgenstern
86c6624f8e Resolved #3326 - Settling a city removes the improvement in progress 2020-11-09 21:26:26 +02:00
Yair Morgenstern
5e116867e6 Resolved #3323 - improvement uniques are no longer added twice 2020-11-08 23:40:10 +02:00
Yair Morgenstern
e3fc967216 3.11.10-patch1 2020-11-08 23:39:05 +02:00
Yair Morgenstern
965b865422 Changed the tileGroup improvement image conparison from strings to lists, to save both time and (more importantly) string concating 2020-11-06 11:45:05 +02:00
Yair Morgenstern
4f344b65f8 We now remove resources and improvements that are not in the ruleset from the map when loading the game 2020-11-06 11:43:49 +02:00
Yair Morgenstern
1f1a2fe7bc Mod repositories where the main branch is not "master" are not shown in the UI, since we can't download them 2020-11-05 21:46:04 +02:00
Yair Morgenstern
4e0c88cc20 AI no longer tries to construct work boats that can't reach their intended destination 2020-11-05 20:02:02 +02:00
GGGuenni
d0dce25590
Fixed SetUserID (#3319)
SetUserID couldn't be used in main menu
2020-11-04 21:59:31 +02:00
Duan Tao
ff8221de2d
Diplomatic penalty of stealing lands decreases by time. (#3318) 2020-11-04 10:25:55 +02:00
Yair Morgenstern
65524cb7dd Removed exitEvent from the UncivGameParameters, since Gdx.app.exit() does the same thing :) 2020-11-04 00:09:11 +02:00
Yair Morgenstern
315a55f972 Resolved #3317 - mod management screen displays properly again
3.11.9-patch2
2020-11-03 23:23:02 +02:00
jnecus
b5c9fb79bf
FIx bug Carrier-based aircraft not healing (#3316)
With reference to issue #3307

I think that aircraft on aircraft carriers were being treated at land units at sea.

I have added the check to test whether they are being transported so that they should now heal whilst on aircraft carriers.
2020-11-03 20:10:54 +02:00
Yair Morgenstern
d240c12292 Merge branch 'master' of https://github.com/yairm210/Unciv 2020-11-03 19:17:34 +02:00
Yair Morgenstern
a92d35eba1 3.11.9-patch1
Fixed silly crash from test code that shouldn't have been there...
2020-11-03 19:16:51 +02:00
givehub99
23cab0d50c
Polynesia's unique "+[10]% Strength if within [2] tiles of a [Moai]" was not working correctly. The matchesUniqueFilter function didn't check for improvement on the tile. This was corrected and now Polynesia's unique works correctly. Any other improvement besides Moai will also work. (#3315) 2020-11-03 19:12:34 +02:00
Yair Morgenstern
f957dee357 Can no longer see other players' IDs in a multiplayer game through the new game screen
Moved the building mod check to all mods, not only ruleset mods
2020-11-02 23:00:45 +02:00
Yair Morgenstern
fb3048442c Added mod check for upgrading to a unit with no required tech 2020-11-02 22:21:54 +02:00
Yair Morgenstern
cea8bdf12c Added mod check for unit promotions 2020-11-02 22:02:22 +02:00
Yair Morgenstern
b495398c0e Tile editor can handle resources that don't naturally appear on any terrain 2020-11-02 21:49:42 +02:00
Yair Morgenstern
1568ce90da Updated to latest LibGDX 2020-11-02 21:48:43 +02:00
Yair Morgenstern
87b0af6c1c AI can no longer raze capital cities 2020-11-02 20:21:44 +02:00
Yair Morgenstern
da5935e5c8 Stats unique can no longer crash badly defined mods 2020-11-01 19:37:29 +02:00
givehub99
88ac6330dc
-"Unable to capture cities" unique prevents the unit from conquering/capturing a city. (#3309)
-Units with "All tiles costs 1" unique now spend all movement points when embarking.

Technically, in CIV 5, helicopters do not embark or spend all movement units when moving to water, if embarkation (Optics) isn't researched.

IMO, though, it is so unlikely that someone will have helicopters researched but not embarkation, that I don't think it is worth editing the code for this fringe case.
2020-10-30 10:01:27 +02:00
Yair Morgenstern
247350d6a1
Revert "-Terracotta Army, Alhambra, Hanse, Leaning Tower of Pisa, Neuschwanstein, and Hubble Space Telescope are no longer buildable or displayed in the pedia since they are not part of vanilla Civ 5. (#3300)" (#3301)
This reverts commit 49cdf09b44.
2020-10-27 00:22:02 +02:00
givehub99
49cdf09b44
-Terracotta Army, Alhambra, Hanse, Leaning Tower of Pisa, Neuschwanstein, and Hubble Space Telescope are no longer buildable or displayed in the pedia since they are not part of vanilla Civ 5. (#3300)
Their entries were kept in the json files so as to not break pre-existing save files.

-Units and buildings that are unbuildable are not shown in the pedia or tech picker as being unlockable by tech
2020-10-27 00:20:48 +02:00
Yair Morgenstern
b2c6cc59b7 All stat-based uniques are parsed EXACTLY once, for performance reasons and to avoid ANRs 2020-10-26 23:38:29 +02:00
Yair Morgenstern
a3bed178d0 Avoided another rare crash 2020-10-26 23:37:44 +02:00
Yair Morgenstern
250d7debb5 Avoided more badly-defined-mod crashes 2020-10-26 23:20:16 +02:00
givehub99
64fc57e6d2
Helicopter Gunship uniques (#3294)
* Preparation for Helicopter unit

-"All tiles costs 1" unique makes every tile cost 1. Used by Helicopter in CIV 5.

-"Can pass through impassable tiles" unique allows unit to pass through any tile. Used by Helicopter in CIV 5. Does not let units cross ocean if they couldn't already, just terrain that is considered "impassable"

-Mountains now do 50 damage to units that end turn on it. In civ 5 and its expansion this is what happens to any unit that is able to pass mountains.
This is "hard coded" for now. Also added the notification text to template.properties

* mountains do not give sight bonus when on them

* Revert "mountains do not give sight bonus when on them"

This reverts commit 83ad3df5d4.
2020-10-26 20:28:44 +02:00
Yair Morgenstern
3713923caf Added mods to crash report, many crashes are caused by incorrectly defined mods 2020-10-24 23:16:16 +03:00
Yair Morgenstern
895ed528af Resolved #3285 - added a notification when cities are no longer in resistance 2020-10-24 22:43:04 +03:00
Yair Morgenstern
93aa06bc99 terrain.occursOn is now an arrayList - helps with definition checking and generally simplifies things 2020-10-24 22:38:44 +03:00
Yair Morgenstern
c85b51474c Can no longer start a new game with an incorrectly defined mod! :) 2020-10-24 22:38:19 +03:00
Yair Morgenstern
2a82482d05 Fixed some more silly bugs caused by badly configured mods 2020-10-24 22:21:09 +03:00
Yair Morgenstern
02d2e29700 More tile configurations are enabled (e.g. "baseTile+resource+improvement") 2020-10-24 22:10:23 +03:00
Yair Morgenstern
a9660bba44 Player is informed if Unstable mods are added to a game - and it no longer crashes 2020-10-24 22:04:06 +03:00
Yair Morgenstern
b867e829a4 ResposePopup -> ToastPopup rename 2020-10-24 22:03:25 +03:00
Yair Morgenstern
8dde23aa38 3.11.6 2020-10-21 19:01:07 +03:00
Yair Morgenstern
c7e0b57a5d Changed all prebuilt font characters to single-char characters - this is in the vague hope that it will solve the Mystery of the Disappearing C's 2020-10-20 19:41:36 +03:00
Yair Morgenstern
940fe07a0a Added culture and science colors to resources 2020-10-20 19:26:37 +03:00
Yair Morgenstern
c7b1121fe4 Resolved another crash caused by incorrect ruleset mod definitions 2020-10-19 23:24:53 +03:00
Yair Morgenstern
bd810d3d0c Split civilopedia "buildings" category into "buildings" and "wonders" 2020-10-19 23:21:35 +03:00
Yair Morgenstern
4d3f16c64e Added "locate mod errors" button in the options menu for discovering broken links in base ruleset mods 2020-10-19 23:07:01 +03:00
Yair Morgenstern
3ada446df4 Resolved #3274 - empty maps start with ocean tiles 2020-10-19 22:37:18 +03:00
givehub99
d75541e5b4
Consolidated unit kill bonus uniques (#3267)
* -Consolidated unit kill bonus uniques.
Syntax is "Earn []% of [] opponent's [] as [] for kills" for both units and nations.

Ex.
"Earn [10]% of [military] opponent's [Cost] as [Gold] for kills"
or
"Earn [100]% of [Barbarians] opponent's [Strength] as [Culture] for kills"

Only Culture and Gold are supported as rewards now, but it can be expanded later. The pictish warrior unit in G&K gets 50% of opponent's strength as faith, so we can have the function edited to allow for faith when we get to that point.
Only Strength or Cost is supported as what the reward amount is based on.

-Policies.json and Nations.json were changed to fit the new syntax. The old syntax still works for mods for now.

-matchesCategory MapUnit function can now check if the unit is a barbarian

* -Compatibility for depecrated unit kill bonus uniques done more efficiently and counted only once (since prior to this PR, it was also counted only once)

* -Changed it to "Barbarian" instead of "Barbarians", added "Barbarian" to template.properties

* space after translation template
2020-10-18 18:10:26 +03:00
Yair Morgenstern
8ad35df0f7 Merge branch 'master' of https://github.com/yairm210/Unciv 2020-10-17 22:16:14 +03:00
Yair Morgenstern
7c8aab1ff0 Mod management screen is not generally available :) 2020-10-17 22:15:49 +03:00
Federico Luongo
a24335abea
Diplomacy Screen right table is scrollable (#3260)
* Diplomacy Screen right table is scrollable

* Scrollable city-state table

* Resized to fit lower resolution

* Fix right table width
2020-10-17 22:07:48 +03:00
Yair Morgenstern
a6642cb536 Resolved #3265 - added keyboard shortcuts to tile improvements 2020-10-17 22:06:50 +03:00
Federico Luongo
8c5e0d1889
Fix for barbarian quest (#3271)
* Coordinates equality is checked between integers, instead of floats
2020-10-17 21:34:01 +03:00
Yair Morgenstern
6d422d6674 City connections work well when road and railroad required techs are changed (in mods) 2020-10-16 14:42:01 +03:00
Yair Morgenstern
7b019f3175 Fixed ANRs caused by upkeep calculation taking too long - @givehub99
Added more popups when moders break things instead of crashing directly
2020-10-16 14:24:52 +03:00
Yair Morgenstern
3bf045d354 One high-stakes, no-holds-barred, to-the-death profiling later, and we're left with a much less laggy main screen and a much more profile-able citybutton/ 2020-10-16 00:39:58 +03:00
Yair Morgenstern
ae9a026201 Should be able to add key shortcuts in any screen now :) 2020-10-15 21:37:09 +03:00
Yair Morgenstern
55d0f7f1dd Can now move around the world screen with the arrow keys as well as WASD 2020-10-15 21:09:05 +03:00
Yair Morgenstern
c75f0162d5 Added city images by The Bucketeer for all eras up to Modern 2020-10-15 20:01:25 +03:00
givehub99
8c51833a5a
New parameterized uniques (#3250)
* -New unit unique "Bonus as Defender []%". "+25% Combat Bonus when defending" now deprecated, but kept for now for mods. Json promotion changed to fit new syntax.
Defender Bonus modifier "Defender Bonus" added to template.properties for translation.

-"All newly-trained [] units in this city receive the [] promotion" now uses unit category checking.

-New building unique "New [] units start with [] Experience in this city"
This can used by Poland's stable unique replacement in BNW, as it gives extra xp for mounted units.
"New [] units start with [] Experience" is the new nation wide version of this.

"New military units start with [] Experience" is now deprecated, but kept for now for mods. Json policy changed to fit new syntax.

-Unit category checking can now check for "non-air", "military", "military units" and uniques.
Added "military" to template.properties for translation.

-New unit unique "No defensive terrain penalty". Admittedly this is for a mod I'm making.

* translations must have spaces after!

* -Attacker Bonus unique changed to "+[]% Strength when attacking"
Changed Units.json and and Wolf Pack from UnitPromotions.json to this syntax

-Defender Bonus unique changed to "+[]% Strength when defending"
Armor Plating promotions were changed to this syntax
2020-10-14 10:22:49 +03:00
Federico Luongo
b5a32e64ae
City-states personalities (#3259)
* City State Personality

* Introduced 4 personalities for city states: Friendly, Neutral, Hostile and Irrational.
* Influence recovery and degrade depends on city state personality.

* Quests assignement dependant on Personality and Trait

* Personality localization strings
2020-10-14 09:51:31 +03:00
Yair Morgenstern
8f535391b3 Influence bar not displayed for city-states that don't know the viewing civ 2020-10-11 22:11:31 +03:00
Yair Morgenstern
9a887e4840 Resolved #3254 - food-to-production not added twice when calculating turns to production 2020-10-11 22:10:32 +03:00
Federico Luongo
80ce4496c9
City states button influence bar (#3248)
* City States influence fix

* Influence when at war = -60f
* Enemies if influence < 0f, neutrality is only from 0f to 30f
* Changed RelationshipLevel accordingly

* City States buttons influence bar

* Influence bar in DiplomacyScreen
2020-10-10 22:59:17 +03:00
Yair Morgenstern
f7ff1bd267 Translation generation can handle multiple parameters of the same type 2020-10-09 14:39:41 +03:00
Yair Morgenstern
be5f42f94b AI does not construct science-related constructions when all techs have been researched 2020-10-09 14:22:57 +03:00
Yair Morgenstern
e292c210c8 Added "Must be next to []" unique for tile improvements 2020-10-08 17:35:25 +03:00
Yair Morgenstern
0543c6473f Welp now it builds fine 2020-10-08 17:34:35 +03:00
Yair Morgenstern
8df9a4fd7e Merge branch 'master' of https://github.com/yairm210/Unciv 2020-10-08 17:12:01 +03:00
Yair Morgenstern
e14db65996 Resolved #3239 - simplified unit actions, which were unnecessarily complicated 2020-10-08 17:11:37 +03:00
Federico Luongo
fea342a31b
Clear Barbarian Camp quest (#3246) 2020-10-08 16:29:56 +03:00
Federico Luongo
eaa89d69f4
Pixel unit colors based on civilization colors (#3231)
* Enabled Pixel Unit colors based on civilization colors

* Strict pattern for image layers

* Updated docstring

* Reworked layers' retrieval
2020-10-08 15:42:16 +03:00
Yair Morgenstern
0b9bcabea4 Added resource-providing building unique 2020-10-08 15:36:00 +03:00
Yair Morgenstern
55d904e1cd Confirmation popup when clearing the map in the map editor 2020-10-08 15:34:31 +03:00
Yair Morgenstern
36ed648621 Files in the mod folder no longer crash the game on startup 2020-10-08 15:33:55 +03:00
givehub99
da328c0408
Unified Unit Category Checking For Uniques (#3238)
* Starting unified unit category checking. This will increase flexibility with uniques as well as cut down on uniques that have only a slightly different way of checking unit categories.

Things currently checked by the category checking method are:
Type of unit
Name of unit
Whether unit is wounded
If the unit is land, water, or air

"Bonus vs City y%" still works currently.

Uniques that have been changed/added to use this category checking method so far are:

"Bonus vs x y%"
"[] units deal +[]% damage" (parameterization of "Wounded military units deal +25% damage")
"[] units gain the [] promotion"

If PR approved, using this method for more uniques would be a good idea.

Commented as depecrated are these uniques
"+[]% Strength vs []" (this has not been used in json files)
"Wounded military units deal +25% damage" (policies json file was updated to use parameterized version)

The following was added to template.properties for translating modifiers:

Air
Wounded

* translation ending with a space

* -Changed matchesCategory method for CityCombatant to what was suggested
-Changed matchesCategory method for MapUnitCombatant to what was suggested
-Use type.name instead of type.toString().toLowerCase()
-Lowercasing is no longer allowed for type names and unit names.

I kept the lower cased versions of wounded, land, water, and air for compatibility as several of the uniques are phrased like "Bonus vs land units 25%" and such and have entries in template.properties (ie. land units = ).

* -Lowercasing is no longer allowed. For wounded, land, water or air, you have to either use the capitalized version (ie. "Wounded") or lower case with units (ie. "wounded units"). This lets preexisting uniques that use "wounded units" etc still work while also letting people use the singular capitalized word (ie. "Wounded") for other uniques.

* fixed missing check for wounded units
2020-10-08 13:09:05 +03:00
Yair Morgenstern
4fa7c8d4c6 3.11.2 2020-10-08 12:47:08 +03:00
Federico Luongo
7aedb6d4df
Find Player quest (#3237)
* Find Player quest

* Sequences
2020-10-08 12:25:58 +03:00
Yair Morgenstern
4e50ea9618 Merge remote-tracking branch 'origin/revert-3240-TechUniques' 2020-10-08 12:23:53 +03:00
Yair Morgenstern
18c837a7ed More informative alert for tech modders 2020-10-08 12:21:43 +03:00
Yair Morgenstern
236c7a1c15 Revert "When checking for nation uniques, it also checks the tech uniques (#3240)"
This reverts commit 31226c97e8.
2020-10-07 23:05:46 +03:00
givehub99
31226c97e8
When checking for nation uniques, it also checks the tech uniques (#3240)
* When checking for nation uniques, it also checks the tech uniques

* asSequence() before map
2020-10-07 23:05:06 +03:00
Yair Morgenstern
223e52fe32 "matches" is a more intuitive name than "fits" for filtering 2020-10-07 14:17:50 +03:00
Yair Morgenstern
a485ad5fa5 Merge branch '3.11.1-patch1' 2020-10-07 14:13:30 +03:00
Yair Morgenstern
8c1913c2c4 Total conversion mods should handle missing specialists (altough they really should deal with it) 2020-10-07 14:03:27 +03:00
Yair Morgenstern
1a4cc125c3 And for units as well of course 2020-10-07 13:44:42 +03:00
Yair Morgenstern
e9835eab12 Resolved #3229 - added "Not displayed as an available construction unless [] is built" unique 2020-10-07 13:41:56 +03:00
Federico Luongo
1dd82f6f58
Find Natural Wonder Quest implemented (#3211)
* Find Natural Wonder Quest implemented

* List to sequence to list
2020-10-06 13:59:54 +03:00
Yair Morgenstern
fa59d4888a Era-specific city tiles for Ancient, Classical and Medieval 2020-10-06 12:22:55 +03:00
Yair Morgenstern
bb5eff5250 Battle damage calculations changed to ints, for simplicity 2020-10-06 11:16:33 +03:00
givehub99
9ffa0bee54
Consolidated Generic Tile Bonus Uniques (including Friendly Land, Foreign Land) (#3232)
* Redid things with help from HadeanLake:

-"+[]% combat bonus in []" Unit Unique
-"+[]% combat bonus for units fighting in []" Nation Unique
-Both of these can check for terrain or Friendly Land or Foreign Land
-Function to add stacking modifiers
-Himeji Castle and Foreign Legion had uniques changed to fit this syntax
-Old way still works for now, but deprecated

* fixed comments about deprecation and the new syntax
2020-10-06 10:52:30 +03:00
Federico Luongo
f9ebc8aa0f
Acquire Great Person Quest implemented (#3210)
* Acquire Great Person Quest implemented

* List to sequence to list
2020-10-06 10:48:59 +03:00
Mojtaba Rahimy
8e53be616d
Ui fixes (#3218)
* moving close button to end of the list and setting color to red

* aligning text/icon in main screen top bar
2020-10-06 10:28:13 +03:00
Yair Morgenstern
93bf69f3d5 Fixes for minor bugs from the previous version 2020-10-05 23:20:49 +03:00
Yair Morgenstern
256eedc7c0 Lines go behind the techs in the tech screen, and are colored so you can trace the path of the current research queue 2020-10-05 12:12:15 +03:00
Yair Morgenstern
5553be0d67 Minimap no longer adds city indicator on every update, leading to lower framerate over time 2020-10-05 11:45:55 +03:00
Yair Morgenstern
523ed10e68 Specialist names are taken from the json files 2020-10-04 16:25:07 +03:00
Yair Morgenstern
58d651bfe2 MODDABLE SPECIALISTS ARE GO! 2020-10-04 16:16:42 +03:00
Yair Morgenstern
a24dc7cc69 Completely removed usages of the old getMaxSpecialists 2020-10-04 15:47:57 +03:00
Yair Morgenstern
fd6956507d Merge tag '3.11.0-patch1' 2020-10-04 15:20:48 +03:00
Yair Morgenstern
be2dd5c068 3.11.0-patch1
Solved some errors that occured as a result of the recent changes assuming the specialists exist, which is not true in revamp mods
2020-10-04 15:18:26 +03:00
Federico Luongo
2d6c322856
Connect Resource Quest implemented (#3209)
* Removed superfluous filters in getResourceForQuest
2020-10-04 15:01:57 +03:00
givehub99
67efd6c957
Problem: Some promotions in CIV 5 have multiple effects, but Unciv promotions only allow for one effect (#3219)
Solution: This PR adds "uniques" field to allow for multiple effects, while keeping "effect" field so that rulesets prior to this PR can still work.
2020-10-04 10:55:42 +03:00
Yair Morgenstern
3e98e0c00f 3.11.0 2020-10-03 20:48:34 +03:00
Jack Rainy
bddded04f5
Patch of the promotion exploit (#3214) 2020-10-03 20:24:19 +03:00
Federico Luongo
300c7179e7
Various Quest relted (#3206)
* Renamed some quests to better ones (Kill Camp -> Clear Barbarian Camp and Kill City State -> Conquer City State)
* Quests names are hardcoded in a enum class
* Quests.json translations automated
2020-10-01 21:08:26 +03:00
Yair Morgenstern
a4d1232403 Final conversion of existing specialists to the new format 2020-10-01 17:06:34 +03:00
givehub99
fab8242c6a
"[] units gain the [] promotion" (#3204) 2020-10-01 09:51:24 +03:00
Yair Morgenstern
bfa9c65700 Modding - Buildings can be rendered obsolete (unbuildable) by techs 2020-09-30 23:17:09 +03:00
Yair Morgenstern
aa2486c896 Great person points come from the json! The only things that still happen directly to the specialists stats is the assign/unassign, this is as close as we'll get without changing the rest of it! 2020-09-30 20:18:52 +03:00
Yair Morgenstern
e39d3e89da All specialist colors come from the json now :) 2020-09-30 19:42:47 +03:00
Yair Morgenstern
5677fb494a Added helper function colorFromRGB(List<Int>) 2020-09-30 19:26:20 +03:00
Yair Morgenstern
43f5799578 Specialist information is now hybrid 2020-09-30 18:03:26 +03:00
Federico Luongo
9f9d89af9d
resourceIsVisible to be checked before getting tile resource (#3201) 2020-09-30 17:28:05 +03:00
Yair Morgenstern
e983be0325 Started converting specialists to by-json and by-name 2020-09-30 13:10:02 +03:00
Yair Morgenstern
f411089b8d Better improvement on tile checks 2020-09-30 11:06:51 +03:00
Yair Morgenstern
f50a757069 Unified "improvement on tile" checks 2020-09-30 10:51:22 +03:00
Federico Luongo
adaee7e7ab
City State quests (#3183)
* City State quests

* Flag to log two civ ever been friends
* Utility functions in GameInfo
* Created Diplomacy Action for notifications
* Utility functions for map
* Can be specified a custom color for surroundWithCircle
* Translation placeholder utility
* Added Quest model
* Utility function: number of researched technologies

* Image atlas rebuilt

* Localization

* Updated DiplomaticFlags and added EverBeenFriends

Slightly reworked nextTurnFlags() for code clarity and introduced the new flag EverBeenFriends that is set as soon as two civilizations are at least friends. It never expires.

* Removed quests not implemented yet from json
2020-09-29 23:26:50 +03:00
Yair Morgenstern
9b3dd5058f Better checking for unloadable scenarios 2020-09-29 14:15:00 +03:00
Yair Morgenstern
6662944f32 Resolved #3085 - reconquering our cities while they were still in resistance leads to them not having resistance against us 2020-09-29 11:48:21 +03:00
givehub99
56dbd5459e
"No Maintenance costs for improvements in []" generic unique. Compatibility for Incan unique without having to edit the nations.json file. (#3194) 2020-09-28 23:34:36 +03:00
Yair Morgenstern
30396239c1 Cannot open multiple gold selection popups in trade table 2020-09-28 23:06:46 +03:00
Yair Morgenstern
e1819eb748 Scenarios that can't be loaded not displayed to users 2020-09-26 21:24:54 +03:00
HadeanLake
0f97c5eb59
parameterized few uniques, fixed "Mass Media" tech in mods (#3184)
* parameterized "Culture cost of adopting new Policies reduced by [10]%" and "Each city founded increases culture cost of policies [33]% less than normal"

* removed old fix for abcense of "Mass Media" tech so mods can have this tech
2020-09-26 20:59:22 +03:00
Yair Morgenstern
33270baea2 Resolved #3186 - Diplomacy overview displays war/peace status and not relationship level. 2020-09-26 20:40:51 +03:00
Yair Morgenstern
43bef4d88d Better trade cancellation when all cities are offered (also includes player-to-player cases, not only AI) 2020-09-25 15:33:12 +03:00
Yair Morgenstern
009c59b77c Fixed modded images not loading properly 2020-09-25 13:50:02 +03:00
Yair Morgenstern
98a79f8fb4 Removed edge case option where the AI can trade you all of their cities 2020-09-25 13:42:13 +03:00
givehub99
1f52a8ad88
Hide Unit or Building as Unique (#3181)
* This allows for unique unit or building not to be displayed as a unique on the nation select screen and nation civilopedia entry.

The primary usage of this to allow modders to avoid having their dummy unit/building that is used to disallow a nation from making the unit/building it replaces, from
appearing as a unique to the player. In other words, it won't show the comparison stats/etc.

In conjunction with this PR https://github.com/yairm210/Unciv/pull/3180 it allows modders to cleanly disallow nations from making certain units/buildings.

This would also be useful for Venice from the Brave New World expansion as it cannot build Settlers. https://civilization.fandom.com/wiki/Venetian_(Civ5)

Here is a mod to test this PR:
https://cdn.discordapp.com/attachments/670547794951405584/758550228126793759/Test_Hide_As_Unique.zip

This mod disallows Babylon from making Scout and Horseman and also doesn't show the dummy replacement unit/building on Babylon's nation info.
It also makes Babylon have a unique Monument replacement that it can build, but is still not shown as a unique on Babylon's nation info.
It also adds an example Venice nation that can't build Settlers.

* "Will not be displayed in Civilopedia" unique prevents a unit or building from being shown in Civilopedia or shown as a unique
2020-09-25 12:37:23 +03:00
HadeanLake
4ee3dae134
* tweaked some buildings (#3172)
Windmill provides "+[10]% Production when constructing [Buildings]" (only regular buildings) instead of 10% to everything
Oxford University does not provide 50% science boost - it was a copying error from National College
* tweaked techs
Implemented "Reveals the entire map" unique ("Satellites" tech)
discovering a tech can trigger unique
"Remove Marsh" unlocked with "Masonry"
2020-09-22 15:17:04 +03:00
givehub99
53a836201d
This allows mods to override unique text for nations. This is useful for using uniques but phrasing them differently when shown to the player. (#3166)
The attribute in the nation json to change this is "uniqueText"

A mod to test this is here, it changes Babylon's unique text to "Test Babylon Unique Text"
https://cdn.discordapp.com/attachments/670547794951405584/757393404924526672/Test_Custom_Nation_Unique_Text.zip
2020-09-21 21:45:49 +03:00
HadeanLake
f721f59734
Added national wonders, fixed some minor issues (#3163)
* fixed translation of "Owned: [amountOwned] = " line

* Tweaked culture from killing
Aztecs get melee strength of the unit killed in culture and honor opener does the same thing.
They stack. So you get culture equal to 200% of the dead unit's strength (not ranged strength).

* removed hurryCostModifier from units that should not have it

Default value of HurryCostModifier is 0
List of units with non-default HurryCostModifier:

Settler (20)
SS parts (-1) (cannot be hurried)

Frigate (20)
Ship of the Line (20)
Caravel (30)
Turtle Ship (30)

Catapult (20)
Ballista (20)

Horseman (20)
Companion Cavalry (20)

Swordsman (20)
Mohawk Warrior (20)
Legion (20)
Berserker (20)

* added missing definitions from vanilla (commented out)
added missing obsolete tech tags, etc

* tweaked hurryCostModifier, added missing vanilla buildings (commented out)

* added promotions and parametrized uniques
Morale (+[15]% Combat Strength)
Great Generals I ([Great General] is earned [50]% faster)
Great Generals II ([Great General] is earned [100]% faster)
Quick Study ([50]% Bonus XP gain)
Unretired Mass Media icon

Added Heroic Epic, National Epic and National Treasury national wonders
Heroic Epic has unique "All newly-trained [non-air] units in this city receive the [Morale] promotion" - "non-air" is valid param now

[Raising The Flag on Iwo Jima silhouette, Marine Corps War Memorial Raising the Flag on Iwo Jima Battle of Iwo Jima Washington, D.C., memorial free png](https://www.pngfuel.com/free-png/opgid) for Heroic Epic and Morale promotion
[Arc de Triomphe](https://thenounproject.com/search/?q=Arc%20de%20Triomphe&i=2936011) by iconfield for National Epic
[Bank](https://thenounproject.com/term/bank/213472/) by By P Thanga Vignesh for National Treasury
reused general icon for Great Generals and Quick Study promotions

* implemented "Cost increases by [30] per owned city of cities" unique
All vanilla national wonders that require something in all cities have it

* added uniques
"Nuclear weapon" - Game option "nuclearWeaponsEnabled" enables units with this unique
"Requires [building]" - Apollo Program, Manhattan Project etc
"Requires adopted [policy]" - in expansions Statue of Zeus will require "Honor", Prora - "Autocracy", Landsknecht - "Mercenary Army".

* merged "Requires adopted [policy]" with "Requires [Wonder]"

* Separated unique.params[0] to val filter

* Changed National Epic image
2020-09-21 21:44:52 +03:00
Billy Brawner
205b5ccfea
Implement custom save locations for Android and Desktop (#3160)
* Implement custom save locations for Android and Desktop

* Request write permission to save to external storage

* Fix race condition for custom saves/loads caused by autosaves

* Remove unnecessary WRITE_EXTERNAL_STORAGE permission for saving files

* Fix padding for custom save/load location buttons

* Use nullability checks as defined in coding style guide

* Use nullability checks as defined in coding style guide

* Use early return for readability

* Rename save/load completion callbacks for custom locations and implement error handling
2020-09-20 23:22:07 +03:00
Yair Morgenstern
fded66b523 Trade table options are now mousewheel-scrollable - the problem was there was a scrollpane within a scrollpane - #2824 2020-09-20 22:20:33 +03:00
givehub99
ef181a4f4c
Adds "Start with [] technology" unique (#3150)
* Adds "Start with [] technology" unique, useful for mods and Hunnic civilization from official CIV 5 DLC Gods and Kings. This unique can be tested with this mod https://cdn.discordapp.com/attachments/670547794951405584/756223352930304140/Test_Start_Technology_Nation_Unique.zip which lets Babylon start with Pottery.

* assigning the start technology unique parameter value to variable, changing the unique syntax to 'Starts with []'
2020-09-20 20:29:04 +03:00
Yair Morgenstern
eb7aac0959 Added 'back button' functionality to victory screen (#2824) 2020-09-18 13:58:17 +03:00
Yair Morgenstern
8db955b851 3.10.10 2020-09-18 11:27:11 +03:00
lishaoxia1985
9f4607635b
UI Upgrade (#3149)
* UI Update

* Replace ScrollPane with Table in Minimap
2020-09-18 10:59:18 +03:00
Yair Morgenstern
a0d18889e0 Generified "[X] free [] units"
Barbarians don't try to attack with civilian units (classic Mod)
2020-09-16 20:46:34 +03:00
Yair Morgenstern
1ceb3548dd Resolved #3130 - "All policies adopted" shown in policy picker screen when relevant 2020-09-16 19:17:25 +03:00
Yair Morgenstern
1f4d5f5573 Multiselect applies to civilian units and from city overlays 2020-09-14 21:48:46 +03:00
HadeanLake
044d04ab28
implement fun isHill() = baseTerrain == Constants.hill (#3128)
fixed isAdjacentToFreshwater - should also check for river on tile
use fitsUniqueFilter instead of checking baseTerrain, terrainFeature and some other filters separately
changes nothing but makes hill PR a lot more readable
2020-09-12 21:34:23 +03:00
Yair Morgenstern
7a7028e3a5 Can now move multiple units to nearby tiles at the same turn 2020-09-11 17:56:23 +03:00
Yair Morgenstern
5a44d7e098 Multiple selected units are more obvious on-map 2020-09-11 17:09:50 +03:00
Yair Morgenstern
f63005ad3c Multiselect & move works! Currently very restricted and not all selected units are visible to user 2020-09-11 16:55:35 +03:00
Yair Morgenstern
c659af8762 Movement popup can handle multiple selected units, but only considers one of them 'moveable' - so far no functional change, only bricklaying 2020-09-11 16:16:25 +03:00
Yair Morgenstern
b9938eb116 Unreachable tiles for air units merged with the rest of the 'can move tile to' logic 2020-09-11 15:57:23 +03:00
Yair Morgenstern
7e36b51db5 Changes to MoveButtonDto in preparation for multiple unit movement 2020-09-11 15:40:43 +03:00
Yair Morgenstern
395292e2f3 Added backing field selectedUnits:ArrayList<MapUnit> for selectedUnit in UnitTable - will allow multi-select in the future, no functional change for now 2020-09-11 12:04:43 +03:00
Yair Morgenstern
4844a0e005 Fixed fresh water adjacency - @HadeanLake 2020-09-11 11:02:05 +03:00
Yair Morgenstern
265e6416f9 Ottoman unique is back to how it should be in Vanilla - @lishaoxia1985 don't slip gameplay changes into a UI commit please. 2020-09-11 09:29:56 +03:00
Yair Morgenstern
cb0599b9f5 Simplified "on [seacost]" and "on [tile next to fresh water]" to "next to [Coast]" and "next to [Fresh water]" 2020-09-11 09:24:08 +03:00
Yair Morgenstern
9e7b28a6e4 Background tiles are no longer "fuzzy" 2020-09-11 09:09:29 +03:00
HadeanLake
9f48f43ad0
parameterized some uniques, fixes some minor bugs (#3122)
Fixed Moai
Wonder overlay will remove terrain overlay in default tileset
Oasis, Marsh and Atoll now have "Rare feature" unique, rare features can be added by mods
implemented TileInfo.fitsUniqueFilter(filterText:String): Boolean
parameterized uniques:
* "Must have an owned [Mountain] within [2] tiles"
* "Must be on [River]" - not to be confused with "Must be next to [River]" - the tile city on must have river at its border, not the adjacent tile
* "Must not be on [Hill]"
* "Must not be next to []"
* "Must be on [seacoast]" - next to "Coast" tile
* "Must be on [tile adjacent to source of fresh water]"
* "Must be next to [Water]" - next to any water tile, including "Lakes"
* "Must be next to [terrainFeature]"
* "Must be next to [unique]" - e.g "Must be next to [Rare feature]" - next to terrain or terrain feature having this unique
2020-09-11 07:56:56 +03:00
Yair Morgenstern
3eee2bff78 Resolved #3115 - AI no longer congregates great people in cities where it can't improve tiles 2020-09-10 21:00:53 +03:00
Yair Morgenstern
9ba9dd6fcf Fixed AI unit upgrading - can now 'skip' over intermediate units, the way the "promote unit" action works. #3115 2020-09-10 19:51:14 +03:00
Yair Morgenstern
10b0d498c6 Merge branch 'master' of https://github.com/yairm210/Unciv 2020-09-10 19:50:05 +03:00
Yair Morgenstern
5e8f1176f3 3.10.8-patch1 2020-09-10 19:32:45 +03:00
lishaoxia1985
9d951835d1
UI Update (#3102)
* Add "Load game" in WorldscreenMenuPopup

* UI Update

* Fix the Ottomans uniques, edit Tech description
2020-09-10 19:25:56 +03:00
Yair Morgenstern
baa7044fd1 Resolved #3048 - Fixed ANRs on 'Resume' on huge save files 2020-09-08 19:30:56 +03:00
Yair Morgenstern
3719b5c4f6 Added mod screen translation terms 2020-09-07 23:03:12 +03:00
Yair Morgenstern
4fa77ac20b Mod management screen scrolls lists separately 2020-09-07 22:38:05 +03:00
Yair Morgenstern
6d4c1cb347 Resolved #3059 - better city expansion rules 2020-09-06 23:18:15 +03:00