Commit Graph

6760 Commits

Author SHA1 Message Date
Yair Morgenstern
9595247d3b Finished unique typing for CivInfo.hasUnique() and removed string version!
Damn but there are a LOT of uniques that have accumulated over time
2022-02-20 21:17:58 +02:00
Yair Morgenstern
cd92f66c3a Resolved ANR when copying game data to clipboard 2022-02-20 19:53:19 +02:00
Yair Morgenstern
2786e0091c Massive unique deprecation 2022-02-20 18:27:40 +02:00
Yair Morgenstern
64b8d805c3 Resolved #6184 - don't display turns to relationship change for non-decreasing city-state relationships 2022-02-20 12:45:48 +02:00
Yair Morgenstern
5b50f32505 Great Admiral movement removed from NAval Tradition - per #6131 2022-02-19 23:10:15 +02:00
Yair Morgenstern
4f9c17da0b Resolved untranslated string in improvment description - #6131 2022-02-19 23:08:19 +02:00
Yair Morgenstern
0a4df1ca9f Resolved #6188 - don't show 'missing cities that need to build X' for buildings already built in the city
It gives the impression that the buildings stop providing their bonus if the condition is no longer satisfied
2022-02-19 23:05:47 +02:00
Yair Morgenstern
99e913ba24 Bah released without the changelog :/ 2022-02-19 20:34:20 +02:00
Yair Morgenstern
970e535e62 3.19.10 2022-02-19 19:57:23 +02:00
Yair Morgenstern
f7f21d0cbf
Translations update (#6196)
* Update Russian.properties (#6191)

* Update Korean.properties (#6183)

* Update Korean.properties

* Update Korean.properties

* Update French.properties (#6174)

* Update Spanish.properties (#6173)

TRANSLATION

* Update Italian.properties (#6172)

* Update Italian.properties

* Update Italian.properties

* Update Indonesian.properties (#6171)

* Update German translation (#6170)

* Update Japanese translation (#6169)

* Update Japanese.properties

* fix translation

* Translation: Update Spanish 3.19.10 (#6182)

Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>

* Update Brazilian_Portuguese.properties (#6190)

Co-authored-by: deqtodo <94169613+deqtodo@users.noreply.github.com>
Co-authored-by: Samsaek the Calico <saud2410@naver.com>
Co-authored-by: Ouaz <Ouaz@users.noreply.github.com>
Co-authored-by: Hello200000 <98656089+Hello200000@users.noreply.github.com>
Co-authored-by: Giuseppe D'Addio <41149920+Smashfanful@users.noreply.github.com>
Co-authored-by: kensvin <63847755+Kensvin28@users.noreply.github.com>
Co-authored-by: MartinP <77325495+Mape6@users.noreply.github.com>
Co-authored-by: nukurette <76560753+nukurette@users.noreply.github.com>
Co-authored-by: ArchDuque-Pancake <78449553+ArchDuque-Pancake@users.noreply.github.com>
Co-authored-by: Rodolfz147 <100000475+Rodolfz147@users.noreply.github.com>
2022-02-19 19:40:16 +02:00
Yair Morgenstern
6d48f99206
Trigger uniques by sacrificing units with conditional (#6157)
* Triggered uniques currently come from researching techs, adopting policies, and building buildings.
This adds a third way of triggering uniques, by attaching them to units with a "by consuming this unit" conditional, which will be added as a possible unit action.
So for example, "[amount] Free Technologies <by consuming this unit>", "Reveals the entire map <by consuming this unit>" etc.

* Added a new uniquetype for triggerable uniques, to make them separate from regular global uniques, so that triggerable uniques can become unit uniques when necessary

* And added translations so the tests will pass
2022-02-19 19:38:39 +02:00
Xander Lenstra
a8be359ed2
Damage in battle table is now the average damage done (#6176)
* Damage in battle table is now the average damage done

* Trailing comma's

* Fixed typo
2022-02-19 19:34:46 +02:00
itanasi
402a9ba825
Show Improvements that are buildable after Removing TerrainFeature (#6149)
* Initial working version!

* More comments

* Add missing .tr() translation calls

* add brackets

* Fixed

* Optimize checking for removable last feature
More complete tileInfo.clone()

Co-authored-by: itanasi <spellman23@gmail.com>
2022-02-19 19:34:27 +02:00
Xander Lenstra
f9bab01a64
Added conditional checking for tiles (#6187)
* Added conditional checking for tiles

* Fixed compile error

* I actually like this variable more over here
2022-02-19 19:33:44 +02:00
Yair Morgenstern
22466a9d45
Make tileInfo.terrainFeatures immutable (#6180)
* Step 1 of saving terrain features as a transient - move all terrainFeature changes to new 'addTerrainFeature' and 'removeTerrainFeature' functions
This also included slight rewriting of functions for clarity, but NO functional changes.
Even though there's some logic that I would definitely change, this PR isn't the place for that.

* Fixed tests
2022-02-19 19:28:05 +02:00
SomeTroglodyte
6e92ea4d29
Fix for #6178 music resumes after minimizing on android (#6195) 2022-02-19 18:40:52 +02:00
itanasi
2d60fe4565
Prevent Civilians from capturing Civilians (#6185)
* Initial attempt

* Allow Ranged to move into unguarded Civilian Unit

* Comment for clarity

* Fix unit test so that it doesn't segfault and checks you can't move into military units

* Unify that all units can move on to (and through) unguarded civilians that you are at war with
Add TileInfo.getUnguardedCivilian() to quickly respond if there is an unguarded Civilian on the tile
Something is bugged in movement code

* Fix MapUnit.moveThroughTile() so that it doesn't segfault by fixing getUnguardedCivilian()

* captureCivilianUnit() call is now redundant in postBattleMoveToAttackedTile() since canMoveTo() will now return true and capture will happen during the moveToTile() call

* Add check so Civilian Units don't capture other Civilians

* Change logic to isMilitary()

Co-authored-by: temurakami <spellman23@gmail.com>
2022-02-19 18:37:38 +02:00
itanasi
4e338ae4f3
Embarking penalty logic fix (#6181)
* Fox naval unit Landind penalty is for attacking on to land

* Only Land unit should have Boarding penalty

* Unbreak logic

Co-authored-by: itanasi <spellman23@gmail.com>
2022-02-18 13:15:35 +01:00
Yair Morgenstern
82236fe2c8 More uniquetyping 2022-02-18 13:42:23 +02:00
Yair Morgenstern
0171ad168f #6131 fixes
Partially translated Uniques when picking a Pantheon
2022-02-18 00:19:45 +02:00
Yair Morgenstern
b8d8e11a86 #6131 fixes
Fixed icon and text for resource stats improvements in Improvement Civilopedia pages
Fixed 'null' for improvement picker for some resource-only improvements
2022-02-18 00:16:02 +02:00
Yair Morgenstern
1e6b0e248c Fixed icon and text for resource stats improvements in Improvement Civilopedia pages 0- #6131 2022-02-18 00:07:08 +02:00
Yair Morgenstern
4fe8450b69 Show json parsing errors for mods in the options menu 2022-02-17 23:55:03 +02:00
Yair Morgenstern
a38034ed91 AI only builds work boats for water resources whose improvement can actually be constructed 2022-02-17 23:39:49 +02:00
Yair Morgenstern
c41410812a Resolved #6175 - attack randomness is turn and tile based to avoid save-scumming 2022-02-16 12:29:28 +02:00
Yair Morgenstern
9d0db40bbf 3.19.9 2022-02-15 11:52:56 +02:00
Yair Morgenstern
23585832b5
Translations update (#6166)
* Update Spanish.properties (#6163)

* Update Spanish.properties

translation

* Update Spanish.properties

* Update Korean.properties (#6158)

* Update Korean.properties

* Update Korean.properties

* Update Traditional_Chinese.properties (#6156)

* Update French.properties (#6155)

* Update German translation (#6154)

* Update German translation

* Update German translation

* Update German translation

* Update and rename Spanish.properties  (#6153)

* Update and rename Spanish.properties to español.properties

Fixed some bugs in translations

* Rename español.properties to Spanish.properties

* Update Spanish.properties

Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>

Co-authored-by: Hello200000 <98656089+Hello200000@users.noreply.github.com>
Co-authored-by: Samsaek the Calico <saud2410@naver.com>
Co-authored-by: Chia-Hung Ni <jameseses@gmail.com>
Co-authored-by: Ouaz <Ouaz@users.noreply.github.com>
Co-authored-by: MartinP <77325495+Mape6@users.noreply.github.com>
2022-02-15 11:51:00 +02:00
Yair Morgenstern
86cbe895be
In Civ VI there are certain units available only if a specific building is built, and this was raised as a request by modders as well. (#6160)
Instead of expanding the existing 'requires building' unique to units and adding limiters, it's both easier and more generalizable to add conditionals for cities with and without certain buildings to replace the uniques entirely
2022-02-15 11:40:47 +02:00
Yair Morgenstern
97d74a3aef Enabled type check checking for uniques whose deprecation leads to multiple uniques!
This also enables auto-deprecating the Embark+Ocean unique
2022-02-15 11:29:32 +02:00
Yair Morgenstern
48bbed9fad Resolved #6164 - transported units reveal tiles as if they passed through the path of the transporting unit 2022-02-15 10:47:47 +02:00
Yair Morgenstern
1e44b1a235 Fixed misplaced back arrow 2022-02-14 22:00:33 +02:00
itanasi
9d1f463310
Add Amphibious penalty to Land attacking into Water and vice versa (#6127)
* Add Amphibious penalty to Land attacking into Water and vice versa

* Replace Landing with Amphibious in all translation files

* Fix trailing whitespace

* Revert translation files

* Change working of Amphibious
Set penalty to Landing and Boarding

* Type-ify Unique and add Depreciated
Add Promotion to Melee Naval
Add exception that Landing penalty is NOT against cities

* Fix Vanilla

* Rename to Landing Party
Icon doesn't work

* Properly regenerated game.atlas/game.png

Co-authored-by: itanasi <spellman23@gmail.com>
2022-02-14 19:21:53 +01:00
Yair Morgenstern
bce65a96f6 More unique typing 2022-02-14 19:05:54 +02:00
Yair Morgenstern
4d02cdeb3b Captured unit notifications now sent to the correct civ :) 2022-02-14 14:47:58 +02:00
Yair Morgenstern
2b4a9d0766 More uniquetyping 2022-02-13 21:03:35 +02:00
Yair Morgenstern
7887e7a238 Resolved untranslated texts as per #6131
- Don't show hidden uniques in unit short text ('Never appears as Barbarian unit')
2022-02-13 12:25:29 +02:00
Yair Morgenstern
3fbcf64371 Apparently Android Studio was autoremoving the whitespace because it thought it knows better than me. Disabled by Editor > General > On save > disable Remove trailing whitespace 2022-02-13 11:19:45 +02:00
Yair Morgenstern
e6555741be Resolved untranslated texts as per #6131
- "Ampitheatre"
- Fixed tests
2022-02-13 11:04:28 +02:00
Yair Morgenstern
4b2bde0365 Resolved untranslated texts as per #6131
- "Resources" in city-state diplomacy screen
- "When Friends"/"When Allies" in same
- "Enhance religion"
- "Choose a Religion" in religion screen
- Religion name in religion screen
- Translated drilldown items in city screen
- "null for wheat" in improvement Civilopedia entry
- "Type" and others in city-state civilopedia entry
2022-02-13 10:58:47 +02:00
Yair Morgenstern
0d3a0ef7e3 Resolved untranslated texts as per #6131
- Added unique targets as lines to translate so they'll appear in BattleTable
2022-02-13 10:34:50 +02:00
Yair Morgenstern
47dea93775 Resolved untranslated texts as per #6131
- Requires more population
- Religious
- "Requires" in Policy civilopedia text
- "for" in improvement civilopedia text
- Untranslated conditionals in battle table (listed as "when fighting in [tileFilter] tiles")
2022-02-13 10:30:31 +02:00
Yair Morgenstern
ce3b6dfb3a Unit upgrade can accept unit conditionals 2022-02-13 10:09:06 +02:00
Yair Morgenstern
63f927af83 Better fix, will also solve future problems of this sort 2022-02-12 22:04:08 +02:00
Yair Morgenstern
901c8a81a5 Plundering no longer gives huge amounts when attacking far weaker units 2022-02-12 22:01:20 +02:00
Yair Morgenstern
b62617c4d2 Resolved #6147 - can see improvement removal icons in Civilopedia 2022-02-12 20:14:52 +02:00
Yair Morgenstern
3bbfb0100c Finishing off #6133 - autoreplace cycles through deprecation replacements until it reaches a non-deprecated text
This is guaranteed to not cycle endlessly thanks to the added test
Checked by having 2 uniques' deprecation text reference each other and it failed as expected
2022-02-12 20:03:24 +02:00
Yair Morgenstern
c498426715 3.19.8 2022-02-12 19:25:12 +02:00
Xander Lenstra
f5e9952caf
Add uniques and constants for unit supply (#6146)
* Code readability

* Uniques & constants for unit supply

* Fixed tests

* Added a cityFilter to the 'supply per pop' unique
2022-02-12 19:22:17 +02:00
Yair Morgenstern
f03a6bd6b3
Translations update (#6150)
* Translation: Actualizar Español (#6141)

* Update Russian.properties (#6139)

* Update Italian.properties (#6138)

* Update French.properties (#6135)

Co-authored-by: ArchDuque-Pancake <78449553+ArchDuque-Pancake@users.noreply.github.com>
Co-authored-by: deqtodo <94169613+deqtodo@users.noreply.github.com>
Co-authored-by: Giuseppe D'Addio <41149920+Smashfanful@users.noreply.github.com>
Co-authored-by: Ouaz <Ouaz@users.noreply.github.com>
2022-02-12 19:03:43 +02:00
Yair Morgenstern
e72dcc8b0d
Unified "X is only available under Y conditions" into a single unique (#6133)
* Unified "X is only available under Y conditions" into a single unique

There were a few problems with existing uniques - they weren't really composable, the offered things they didn't keep, etc

For example, "Incompatible with [policy/tech/promotion]", UniqueTarget.Policy, UniqueTarget.Tech, UniqueTarget.Promotion. In fact, promotions only checked promotion incompatibility, promotions - promotion incompat, etc

Additionally, with a few more changes, this could cover several other uniques - "Hidden until [amount] social policy branches have been completed", "Requires at least [amount] population", perhaps others

I have to say I think conditionals are the best thing ever and they make amazing composability possible :)

* Autoupdate correctly recognizes parameters
Updated ruleset jsons

* Deprecation texts should be allowed to forward to other deprecated uniques so we only need to change the leaves when introducing new uniques, not go through the whole tree
2022-02-12 19:03:30 +02:00