-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGoldenAge_Cultivation.sql
594 lines (562 loc) · 38.3 KB
/
GoldenAge_Cultivation.sql
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
--v226 农场和矿山现在要在资源上才能建造
DELETE FROM Improvement_ValidTerrains WHERE ImprovementType='IMPROVEMENT_FARM';
DELETE FROM Improvement_ValidTerrains WHERE ImprovementType='IMPROVEMENT_MINE';
--资源培育 Credit to 'Resource Cultivation' by Zegangani.
INSERT OR REPLACE INTO Types
(Type, Kind) VALUES
('UNIT_FARMER', 'KIND_UNIT'),
('UNIT_HERDMAN', 'KIND_UNIT'),
('UNIT_FISHER', 'KIND_UNIT'),
('UNIT_MINER', 'KIND_UNIT');
INSERT OR REPLACE INTO Units
(UnitType, Name, Description, BaseSightRange, BaseMoves, Domain, FormationClass, Cost, CostProgressionModel, CostProgressionParam1, BuildCharges, PurchaseYield, MustPurchase, PrereqTech) VALUES
('UNIT_FARMER', 'LOC_UNIT_FARMER_NAME', 'LOC_UNIT_FARMER_DESCRIPTION', 1, 2, 'DOMAIN_LAND', 'FORMATION_CLASS_CIVILIAN', 100, 'COST_PROGRESSION_PREVIOUS_COPIES', 25, 2, 'YIELD_GOLD', 1, 'TECH_MATHEMATICS'),
('UNIT_HERDMAN', 'LOC_UNIT_HERDMAN_NAME', 'LOC_UNIT_HERDMAN_DESCRIPTION', 1, 2, 'DOMAIN_LAND', 'FORMATION_CLASS_CIVILIAN', 100, 'COST_PROGRESSION_PREVIOUS_COPIES', 25, 2, 'YIELD_GOLD', 1, 'TECH_HORSEBACK_RIDING'),
('UNIT_FISHER', 'LOC_UNIT_FISHER_NAME', 'LOC_UNIT_FISHER_DESCRIPTION', 1, 2, 'DOMAIN_LAND', 'FORMATION_CLASS_CIVILIAN', 100, 'COST_PROGRESSION_PREVIOUS_COPIES', 25, 2, 'YIELD_GOLD', 1, 'TECH_SHIPBUILDING'),
('UNIT_MINER', 'LOC_UNIT_MINER_NAME', 'LOC_UNIT_MINER_DESCRIPTION', 1, 2, 'DOMAIN_LAND', 'FORMATION_CLASS_CIVILIAN', 100, 'COST_PROGRESSION_PREVIOUS_COPIES', 25, 2, 'YIELD_GOLD', 1, 'TECH_CONSTRUCTION');
INSERT OR REPLACE INTO TypeTags
(Type, Tag) VALUES
('UNIT_FARMER', 'CLASS_BUILDER'),
('UNIT_FARMER', 'CLASS_LANDCIVILIAN'),
('UNIT_HERDMAN', 'CLASS_BUILDER'),
('UNIT_HERDMAN', 'CLASS_LANDCIVILIAN'),
('UNIT_FISHER', 'CLASS_BUILDER'),
('UNIT_FISHER', 'CLASS_LANDCIVILIAN'),
('UNIT_MINER', 'CLASS_BUILDER'),
('UNIT_MINER', 'CLASS_LANDCIVILIAN');
INSERT OR REPLACE INTO UnitCaptures
(CapturedUnitType, BecomesUnitType) VALUES
('UNIT_FARMER', 'UNIT_FARMER'),
('UNIT_HERDMAN', 'UNIT_HERDMAN'),
('UNIT_FISHER', 'UNIT_FISHER'),
('UNIT_MINER', 'UNIT_MINER');
INSERT OR REPLACE INTO Improvement_ValidBuildUnits
(ImprovementType, UnitType) VALUES
('IMPROVEMENT_FARM', 'UNIT_FARMER'),
('IMPROVEMENT_PLANTATION', 'UNIT_FARMER'),
('IMPROVEMENT_PASTURE', 'UNIT_HERDMAN'),
('IMPROVEMENT_CAMP', 'UNIT_HERDMAN'),
('IMPROVEMENT_FISHING_BOATS', 'UNIT_FISHER'),
('IMPROVEMENT_FISHERY', 'UNIT_FISHER'),
('IMPROVEMENT_MINE', 'UNIT_MINER'),
('IMPROVEMENT_QUARRY', 'UNIT_MINER');
INSERT OR REPLACE INTO UnitAiInfos
(UnitType, AiType) VALUES
('UNIT_FARMER', 'UNITAI_BUILD'),
('UNIT_FARMER', 'UNITTYPE_CIVILIAN'),
('UNIT_HERDMAN', 'UNITAI_BUILD'),
('UNIT_HERDMAN', 'UNITTYPE_CIVILIAN'),
('UNIT_FISHER', 'UNITAI_BUILD'),
('UNIT_FISHER', 'UNITTYPE_CIVILIAN'),
('UNIT_MINER', 'UNITAI_BUILD'),
('UNIT_MINER', 'UNITTYPE_CIVILIAN');
INSERT OR REPLACE INTO AiFavoredItems
(ListType, Item, Value) VALUES
('UnitPriorityBoosts', 'UNIT_FARMER', 50),
('UnitPriorityBoosts', 'UNIT_HERDMAN', 50),
('UnitPriorityBoosts', 'UNIT_FISHER', 50),
('UnitPriorityBoosts', 'UNIT_MINER', 50);
--==========================================================================================================================
--AI free units by era
-- INSERT OR REPLACE INTO TraitModifiers
-- (TraitType , ModifierId)
-- SELECT 'TRAIT_LEADER_MAJOR_CIV' , 'GOLDEN_AI_UNIT_FARMER_' ||EraType
-- FROM Eras WHERE ChronologyIndex = 3 OR ChronologyIndex = 5 OR ChronologyIndex = 7;
-- INSERT OR REPLACE INTO TraitModifiers
-- (TraitType , ModifierId)
-- SELECT 'TRAIT_LEADER_MAJOR_CIV' , 'GOLDEN_AI_UNIT_HERDMAN_' ||EraType
-- FROM Eras WHERE ChronologyIndex = 3 OR ChronologyIndex = 5 OR ChronologyIndex = 7;
-- INSERT OR REPLACE INTO TraitModifiers
-- (TraitType , ModifierId)
-- SELECT 'TRAIT_LEADER_MAJOR_CIV' , 'GOLDEN_AI_UNIT_FISHER_' ||EraType
-- FROM Eras WHERE ChronologyIndex = 3 OR ChronologyIndex = 5 OR ChronologyIndex = 7;
-- INSERT OR REPLACE INTO TraitModifiers
-- (TraitType , ModifierId)
-- SELECT 'TRAIT_LEADER_MAJOR_CIV' , 'GOLDEN_AI_UNIT_MINER_' ||EraType
-- FROM Eras WHERE ChronologyIndex = 3 OR ChronologyIndex = 5 OR ChronologyIndex = 7;
-- INSERT OR REPLACE INTO Modifiers
-- (ModifierId , ModifierType, SubjectRequirementSetId)
-- SELECT 'GOLDEN_AI_UNIT_FARMER_' ||EraType, 'MODIFIER_PLAYER_GRANT_UNIT_IN_CAPITAL', 'GOLDEN_AI_IS_GAME_ERA_ATLEAST_' ||EraType|| '_REQUIREMENTS'
-- FROM Eras WHERE ChronologyIndex = 3 OR ChronologyIndex = 5 OR ChronologyIndex = 7;
-- INSERT OR REPLACE INTO Modifiers
-- (ModifierId , ModifierType, SubjectRequirementSetId)
-- SELECT 'GOLDEN_AI_UNIT_HERDMAN_' ||EraType, 'MODIFIER_PLAYER_GRANT_UNIT_IN_CAPITAL', 'GOLDEN_AI_IS_GAME_ERA_ATLEAST_' ||EraType|| '_REQUIREMENTS'
-- FROM Eras WHERE ChronologyIndex = 3 OR ChronologyIndex = 5 OR ChronologyIndex = 7;
-- INSERT OR REPLACE INTO Modifiers
-- (ModifierId , ModifierType, SubjectRequirementSetId)
-- SELECT 'GOLDEN_AI_UNIT_FISHER_' ||EraType, 'MODIFIER_PLAYER_GRANT_UNIT_IN_CAPITAL', 'GOLDEN_AI_IS_GAME_ERA_ATLEAST_' ||EraType|| '_REQUIREMENTS'
-- FROM Eras WHERE ChronologyIndex = 3 OR ChronologyIndex = 5 OR ChronologyIndex = 7;
-- INSERT OR REPLACE INTO Modifiers
-- (ModifierId , ModifierType, SubjectRequirementSetId)
-- SELECT 'GOLDEN_AI_UNIT_MINER_' ||EraType, 'MODIFIER_PLAYER_GRANT_UNIT_IN_CAPITAL', 'GOLDEN_AI_IS_GAME_ERA_ATLEAST_' ||EraType|| '_REQUIREMENTS'
-- FROM Eras WHERE ChronologyIndex = 3 OR ChronologyIndex = 5 OR ChronologyIndex = 7;
-- INSERT OR REPLACE INTO ModifierArguments
-- (ModifierId , Name , Value)
-- SELECT ModifierId , 'Amount' , 1 FROM TraitModifiers WHERE ModifierId LIKE 'GOLDEN_AI_UNIT_FARMER_%';
-- INSERT OR REPLACE INTO ModifierArguments
-- (ModifierId , Name , Value)
-- SELECT ModifierId , 'UnitType' , 'UNIT_FARMER' FROM TraitModifiers WHERE ModifierId LIKE 'GOLDEN_AI_UNIT_FARMER_%';
-- INSERT OR REPLACE INTO ModifierArguments
-- (ModifierId , Name , Value)
-- SELECT ModifierId , 'Amount' , 1 FROM TraitModifiers WHERE ModifierId LIKE 'GOLDEN_AI_UNIT_HERDMAN_%';
-- INSERT OR REPLACE INTO ModifierArguments
-- (ModifierId , Name , Value)
-- SELECT ModifierId , 'UnitType' , 'UNIT_HERDMAN' FROM TraitModifiers WHERE ModifierId LIKE 'GOLDEN_AI_UNIT_HERDMAN_%';
-- INSERT OR REPLACE INTO ModifierArguments
-- (ModifierId , Name , Value)
-- SELECT ModifierId , 'Amount' , 1 FROM TraitModifiers WHERE ModifierId LIKE 'GOLDEN_AI_UNIT_FISHER_%';
-- INSERT OR REPLACE INTO ModifierArguments
-- (ModifierId , Name , Value)
-- SELECT ModifierId , 'UnitType' , 'UNIT_FISHER' FROM TraitModifiers WHERE ModifierId LIKE 'GOLDEN_AI_UNIT_FISHER_%';
-- INSERT OR REPLACE INTO ModifierArguments
-- (ModifierId , Name , Value)
-- SELECT ModifierId , 'Amount' , 1 FROM TraitModifiers WHERE ModifierId LIKE 'GOLDEN_AI_UNIT_MINER_%';
-- INSERT OR REPLACE INTO ModifierArguments
-- (ModifierId , Name , Value)
-- SELECT ModifierId , 'UnitType' , 'UNIT_MINER' FROM TraitModifiers WHERE ModifierId LIKE 'GOLDEN_AI_UNIT_MINER_%';
--==========================================================================================================================
CREATE TABLE GA_Resource_Cultivation(
ResourceType varchar(100),
ResourceClassType varchar(100),
UnitType varchar(100) NULL,
ImprovementType varchar(100) NULL,
PrereqTech varchar(100) NULL,
PrereqCivic varchar(100) NULL,
ResourceCultivation varchar(100) NOT NULL CHECK (ResourceCultivation IN (0, 1) ) DEFAULT 0,
Icon varchar(100) NULL,
ValidImprovementType varchar(100) NULL,
TraitType varchar(100) NULL,
Housing varchar(100) NOT NULL DEFAULT 0,
TilesRequired varchar(100) NOT NULL DEFAULT 0,
Domain varchar(100) NOT NULL DEFAULT 'DOMAIN_LAND',
PRIMARY KEY (UnitType, ImprovementType)
);
INSERT OR IGNORE INTO GA_Resource_Cultivation(ResourceType, ResourceClassType)
SELECT ResourceType, ResourceClassType FROM Resources WHERE ResourceType IN
(
--Plant based resources
'RESOURCE_RICE',
'RESOURCE_WHEAT',
'RESOURCE_MAIZE',
'RESOURCE_BANANAS',
'RESOURCE_CITRUS',
'RESOURCE_COCOA',
'RESOURCE_COFFEE',
'RESOURCE_COTTON',
'RESOURCE_DYES',
'RESOURCE_INCENSE',
'RESOURCE_SILK',
'RESOURCE_SPICES',
'RESOURCE_SUGAR',
'RESOURCE_TEA',
'RESOURCE_TOBACCO',
'RESOURCE_WINE',
'RESOURCE_OLIVES',
--Mine Resources
'RESOURCE_COPPER',
'RESOURCE_STONE',
'RESOURCE_DIAMONDS',
'RESOURCE_GYPSUM',
'RESOURCE_JADE',
'RESOURCE_MARBLE',
'RESOURCE_MERCURY',
'RESOURCE_SALT',
'RESOURCE_SILVER',
'RESOURCE_AMBER',
--Water Resources
'RESOURCE_CRABS',
'RESOURCE_FISH',
'RESOURCE_WHALES',
'RESOURCE_PEARLS',
'RESOURCE_TURTLES',
--Animal Resources
'RESOURCE_CATTLE',
'RESOURCE_SHEEP',
'RESOURCE_DEER',
'RESOURCE_FURS',
'RESOURCE_IVORY',
'RESOURCE_TRUFFLES',
'RESOURCE_HONEY',
--Sukritact's Resources
'RESOURCE_SUK_CAMEL',
'RESOURCE_SUK_CHEESE',
'RESOURCE_SUK_OBSIDIAN',
'RESOURCE_SUK_SHARK',
'RESOURCE_GOLD',
'RESOURCE_DLV_BISON',
--CIVITAS Resources
'RESOURCE_P0K_PENGUINS',
'RESOURCE_P0K_OPAL',
'RESOURCE_CVS_POMEGRANATES',
'RESOURCE_P0K_PAPYRUS',
'RESOURCE_P0K_MAPLE',
'RESOURCE_P0K_PLUMS',
--Latin American Resources
'RESOURCE_LEU_P0K_POTATOES',
'RESOURCE_LEU_P0K_CAPYBARAS',
'RESOURCE_LEU_P0K_COCA',
'RESOURCE_LEU_P0K_LLAMAS',
'RESOURCE_LEU_P0K_QUINOA',
'RESOURCE_LEU_P0K_YERBAMATE',
--Sukritact's Oceans
'RESOURCE_SUK_SQUID',
'RESOURCE_SUK_SEALS',
'RESOURCE_SUK_CORAL',
'RESOURCE_SUK_LOBSTER',
'RESOURCE_SUK_CAVIAR'
);
----------------------------------------------------------------------------------------------------------------------------
-- Setting the Icons (just reusing the colored Icons of the Resources)
----------------------------------------------------------------------------------------------------------------------------
UPDATE GA_Resource_Cultivation SET Icon = 'ICON_'|| ResourceType;
----------------------------------------------------------------------------------------------------------------------------
-- Types
----------------------------------------------------------------------------------------------------------------------------
INSERT OR IGNORE INTO Types(Type, Kind)
VALUES ('TRAIT_BONUS_RESOURCE_CULTIVATION', 'KIND_TRAIT'),
('TRAIT_LUXURY_RESOURCE_CULTIVATION', 'KIND_TRAIT');
----------------------------------------------------------------------------------------------------------------------------
-- Traits
----------------------------------------------------------------------------------------------------------------------------
INSERT OR IGNORE INTO Traits(TraitType, Name)
VALUES ('TRAIT_BONUS_RESOURCE_CULTIVATION', 'LOC_TRAIT_BONUS_RESOURCE_CULTIVATION_NAME'),
('TRAIT_LUXURY_RESOURCE_CULTIVATION', 'LOC_TRAIT_LUXURY_RESOURCE_CULTIVATION_NAME');
----------------------------------------------------------------------------------------------------------------------------
-- Valid Build Unit/ImprovementType, TraitType --Base Game Resources
----------------------------------------------------------------------------------------------------------------------------
--Plant Based Resources
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FARMER', ValidImprovementType = 'IMPROVEMENT_FARM', TraitType = 'TRAIT_BONUS_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_WHEAT';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FARMER', ValidImprovementType = 'IMPROVEMENT_FARM', TraitType = 'TRAIT_BONUS_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_RICE';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FARMER', ValidImprovementType = 'IMPROVEMENT_FARM', TraitType = 'TRAIT_BONUS_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_MAIZE' AND EXISTS (SELECT 1 FROM Resources WHERE ResourceType = 'RESOURCE_MAIZE');
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FARMER', ValidImprovementType = 'IMPROVEMENT_PLANTATION', TraitType = 'TRAIT_BONUS_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_BANANAS';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FARMER', ValidImprovementType = 'IMPROVEMENT_PLANTATION', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_CITRUS';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FARMER', ValidImprovementType = 'IMPROVEMENT_PLANTATION', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_COCOA';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FARMER', ValidImprovementType = 'IMPROVEMENT_PLANTATION', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_COFFEE';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FARMER', ValidImprovementType = 'IMPROVEMENT_PLANTATION', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_COTTON';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FARMER', ValidImprovementType = 'IMPROVEMENT_PLANTATION', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_DYES';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FARMER', ValidImprovementType = 'IMPROVEMENT_PLANTATION', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_INCENSE';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FARMER', ValidImprovementType = 'IMPROVEMENT_PLANTATION', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_OLIVES';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FARMER', ValidImprovementType = 'IMPROVEMENT_PLANTATION', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_SILK';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FARMER', ValidImprovementType = 'IMPROVEMENT_PLANTATION', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_SPICES';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FARMER', ValidImprovementType = 'IMPROVEMENT_PLANTATION', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_SUGAR';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FARMER', ValidImprovementType = 'IMPROVEMENT_PLANTATION', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_TEA';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FARMER', ValidImprovementType = 'IMPROVEMENT_PLANTATION', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_TOBACCO';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FARMER', ValidImprovementType = 'IMPROVEMENT_PLANTATION', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_WINE';
--Mine Resources
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_MINER', ValidImprovementType = 'IMPROVEMENT_MINE', TraitType = 'TRAIT_BONUS_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_COPPER';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_MINER', ValidImprovementType = 'IMPROVEMENT_QUARRY', TraitType = 'TRAIT_BONUS_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_STONE';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_MINER', ValidImprovementType = 'IMPROVEMENT_QUARRY', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_DIAMONDS';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_MINER', ValidImprovementType = 'IMPROVEMENT_QUARRY', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_GYPSUM';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_MINER', ValidImprovementType = 'IMPROVEMENT_QUARRY', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_JADE';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_MINER', ValidImprovementType = 'IMPROVEMENT_QUARRY', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_MARBLE';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_MINER', ValidImprovementType = 'IMPROVEMENT_MINE', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_MERCURY';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_MINER', ValidImprovementType = 'IMPROVEMENT_MINE', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_SALT';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_MINER', ValidImprovementType = 'IMPROVEMENT_MINE', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_SILVER';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_MINER', ValidImprovementType = 'IMPROVEMENT_MINE', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_AMBER';
--Water Resources
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FISHER', ValidImprovementType = 'IMPROVEMENT_FISHING_BOATS', TraitType = 'TRAIT_BONUS_RESOURCE_CULTIVATION', Domain = 'DOMAIN_SEA'
WHERE ResourceType = 'RESOURCE_CRABS';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FISHER', ValidImprovementType = 'IMPROVEMENT_FISHING_BOATS', TraitType = 'TRAIT_BONUS_RESOURCE_CULTIVATION', Domain = 'DOMAIN_SEA'
WHERE ResourceType = 'RESOURCE_FISH';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FISHER', ValidImprovementType = 'IMPROVEMENT_FISHING_BOATS', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION', Domain = 'DOMAIN_SEA'
WHERE ResourceType = 'RESOURCE_WHALES';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FISHER', ValidImprovementType = 'IMPROVEMENT_FISHING_BOATS', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION', Domain = 'DOMAIN_SEA'
WHERE ResourceType = 'RESOURCE_PEARLS';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FISHER', ValidImprovementType = 'IMPROVEMENT_FISHING_BOATS', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION', Domain = 'DOMAIN_SEA'
WHERE ResourceType = 'RESOURCE_TURTLES';
--Domestic Animal Resources
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_HERDMAN', ValidImprovementType = 'IMPROVEMENT_PASTURE', TraitType = 'TRAIT_BONUS_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_CATTLE';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_HERDMAN', ValidImprovementType = 'IMPROVEMENT_PASTURE', TraitType = 'TRAIT_BONUS_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_SHEEP';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_HERDMAN', ValidImprovementType = 'IMPROVEMENT_CAMP', TraitType = 'TRAIT_BONUS_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_DEER';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_HERDMAN', ValidImprovementType = 'IMPROVEMENT_CAMP', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_FURS';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_HERDMAN', ValidImprovementType = 'IMPROVEMENT_CAMP', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_IVORY';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_HERDMAN', ValidImprovementType = 'IMPROVEMENT_CAMP', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_TRUFFLES';
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_HERDMAN', ValidImprovementType = 'IMPROVEMENT_CAMP', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_HONEY' AND EXISTS (SELECT * FROM Resources WHERE ResourceType = 'RESOURCE_HONEY');
--Sukritact's Resources
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_HERDMAN', ValidImprovementType = 'IMPROVEMENT_PASTURE', TraitType = 'TRAIT_BONUS_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_SUK_CAMEL' AND EXISTS (SELECT * FROM Resources WHERE ResourceType = 'RESOURCE_SUK_CAMEL');
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_HERDMAN', ValidImprovementType = 'IMPROVEMENT_CAMP', TraitType = 'TRAIT_BONUS_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_DLV_BISON' AND EXISTS (SELECT * FROM Resources WHERE ResourceType = 'RESOURCE_DLV_BISON');
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_HERDMAN', ValidImprovementType = 'IMPROVEMENT_PASTURE', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_SUK_CHEESE' AND EXISTS (SELECT * FROM Resources WHERE ResourceType = 'RESOURCE_SUK_CHEESE');
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_MINER', ValidImprovementType = 'IMPROVEMENT_QUARRY', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_SUK_OBSIDIAN' AND EXISTS (SELECT * FROM Resources WHERE ResourceType = 'RESOURCE_SUK_OBSIDIAN');
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FISHER', ValidImprovementType = 'IMPROVEMENT_FISHING_BOATS', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION', Domain = 'DOMAIN_SEA'
WHERE ResourceType = 'RESOURCE_SUK_SHARK' AND EXISTS (SELECT * FROM Resources WHERE ResourceType = 'RESOURCE_SUK_SHARK');
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_MINER', ValidImprovementType = 'IMPROVEMENT_MINE', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_GOLD' AND EXISTS (SELECT * FROM Resources WHERE ResourceType = 'RESOURCE_GOLD');
--CIVITAS Resources
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_HERDMAN', ValidImprovementType = 'IMPROVEMENT_CAMP', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_P0K_PENGUINS' AND EXISTS (SELECT * FROM Resources WHERE ResourceType = 'RESOURCE_P0K_PENGUINS');
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_MINER', ValidImprovementType = 'IMPROVEMENT_MINE', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_P0K_OPAL' AND EXISTS (SELECT * FROM Resources WHERE ResourceType = 'RESOURCE_P0K_OPAL');
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FARMER', ValidImprovementType = 'IMPROVEMENT_PLANTATION', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_CVS_POMEGRANATES' AND EXISTS (SELECT * FROM Resources WHERE ResourceType = 'RESOURCE_CVS_POMEGRANATES');
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FARMER', ValidImprovementType = 'IMPROVEMENT_PLANTATION', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_P0K_PAPYRUS' AND EXISTS (SELECT * FROM Resources WHERE ResourceType = 'RESOURCE_P0K_PAPYRUS');
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FARMER', ValidImprovementType = 'IMPROVEMENT_PLANTATION', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_P0K_MAPLE' AND EXISTS (SELECT * FROM Resources WHERE ResourceType = 'RESOURCE_P0K_MAPLE');
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FARMER', ValidImprovementType = 'IMPROVEMENT_PLANTATION', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_P0K_PLUMS' AND EXISTS (SELECT * FROM Resources WHERE ResourceType = 'RESOURCE_P0K_PLUMS');
--Latin American Resources
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FARMER', ValidImprovementType = 'IMPROVEMENT_FARM', TraitType = 'TRAIT_BONUS_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_LEU_P0K_POTATOES' AND EXISTS (SELECT * FROM Resources WHERE ResourceType = 'RESOURCE_LEU_P0K_POTATOES');
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FARMER', ValidImprovementType = 'IMPROVEMENT_FARM', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_LEU_P0K_QUINOA' AND EXISTS (SELECT * FROM Resources WHERE ResourceType = 'RESOURCE_LEU_P0K_QUINOA');
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_HERDMAN', ValidImprovementType = 'IMPROVEMENT_CAMP', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_LEU_P0K_CAPYBARAS' AND EXISTS (SELECT * FROM Resources WHERE ResourceType = 'RESOURCE_LEU_P0K_CAPYBARAS');
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_HERDMAN', ValidImprovementType = 'IMPROVEMENT_PASTURE', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_LEU_P0K_LLAMAS' AND EXISTS (SELECT * FROM Resources WHERE ResourceType = 'RESOURCE_LEU_P0K_LLAMAS');
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FARMER', ValidImprovementType = 'IMPROVEMENT_PLANTATION', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_LEU_P0K_COCA' AND EXISTS (SELECT * FROM Resources WHERE ResourceType = 'RESOURCE_LEU_P0K_COCA');
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FARMER', ValidImprovementType = 'IMPROVEMENT_PLANTATION', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION'
WHERE ResourceType = 'RESOURCE_LEU_P0K_YERBAMATE' AND EXISTS (SELECT * FROM Resources WHERE ResourceType = 'RESOURCE_LEU_P0K_YERBAMATE');
--Sukritact's Oceans
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FISHER', ValidImprovementType = 'IMPROVEMENT_FISHING_BOATS', TraitType = 'TRAIT_BONUS_RESOURCE_CULTIVATION', Domain = 'DOMAIN_SEA'
WHERE ResourceType = 'RESOURCE_SUK_SQUID' AND EXISTS (SELECT * FROM Resources WHERE ResourceType = 'RESOURCE_SUK_SQUID');
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FISHER', ValidImprovementType = 'IMPROVEMENT_FISHING_BOATS', TraitType = 'TRAIT_BONUS_RESOURCE_CULTIVATION', Domain = 'DOMAIN_SEA'
WHERE ResourceType = 'RESOURCE_SUK_SEALS' AND EXISTS (SELECT * FROM Resources WHERE ResourceType = 'RESOURCE_SUK_SEALS');
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FISHER', ValidImprovementType = 'IMPROVEMENT_FISHING_BOATS', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION', Domain = 'DOMAIN_SEA'
WHERE ResourceType = 'RESOURCE_SUK_CORAL' AND EXISTS (SELECT * FROM Resources WHERE ResourceType = 'RESOURCE_SUK_CORAL');
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FISHER', ValidImprovementType = 'IMPROVEMENT_FISHING_BOATS', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION', Domain = 'DOMAIN_SEA'
WHERE ResourceType = 'RESOURCE_SUK_LOBSTER' AND EXISTS (SELECT * FROM Resources WHERE ResourceType = 'RESOURCE_SUK_LOBSTER');
UPDATE GA_Resource_Cultivation SET UnitType = 'UNIT_FISHER', ValidImprovementType = 'IMPROVEMENT_FISHING_BOATS', TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION', Domain = 'DOMAIN_SEA'
WHERE ResourceType = 'RESOURCE_SUK_CAVIAR' AND EXISTS (SELECT * FROM Resources WHERE ResourceType = 'RESOURCE_SUK_CAVIAR');
--==========================================================================================================================
----------------------------------------------------------------------------------------------------------------------------
-- Setting the Improvement Type of the Resources
----------------------------------------------------------------------------------------------------------------------------
UPDATE GA_Resource_Cultivation SET ImprovementType = 'IMPROVEMENT_CULTIVATE_'|| REPLACE(ResourceType, 'RESOURCE_','') WHERE ResourceCultivation = 0;
----------------------------------------------------------------------------------------------------------------------------
-- Types
----------------------------------------------------------------------------------------------------------------------------
INSERT OR IGNORE INTO Types(Type,Kind)
SELECT
ImprovementType as Type,
'KIND_IMPROVEMENT' as Kind
FROM
GA_Resource_Cultivation;
----------------------------------------------------------------------------------------------------------------------------
-- Improvements
----------------------------------------------------------------------------------------------------------------------------
INSERT OR IGNORE INTO Improvements(ImprovementType, Name, PrereqTech, PrereqCivic, Buildable, Description, PlunderType, Icon, TraitType, Housing, TilesRequired, CanBuildOutsideTerritory, Domain)
SELECT
ImprovementType,
'LOC_'|| ImprovementType ||'_NAME' AS Name,
PrereqTech,
PrereqCivic,
1 AS Buildable,
'LOC_'|| ImprovementType ||'_DESCRIPTION' AS Description,
'PLUNDER_NONE' AS PlunderType,
Icon,
TraitType,
Housing,
TilesRequired,
0 AS CanBuildOutsideTerritory,
Domain
FROM GA_Resource_Cultivation;
----------------------------------------------------------------------------------------------------------------------------
-- Improvement_ValidBuildUnits
----------------------------------------------------------------------------------------------------------------------------
INSERT OR IGNORE INTO Improvement_ValidBuildUnits(ImprovementType,UnitType)
SELECT
ImprovementType,
UnitType
FROM GA_Resource_Cultivation;
----------------------------------------------------------------------------------------------------------------------------
-- Improvement_ValidTerrains
----------------------------------------------------------------------------------------------------------------------------
INSERT OR IGNORE INTO Improvement_ValidTerrains(ImprovementType, TerrainType)
SELECT
DISTINCT
fg.ImprovementType,
vt.TerrainType
FROM GA_Resource_Cultivation fg
JOIN Resource_ValidTerrains vt ON fg.ResourceType = vt.ResourceType;
----------------------------------------------------------------------------------------------------------------------------
-- Improvement_ValidFeatures
----------------------------------------------------------------------------------------------------------------------------
INSERT OR IGNORE INTO Improvement_ValidFeatures(ImprovementType, FeatureType)
SELECT
DISTINCT
fg.ImprovementType,
vf.FeatureType
FROM GA_Resource_Cultivation fg
JOIN Resource_ValidFeatures vf ON fg.ResourceType = vf.ResourceType;
----------------------------------------------------------------------------------------------------------------------------
-- Improvement_YieldChanges
----------------------------------------------------------------------------------------------------------------------------
INSERT OR IGNORE INTO Improvement_YieldChanges(ImprovementType, YieldType, YieldChange)
SELECT
DISTINCT
fg.ImprovementType,
yg.YieldType,
yg.YieldChange
FROM GA_Resource_Cultivation AS fg
JOIN Resource_YieldChanges AS yg ON fg.ResourceType = yg.ResourceType;
--==========================================================================================================================
----------------------------------------------------------------------------------------------------------------------------
-- DistrictModifiers
----------------------------------------------------------------------------------------------------------------------------
INSERT OR IGNORE INTO DistrictModifiers(DistrictType, ModifierId)
SELECT
'DISTRICT_CITY_CENTER' AS DistrictType,
'GA_CITIES_CAN_CULTIVATE_'|| REPLACE(ResourceType, 'RESOURCE_','') AS ModifierId
FROM GA_Resource_Cultivation WHERE ResourceCultivation = 0 AND TraitType = 'TRAIT_BONUS_RESOURCE_CULTIVATION';
INSERT OR IGNORE INTO DistrictModifiers(DistrictType, ModifierId)
SELECT
'DISTRICT_CITY_CENTER' AS DistrictType,
'GA_CITY_CAN_CULTIVATE_'|| REPLACE(ResourceType, 'RESOURCE_','') AS ModifierId
FROM GA_Resource_Cultivation WHERE ResourceCultivation = 0 AND TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION';
----------------------------------------------------------------------------------------------------------------------------
-- Modifiers
----------------------------------------------------------------------------------------------------------------------------
--Bonus Resources Everywhere Resource per City
INSERT OR IGNORE INTO Modifiers(ModifierID, ModifierType, RunOnce, Permanent, OwnerRequirementSetId)
SELECT
'GA_CITIES_CAN_CULTIVATE_'|| REPLACE(ResourceType, 'RESOURCE_','') AS ModifierId,
'MODIFIER_PLAYER_CITIES_ATTACH_MODIFIER' AS ModifierType,
0,
1,
'GA_PLAYER_HAS_IMPROVED_'|| REPLACE(ResourceType, 'RESOURCE_','') AS OwnerRequirementSetId
FROM GA_Resource_Cultivation WHERE ResourceCultivation = 0 AND TraitType = 'TRAIT_BONUS_RESOURCE_CULTIVATION';
INSERT OR IGNORE INTO Modifiers(ModifierID, ModifierType, Permanent)
SELECT
'GA_CITY_CAN_CULTIVATE_'|| REPLACE(ResourceType, 'RESOURCE_','') AS ModifierId,
'MODIFIER_CITY_ADJUST_ALLOWED_IMPROVEMENT' AS ModifierType,
1
FROM GA_Resource_Cultivation WHERE ResourceCultivation = 0 AND TraitType = 'TRAIT_BONUS_RESOURCE_CULTIVATION';
--One City Luxury Resource Specialization
INSERT OR IGNORE INTO Modifiers(ModifierID, ModifierType, RunOnce, Permanent, SubjectRequirementSetId)
SELECT
'GA_CITY_CAN_CULTIVATE_'|| REPLACE(ResourceType, 'RESOURCE_','') AS ModifierId,
'MODIFIER_CITY_ADJUST_ALLOWED_IMPROVEMENT' AS ModifierType,
0,
0,
'GA_CITY_HAS_IMPROVED_'|| REPLACE(ResourceType, 'RESOURCE_','') ||'_PROPERTY_REQUIREMENTS' AS SubjectRequirementSetId
FROM GA_Resource_Cultivation WHERE ResourceCultivation = 0 AND TraitType = 'TRAIT_LUXURY_RESOURCE_CULTIVATION';
----------------------------------------------------------------------------------------------------------------------------
-- ModifierArguments
----------------------------------------------------------------------------------------------------------------------------
INSERT OR IGNORE INTO ModifierArguments(ModifierID, Name, Value)
SELECT
'GA_CITIES_CAN_CULTIVATE_'|| REPLACE(ResourceType, 'RESOURCE_','') AS ModifierId,
'ModifierId' AS Name,
'GA_CITY_CAN_CULTIVATE_'|| REPLACE(ResourceType, 'RESOURCE_','') AS Value
FROM GA_Resource_Cultivation WHERE ResourceCultivation = 0 AND TraitType = 'TRAIT_BONUS_RESOURCE_CULTIVATION';
INSERT OR IGNORE INTO ModifierArguments(ModifierID, Name, Value)
SELECT
'GA_CITY_CAN_CULTIVATE_'|| REPLACE(ResourceType, 'RESOURCE_','') AS ModifierId,
'ImprovementType' AS Name,
ImprovementType
FROM GA_Resource_Cultivation WHERE ResourceCultivation = 0;
----------------------------------------------------------------------------------------------------------------------------
-- RequirementSetRequirements
----------------------------------------------------------------------------------------------------------------------------
INSERT OR IGNORE INTO RequirementSetRequirements(RequirementSetId, RequirementId)
SELECT
'GA_PLAYER_HAS_IMPROVED_'|| REPLACE(ResourceType, 'RESOURCE_','') AS RequirementSetId,
'GA_REQUIRES_PLAYER_HAS_IMPROVED_'|| REPLACE(ResourceType, 'RESOURCE_','') AS RequirementId
FROM GA_Resource_Cultivation;
INSERT OR IGNORE INTO RequirementSetRequirements(RequirementSetId, RequirementId)
SELECT
'GA_CITY_HAS_IMPROVED_'|| REPLACE(ResourceType, 'RESOURCE_','') ||'_PROPERTY_REQUIREMENTS' AS RequirementSetId,
'REQUIRES_GA_'|| REPLACE(ResourceType, 'RESOURCE_','') ||'_PROPERTY' AS RequirementId
FROM GA_Resource_Cultivation WHERE NOT TraitType = 'TRAIT_BONUS_RESOURCE_CULTIVATION';
INSERT OR IGNORE INTO RequirementSetRequirements(RequirementSetId, RequirementId)
SELECT
'GA_CITY_HAS_IMPROVED_'|| REPLACE(ResourceType, 'RESOURCE_','') ||'_PROPERTY_REQUIREMENTS' AS RequirementSetId,
'GA_REQUIRES_PLAYER_HAS_IMPROVED_'|| REPLACE(ResourceType, 'RESOURCE_','') AS RequirementId
FROM GA_Resource_Cultivation WHERE NOT TraitType = 'TRAIT_BONUS_RESOURCE_CULTIVATION';
----------------------------------------------------------------------------------------------------------------------------
-- RequirementSets
----------------------------------------------------------------------------------------------------------------------------
INSERT OR IGNORE INTO RequirementSets(RequirementSetId, RequirementSetType)
SELECT
'GA_PLAYER_HAS_IMPROVED_'|| REPLACE(ResourceType, 'RESOURCE_','') AS RequirementSetId,
'REQUIREMENTSET_TEST_ALL' AS RequirementSetType
FROM GA_Resource_Cultivation;
INSERT OR IGNORE INTO RequirementSets(RequirementSetId, RequirementSetType)
SELECT
'GA_CITY_HAS_IMPROVED_'|| REPLACE(ResourceType, 'RESOURCE_','') ||'_PROPERTY_REQUIREMENTS' AS RequirementSetId,
'REQUIREMENTSET_TEST_ALL' AS RequirementSetType
FROM GA_Resource_Cultivation WHERE NOT TraitType = 'TRAIT_BONUS_RESOURCE_CULTIVATION';
----------------------------------------------------------------------------------------------------------------------------
-- Requirements
----------------------------------------------------------------------------------------------------------------------------
INSERT OR IGNORE INTO Requirements(RequirementId, RequirementType)
SELECT
'GA_REQUIRES_PLAYER_HAS_IMPROVED_'|| REPLACE(ResourceType, 'RESOURCE_','') AS RequirementId,
'REQUIREMENT_PLAYER_HAS_RESOURCE_IMPROVED' AS RequirementType
FROM GA_Resource_Cultivation;
INSERT OR IGNORE INTO Requirements(RequirementId, RequirementType)
SELECT
'GA_REQUIRES_CITY_HAS_IMPROVED_'|| REPLACE(ResourceType, 'RESOURCE_','') ||'_PROPERTY_REQUIREMENTS_MET' AS RequirementSetId,
'REQUIREMENT_REQUIREMENTSET_IS_MET' AS RequirementType
FROM GA_Resource_Cultivation WHERE NOT TraitType = 'TRAIT_BONUS_RESOURCE_CULTIVATION';
INSERT OR IGNORE INTO Requirements(RequirementId, RequirementType)
SELECT
'REQUIRES_GA_'|| REPLACE(ResourceType, 'RESOURCE_','') ||'_PROPERTY' AS RequirementSetId,
'REQUIREMENT_PLOT_PROPERTY_MATCHES' AS RequirementType
FROM GA_Resource_Cultivation WHERE NOT TraitType = 'TRAIT_BONUS_RESOURCE_CULTIVATION';
----------------------------------------------------------------------------------------------------------------------------
-- RequirementArguments
----------------------------------------------------------------------------------------------------------------------------
INSERT OR IGNORE INTO RequirementArguments(RequirementId, Name, Value)
SELECT
'GA_REQUIRES_PLAYER_HAS_IMPROVED_'|| REPLACE(ResourceType, 'RESOURCE_','') AS RequirementId,
'ResourceType' AS Name,
ResourceType
FROM GA_Resource_Cultivation;
INSERT OR IGNORE INTO RequirementArguments(RequirementId, Name, Value)
SELECT
'GA_REQUIRES_CITY_HAS_IMPROVED_'|| REPLACE(ResourceType, 'RESOURCE_','') ||'_PROPERTY_REQUIREMENTS_MET' AS RequirementId,
'RequirementSetId' AS Name,
'GA_'|| REPLACE(ResourceType, 'RESOURCE_','') ||'_PROPERTY_REQUIREMENTS' AS Value
FROM GA_Resource_Cultivation WHERE NOT TraitType = 'TRAIT_BONUS_RESOURCE_CULTIVATION';
INSERT OR IGNORE INTO RequirementArguments(RequirementId, Name, Value)
SELECT
'REQUIRES_GA_'|| REPLACE(ResourceType, 'RESOURCE_','') ||'_PROPERTY' AS RequirementSetId,
'PropertyName' AS Name,
'GA_PLAYER_'|| REPLACE(ResourceType, 'RESOURCE_','') ||'_MAX_AMOUNT' AS Value
FROM GA_Resource_Cultivation WHERE NOT TraitType = 'TRAIT_BONUS_RESOURCE_CULTIVATION';
INSERT OR IGNORE INTO RequirementArguments(RequirementId, Name, Value)
SELECT
'REQUIRES_GA_'|| REPLACE(ResourceType, 'RESOURCE_','') ||'_PROPERTY' AS RequirementSetId,
'PropertyMinimum' AS Name,
1 AS Value
FROM GA_Resource_Cultivation WHERE NOT TraitType = 'TRAIT_BONUS_RESOURCE_CULTIVATION';