-- credits
-- Author: AAAAAAAAAA
-- DateCreated: aa/aa/aaaa aa:aa:aa AA
--------------------------------------------------------------
--------------------------------------------------------------
Keiki Haniyasushin: 

Leader Icon: https://twitter.com/dance_a_blue/status/1543236188383100928
Unit Model: https://forums.civfanatics.com/resources/civ5-ancient-unit-pack-08-japan.19555/
Map Image: https://twitter.com/prp_z/status/1178983790170923008
DoM Image: https://www.pixiv.net/artworks/86550172
Diplo Screen Image: Stage 6 background - Wily Beast and Weakest Creature
Unit Icon 1: https://commons.wikimedia.org/wiki/File:Haniwa_-_Warrior_in_Keiko_Armor.jpg
Unit Icon 2: https://en.wikipedia.org/wiki/Haniwa#/media/File:Warrior_in_Keiko_Armor,_National_Treasure,_Kofun_period,_6th_century,_haniwa_(terracotta_tomb_figurine)_from_Iizuka-machi,_Ota-shi,_Gunma_-_Tokyo_National_Museum_-_DSC06425.JPG
Unit Icon 3: https://www.pixiv.net/artworks/118667860
Peace Music: Fukashin Ryouiki no Kengen - O-Life Japan
War Music: The Idola of the Creators - ASARI
LUA Snippets: Senshi's Japan (Toyotomi Hideyoshi)

--------------------------------------------------------------
Junko: 

Leader Icon: https://twitter.com/Insanityfactor/status/841142667329208320
Unit Model: https://forums.civfanatics.com/resources/siam-mongol-riflemen.20057/
Map Image: https://www.pixiv.net/artworks/62815822
DoM Image: https://twitter.com/Shee_take/status/1533109810493030400
Diplo Screen Image: Sea of Tranquility (Far Side) - Touhou: Lost Word
Unit Icon: https://www.pixiv.net/artworks/94159562
Building Icon: https://www.deviantart.com/gabo-7/art/The-Lunar-Capital-468778471
Peace Music: https://www.youtube.com/watch?v=CblzWWdcGSA
War Music: Pure Furies ~ Whereabouts of the Heart - Dr. Latency's Freak Report
LUA Snippets: ExplosiveWatermelon's Paris (Louis Charles Delescluze),  Agla's The Aghlabids (Ibrahim II)
--------------------------------------------------------------
Kagerou Imaizumi: 

Leader Icon: https://twitter.com/kumadano/status/575799007177351168/photo/1
Unit Model: https://forums.civfanatics.com/resources/naga-myrmidon.24864/, https://forums.civfanatics.com/resources/warhammer-dark-elf-pack.25774/
Map Image: Strange Creators of Outer World / Who's Who of Humans & Youkai in Gensokyo
DoM Image: http://www.pixiv.net/member_illust.php?mode=medium&illust_id=56608657
Diplo Screen Image: Bamboo Forest stage - Urban Legend in Limbo
Unit Icon 1: https://www.pixiv.net/artworks/72503380
Unit Icon 2: https://twitter.com/Ku_ra_main/status/1442461494550020101
Peace Music: Mysterious Purification Rod - Double Dealing Character
War Music: Strange, Strange Instruments - Double Dealing Character
LUA Snippets: DuskJockey's Panama (Manuel Amador), DuskJockey's Canada (Wilfrid Laurier), JFD's Maori (Potatau Te Wherowhero)

--------------------------------------------------------------
Miyoi Okunoda: 

Leader Icon: http://suoiretsym.com/wp-content/gallery/graffiti/1205.jpg
Unit Model: https://forums.civfanatics.com/resources/civ-5-viet-cong.22497/ 
Map Image: https://ak794itomugi.tumblr.com/post/705438284466241536
DoM Image: https://www.pixiv.net/artworks/80872970
Diplo Screen Image: Geidontei Interior - Touhou: Lost Word
Unit Icon: https://media.istockphoto.com/id/1367249118/vector/a-businessman-who-gets-drunk-with-beer.jpg?s=612x612&w=0&k=20&c=x5gJOk2rUu4IhhlUkyxvMZByCuY4xcsmjdcFzvAvD84=
Building Icon: Geidontei - Yukkuri Hunt
Resource Icons: https://souga.biz/
Peace Music: Drunken Moon - Touhou Kinpatsu Shoujo Chiikoujou Iinkai (Twilight Ensemble album)
War Music: Chains of One's Past - Prismriver Orchestra
LUA Snippets: DuskJockey's Tagalogs (Kalangitan), Sas' Katanga (Moise Tshombe)

--------------------------------------------------------------
Minamitsu Murasa: 

Leader Icon: https://x.com/mirage333/status/1078280071234777088
Unit Model: https://forums.civfanatics.com/resources/civ5-hms-warrior-ironclad-frigate.22555/
Map Image: https://www.pixiv.net/en/artworks/53995107
DoM Image: https://twitter.com/Houdukixx/status/725444269041840129
Diplo Screen Image: Sunken Ship - Touhou: Lost Word
Unit Icon: Stock clipart of a ghost ship
Improvement Model: https://steamcommunity.com/sharedfiles/filedetails/?id=438187330 (Exploration Continued Expanded)
Peace Music: Captain's Orders - Gu Xiang De Ge (send_off album)
War Music: vacuous vortex - Sound.AVE
LUA Snippets: TopHat's Ket (Olgit), PorkBean's Quilombo dos Palmares (Zumbi), Zharques' Tui Manu'a (Matelita), JFD's The Kingdom of Italy (Victor Emmanuel III)

--------------------------------------------------------------
Chimata Tenkyuu: 

Leader Icon: https://www.pixiv.net/en/artworks/89618936
Unit Model: https://forums.civfanatics.com/resources/civ5-master-weaver-colonization.21994/, https://forums.civfanatics.com/resources/medieval-free-company-poleaxe-great-axe.24628/
Map Image: https://x.com/AKI_kikumugi/status/1414240577911017474
DoM Image: https://www.pixiv.net/en/artworks/91607078
Diplo Screen Image: https://pngtree.com/freebackground/mountain-and-river-silhouette-with-full-flower-moon-halo-photo_10571702.html
Unit Icon 1: https://www.pixiv.net/en/artworks/89618936
Unit Icon 2: https://www.pixiv.net/en/artworks/89618936
Peace Music: https://www.nicovideo.jp/watch/sm39711245
War Music: Marche no Koe naki Koe - O-Life Japan
LUA Snippets: Urdnot_Scott's The Mughal Empire (Aurangzeb), DuskJockey's Tagalogs (Kalangitan), TopHat's Ayutthaya (Narai)

--------------------------------------------------------------
Others:

Unit and Building Icon Backgrounds: DJSHenninger
Diplo Screen Leader Images: dairi
Civilopedia Texts: en.touhouwiki.net, wikipedia.org

Disclaimer: I do not own any of these. All belong to their respective owners. 

--------------------------------------------------------------

<!--UniqueLuxuryCities>1</UniqueLuxuryCities-->
<!--UniqueLuxuryQuantity>2</UniqueLuxuryQuantity-->

<CannotBeChosen>true</CannotBeChosen>

INSERT INTO Unit_Builds (UnitType, BuildType)
SELECT Type, 'BUILD_SHIPWRECK' 
FROM Units WHERE Domain = 'DOMAIN_SEA';

<Unit_Builds>
	<Row>
		<UnitType>UNIT_WORKBOAT</UnitType>
		<BuildType>BUILD_SHIPWRECK</BuildType>
	</Row>
</Unit_Builds>

function Murasa_RespawnNavalDeath(playerID, unitID, unitType, iX, iY, bDelay, killerID)
	if (bDelay) then return end
	local pPlayer = Players[playerID]
	local playerTeam = Teams[pPlayer:GetTeam()]
	if killerID == -1 then return end
	if pPlayerID == killerID then return end
	if (not pPlayer) then return end
	if (not pPlayer:IsAlive()) then return end
	if (not pPlayer:GetCivilizationType() == iCiv) then return end
		local plot = Map.GetPlot(iX, iY)
		local unit = GameInfo.Units[unitType]
		if g_GetRandom(1,100) <= 50 then
			local pNearestCity = nil;
			local iNearestDistance = 1000000;
			for cityIndex = 0, pPlayer:GetNumCities() - 1, 1 do
				local pCity = pPlayer:GetCityByID(cityIndex);
				if (pCity ~= nil) and pCity:IsCoastal() then
					if unit:GetDomainType() == GameInfoTypes["DOMAIN_SEA"] then
						local iDistance = Map.PlotDistance(iX, iY, pCity:GetX(), pCity:GetY());
						if (iDistance < iNearestDistance) then
							iNearestDistance = iDistance;
							pNearestCity = pCity;
						end
					end
				end
			end
		if (pNearestCity ~= nil) then
			pPlayer:InitUnit(unit, pNearestCity:GetX(), pNearestCity:GetY())
			return true;
		end
	end		
end

local unitYuurei						    = GameInfoTypes["UNIT_FUNAYUUREI"]
local promotionAfterRandom					= GameInfoTypes["PROMOTION_FUNAYUUREI_AFTERRANDOM"]
local promotionFunayuurei					= GameInfoTypes["PROMOTION_FUNAYUUREI"]
local promotionCapsizing					= GameInfoTypes["PROMOTION_FUNAYUUREI_HIT"]
local unitclassYuurei						= GameInfoTypes["UNITCLASS_PRIVATEER"]


function Yuurei_UnitSetDamage(playerID, unitID, newDamage, oldDamage)
	if (newDamage <= oldDamage) then return end
	local pPlayer = Players[playerID]
	if pPlayer and pPlayer:IsAlive() and (pPlayer:GetNumUnits() > 0) then
		local pUnit = pPlayer:GetUnitByID(unitID)
		if pUnit and (not pUnit:IsHasPromotion(promotionAfterRandom)) then
			local pUnitPlot = pUnit:GetPlot()	
			if pUnitPlot then
				for pPlot in PlotAreaSweepIterator(pUnitPlot, 4, SECTOR_NORTH, DIRECTION_CLOCKWISE, DIRECTION_OUTWARDS, CENTRE_EXCLUDE) do
					local iNumUnits = pPlot:GetNumUnits()
					if iNumUnits > 0 then
						for i = 0, (iNumUnits - 1), 1 do
							local pPlotUnit = pPlot:GetUnit(i)
							if pPlotUnit and pPlotUnit:IsHasPromotion(promotionAfterRandom) then
								pPlotUnit:SetHasPromotion(promotionAfterRandom, false)
								pPlotUnit:SetHasPromotion(promotionFunayuurei, true)
								pUnit:SetHasPromotion(promotionCapsizing, true)
								return
							end
						end
					end
				end
			end
		end
	end
end  

function Yuurei_PlayerDoTurn(playerID)
	local pPlayer = Players[playerID]
	local pUnit = pPlayer:GetUnitByID(unitID)
	if pUnit and pUnit:IsHasPromotion(promotionCapsizing) and (pUnit:GetMoves() >= 60) then
		pUnit:ChangeMoves(-120)
		print("move reduced")
		pUnit:SetHasPromotion(promotionCapsizing, false)
	end
end

Events.SerialEventUnitSetDamage.Add(Yuurei_UnitSetDamage) 
GameEvents.PlayerDoTurn.Add(Yuurei_PlayerDoTurn)

Band walker no gozen niji - ShibayanRecords (TOHO BOSSA NOVA 11 album)

local mineHimemushiBuild = JFD_GetRandom(1, 5)
				if mineHimemushiBuild == 1 then
					pPlot:SetResourceType(GameInfoTypes.RESOURCE_SILVER, 1)
				elseif mineHimemushiBuild == 2 then
					pPlot:SetResourceType(GameInfoTypes.RESOURCE_GEMS, 1)
				elseif mineHimemushiBuild == 3 then
					pPlot:SetResourceType(GameInfoTypes.RESOURCE_GOLD, 1)
				elseif mineHimemushiBuild == 4 then
					pPlot:SetResourceType(GameInfoTypes.RESOURCE_COPPER, 1)
				elseif mineHimemushiBuild == 5 then
					pPlot:SetResourceType(GameInfoTypes.RESOURCE_SALT, 1)
				end
