Commit Graph

84 Commits

Author SHA1 Message Date
Xander Lenstra
160b51d578
Added more unit tests (#7448) 2022-07-14 10:27:06 +03:00
OptimizedForDensity
cdecb3f52d
Fix monastery purchase cost (#7417) 2022-07-10 19:15:43 +03:00
OptimizedForDensity
9477b319bc
Generalize production-to-stat conversion uniques (#7342)
* Generalize production to stat conversion enabling uniques

* Remove unnecessary code

* Rename class

* Update sound
2022-07-04 16:38:24 +03:00
OptimizedForDensity
98af4207ec
Make mounted vs city penalties only for attacking (#7296)
* Make horse vs city penalties only for attacking

* Reorder conditions

Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
2022-06-25 22:30:04 +03:00
OptimizedForDensity
efc095eaa1
Logistics allows move after attack (#7291) 2022-06-25 22:19:41 +03:00
OptimizedForDensity
03ee03d99b
Fix cataphract not requiring horses (#7292)
* Fix cataphract not requiring horses

* Spacing
2022-06-25 22:12:09 +03:00
alexban011
8f53262fc4
CityScreen plays a sound when opened (#7163)
* added sounds to cityScreen

* changes? ..don't know how to name this commit

* removed try block

* improved era1 sound and added slider for city enter sounds

* added Information Era sound

* added Future Era sound

* better option name + translation

* added Atomic Era sound

* normalized sounds

* prevent spam + better era 0 and 1 sounds

* cleanup

* sound improvements to medieval and atomic

* volume now tied to sound effects

* improved information sound

* improved future sound

* sounds now stop if you exit the city screen

* improved Renaissance sound

* now in separate function

* now using the music controller

* better file names

* WLTK day sound + sounds are now configurable in Eras.json

* removed redundant setting and fixed comment

* added PlaySingle

* musicController no longer used

* Gdx.audio.newMusic is now used

* function name

* function are now in their own class

* CitySoundPlayer now has 1 instance in UncivGame and is hooked

* credits

* sounds loop

* loopable sounds

* updated credits

* fixed sound not stopping when changing city without leaving cityScreen

* changed WLTKNew sound

* added toggle for the sounds

* changed WLTK sound, removed music and made all tracks have the same volume

* addressed some of the issues

* addressed more issues

* increased sounds volume + volume slider

* made WLTK sound slightly quieter

* removed entry from Vanilla eras

* revert back to CitySoundPlayer.kt

* no more hooks

* removed unused stuff

* changees

* completly reverted MusicController

* and the MusicTrackChooserFlags

* fixed ESC not stopping sounds

* updated credits to mention the sounds are modified

* dispose()

* removed try block
2022-06-22 09:11:03 +03:00
SomeTroglodyte
9683e27526
Civilopedia tweaks (#7051)
* Civilopedia Files Split

* Central showReligionInCivilopedia function

* ConstructImprovementConsumingUnit with Conditional for Prophet

* Show Units capable of building an Improvement

* "Needs removal of terrain features to be built"
2022-06-19 02:29:07 +02:00
OptimizedForDensity
c922f134e6
Moddable game speeds (#6856)
* Move GameSpeed definition to JSON files

* Add game speeds civilopedia page
2022-06-18 23:27:46 +02:00
OptimizedForDensity
b79246ee02
Certain projects cannot be hurried by great engineer (#7076) 2022-06-08 10:20:45 +03:00
OptimizedForDensity
afce951724
Pillaging certain improvements may loot gold or other stat resources (#6993)
* Pillaging loots gold on certain improvements

* Add warning if improvement pillageGold > 0 and has UniqueType.Unpillagable

* Pillage yields as a UniqueType

* Forgot to undo demonstration

* Remove unused line

* Eliminate some redundancy

* Reword unique text

* Slight cleanup and add notification for pillage victim

* Reviews

* Made pillaging notifications more consistent with other hostile action notifications

* Missed a line
2022-06-01 19:13:04 +02:00
OptimizedForDensity
09195d6b62
More UniqueType unit tests and correct some broken uniques in JSON files (#6965)
* Add ruin reward unique check plus fix broken unique
2022-05-29 16:08:15 +02:00
OptimizedForDensity
c48c6df22a
Fix piety complete faith discount (#6961) 2022-05-27 00:44:16 +03:00
Jack Rainy
4986505363
Great General typed uniques and improved moddability (#6818)
* Great General UniqueTyped and improved moddability - draft

* Great General UniqueTyped and improved moddability - reviews

* Great General UniqueTyped and improved moddability - no reason not to cache another

* Integration with JackRainy's solution

* Integration with JackRainy's solution - part 2

* Revert of maxGreatGeneralBonusRadius logic

* Minor refactoring

* Code review: minor refactoring

* Keep the warning for the modders about the obsolete unique

* Code review: Better wording for the unique

Co-authored-by: SomeTroglodyte <63000004+SomeTroglodyte@users.noreply.github.com>
2022-05-18 00:02:53 +03:00
Xander Lenstra
7079619fe2
Great improvements can again be constructed on forest (#6823)
* Great improvements can again be constructed on forest
This PR fixes a bug where great improvements couldn't be build on 
forests/marshes/jungles/etc. It does so by creating a unique which 
specifically allows for removing features, and checking for that.
Additionally, we only remove these features when we have the tech to 
remove them. For example, you can no longer plonk an Academy down over a 
forest without having researched mining.

* Missed the file for vanilla

* Reviews

* Fixed logic
2022-05-17 20:04:49 +03:00
Xander Lenstra
8fcfbf752b
Improved clarity and moddability of building improvements (#6712)
* Renamed tile.hasUnique, deprecated `Indestructable`, unique for citadels
Also refactored the consumption of (great) people out of UnitActions.

* Reworked when improvements can be build somewhere for more clarity

* Made resources improvable by multiple improvements; Offshore Platform

* Fix compatability

* WIP

* Fixed the tests, but better

* I suppose I might as well update this now that we're a version later
2022-05-11 00:35:21 +02:00
SomeTroglodyte
4b7edca7a8
Rework of the "Creates improvement on a specific tile" Unique (#6687)
* Make Citadel tile takeover a unique

* CreatesOneImprovement unique overhaul step 1

* CreatesOneImprovement unique overhaul - increase highlights alpha

* Fix missing translatables, again

* CreatesOneImprovement unique overhaul - review suggestions

Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
2022-05-08 21:22:01 +03:00
Xander Lenstra
c55b14eaa7
Implemented most easy things from comments on moddable victory PR (#6600)
* Implemented most easy things from comments on moddable victory PR
Also added religious victory condition

* Fixed tests

* Fixed compile problems & missing string

* Fixed typo
2022-05-03 07:56:24 +03:00
Xander Lenstra
933e769d8e
Changed milestone build globally text to make it more understandable (#6613)
* Changed milestone build globally text to make it more understandable

* Actually this is probably just as clear, gramatically more correct and
more imperative like the other milestones

* Fixed tests

* Reworded again
2022-04-27 09:15:33 +03:00
Xander Lenstra
34105efdda
Moddable victories (#6161)
* Added a moddable (but not yet functional) file for victories

* Spaceship parts are units now

* Fixed tests

* Added milestone objects

* Made 'our status' table in VictoryScreen dependend on file

* Updated VictoryManager to use the new Milestone system

* Fixed bug where in vanilla too many spaceship parts could beb uild

* Whoops

* Updated global victory table to use the jsons

* Updated the new game screen to show the new victory types
Also started with the deprecation of VictorType

* Did some translation stuff, also finally fixed the tests

* Removed VictoryType and reworked AI to use Milestones instead

* Add some checks for the victory file; tested that custom victories work
Also moves some code to a better spot and fixes compilation errors

* Fixed some things I thought about while falling asleep
Most notably: built -> build; fixed spaceship part construction 
priority; removed more code for the old system

* Fixed translation issues on the victory screen
2022-04-24 22:45:38 +03:00
Yair Morgenstern
1069b0933e
Added "Vegetation" unique so that vegetation spawn is not limited to just jungle and forest (#6569) 2022-04-19 15:25:33 +03:00
SomeTroglodyte
83327dabe8
Fix Goddess of Protection - maybe (#6493)
* Fix Goddess of Protection - maybe

* Improve TextSimilarity for case-only differences
2022-04-06 20:24:35 +03:00
SomeTroglodyte
357800a80e
Missing translations cleanup (#6452) 2022-03-31 23:14:35 +03:00
Xander Lenstra
72b4d2069e
Typed denmarks unique and generalized it (#6463)
* Typed denmarks unique and generalized it

* Added support for deprecated unique
2022-03-31 23:05:37 +03:00
Xander Lenstra
8820ae6dad
Generalized a few nation uniques (#6443)
* Generalized a few nation uniques

* Fixed a bug and made random less random

* Implemented requested changes
2022-03-28 17:33:31 +03:00
SomeTroglodyte
870659d142
Translation writer conditionals (#6433)
* TranslationFileWriter processes Conditionals

* TranslationFileWriter processes Conditionals - wiki and reprocessed language files
2022-03-28 17:30:16 +03:00
청하늘
84561e7ad4
Add Moddable Policy Priorities (#6390)
* Fixed G&K policy eras

Patronage should be Medieval and Freedom should be Industrial in G&K

* Added 'priorities' object to policy branch entries

* Fixed Vanilla policy eras

Also set testing priorities in advance

* Partial code formatting

* Reworked how the AI chooses a policy to newly adopt

* Removed debugging codes

* Update Civilization-related-JSON-files.md

Added Branch priorities

* Assigned actual priorities to each branch

Also fixed a debugging value in Ruleset.kt (-1 -> 0)
2022-03-25 17:33:42 +03:00
SomeTroglodyte
cf21ade76e
Moddable Ice generation (any impassable feature on Water possible) (#6329)
Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
2022-03-21 21:08:25 +02:00
Xander Lenstra
367a427436
Unified two uniques into one more descriptive unique (#6380)
* Unified two uniques into one more descriptive unique

* Fixed fallout generation & typo
2022-03-21 21:05:54 +02:00
Xander Lenstra
984c4d9b2d
Unified & generalized a few uniques (#6379)
* Generalized trade route percent bonuses

* Unified two uniques using populationFilter; deprecated a deprecated uniq

* Made some renamings to improve clarity & fixed tests

* Fixed tests again

* Fixed typo
2022-03-21 21:05:20 +02:00
Xander Lenstra
1df49749f2
Split 6 tiles visible unique into its parts, making it more moddable (#6389)
* Split sight unique into its parts, making it more moddable

* Standardized unique ordering
2022-03-21 21:03:33 +02:00
SomeTroglodyte
e5b36f5b9f
Unique units abilities that should be inherited by upgrades (#6304)
* Unique units abilities that should be inherited by upgrades

* Unique units abilities that should be inherited by upgrades - xlt

* Unique units abilities that should be inherited by upgrades - wiki
2022-03-10 19:45:32 +02:00
SpacedOutChicken
44b4cb7e9b
Add Amphibious promotion to Songhai units (#6306)
* Destroy Arsenal when city is captured

* Update vanilla Songhai

* Add Amphibious promotion to all Songhai units

In Gods and Kings, all Songhai Land units have the Amphibious promotion. This brings our Gods and Kings up to speed with the original.
2022-03-10 19:43:34 +02:00
SpacedOutChicken
43ebab9050
Petra fix (#6305)
* Destroy Arsenal when city is captured

* Fix Petra culture wiht city filter

Change Petra's culture bonus to city-specific bonus instead of empire-wide bonus
2022-03-08 20:21:41 +02:00
SomeTroglodyte
28ab45ae40
Fix Mughal Fort using UniqueType Stats instead of StatsPerCity (#6289) 2022-03-07 10:22:01 +02:00
SomeTroglodyte
bca3d5645a
Fix Spaceship production boni (and key binding) (#6247)
* Fix spaceship part boni

* Key binding for 'Add part to spaceship'
2022-02-28 19:42:02 +02:00
SomeTroglodyte
651dcff581
Fix Polynesia's Wayfinding (#6238)
* Fix Polynesia's Wayfinding

* Fix mod option to use other unit filters with UnitsMayEnterOcean
2022-02-28 19:41:22 +02:00
itanasi
f360eda047
Align (reduce) Embarked Defense Strength per Era (#6231)
* Change Embarked Defending Strength per era. Update Tutorial a little

* Use JSON implementation of EmbarkDefense

Co-authored-by: itanasi <spellman23@gmail.com>
2022-02-28 19:41:13 +02:00
Yair Morgenstern
09089cb60d Added uniques and deprecations for "Requires" and "Unlocked by" uniques - #6165 2022-02-22 16:55:37 +02:00
Xander Lenstra
90386bd4e7
Made spaceship parts units instead of buildings (#6203)
* Spaceship parts are units now

* Fixed tests

* Removed commented out lines

* `Spaceship Part` unique can also go on buildings in ods
2022-02-22 11:30:20 +02:00
Yair Morgenstern
5b50f32505 Great Admiral movement removed from NAval Tradition - per #6131 2022-02-19 23:10:15 +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
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
e6555741be Resolved untranslated texts as per #6131
- "Ampitheatre"
- Fixed tests
2022-02-13 11:04:28 +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
Yair Morgenstern
4fb4722e3a
Arbitrary conditionals can become timed conditionals! (#6134)
* Arbitrary conditionals can become timed conditionals!
triggerCivwideUniques is activated in 3 situations:
- Tech complete
- Policy adopted
- Building complete

So for each of the unique containers for these I added a catch saying 'if this unique is a temporary unique then don't save it yourself

This has been lying around in todos for a while and generalizes one of the nasty hardcoded messes that I hate about Civ V. Why would you introduce ONE timed effect in the whole game?! You can use them all the time like Humankind or never use them like Civ IV, but why have just one whyyy

One more thing in this PR, that needed to be solved by the by, is allowing parameters to have a '2' on the end so we can autoreplace multiple parameters of the same type.
Using a regex is slightly more inefficient, but since this is A. only used once per UniqueType.kt, and B. allows us to have as many 'amount's as we want which is important if we have a lot of conditionals, I feel this is justified.

* Fixed comments from PR
2022-02-12 19:03:11 +02:00
Yair Morgenstern
9696fa59f5
Added unique to convert terrain to other terrain if adjacent to something (#6094)
* Added unique to convert terrain to other terrain if adjacent to something

Terrain converting to other terrain when adjacent to rivers was using hardcoded stuff, so I un-hardcoded it
I thought I could use this to replace the 'coast' hardcoding, and if it wasn't for the maxCoastExtension then I could.
Modders CAN therefore add their own coast (Lava tiles and Ash tiles I dunno) but it will only be for directly close terrains.
This enables Deciv Redux to spawn huge maps.

* Also for Vanilla, which apparently had a different number of tabs than G&K for no apparent reason.

* Apparently terrain name wasn't a uniquetype yet

(cherry picked from commit 593fc257b5)
2022-02-02 00:59:37 -08:00
Xander Lenstra
6bc41a627c
Typed all healing uniques (#6087)
* Typed all healing uniques

* Fixed tests by replacing placeholder texts by types in BeliefAutomation
2022-02-01 09:43:37 +02:00
Xander Lenstra
a237e7bf82
Typed all remaining uniques using CityInfo.GetMatchingUniques and removed that function (#6071)
* Typed all remaining uniques using CityInfo.GetMatchingUniques and removed that function

* Fixed two NullPtrExceptions

* Fixed syntax
2022-01-29 23:27:48 +02:00