-- Readme
-- Author: Typhlomence (thread at CivFanatics: http://forums.civfanatics.com/showthread.php?t=528199)
-- DateCreated: 3/19/2016 12:03:31 AM
--------------------------------------------------------------

This was supposed to be released on April Fools' day and so is a bit of a joke civ, but obviously I missed that. I hope you enjoy it anyway. :)

This mod adds two civilizations based on Danny Choo's Culture Japan and Mirai Millennium, both with the sweet and reliable Mirai Suenaga as their leader! Each civilization in this mod has a different focus - Culture Japan, as you can expect, is designed around spreading Tourism and winning Cultural Victories, while Sorunia (Mirai Millennium) promotes high Production and strong military units.

This mod requries Brave New World. It also includes compatibility with:
	- Ryoga's Unique Cultural Influence
	- JFD's Cultural Diversity (Oriental, uses the same as vanilla Japan. If using the Cultural Diversity soundtrack, the Japanese songs will be added to this mod's soundtrack instead of replacing them.)
	- JFD's Rise to Power
	- Bingles' Civ IV Leader Traits (Creative and Philosophical for Culture Japan, Inventive and Protective for Sorunia)
	- JFD's Exploration Continued Expanded
	- Hazel's Map Labels
	- Vicevirtuoso's Wish for the World* **
	- Sukritact's Modular City Info Stack
	- JFD's and Pouakai's Mercenaries
	- JFD's Cities in Development**
	- Ethnic Units / R.E.D. Modpack (Japanese units - it also adds a Japanese Fighter to Ethnic Units, as the original Ethnic Units does not include one because of the Zero UU)
	- Enlightenment Era*
	- YnAEMP v23 (Culture Japan only - starting location is Tokyo)
Compatibility with Events and Decisions will come later, though you will get a custom Cultural Development event.
* No specific support, but should work fine
** UnitPanel.lua may cause issues, however - see "Known issues"

Mod options can be changed via the MiraiOptions.sql file. The leader changing mechanics of Culture Japan can be altered in this file (including switching off Mirai's third, "bonus" appearance), as well as changing whether the Culture Japan civilization is called "Culture Japan" or "Japan" in-game.

If you encounter any issues, please enable logging (http://forums.civfanatics.com/showthread.php?t=487482), and set the "bDebug" variable in any Lua files in the mod that have it to "true", and let me know if any Lua errors occur.

Culture Japan:

UA: Forever Sweet Seventeen - Recieve Golden Age points every time you complete a World Wonder. Tourism output of Great Works is increased by 5% for every Declaration of Friendship you have with another civilization.
	- The amount of Golden Age points you receive is 50% of the Wonder's Production cost, and takes game speed into account.
	- While not affecting gameplay, Mirai has different appearances she can take depending on the terrain around her current capital city. If around cold terrain like Snow or Tundra, she will wear her winter uniform, otherwise she will wear her summer uniform. There's also a third appearance you can get in other circumstances, but that's for you to discover... :P

UU: Smart Doll (Worker) - It works faster than the standard unit, and can ignore enemy Zones of Control. It also has two rather special abilites:
	- The first allows the Smart Doll to upgrade to a military unit, the Smart Doll Plus, in times of war. This Melee unit is available at any time, and will have 80% of the Combat Strength of the strongest Melee or Gunpowder unit you can currently build. It automatically gets upgraded when you discover a technology that unlocks a new unit of those types, though the Smart Doll Plus must be brought into your territory first.
	- The second lets you gift the Smart Doll to another major civilization for Tourism, as long as you are not at war with them, and are generating at least 50 Tourism per turn (scaled by game speed). The amount of Tourism generated by gifting the unit is a fifth of that of a Great Musician, and only affects the civilization you gifted the Smart Doll to. This action can only be performed once per Smart Doll. The Smart Doll Plus retains this ability, and provides double the Tourism against the receiver of the gift - triple if the unit is above level five. This ability will still work if another unit somehow receives the Smart Doll's promotion.
		- The upgrading ability of the Smart Doll only works for non-Culture Japan civilizations if they already own a Smart Doll Plus. This is so you don't have to worry about your Smart Doll gifts being used against you, if you don't want to bolster the recepient's military.
		- If another civilization is given a Smart Doll Plus, the combat strength will be reset and will then be recalculated on what *their* strongest Melee or Gunpowder unit is. This means it is possible for a Smart Doll Plus to lose or gain strength on being gifted.
	- If playing with JFD's Exploration Continued Expanded, Smart Dolls and their upgrade start with immunities to Scurvy and Disease.

UB: Convention Centre (Museum) - It includes an additional slot for Great Works and produces +2 Local Happiness in the city. Also, when its theming bonus is in effect, the city will enter a 'We Love the King Day' every time you expend a cultural Great Person.
	- The WLTKD generated by the Convention Centre is a fixed 5 turns, though any existing WLTKD, regardless of source, will be extended by this effect.
	- The theming bonuses for the Convention Centre have the same requirements as the normal Musuem, though they provide double the Tourism, partly to offset the challenge of getting three required Great Works instead of two.

Peace Diplomacy Track: Mirai Dance (Mirai Music)
War Diplomacy Track: Condition RED (Sega Touring Car Championship)

Sorunia:

UA: Mirai Millennium - Every time a city is founded, there is a chance of discovering sources of the Bonus Resource Sorunix. After the discovery of Flight, all cities gain the ability to Airlift units.
	- Sorunix is a resource introduced along this civilization. Its base yield is 1 Production, and when improved by a Mine or Offshore Platform, it will also produce 1 Science. If a city is working an improved Sorunix tile when a Melee unit is built, the unit will receive a promotion that gives a 25% Combat Bonus against other Melee and Gunpowder units. This is kept on upgrade (I added this so that Sournia had more than just some extra yields at the start of the game). If you are working two or more improved sources, Armoured units will also gain a promotion that gives them an extra movement point and allows them to heal an additional 10 hit points each turn.
	- When Sorunia founds a city, there is a 4/8 chance of spawning one source of Sorunix, a 2/8 chance of spawning two sources, and a 1/8 chance of spawning three or no sources. Sorunix can spawn on both land or water tiles, but will never spawn on:
		- a tile that already has a resource;
		- an impassible tile;
		- a mountain;
		- a lake;
		- an improved tile;
		- a tile owned by another civiliation; and
		- the tile you founded the city on.
	If there are not enough valid tiles to place the number of sources picked when founding it city, the code will try to place as many as possible. If Sorunix is placed on a tile that is not yet visible, the tile will be revealed. Finally, your first city will always spawn with at least two sources, as long as there's room.
	- The Airlift ability applies to any city you obtain, immediately when you obtain it (with the possible exception of when it is done by another mod's Lua function), as long as you have Flight researched.

UU: Retrograde Suit Trooper (Paratrooper) - This unit has a greater paradrop range than the unit it replaces, and also causes defending units to retreat if it inflicts more damage on them than it receives. A defender who cannot retreat instead takes extra damage. This unit's Combat Strength will also increase depending on the number of Sorunix resources the city is working when it is constructed. This unit is classed as a Melee unit, rather than a Gunpowder unit like the normal Paratrooper.
	- Paradrop range is 15, from the normal Paratrooper's 9.
	- Every improved source of Sorunix worked by the city will give a Retrograde Suit Trooper an additional 5 Combat Strength. This does mean that if you have closely settled cities and get a lucky Sorunix distribution, you can create some horrifically strong (for the era) Retrograde Suit Troopers...
	- The Solar Marine Crimson Force promotion is kept on upgrade.

UI: Magma Array - Available at Steam Power, they can be only be constructed on hills or certain resources. The Magma Array boosts the Production of a tile by 3, and any adjacent mountain tiles will further increase it by 1 each. Building the Magma Array on a source of Sorunix will provide an additional 2 Production on top of the resource's base yield. However, if built on another compatible resource, the base Production yield of the Magma Array will be negated, and in exchange it will provide 2 Science.
	- Apart from Sorunix, Magma Arrays can be built on sources of Coal, Oil, Gems and Uranium. They will still be connected to your trade network, and also make the Magma Array a valid improvement on non-hill tiles.

Peace Diplomacy Track: Sukirai (Mirai Music)
War Diplomacy Track: Fight (Gundam 00 OST 2)

Also includes the following music tracks, all from Mirai Music. The Japanese songs included in the base game (identified by the Cultural Diversity soundtrack) will also play for these civs.
- Mirai Mechanism
- Mirai Moment
- Spiral
- Pizziciato Mind
- Ivory
- Mirai Cafe
- Mirai Element
- Mirai Channel

Includes unique diplomacy responses for the following leaders:
	- Culture Japan Mirai:
		- Various civilizations from the history of Japan:
			- Oda Nobunaga (Firaxis)
			- Meiji (JFD)
			- Tojo (JFD)
			- All of the civilizations from Homusubi's Rising Sun civilization pack
			- Sho Hashi of the Ryukyu (Hiram)
			- Hattori Hanso (_bane)
			- Archer from Fate Stay Night (Vice Virtuoso - he's fictional but is represented in that mod as leading Japan)
	- Because there are two civilizations led by the same person and so are more likely to appear in the same game, I took the liberty of making unique responses for a mirror match, as well - these should appear no matter what combinations of Mirais you have in a game!

1 (16/04/2015)
	- Initial version

Notes:
- So that the AI doesn't upgrade all its Smart Dolls to Smart Doll Plusses during wartime and loses the ability to make improvements, I have limited them to not be able to upgrade Smart Dolls if doing so would leave them with less than half the (working) Smart Dolls as they have cities.
- By default, Mirai's appearance changing is disabled when YnAEMP is active, so that she uses her summer appearance when her capital is Tokyo. This behaviour can be disabled in MiraiOptions.sql.
- The code for setting unique diplomacy responses to certain leaders does not reset them back to normal if you start a new game without returning to the main menu first. Therefore, it is best to quit to the main menu first if you want to start a new game or load an existing, seperate one.

Known issues:
- This mod includes a custom UnitPanel.lua in order to make the Smart Doll's gifting ability work. For this reason, it will most likely conflict with other mods that have their own UnitPanel.lua. The Smart Doll and its promotion should not appear at all if you don't play with Culture Japan in the game, so you can rename this file if you wish to play a game with Sorunia and another mod that includes UnitPanel.lua. The following mods include the same or a compatible UnitPanel.lua, and so will not cause issues:
	- Bunbunbaru Newspaper (possibly)
	- JFD's Cities in Development (rename or delete this mod's unit panel)
	- Madoka Magica - Wish for the World (rename or delete this mod's unit panel)
	- Madoka Magica Civilization Pack - Rebellion
	- Metal Gear Solid -- Militaires Sans Frontieres Civilization [BNW] (rename or delete this mod's unit panel)
	- Touhou - Evil Spirits
	- Touhou - Tanuki
- Because of this implementation of the Smart Doll's Tourism gifting, the regular gifting option will still appear. You can still use it for gifting the unit to a City State, however. It also means that it will not work at all in multiplayer without causing a de-sync. For this reason, the ability will be disabled in a multiplayer game, though the other abilities of the Smart Doll will remain intact.
- Because changing the AI requires code changes, I've attempted to add Lua that brute forces the AI to use Smart Dolls as gifts under circumstances where it might be beneficial for it. I have no idea whether it will work effectively, though.

Credits:
- Vice Virtuoso: Dynamic 2D Leaderscreens, UnitPanel.lua, voices for Retrograde Suit Trooper
- BouncyMischa: help with Custom Missions
- saibotlieh: various Civ 4 models I used to make the unit models for this mod
- Lord Tirian: Cybernetic Consciousness Cityset for Civ 4, part of which I used for the centre section and textures of the Magma Array
- JFD: MasterSupportFile.sql for supporting various mods, and the YnAEMP location for Tokyo
- danrell: Nakajima Ki-44 Shoki unit model
- Outpost 2: Divided Destiny: sounds for selecting Smart Doll (Plus)
- Danny Choo: for Culture Japan, and especially making Photoshop files for Mirai available
	- Iizuki Tasuku: art of Mirai used for the Dawn of Man screens (http://www.dannychoo.com/en/post/26586/Iizuki+Tasuku.html)
	- Koizumi Amane: art of Mirai used for the diplomacy screen and leader icons (http://www.dannychoo.com/en/post/26834/Koizumi+Amane.html)
- Image credits:
	- Tokyo Big Sight (background for Mirai's summer diplomacy screen) - By Douglas Paul Perkins - Own work, CC BY 3.0, https://commons.wikimedia.org/w/index.php?curid=33978872
	- Hama-rikyuu Garden, Tokyo, Japan (background for Mirai's winter diplomacy screen) - By Daderot - Own work, CC0, https://commons.wikimedia.org/w/index.php?curid=38788173
	- Furuzamami Beach, Okinawa Prefecture, Japan (background for Mirai's bonus diplomacy screen) - By Hashi photo - Hashi photo, CC BY 3.0, https://commons.wikimedia.org/w/index.php?curid=9072332
	- Toki Messe (icon for Convention Centre) - By HIRO - HIRO, Public Domain, https://commons.wikimedia.org/w/index.php?curid=8257585
	- Selection image for Sorunia - Pinakes, http://www.dannychoo.com/en/posts/slide/139582