Commit Graph

63 Commits

Author SHA1 Message Date
Yair Morgenstern
df2cf711ba More deprecation 2021-07-14 23:30:47 +03:00
Yair Morgenstern
0d328ef99a Stuffed some +/- uniques into the square brackets 2021-07-09 11:01:25 +03:00
Xander Lenstra
21eadb39ff
Updated TranslationFileWriter to include the new values that filters can have (#4402)
* Updated TranslationFileWriter to include the new values that filters can have

* Implemented requested changes
2021-07-09 09:14:24 +03:00
Xander Lenstra
fbd64b9520
Refactored the way cities determine what uniques should apply when (#4393)
* I'm so sorry for the size of this PR

* Uniques are better generalized

* Code now compiles

* Missed a line

* Some more cleaning up
2021-07-07 22:01:14 +03:00
Xander Lenstra
7f88844d82
Created Patronage policy branch (#4186)
* Created Patronage policy branch -- draft

* Patronage branch is now functional

* Added images for the policies

* Temporarily bandaged backwards compatability, added incompatabilities

* Implemented recommended changes

* Fixed acquirement of 'patronage complete' not being saved

* Reverted change I was unhappy with

* Implemented requested changes

* Fixed build errors

* Implemented recommended changes

* City States can now give any great person, including unique ones, conform Ravignirs tests
2021-06-22 17:25:29 +03:00
Xander Lenstra
3d1836a081
Created Order branch with G&K policies (#4158)
* Created Order branch with G&K policies

* Implemented requested changes
2021-06-20 21:39:14 +03:00
Yair Morgenstern
655923f4cf Great improvement bonus provided properly 2021-06-18 14:34:15 +03:00
Xander Lenstra
d1c10c6d47
Updated Autocracy branch to G&K (#4149)
* Updated Autocracy branch to G&K

* Fxied a typo

* Implemented potentially requested changes

* Implemented requested changes

Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
2021-06-18 09:46:30 +03:00
Xander Lenstra
1d18c418e7
Updated Freedom branch to G&K (#4142)
* Updated Freedom branch to G&K

* Hotfix for autocracy policy that I accidentally added already

* Implemented recommended changes (mostly)

* Implemented recommended changes

* Implemented recommended changes better
2021-06-18 09:42:48 +03:00
Yair Morgenstern
67820e8870 Unitfilter now accepts multiple filters (see wiki/uniques for details) 2021-06-17 19:49:20 +03:00
Xander Lenstra
434136e6cc
Updated Commerce branch to G&K (#4129)
* Updated Commerce branch to G&K

* Implemented requested changes
2021-06-15 09:52:59 +03:00
Xander Lenstra
fbebcdcd21
Updated Rationalism branch to G&K (#4136) 2021-06-14 15:10:49 +03:00
Yair Morgenstern
60d8adce38 3.15.0 2021-06-13 22:40:12 +03:00
Xander Lenstra
0d79326869
Updated Tradition branch to G&K (#4106)
* Updated Tradition branch to G&K

* Small performance boost for calcualting maintenance; fix crash on next turn

* Fixed a bug where maintenance-free buildings would still cost maintenance

* Simplified some code

* I am unable to read

* Fixed a few broken uniques, including #4109

* Implemented requested changes
2021-06-13 08:14:31 +03:00
Xander Lenstra
da991b5f66
Updated Honor branch to G&K (#4118)
* Updated Honor policies to G&K

* Simplified another unique

* Implemented requested changes
2021-06-13 08:11:14 +03:00
Xander Lenstra
60809db065
Updated Liberty branch to G&K (#4115)
* Updated Liberty branch to G&K, improved modularity of uniques

* Updated meritocracy to only affect non-occupied cities

* Implemented requsted changes
2021-06-13 08:06:35 +03:00
Yair Morgenstern
7e7f72ed2f Tradition works again 2021-05-07 12:03:13 +03:00
Yair Morgenstern
0440a70a9c Resolved #3353 - Changed "Earn [amount]% of [param] opponent's [param2] as [stat] for kills" to "Earn [amount]% of killed [param] unit's [param2] as [stat]" 2021-04-13 22:04:00 +03:00
Yair Morgenstern
881a885c14 Differentiated between 'Land' as in 'Land unit' and 'Territory' for rankings 2021-04-13 00:13:17 +03:00
Yair Morgenstern
87ff4c91f5 3.13.9 2021-03-18 20:59:42 +02:00
Yair Morgenstern
b0bf18afa0 Added custom victory conditions 2021-02-05 16:06:58 +02:00
Yair Morgenstern
84c200bd32 New cityFilter for cities connected to capital 2021-02-05 15:34:20 +02:00
Yair Morgenstern
1e6c8dacff Deprecated old uniques 2021-02-05 12:22:47 +02:00
SpacedOutChicken
55b4298cec
New uniques for border expansion - "-[]% Gold cost of acquiring tiles []" and "-[]% Culture cost of acquiring tiles []" (#3565)
* no message

* Revert "no message"

This reverts commit 9ece60bd58.

* Renamed Haka War Dance effect to Intimidation, to make it more applicable to non-Maori Warrior units.

* no message

* Parameterized civUnique for extra experience from combat

* Update build.gradle.kts

* Update BattleDamage.kt

* Update Policies.json

* Update Battle.kt

* Fully parameterized nationwide XP gain

* New parameterized uniques for border expansion - "-[]% Gold cost of acquiring tiles []" and "-[]% Culture cost of acquiring tiles []"

* Parameterized uniques for acquiring new tiles via either culture or gold

* Parameterizing expansion unique - improved calculation method

* Improved parameterization for border expansion uniques
2021-02-03 13:06:53 +02:00
SpacedOutChicken
457588a2c9
Parameterize Civ Unique for increased XP gain (#3561)
* no message

* Revert "no message"

This reverts commit 9ece60bd58.

* Renamed Haka War Dance effect to Intimidation, to make it more applicable to non-Maori Warrior units.

* no message

* Parameterized civUnique for extra experience from combat

* Update build.gradle.kts

* Update BattleDamage.kt

* Update Policies.json

* Update Battle.kt

* Fully parameterized nationwide XP gain
2021-01-29 12:31:52 +02:00
Yair Morgenstern
1a576539e0 Implemented Cultural Diplomacy policy 2021-01-29 12:06:16 +02:00
Yair Morgenstern
2f121983cf Implemented Scholasticism 2021-01-29 12:01:25 +02:00
Yair Morgenstern
4e2aaa76dc Started implementing Patronage branch. Parametrized some uniques, city-states can handle different resting points for different civs. 2021-01-29 11:54:23 +02:00
Yair Morgenstern
9c725d74ae Parametrized "Maintenance on roads & railroads reduced by []%" 2021-01-29 10:35:01 +02:00
Yair Morgenstern
18f4d4e53e Added city filter, and gerenicised several uniques to work with the city filter.
Deleted some deprecated uniques
2021-01-28 14:26:42 +02:00
Yair Morgenstern
8689fe0ffa Clarified Protectionism effect 2020-12-23 21:28:59 +02:00
Yair Morgenstern
963fee3552 Added much-needed "+[]% Production when constructing [] units" unique 2020-12-13 09:27:31 +02:00
Yair Morgenstern
4c48522de2 Removed unused "effects" from the policy file 2020-12-11 14:26:40 +02:00
ravignir
323c593d6e
Fixed Free Thought trading post bonus. (#3361)
It should provide Science instead of Gold.
2020-11-24 10:52:02 +02: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
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
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
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
HadeanLake
8ac3a88cec
fixed #3066, crash in chooseMilitaryUnit and some great people actions (#3099)
* fixed KotlinNullPointerException crash in chooseMilitaryUnit
random() is not to be used in predicate
* GodmodeCheckbox is not lockable and unchecked by default
* no great people actions if no movement points left
* unique "Can start an []-turn golden age" now has parameter and 8-turn golden ages will last 8 turns instead of 10
golden age can be started if unit is on own territory (even embarked)
* "Golden Age length increased by [50]%" - now has parameter
* tweaked changed fort and terrain defence bonuses
fort can be built on forest and jungle (vegetation will not be removed)
any open flat land gives 10%  penalty
marsh gives 15% penalty
only top terrain counts, improvement bonus will be added to that
flatland + fort = 40%
hill + fort = 75%
hill = 25%
forest/jungle on flatland = 25%
forest/jungle on hill = 25%
forest on flat + fort = 75%
forest on hill + fort = 75%
forest on hill + citadel = 125%
fixed 20% penalty for attacking over river - will be displayed if unit is standing on the other side of river
"Amphibious" unique removes this penalty
2020-09-05 20:32:27 +03:00
HadeanLake
e6e31b4e1a
Aztecs and some other things (#3033)
* Added icons
* [temple](https://thenounproject.com/search/?q=temple&i=28256) By Fabio Meroni for Temple of Artemis
* [Canoe](https://thenounproject.com/term/canoe/402285/) By Viktor Fedyuk (Tim P) for Floating Gardens
* [Garden](https://thenounproject.com/search/?q=garden&i=1478380) By Bharat
Aztecs by Séan https://discord.com/channels/586194543280390151/633733497277775884/727255962754351104
Jaguar by Red11

Reused slinger icon for Slinger Withdraw

* Added buildings and uniques for them
garden - bonus building of the Medieval Era. City "Must border a source of fresh water"
Temple of Artemis - World wonder of the Ancient era
Floating Gardens - Aztec unique building, replaces Water Mill

"[+1 Science] Per [2] Population in this city" - for Library and Public School
"+[]% great person generation in this city" - for garden
"Must border a source of fresh water" - "fresh water" provided by river or tiles with "Fresh water" unique. Added "Fresh water" unique to Lakes and Oasis
"+[10]% growth in all cities" - now has parameter - for Tradition Complete policy and Temple of Artemis
"+[10]% growth in capital" - now has parameter
"+[15]% Production when constructing [ranged units]"   - "ranged units" now valid param
"[stats] once [tech] is discovered" - Petra and Mughal Fort have it
"[+1 Production] from [River] tiles in this city"]  - now can use "River" - for Hydro plant

* Added Jaguar - Aztec unique unit
New unique - "+[]% combat bonus in [param]" unique - Norwegian Ski Infantry, Jaguars and Mohawks have it. param can be terrainFeature or baseTerrain, in case of baseTerrain it implies there are no features like vegetation her
Implemented "Culture for the empire from each enemy unit killed"
tweaked honor policy - it should bring half as much culture, and same as Sacrificial Captives
Fixed penalty for terrain if unit do not have "No defensive terrain bonus" unique

* Added Aztecs

* Update template.properties

* update template.properties

* update template.properties

* update template.properties
2020-08-30 21:02:59 +03:00
Yair Morgenstern
6ff712b625 A mishmash of different fixes: Unit uniques and promotions, happiness calculation, etc. 2020-08-24 10:58:14 +03:00
HadeanLake
a12c1ada26
Fixed AI being stuck doing science or gold per turn (#3006)
* AI will no longer get stuck doing science or gold per turn

* added missing commas in jsons
2020-08-18 20:53:16 +03:00
Yair Morgenstern
9f5b8d157a Converted civ uniques up to India 2020-08-06 19:53:29 +03:00
Yair Morgenstern
1fb566ec30 RIP PolicyManager.PolicyEffects 2020-08-06 18:40:35 +03:00
Yair Morgenstern
a97c9bafcc Civ uniques up to Arabia converted 2020-08-02 22:03:30 +03:00
Yair Morgenstern
5aaab7e137 Civ uniques done up till Egypt 2020-08-02 17:04:11 +03:00
Yair Morgenstern
ebb8432dcb Changed how great unit recognition works 2020-08-02 13:53:27 +03:00
Yair Morgenstern
b4708b05b3 Unified regular unit and great person unit additions
First playaround with nation uniques!
2020-08-01 23:04:33 +03:00
Yair Morgenstern
fbf4312973 All policies converted! 2020-07-31 19:09:56 +03:00
Yair Morgenstern
0f727e1929 Moar policies! Policy stat changes can now happen from wonders as well! 2020-07-31 00:25:48 +03:00