--============================================================
-- YU - MOD SUPPORT ==========================================
--============================================================
-- Author: Lime
-- DateCreated: 1/9/2018 21:22:05
--------------------------------------------------------------
--	Mods to give support to:
--		JFD's Rule with Faith
--		Tomatekh's Historical Religions
--		Gedemon's Yet (not) Another Earth Maps Pack
--		Gedemon's Cordiform YnAEMP Map
--		
--------------------------------------------------------------

--============================================================
-- JFD's Rule with Faith =====================================
--============================================================

-- Inherently supported because of China
--	LESS WORK FOR ME!

--============================================================
-- Gedemon's Yet (not) Another Earth Maps Pack ===============
--============================================================
CREATE TABLE IF NOT EXISTS StartPosition (MapName TEXT, Civilization TEXT, Leader TEXT, X INT default 0, Y INT default 0);
INSERT INTO StartPosition
		(MapName,							Leader,					X,		Y)
VALUES	('GiantEarth',						'LEADER_LIME_CHINA_YU',	81,		60),
		('GreatestEarthMap',				'LEADER_LIME_CHINA_YU',	85,		52),
		('LargestEarth',					'LEADER_LIME_CHINA_YU',	108,	75),
		('CordiformEarth',					'LEADER_LIME_CHINA_YU',	59,		34);
	--	('TrueStartLocationEastAsia',		'LEADER_LIME_CHINA_YU',	,		),
	--	('EastAsia',						'LEADER_LIME_CHINA_YU',	,		);

--============================================================
-- Tomatekh's Historical Religions ===========================
--============================================================
UPDATE FavoredReligions
	SET ReligionType = 'RELIGION_TAOISM'	-- What the fuck do Chinese people believe in
	WHERE LeaderType = 'LEADER_LIME_CHINA_YU' 
	AND EXISTS (SELECT ReligionType FROM Religions WHERE ReligionType = 'RELIGION_TAOISM');

CREATE TRIGGER Lime_China_Yu_FavoredReligions 
	AFTER INSERT ON Religions WHEN 'RELIGION_TAOISM' = NEW.ReligionType 	
	BEGIN 
		INSERT OR REPLACE INTO FavoredReligions 
					(LeaderType, 				ReligionType) 
			VALUES 	('LEADER_LIME_CHINA_YU',	'RELIGION_TAOISM');
	END;