-
Notifications
You must be signed in to change notification settings - Fork 0
/
HBAssignStartingPlots3.6.lua
14299 lines (13412 loc) · 639 KB
/
HBAssignStartingPlots3.6.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
------------------------------------------------------------------------------
-- FILE: AssignStartingPlots.lua
-- AUTHOR: Bob Thomas
-- PURPOSE: Civ5's new and improved start plot assignment method.
------------------------------------------------------------------------------
-- REGIONAL DIVISION CONCEPT: Bob Thomas
-- DIVISION ALGORITHM CONCEPT: Ed Beach
-- CENTER BIAS CONCEPT: Bob Thomas
-- RESOURCE BALANCING: Bob Thomas
-- LUA IMPLEMENTATION: Bob Thomas
------------------------------------------------------------------------------
-- Copyright (c) 2010 Firaxis Games, Inc. All rights reserved.
------------------------------------------------------------------------------
include("HBMapmakerUtilities3.6");
include("NaturalWondersCustomMethods");
------------------------------------------------------------------------------
-- NOTE FOR MODDERS: There is a detailed Reference at the end of the file.
------------------------------------------------------------------------------
-- FOREWORD
-- Jon wanted a lot of changes to terrain composition for Civ5. These have
-- had the effect of making different parts of each randomly generated maps
-- more distinct, more unique, but it has also necessitated a complete
-- overhaul of where civs are placed on the map and how resources are
-- distributed. The new placements are much more precise, both for civs
-- and resources. As such, any modifications to terrain or resource types
-- will no longer be "plug and play" in the XML. Terrain modders will have
-- to work with this file as well as the XML, to integrate their mods in to
-- the new system.
-- Some civs will be purposely placed in difficult terrain, depending on what
-- a given map instance has to offer. Civs placed in tough environments will
-- receive specific amounts of assistance, primarily in the form of Bonus food
-- from Wheat, Cows, Deer, Bananas, or Fish. This part of the new system is
-- very precisely calibrated and balanced, so be aware that any changes or
-- additions to how resources are placed near start points will have a
-- dramatic effect on the game, and could pose challenges of a sort that were
-- not present in the sphere of Civ4 modding.
-- The Luxury resources are also carefully calibrated. In a given game, some
-- will be clustered near a small number of civs (perhaps even a monopoly
-- given to one). Some will be placed only near City States, requiring civs
-- to go through a City State, one way or another, to obtain any instances of
-- that luxury type. Some will be left up to fate, appearing randomly in
-- whatever is their normal habitat. Yet others may be oversupplied or perhaps
-- even absent from a given game. Which luxuries fall in to which category
-- will be scrambled, to keep players guessing, and to help further the sense
-- of curiosity when exploring a new map in a new game.
-- Bob Thomas - April 16, 2010
-- There is a Reference section at the end of the file.
------------------------------------------------------------------------------
------------------------------------------------------------------------------
AssignStartingPlots = {};
------------------------------------------------------------------------------
-- WARNING: There must not be any recalculation of AreaIDs at any time during
-- the execution of any operations in or attached to this table. Recalculating
-- will invalidate all data based on AreaID relationships with plots, which
-- will destroy Regional definitions for all but the Rectangular method. A fix
-- for scrambled AreaID data is theoretically possible, but I have not spent
-- development resources and time on this, directing attention to other tasks.
------------------------------------------------------------------------------
function AssignStartingPlots.Create()
-- There are three methods of dividing the map in to regions.
-- OneLandmass, Continents, Oceanic. Default method is Continents.
--
-- Standard start plot finding uses a regional division method, then
-- assigns one civ per region. Regions with lowest average fertility
-- get their assignment first, to avoid the poor getting poorer.
--
-- Default methods for civ and city state placement both rely on having
-- regional division data. If the desired process for a given map script
-- would not define regions of this type, replace the start finder
-- with your custom method.
--
-- Note that this operation relies on inclusion of the Mapmaker Utilities.
local iW, iH = Map.GetGridSize();
local feature_atoll;
for thisFeature in GameInfo.Features() do
if thisFeature.Type == "FEATURE_ATOLL" then
feature_atoll = thisFeature.ID;
end
end
-- Main data table ("self dot" table).
--
-- Scripters have the opportunity to replace member methods without
-- having to replace the entire process.
local findStarts = {
-- Core Process member methods
__Init = AssignStartingPlots.__Init,
__InitLuxuryWeights = AssignStartingPlots.__InitLuxuryWeights,
__CustomInit = AssignStartingPlots.__CustomInit,
ApplyHexAdjustment = AssignStartingPlots.ApplyHexAdjustment,
GenerateRegions = AssignStartingPlots.GenerateRegions,
ChooseLocations = AssignStartingPlots.ChooseLocations,
BalanceAndAssign = AssignStartingPlots.BalanceAndAssign,
PlaceNaturalWonders = AssignStartingPlots.PlaceNaturalWonders,
PlaceResourcesAndCityStates = AssignStartingPlots.PlaceResourcesAndCityStates,
-- Generate Regions member methods
MeasureStartPlacementFertilityOfPlot = AssignStartingPlots.MeasureStartPlacementFertilityOfPlot,
MeasureStartPlacementFertilityInRectangle = AssignStartingPlots.MeasureStartPlacementFertilityInRectangle,
MeasureStartPlacementFertilityOfLandmass = AssignStartingPlots.MeasureStartPlacementFertilityOfLandmass,
RemoveDeadRows = AssignStartingPlots.RemoveDeadRows,
DivideIntoRegions = AssignStartingPlots.DivideIntoRegions,
ChopIntoThreeRegions = AssignStartingPlots.ChopIntoThreeRegions,
ChopIntoTwoRegions = AssignStartingPlots.ChopIntoTwoRegions,
CustomOverride = AssignStartingPlots.CustomOverride,
-- Choose Locations member methods
MeasureTerrainInRegions = AssignStartingPlots.MeasureTerrainInRegions,
DetermineRegionTypes = AssignStartingPlots.DetermineRegionTypes,
PlaceImpactAndRipples = AssignStartingPlots.PlaceImpactAndRipples,
MeasureSinglePlot = AssignStartingPlots.MeasureSinglePlot,
EvaluateCandidatePlot = AssignStartingPlots.EvaluateCandidatePlot,
IterateThroughCandidatePlotList = AssignStartingPlots.IterateThroughCandidatePlotList,
FindStart = AssignStartingPlots.FindStart,
FindCoastalStart = AssignStartingPlots.FindCoastalStart,
FindStartWithoutRegardToAreaID = AssignStartingPlots.FindStartWithoutRegardToAreaID,
-- Balance and Assign member methods
AttemptToPlaceBonusResourceAtPlot = AssignStartingPlots.AttemptToPlaceBonusResourceAtPlot,
AttemptToPlaceHillsAtPlot = AssignStartingPlots.AttemptToPlaceHillsAtPlot,
AttemptToPlaceSmallStrategicAtPlot = AssignStartingPlots.AttemptToPlaceSmallStrategicAtPlot,
FindFallbackForUnmatchedRegionPriority = AssignStartingPlots.FindFallbackForUnmatchedRegionPriority,
AddStrategicBalanceResources = AssignStartingPlots.AddStrategicBalanceResources,
AttemptToPlaceStoneAtGrassPlot = AssignStartingPlots.AttemptToPlaceStoneAtGrassPlot,
NormalizeStartLocation = AssignStartingPlots.NormalizeStartLocation,
NormalizeTeamLocations = AssignStartingPlots.NormalizeTeamLocations,
-- Natural Wonders member methods
ExaminePlotForNaturalWondersEligibility = AssignStartingPlots.ExaminePlotForNaturalWondersEligibility,
ExamineCandidatePlotForNaturalWondersEligibility = AssignStartingPlots.ExamineCandidatePlotForNaturalWondersEligibility,
CanBeThisNaturalWonderType = AssignStartingPlots.CanBeThisNaturalWonderType,
GenerateLocalVersionsOfDataFromXML = AssignStartingPlots.GenerateLocalVersionsOfDataFromXML,
GenerateNaturalWondersCandidatePlotLists = AssignStartingPlots.GenerateNaturalWondersCandidatePlotLists,
AttemptToPlaceNaturalWonder = AssignStartingPlots.AttemptToPlaceNaturalWonder,
-- City States member methods
AssignCityStatesToRegionsOrToUninhabited = AssignStartingPlots.AssignCityStatesToRegionsOrToUninhabited,
CanPlaceCityStateAt = AssignStartingPlots.CanPlaceCityStateAt,
ObtainNextSectionInRegion = AssignStartingPlots.ObtainNextSectionInRegion,
PlaceCityState = AssignStartingPlots.PlaceCityState,
PlaceCityStateInRegion = AssignStartingPlots.PlaceCityStateInRegion,
PlaceCityStates = AssignStartingPlots.PlaceCityStates, -- Dependent on AssignLuxuryRoles being executed first, so beware.
NormalizeCityState = AssignStartingPlots.NormalizeCityState,
NormalizeCityStateLocations = AssignStartingPlots.NormalizeCityStateLocations, -- Dependent on PlaceLuxuries being executed first.
-- Resources member methods
GenerateGlobalResourcePlotLists = AssignStartingPlots.GenerateGlobalResourcePlotLists,
PlaceResourceImpact = AssignStartingPlots.PlaceResourceImpact, -- Note: called from PlaceImpactAndRipples
ProcessResourceList = AssignStartingPlots.ProcessResourceList,
PlaceSpecificNumberOfResources = AssignStartingPlots.PlaceSpecificNumberOfResources,
IdentifyRegionsOfThisType = AssignStartingPlots.IdentifyRegionsOfThisType,
SortRegionsByType = AssignStartingPlots.SortRegionsByType,
AssignLuxuryToRegion = AssignStartingPlots.AssignLuxuryToRegion,
GetLuxuriesSplitCap = AssignStartingPlots.GetLuxuriesSplitCap, -- New for Expansion, because we have more luxuries now.
GetCityStateLuxuriesTargetNumber = AssignStartingPlots.GetCityStateLuxuriesTargetNumber, -- New for Expansion
GetDisabledLuxuriesTargetNumber = AssignStartingPlots.GetDisabledLuxuriesTargetNumber,
AssignLuxuryRoles = AssignStartingPlots.AssignLuxuryRoles,
GetListOfAllowableLuxuriesAtCitySite = AssignStartingPlots.GetListOfAllowableLuxuriesAtCitySite,
GetRandomLuxuriesTargetNumber = AssignStartingPlots.GetRandomLuxuriesTargetNumber, -- MOD.Barathor: New
GetListOfAllowableLuxuriesNearCitySite = AssignStartingPlots.GetListOfAllowableLuxuriesNearCitySite,
GenerateLuxuryPlotListsAtCitySite = AssignStartingPlots.GenerateLuxuryPlotListsAtCitySite, -- Also doubles as Ice Removal.
GenerateLuxuryPlotListsNearCitySite = AssignStartingPlots.GenerateLuxuryPlotListsNearCitySite,
GenerateLuxuryPlotListsInRegion = AssignStartingPlots.GenerateLuxuryPlotListsInRegion,
GetIndicesForLuxuryType = AssignStartingPlots.GetIndicesForLuxuryType,
GetRegionLuxuryTargetNumbers = AssignStartingPlots.GetRegionLuxuryTargetNumbers,
GetWorldLuxuryTargetNumbers = AssignStartingPlots.GetWorldLuxuryTargetNumbers,
PlaceMarble = AssignStartingPlots.PlaceMarble,
PlaceLuxuries = AssignStartingPlots.PlaceLuxuries,
PlaceSmallQuantitiesOfStrategics = AssignStartingPlots.PlaceSmallQuantitiesOfStrategics,
PlaceFish = AssignStartingPlots.PlaceFish,
PlaceFishMainland = AssignStartingPlots.PlaceFishMainland,
PlaceSexyBonusAtCivStarts = AssignStartingPlots.PlaceSexyBonusAtCivStarts,
AddExtraBonusesToHillsRegions = AssignStartingPlots.AddExtraBonusesToHillsRegions,
AddModernMinorStrategicsToCityStates = AssignStartingPlots.AddModernMinorStrategicsToCityStates,
PlaceOilInTheSea = AssignStartingPlots.PlaceOilInTheSea,
FixResourceGraphics = AssignStartingPlots.FixResourceGraphics, -- Sugar could not be made visible enough in jungle, so turn any sugar jungle to marsh.
PrintFinalResourceTotalsToLog = AssignStartingPlots.PrintFinalResourceTotalsToLog,
GetMajorStrategicResourceQuantityValues = AssignStartingPlots.GetMajorStrategicResourceQuantityValues,
GetSmallStrategicResourceQuantityValues = AssignStartingPlots.GetSmallStrategicResourceQuantityValues,
PlaceStrategicAndBonusResources = AssignStartingPlots.PlaceStrategicAndBonusResources,
-- Civ start position variables
startingPlots = {}, -- Stores x and y coordinates (and "score") of starting plots for civs, indexed by region number
method = 2, -- Method of regional division, default is 2
NoCoastInland = true, -- Decides if inland civs can spawn on the coast
iNumCivs = 0, -- Number of civs at game start
player_ID_list = {}, -- Correct list of player IDs (includes handling of any 'gaps' that occur in MP games)
plotDataIsCoastal = {}, -- Stores table of NextToSaltWater plots to reduce redundant calculations
plotDataIsNextToCoast = {}, -- Stores table of TwoAwayFromSaltWater plots to reduce redundant calculations
plotDataIsThreeFromCoast = {}, -- Stores table of ThreeAwayFromSaltWater plots to reduce redundant calculations
plotDataIsFourFromCoast = {}, -- Stores table of FourAwayFromSaltWater plots to reduce redundant calculations
regionData = {}, -- Stores data returned from regional division algorithm
regionTerrainCounts = {}, -- Stores counts of terrain elements for all regions
regionTypes = {}, -- Stores region types
distanceData = table.fill(0, iW * iH), -- Stores "impact and ripple" data of start points as each is placed
playerCollisionData = table.fill(false, iW * iH), -- Stores "impact" data only, of start points, to avoid player collisions
startLocationConditions = {}, -- Stores info regarding conditions at each start location
bModLuxes = false, -- Set to true if extra luxes exsist in database
-- Team info variables (not used in the core process, but necessary to many Multiplayer map scripts)
bTeamGame,
iNumTeamsOfCivs,
teams_with_major_civs,
number_civs_per_team,
-- Rectangular Division, dimensions within which all regions reside. (Unused by the other methods)
inhabited_WestX,
inhabited_SouthY,
inhabited_Width,
inhabited_Height,
-- Natural Wonders variables
naturalWondersData = table.fill(0, iW * iH), -- Stores "impact and ripple" data in the natural wonders layer
bWorldHasOceans,
iBiggestLandmassID,
iNumNW = 0,
wonder_list = {},
eligibility_lists = {},
xml_row_numbers = {},
placed_natural_wonder = {},
feature_atoll,
-- City States variables
cityStatePlots = {}, -- Stores x and y coordinates, and region number, of city state sites
iNumCityStates = 0, -- Number of city states at game start
iNumCityStatesUnassigned = 0, -- Number of City States still in need of placement method assignment
iNumCityStatesPerRegion = 0, -- Number of City States to be placed in each civ's region
iNumCityStatesUninhabited = 0, -- Number of City States to be placed on landmasses uninhabited by civs
iNumCityStatesSharedLux = 0, -- Number of City States to be placed in regions whose luxury type is shared with other regions
iNumCityStatesLowFertility = 0, -- Number of extra City States to be placed in regions with low fertility per land plot
cityStateData = table.fill(0, iW * iH), -- Stores "impact and ripple" data in the city state layer
city_state_region_assignments = table.fill(-1, 41), -- Stores region number of each city state (-1 if not in a region)
uninhabited_areas_coastal_plots = {}, -- For use in placing city states outside of Regions
uninhabited_areas_inland_plots = {},
iNumCityStatesDiscarded = 0, -- If a city state cannot be placed without being too close to another start, it will be discarded
city_state_validity_table = table.fill(false, 41), -- Value set to true when a given city state is successfully assigned a start plot
-- Resources variables
resources = {}, -- Stores all resource data, pulled from the XML
resource_setting, -- User selection for Resource Setting, chosen on game launch (when applicable)
amounts_of_resources_placed = table.fill(0, 99), -- Stores amounts of each resource ID placed. WARNING: This table uses adjusted resource ID (+1) to account for Lua indexing. Add 1 to all IDs to index this table.
luxury_assignment_count = table.fill(0, 99), -- Stores amount of each luxury type assigned to regions. WARNING: current implementation will crash if a Luxury is attached to resource ID 0 (default = iron), because this table uses unadjusted resource ID as table index.
luxury_low_fert_compensation = table.fill(0, 99), -- Stores number of times each resource ID had extras handed out at civ starts. WARNING: Indexed by resource ID.
region_low_fert_compensation = table.fill(0, 22); -- Stores number of luxury compensation each region received
luxury_region_weights = {}, -- Stores weighted assignments for the types of regions
luxury_fallback_weights = {}, -- In case all options for a given region type got assigned or disabled, also used for Undefined regions
luxury_city_state_weights = {}, -- Stores weighted assignments for city state exclusive luxuries
strategicData = table.fill(0, iW * iH), -- Stores "impact and ripple" data in the strategic resources layer
luxuryData = table.fill(0, iW * iH), -- Stores "impact and ripple" data in the luxury resources layer
bonusData = table.fill(0, iW * iH), -- Stores "impact and ripple" data in the bonus resources layer
fishData = table.fill(0, iW * iH), -- Stores "impact and ripple" data in the fish layer
seaOilData = table.fill(0, iW * iH), -- Stores "impact and ripple" data in the sea oil layer
marbleData = table.fill(0, iW * iH), -- Stores "impact and ripple" data in the marble layer
sheepData = table.fill(0, iW * iH), -- Stores "impact and ripple" data in the sheep layer -- Sheep use regular bonus layer PLUS this one
regions_sorted_by_type = {}, -- Stores table that includes region number and Luxury ID (this is where the two are first matched)
region_luxury_assignment = {}, -- Stores luxury assignments, keyed by region number.
iNumTypesUnassigned = 30, -- Total number of luxuries. Adjust if modifying number of luxury resources.
iNumMaxAllowedForRegions = 16, -- Maximum luxury types allowed to be assigned to regional distribution. CANNOT be reduced below 8!
iNumTypesAssignedToRegions = 0,
resourceIDs_assigned_to_regions = {},
iNumTypesAssignedToCS = 3, -- Luxury types that will be placed only near city states
resourceIDs_assigned_to_cs = {},
iNumTypesSpecialCase = 1, -- Marble affects Wonder construction, so requires special-case handling
resourceIDs_assigned_to_special_case = {},
iNumTypesRandom = 0,
resourceIDs_assigned_to_random = {},
iNumTypesDisabled = 0,
resourceIDs_not_being_used = {},
totalLuxPlacedSoFar = 0,
realtotalLuxPlacedSoFar = 0,
-- Plot lists for use with global distribution of Luxuries.
--
-- NOTE: These lists are best synchronized with the equivalent plot list generations
-- for regions and individual city sites, to keep Luxury behavior globally consistent.
-- All three list sets are acted upon by a single set of indices, which apply only to
-- Luxury resources. These are controlled in the function GetIndicesForLuxuryType.
--
global_luxury_plot_lists = {},
coast_next_to_land_list = {},
marsh_list = {},
flood_plains_list = {},
hills_open_list = {},
hills_covered_list = {},
hills_jungle_list = {},
hills_forest_list = {},
jungle_flat_list = {},
forest_flat_list = {},
desert_flat_no_feature = {},
plains_flat_no_feature = {},
dry_grass_flat_no_feature = {},
fresh_water_grass_flat_no_feature = {},
tundra_flat_including_forests = {},
forest_flat_that_are_not_tundra = {},
feature_atoll = feature_atoll,
-- MOD.Barathor: New Plot lists
-- MOD.Barathor: Start
dry_plains_flat_no_feature = {},
fresh_water_plains_flat_no_feature = {},
tundra_flat_forest = {},
desert_or_tundra_flat_no_feature = {},
hills_open_no_tundra = {},
hills_open_no_desert = {},
hills_open_no_tundra_no_desert = {},
hills_open_no_grass = {},
hills_open_no_grass_no_tundra = {},
hills_open_no_grass_no_plains = {},
hills_covered_no_tundra = {},
hills_covered_no_grass = {},
hills_covered_no_grass_no_tundra = {},
flat_covered = {},
flat_covered_no_grass = {},
flat_covered_no_tundra = {},
flat_covered_no_grass_no_tundra = {},
flat_open = {},
flat_open_no_grass_no_plains = {},
flat_open_no_tundra_no_desert = {},
flat_open_no_desert = {},
flat_desert_including_flood = {},
-- MOD.Barathor: End
-- Additional Plot lists for use with global distribution of Strategics and Bonus.
--
-- Unlike Luxuries, which have sophisticated handling to foster supply and demand
-- in support of Trade and Diplomacy, the Strategic and Bonus resources are
-- allowed to conform to the terrain of a given map, with their quantities
-- available in any given game only loosely controlled. Thanks to the new method
-- of quantifying strategic resources, the controls on their distribution no
-- longer need to be as strenuous. Likewise with Bonus no longer affecting trade.
grass_flat_no_feature = {},
tundra_flat_no_feature = {},
snow_flat_list = {},
hills_list = {},
land_list = {},
coast_list = {},
mainland_coast_list = {},
coast_list_panagaea = {},
marble_list = {},
extra_deer_list = {},
desert_wheat_list = {},
banana_list = {},
barren_plots = 0,
-- Positioner defaults. These are the controls for the "Center Bias" placement method for civ starts in regions.
centerBias = 40, -- % of radius from region center to examine first
middleBias = 70, -- % of radius from region center to check second
minFoodInner = 2, --2
minProdInner = 1, --1
minGoodInner = 3, --3
minFoodMiddle = 4, --4
minProdMiddle = 2, --0
minGoodMiddle = 6, --6
minFoodOuter = 4, --4
minProdOuter = 4, --2
minGoodOuter = 8, --8
maxJunk = 5, --5
-- Hex Adjustment tables. These tables direct plot by plot scans in a radius
-- around a center hex, starting to Northeast, moving clockwise.
firstRingYIsEven = {{0, 1}, {1, 0}, {0, -1}, {-1, -1}, {-1, 0}, {-1, 1}},
secondRingYIsEven = {
{1, 2}, {1, 1}, {2, 0}, {1, -1}, {1, -2}, {0, -2},
{-1, -2}, {-2, -1}, {-2, 0}, {-2, 1}, {-1, 2}, {0, 2}
},
thirdRingYIsEven = {
{1, 3}, {2, 2}, {2, 1}, {3, 0}, {2, -1}, {2, -2},
{1, -3}, {0, -3}, {-1, -3}, {-2, -3}, {-2, -2}, {-3, -1},
{-3, 0}, {-3, 1}, {-2, 2}, {-2, 3}, {-1, 3}, {0, 3}
},
firstRingYIsOdd = {{1, 1}, {1, 0}, {1, -1}, {0, -1}, {-1, 0}, {0, 1}},
secondRingYIsOdd = {
{1, 2}, {2, 1}, {2, 0}, {2, -1}, {1, -2}, {0, -2},
{-1, -2}, {-1, -1}, {-2, 0}, {-1, 1}, {-1, 2}, {0, 2}
},
thirdRingYIsOdd = {
{2, 3}, {2, 2}, {3, 1}, {3, 0}, {3, -1}, {2, -2},
{2, -3}, {1, -3}, {0, -3}, {-1, -3}, {-2, -2}, {-2, -1},
{-3, 0}, {-2, 1}, {-2, 2}, {-1, 3}, {0, 3}, {1, 3}
},
-- Direction types table, another method of handling hex adjustments, in combination with Map.PlotDirection()
direction_types = {
DirectionTypes.DIRECTION_NORTHEAST,
DirectionTypes.DIRECTION_EAST,
DirectionTypes.DIRECTION_SOUTHEAST,
DirectionTypes.DIRECTION_SOUTHWEST,
DirectionTypes.DIRECTION_WEST,
DirectionTypes.DIRECTION_NORTHWEST
},
-- Handy resource ID shortcuts
wheat_ID, cow_ID, deer_ID, banana_ID, fish_ID, sheep_ID, stone_ID,
iron_ID, horse_ID, coal_ID, oil_ID, aluminum_ID, uranium_ID,
whale_ID, pearls_ID, ivory_ID, fur_ID, silk_ID,
dye_ID, spices_ID, sugar_ID, cotton_ID, wine_ID, incense_ID,
gold_ID, silver_ID, gems_ID, marble_ID,
-- Expansion luxuries
copper_ID, salt_ID, citrus_ID, truffles_ID, crab_ID, cocoa_ID,
bison_ID,
-- Mod luxuries
coffee_ID, tea_ID, tobacco_ID, amber_ID, jade_ID, olives_ID, perfume_ID, coral_ID, lapis_ID, -- MOD.Barathor: New
-- Even More Resources for Vox Populi (luxuries)
lavender_ID, obsidian_ID, platinum_ID, poppy_ID, tin_ID, -- MOD.HungryForFood: New
-- Even More Resources for Vox Populi (bonus)
coconut_ID, hardwood_ID, lead_ID, maize_ID, pineapple_ID, potato_ID, rice_ID, rubber_ID, sulfur_ID, titanium_ID, -- MOD.HungryForFood: New
-- Local arrays for storing Natural Wonder Placement XML data
EligibilityMethodNumber = {},
OccurrenceFrequency = {},
RequireBiggestLandmass = {},
AvoidBiggestLandmass = {},
RequireFreshWater = {},
AvoidFreshWater = {},
LandBased = {},
RequireLandAdjacentToOcean = {},
AvoidLandAdjacentToOcean = {},
RequireLandOnePlotInland = {},
AvoidLandOnePlotInland = {},
RequireLandTwoOrMorePlotsInland = {},
AvoidLandTwoOrMorePlotsInland = {},
CoreTileCanBeAnyPlotType = {},
CoreTileCanBeFlatland = {},
CoreTileCanBeHills = {},
CoreTileCanBeMountain = {},
CoreTileCanBeOcean = {},
CoreTileCanBeAnyTerrainType = {},
CoreTileCanBeGrass = {},
CoreTileCanBePlains = {},
CoreTileCanBeDesert = {},
CoreTileCanBeTundra = {},
CoreTileCanBeSnow = {},
CoreTileCanBeShallowWater = {},
CoreTileCanBeDeepWater = {},
CoreTileCanBeAnyFeatureType = {},
CoreTileCanBeNoFeature = {},
CoreTileCanBeForest = {},
CoreTileCanBeJungle = {},
CoreTileCanBeOasis = {},
CoreTileCanBeFloodPlains = {},
CoreTileCanBeMarsh = {},
CoreTileCanBeIce = {},
CoreTileCanBeAtoll = {},
AdjacentTilesCareAboutPlotTypes = {},
AdjacentTilesAvoidAnyland = {},
AdjacentTilesRequireFlatland = {},
RequiredNumberOfAdjacentFlatland = {},
AdjacentTilesRequireHills = {},
RequiredNumberOfAdjacentHills = {},
AdjacentTilesRequireMountain = {},
RequiredNumberOfAdjacentMountain = {},
AdjacentTilesRequireHillsPlusMountains = {},
RequiredNumberOfAdjacentHillsPlusMountains = {},
AdjacentTilesRequireOcean = {},
RequiredNumberOfAdjacentOcean = {},
AdjacentTilesAvoidFlatland = {},
MaximumAllowedAdjacentFlatland = {},
AdjacentTilesAvoidHills = {},
MaximumAllowedAdjacentHills = {},
AdjacentTilesAvoidMountain = {},
MaximumAllowedAdjacentMountain = {},
AdjacentTilesAvoidHillsPlusMountains = {},
MaximumAllowedAdjacentHillsPlusMountains = {},
AdjacentTilesAvoidOcean = {},
MaximumAllowedAdjacentOcean = {},
AdjacentTilesCareAboutTerrainTypes = {},
AdjacentTilesRequireGrass = {},
RequiredNumberOfAdjacentGrass = {},
AdjacentTilesRequirePlains = {},
RequiredNumberOfAdjacentPlains = {},
AdjacentTilesRequireDesert = {},
RequiredNumberOfAdjacentDesert = {},
AdjacentTilesRequireTundra = {},
RequiredNumberOfAdjacentTundra = {},
AdjacentTilesRequireSnow = {},
RequiredNumberOfAdjacentSnow = {},
AdjacentTilesRequireShallowWater = {},
RequiredNumberOfAdjacentShallowWater = {},
AdjacentTilesRequireDeepWater = {},
RequiredNumberOfAdjacentDeepWater = {},
AdjacentTilesAvoidGrass = {},
MaximumAllowedAdjacentGrass = {},
AdjacentTilesAvoidPlains = {},
MaximumAllowedAdjacentPlains = {},
AdjacentTilesAvoidDesert = {},
MaximumAllowedAdjacentDesert = {},
AdjacentTilesAvoidTundra = {},
MaximumAllowedAdjacentTundra = {},
AdjacentTilesAvoidSnow = {},
MaximumAllowedAdjacentSnow = {},
AdjacentTilesAvoidShallowWater = {},
MaximumAllowedAdjacentShallowWater = {},
AdjacentTilesAvoidDeepWater = {},
MaximumAllowedAdjacentDeepWater = {},
AdjacentTilesCareAboutFeatureTypes = {},
AdjacentTilesRequireNoFeature = {},
RequiredNumberOfAdjacentNoFeature = {},
AdjacentTilesRequireForest = {},
RequiredNumberOfAdjacentForest = {},
AdjacentTilesRequireJungle = {},
RequiredNumberOfAdjacentJungle = {},
AdjacentTilesRequireOasis = {},
RequiredNumberOfAdjacentOasis = {},
AdjacentTilesRequireFloodPlains = {},
RequiredNumberOfAdjacentFloodPlains = {},
AdjacentTilesRequireMarsh = {},
RequiredNumberOfAdjacentMarsh = {},
AdjacentTilesRequireIce = {},
RequiredNumberOfAdjacentIce = {},
AdjacentTilesRequireAtoll = {},
RequiredNumberOfAdjacentAtoll = {},
AdjacentTilesAvoidNoFeature = {},
MaximumAllowedAdjacentNoFeature = {},
AdjacentTilesAvoidForest = {},
MaximumAllowedAdjacentForest = {},
AdjacentTilesAvoidJungle = {},
MaximumAllowedAdjacentJungle = {},
AdjacentTilesAvoidOasis = {},
MaximumAllowedAdjacentOasis = {},
AdjacentTilesAvoidFloodPlains = {},
MaximumAllowedAdjacentFloodPlains = {},
AdjacentTilesAvoidMarsh = {},
MaximumAllowedAdjacentMarsh = {},
AdjacentTilesAvoidIce = {},
MaximumAllowedAdjacentIce = {},
AdjacentTilesAvoidAtoll = {},
MaximumAllowedAdjacentAtoll = {},
TileChangesMethodNumber = {},
ChangeCoreTileToMountain = {},
ChangeCoreTileToFlatland = {},
ChangeCoreTileTerrainToGrass = {},
ChangeCoreTileTerrainToPlains = {},
SetAdjacentTilesToShallowWater = {},
}
findStarts:__Init()
findStarts:__InitLuxuryWeights()
-- Entry point for easy overrides, for instance if only a couple things need to change.
findStarts:__CustomInit()
return findStarts
end
------------------------------------------------------------------------------
function AssignStartingPlots:__Init()
-- Set up data tables that record whether a plot is coastal land and whether a plot is adjacent to coastal land.
self.plotDataIsCoastal, self.plotDataIsNextToCoast = GenerateNextToCoastalLandDataTables()
self.plotDataIsThreeFromCoast = GenerateThreeFromCoastTable(self.plotDataIsCoastal, self.plotDataIsNextToCoast)
--
-- Set up data for resource ID shortcuts.
--print("########## Resource ID's ##########");
local csvids = "";
for resource_data in GameInfo.Resources() do
table.insert(self.resources, resource_data);
local resourceID = resource_data.ID;
local resourceType = resource_data.Type;
-- Set up Bonus IDs
csvids = csvids .. resourceType .. "," .. resourceID .. "\n";
if resourceType == "RESOURCE_WHEAT" then
self.wheat_ID = resourceID;
elseif resourceType == "RESOURCE_COW" then
self.cow_ID = resourceID;
elseif resourceType == "RESOURCE_DEER" then
self.deer_ID = resourceID;
elseif resourceType == "RESOURCE_BANANA" then
self.banana_ID = resourceID;
elseif resourceType == "RESOURCE_FISH" then
self.fish_ID = resourceID;
elseif resourceType == "RESOURCE_SHEEP" then
self.sheep_ID = resourceID;
elseif resourceType == "RESOURCE_STONE" then
self.stone_ID = resourceID;
-- Set up Strategic IDs
elseif resourceType == "RESOURCE_IRON" then
self.iron_ID = resourceID;
elseif resourceType == "RESOURCE_HORSE" then
self.horse_ID = resourceID;
elseif resourceType == "RESOURCE_COAL" then
self.coal_ID = resourceID;
elseif resourceType == "RESOURCE_OIL" then
self.oil_ID = resourceID;
elseif resourceType == "RESOURCE_ALUMINUM" then
self.aluminum_ID = resourceID;
elseif resourceType == "RESOURCE_URANIUM" then
self.uranium_ID = resourceID;
-- Set up Luxury IDs
elseif resourceType == "RESOURCE_WHALE" then
self.whale_ID = resourceID;
elseif resourceType == "RESOURCE_PEARLS" then
self.pearls_ID = resourceID;
elseif resourceType == "RESOURCE_IVORY" then
self.ivory_ID = resourceID;
elseif resourceType == "RESOURCE_FUR" then
self.fur_ID = resourceID;
elseif resourceType == "RESOURCE_SILK" then
self.silk_ID = resourceID;
elseif resourceType == "RESOURCE_DYE" then
self.dye_ID = resourceID;
elseif resourceType == "RESOURCE_SPICES" then
self.spices_ID = resourceID;
elseif resourceType == "RESOURCE_SUGAR" then
self.sugar_ID = resourceID;
elseif resourceType == "RESOURCE_COTTON" then
self.cotton_ID = resourceID;
elseif resourceType == "RESOURCE_WINE" then
self.wine_ID = resourceID;
elseif resourceType == "RESOURCE_INCENSE" then
self.incense_ID = resourceID;
elseif resourceType == "RESOURCE_GOLD" then
self.gold_ID = resourceID;
elseif resourceType == "RESOURCE_SILVER" then
self.silver_ID = resourceID;
elseif resourceType == "RESOURCE_GEMS" then
self.gems_ID = resourceID;
elseif resourceType == "RESOURCE_MARBLE" then
self.marble_ID = resourceID;
-- Set up Expansion Pack Luxury IDs
elseif resourceType == "RESOURCE_COPPER" then
self.copper_ID = resourceID;
elseif resourceType == "RESOURCE_SALT" then
self.salt_ID = resourceID;
elseif resourceType == "RESOURCE_CITRUS" then
self.citrus_ID = resourceID;
elseif resourceType == "RESOURCE_TRUFFLES" then
self.truffles_ID = resourceID;
elseif resourceType == "RESOURCE_CRAB" then
self.crab_ID = resourceID;
elseif resourceType == "RESOURCE_COCOA" then
self.cocoa_ID = resourceID;
elseif resourceType == "RESOURCE_BISON" then
self.bison_ID = resourceID;
-- Mod Luxury IDs
elseif resourceType == "RESOURCE_COFFEE" then -- MOD.Barathor: New
self.coffee_ID = resourceID;
elseif resourceType == "RESOURCE_TEA" then -- MOD.Barathor: New
self.tea_ID = resourceID;
elseif resourceType == "RESOURCE_TOBACCO" then -- MOD.Barathor: New
self.tobacco_ID = resourceID;
elseif resourceType == "RESOURCE_AMBER" then -- MOD.Barathor: New
self.amber_ID = resourceID;
elseif resourceType == "RESOURCE_JADE" then -- MOD.Barathor: New
self.jade_ID = resourceID;
elseif resourceType == "RESOURCE_OLIVE" then -- MOD.Barathor: New
self.olives_ID = resourceID;
elseif resourceType == "RESOURCE_PERFUME" then -- MOD.Barathor: New
self.perfume_ID = resourceID;
elseif resourceType == "RESOURCE_CORAL" then -- MOD.Barathor: New
self.coral_ID = resourceID;
elseif resourceType == "RESOURCE_LAPIS" then -- MOD.Barathor: New
self.lapis_ID = resourceID;
-- Even More Resources for Vox Populi (luxuries)
elseif resourceType == "RESOURCE_LAVENDER" then -- MOD.HungryForFood: New
self.lavender_ID = resourceID;
elseif resourceType == "RESOURCE_OBSIDIAN" then -- MOD.HungryForFood: New
self.obsidian_ID = resourceID;
elseif resourceType == "RESOURCE_PLATINUM" then -- MOD.HungryForFood: New
self.platinum_ID = resourceID;
elseif resourceType == "RESOURCE_POPPY" then -- MOD.HungryForFood: New
self.poppy_ID = resourceID;
elseif resourceType == "RESOURCE_TIN" then -- MOD.HungryForFood: New
self.tin_ID = resourceID;
-- Even More Resources for Vox Populi (bonus)
elseif resourceType == "RESOURCE_COCONUT" then -- MOD.HungryForFood: New
self.coconut_ID = resourceID;
elseif resourceType == "RESOURCE_HARDWOOD" then -- MOD.HungryForFood: New
self.hardwood_ID = resourceID;
elseif resourceType == "RESOURCE_LEAD" then -- MOD.HungryForFood: New
self.lead_ID = resourceID;
elseif resourceType == "RESOURCE_MAIZE" then -- MOD.HungryForFood: New
self.maize_ID = resourceID;
elseif resourceType == "RESOURCE_PINEAPPLE" then -- MOD.HungryForFood: New
self.pineapple_ID = resourceID;
elseif resourceType == "RESOURCE_POTATO" then -- MOD.HungryForFood: New
self.potato_ID = resourceID;
elseif resourceType == "RESOURCE_RICE" then -- MOD.HungryForFood: New
self.rice_ID = resourceID;
elseif resourceType == "RESOURCE_RUBBER" then -- MOD.HungryForFood: New
self.rubber_ID = resourceID;
elseif resourceType == "RESOURCE_SULFUR" then -- MOD.HungryForFood: New
self.sulfur_ID = resourceID;
elseif resourceType == "RESOURCE_TITANIUM" then -- MOD.HungryForFood: New
self.titanium_ID = resourceID;
end
end
if self.coral_ID ~= nil then
self.bModLuxes = true;
end
print("########## Resource ID's ##########");
print(csvids);
end
------------------------------------------------------------------------------
function AssignStartingPlots:__InitLuxuryWeights()
-- Initialize luxury data table. Index == Region Type
-- Customize this function if the terrain will fall significantly
-- outside Earth normal, or if region definitions have been modified.
-- Note: The water-based luxuries are set to appear in a region only if that region has its start on the coast.
-- So the weights shown for those are reduced in practice to the degree that a map has inland starts.
if self.bModLuxes == true then
self.luxury_region_weights[1] = { -- Tundra
{self.fur_ID, 40},
{self.silver_ID, 40},
{self.amber_ID, 40},
{self.salt_ID, 40},
{self.gold_ID, 10},
{self.copper_ID, 10},
{self.gems_ID, 10},
{self.jade_ID, 10},
{self.lapis_ID, 10},
{self.whale_ID, 10},
{self.crab_ID, 10},
{self.pearls_ID, 10},
{self.obsidian_ID, 10},
{self.coral_ID, 10}, };
self.luxury_region_weights[2] = { -- Jungle
{self.citrus_ID, 40},
{self.cocoa_ID, 40},
{self.spices_ID, 40},
{self.sugar_ID, 40},
{self.obsidian_ID, 40},
{self.coconut_ID, 40},
{self.rubber_ID, 40},
{self.truffles_ID, 40},
{self.silk_ID, 10},
{self.dye_ID, 10},
{self.fur_ID, 10},
{self.whale_ID, 10},
{self.crab_ID, 10},
{self.pearls_ID, 10},
{self.coral_ID, 10}, };
self.luxury_region_weights[3] = { -- Forest
{self.truffles_ID, 40},
{self.silk_ID, 10},
{self.dye_ID, 10},
{self.fur_ID, 40},
{self.coconut_ID, 10},
{self.rubber_ID, 10},
{self.citrus_ID, 10},
{self.cocoa_ID, 10},
{self.spices_ID, 10},
{self.sugar_ID, 10},
{self.whale_ID, 10},
{self.crab_ID, 10},
{self.pearls_ID, 10},
{self.coral_ID, 10}, };
self.luxury_region_weights[4] = { -- Desert
{self.incense_ID, 40},
{self.salt_ID, 40},
{self.gold_ID, 40},
{self.lapis_ID, 40},
{self.obsidian_ID, 10},
{self.copper_ID, 10},
{self.silver_ID, 10},
{self.amber_ID, 10},
{self.gems_ID, 10},
{self.jade_ID, 10},
{self.whale_ID, 10},
{self.crab_ID, 10},
{self.pearls_ID, 10},
{self.coral_ID, 10}, };
self.luxury_region_weights[5] = { -- Hills
{self.gold_ID, 30},
{self.silver_ID, 30},
{self.copper_ID, 30},
{self.gems_ID, 30},
{self.salt_ID, 30},
{self.jade_ID, 30},
{self.amber_ID, 30},
{self.lapis_ID, 30},
{self.obsidian_ID, 30},
{self.whale_ID, 10},
{self.crab_ID, 10},
{self.pearls_ID, 10},
{self.coral_ID, 10}, };
self.luxury_region_weights[6] = { -- Plains
{self.incense_ID, 40},
{self.ivory_ID, 40},
{self.wine_ID, 40},
{self.olives_ID, 40},
{self.coffee_ID, 40},
{self.tobacco_ID, 10},
{self.tea_ID, 10},
{self.perfume_ID, 40},
{self.cotton_ID, 10},
{self.whale_ID, 10},
{self.crab_ID, 10},
{self.pearls_ID, 10},
{self.coral_ID, 10}, };
self.luxury_region_weights[7] = { -- Grass
{self.tobacco_ID, 40},
{self.tea_ID, 40},
{self.cotton_ID, 40},
{self.perfume_ID, 25},
{self.ivory_ID, 10},
{self.wine_ID, 10},
{self.olives_ID, 25},
{self.coffee_ID, 25},
{self.whale_ID, 10},
{self.crab_ID, 10},
{self.pearls_ID, 10},
{self.coral_ID, 10}, };
self.luxury_region_weights[8] = { -- Hybrid
{self.gold_ID, 30},
{self.silver_ID, 30}, -- MOD.Barathor: Favor very flexible resources, like resources that are mined or in the water.
{self.copper_ID, 30},
{self.gems_ID, 30},
{self.salt_ID, 30},
{self.jade_ID, 30},
{self.amber_ID, 30},
{self.lapis_ID, 30},
{self.obsidian_ID, 30},
{self.coffee_ID, 05},
{self.coconut_ID, 05},
{self.rubber_ID, 05},
{self.tobacco_ID, 05},
{self.tea_ID, 05},
{self.perfume_ID, 05},
{self.cotton_ID, 05},
{self.ivory_ID, 05},
{self.wine_ID, 05},
{self.olives_ID, 05},
{self.incense_ID, 05},
{self.truffles_ID, 05},
{self.silk_ID, 05},
{self.dye_ID, 05},
{self.fur_ID, 05},
{self.citrus_ID, 05},
{self.cocoa_ID, 05},
{self.spices_ID, 05},
{self.sugar_ID, 05},
{self.whale_ID, 20},
{self.crab_ID, 20},
{self.pearls_ID, 20},
{self.coral_ID, 20}, };
self.luxury_region_weights[9] = { -- Wetlands
{self.tobacco_ID, 40},
{self.tea_ID, 40},
{self.perfume_ID, 20},
{self.cotton_ID, 30},
{self.olives_ID, 20},
{self.silver_ID, 20},
{self.sugar_ID, 20},
{self.copper_ID, 20},
{self.coral_ID, 20},
{self.crab_ID, 25},
{self.pearls_ID, 25},
{self.coconut_ID, 30},
{self.rubber_ID, 05},
{self.whale_ID, 25},
{self.cocoa_ID, 10},
{self.truffles_ID, 05},
{self.spices_ID, 05},
{self.gems_ID, 20}, };
self.luxury_fallback_weights = { -- Random / Fallback
{self.gold_ID, 10},
{self.silver_ID, 10}, -- MOD.Barathor: Favor water resources since they work great as randoms and make the coasts more interesting.
{self.copper_ID, 10}, -- Also, slightly favor mined resources for their flexibility.
{self.gems_ID, 10},
{self.salt_ID, 10},
{self.jade_ID, 10},
{self.amber_ID, 10},
{self.lapis_ID, 10},
{self.obsidian_ID, 10},
{self.coffee_ID, 05},
{self.tobacco_ID, 05},
{self.tea_ID, 05},
{self.perfume_ID, 05},
{self.cotton_ID, 05},
{self.ivory_ID, 05},
{self.wine_ID, 05},
{self.olives_ID, 05},
{self.incense_ID, 05},
{self.truffles_ID, 05},
{self.silk_ID, 05},
{self.dye_ID, 05},
{self.fur_ID, 05},
{self.citrus_ID, 05},
{self.cocoa_ID, 05},
{self.spices_ID, 05},
{self.sugar_ID, 05},
{self.whale_ID, 30},
{self.crab_ID, 30},
{self.pearls_ID, 30},
{self.coconut_ID, 05},
{self.rubber_ID, 05},
{self.coral_ID, 30}, };
self.luxury_city_state_weights = { -- City States
{self.gold_ID, 05},
{self.obsidian_ID, 05},
{self.silver_ID, 05}, -- MOD.Barathor: Slightly favor water resources since they're flexible and most city-states are coastal.
{self.copper_ID, 05}, -- Also, slightly favor mined resources for their flexibility.
{self.gems_ID, 05},
{self.salt_ID, 05},
{self.jade_ID, 05},
{self.amber_ID, 05},
{self.lapis_ID, 05},
{self.coffee_ID, 05},
{self.tobacco_ID, 05},
{self.tea_ID, 05},
{self.perfume_ID, 05},
{self.cotton_ID, 05},
{self.ivory_ID, 05},
{self.wine_ID, 05},
{self.olives_ID, 05},
{self.incense_ID, 05},
{self.truffles_ID, 05},
{self.silk_ID, 05},
{self.dye_ID, 05},
{self.fur_ID, 05},
{self.citrus_ID, 05},
{self.cocoa_ID, 05},
{self.spices_ID, 05},
{self.sugar_ID, 05},
{self.coconut_ID, 05},
{self.rubber_ID, 05},
{self.whale_ID, 30},
{self.crab_ID, 30},
{self.pearls_ID, 30},
{self.coral_ID, 30}, };
else
self.luxury_region_weights[1] = { -- Tundra
{self.fur_ID, 40},
{self.whale_ID, 25},
{self.crab_ID, 25},
{self.pearls_ID, 25},
{self.silver_ID, 25},
{self.copper_ID, 15},
{self.salt_ID, 20},
{self.gems_ID, 05},
{self.dye_ID, 05}, };
self.luxury_region_weights[2] = { -- Jungle
{self.cocoa_ID, 35},
{self.citrus_ID, 35},
{self.spices_ID, 35},
{self.coconut_ID, 35},
{self.rubber_ID, 35},
{self.gems_ID, 25},
{self.sugar_ID, 20},
{self.pearls_ID, 25},
{self.copper_ID, 05},
{self.truffles_ID, 25},
{self.crab_ID, 25},
{self.whale_ID, 25},
{self.silk_ID, 25},
{self.dye_ID, 25}, };
self.luxury_region_weights[3] = { -- Forest
{self.dye_ID, 10},
{self.silk_ID, 10},
{self.truffles_ID, 30},
{self.coconut_ID, 30},
{self.rubber_ID, 10},
{self.fur_ID, 10},
{self.spices_ID, 10},
{self.citrus_ID, 05},
{self.salt_ID, 05},
{self.copper_ID, 05},
{self.cocoa_ID, 05},
{self.crab_ID, 25},
{self.whale_ID, 25},
{self.pearls_ID, 25}, };
self.luxury_region_weights[4] = { -- Desert
{self.incense_ID, 35},
{self.salt_ID, 25},
{self.gold_ID, 25},
{self.copper_ID, 25},
{self.cotton_ID, 15},
{self.sugar_ID, 15},
{self.pearls_ID, 25},