//Unit codes --- there is no error checking
//0 = Headquarters
//1 = Infantry Division
//2 = Small Corp
//3 = Large Corp
//4 = Army
//5 = Cavalry
//6 = Marine Division
//7 = Paratrooper Corp
//8 = Mountain Corp
//9 = Mechanized Corp
//10 = Armor
//11 = Air Superiority Group
//12 = Ground Attack Group
//13 = Tactical Air Group
//14 = Strategic Air Group
//15 = Submarine Group
//16 = Patrol Group
//17 = Cruiser Group
//18 = Battle Group
//19 = Carrier Group
//20 = Light Carrier Group
//21 = Patrol Craft Group

//advancement codes --- there is no error checking
//0 = Infantry
//1 = Anti-tank
//2 = Breakthrough
//3 = Heavy Armor
//4 = Interceptors
//5 = Escort Fighters
//6 = Fighter Bombers
//7 = Close Support
//8 = Strategic Bombing
//9 = Naval Air Training
//10 = Sonar and Electronics
//11 = Large Warships
//12 = Warships
//13 = Carrier Operations
//14 = Convoy Escort - not used for units
//15 = Attack Submarine
//16 = Long range Submarine

//unit attributes
//0 = Strength
//1 = Firearms
//2 = Guns
//3 = Artillery
//4 = Tanks
//5 = Air Combat
//6 = Tactical
//7 = Strategic
//8 = Naval Air
//9 = Surface
//10 = Anti-Sub
//11 = Anti-Air
//12 = Defense
//13 = Operation Points
//14 = Range (land units are 1)
//15 = Days
//16 = Production Cost
//17 = Oil Use
//18 = Availability (0=can't build, 1=can build)

//Japan gains Indian National Army (INA)
$GiveUnit
if_Date=1/1/1939
xyControl=41,41,Axis
lifespan=tillTrigger
actionCountry=8
unitID=4
//Singapore
name=Indian National Army
addReportTo=All
text=With the capture of Singapore, Rash Behari Bose forms the Indian National Army (INA) supported by Japan at Bangkok
xyArea=37,53
$End

//Malaya blockade special rule
$SuppressPort
if_Date=1/1/1939
//Kuala Lumpur, Bandar Lampung, and Saigon
xyControl=38,43,Axis
xyControl=41,35,Axis
xyControl=43,50,Axis
lifespan=continuous
//Singapore, Kota Bharu, Makhon So Thammarrat, Chimphon
xyArea=41,41,2
xyArea=38,47,2
xyArea=34,51,2
$End

$Information
if_Date=1/1/1939
lifespan=tillTrigger
xyControl=38,43,Axis
xyControl=41,35,Axis
xyControl=43,50,Axis
xyControl=41,41,Allies
addReportTo=All
text=With Kuala Lumpur, Bandar Lampung, Saigon in Japanese hands supply to Singapore, Kota Bharu, and Chumpton is cut off for the Allies
$End

//#################################
//Allies
//#################################

//USA Carrier groups arrive in Pearl Harbor after attack
$GiveUnit
if_Date=1/1/1939
lifespan=tillTrigger
actionCountry=3
unitID=19
//Pearl Harbor
name=Enterprise CV Div
text=CV Enterprise, CV Lexington, two cruiser groups, and one destroyer group arrive at Pearl Harbor
addReportTo=Allies
xyArea=166,68
$End

//USA Carrier groups arrive in Pearl Harbor after attack
$GiveUnit
if_Date=1/1/1939
lifespan=tillTrigger
actionCountry=3
unitID=19
//Pearl Harbor
name=Lexington CV Div
xyArea=166,68
$End

//USA DD group arrives in Pearl Harbor after attack
$GiveUnit
if_Date=1/1/1939
lifespan=tillTrigger
actionCountry=3
unitID=16
//Pearl Harbor
xyArea=166,68
$End

//USA CA group arrives in Pearl Harbor after attack
$GiveUnit
if_Date=1/1/1939
lifespan=tillTrigger
actionCountry=3
unitID=17
name=San Francisco CA Sqd
//Pearl Harbor
xyArea=166,68
$End

//USA CA group arrives in Pearl Harbor after attack
$GiveUnit
if_Date=1/1/1939
lifespan=tillTrigger
actionCountry=3
unitID=17
name=Salt Lake City CA Sqd
//Pearl Harbor
xyArea=166,68
$End

$Information
if_Date=12/23/1941
lifespan=tillTrigger
actionCountry=3
text=CV Yorktown, CV Saratoga, BB Colorado, and two destroyer groups are ready for action on the West Coast.
addReportTo=Allies
$End


//If Japan invades USA
$GiveUnit
if_Date=1/1/1939
actionCountry=3
//Japan lands in USA
landUnitInRadius=194,86,1,20,Axis
lifespan=tillTrigger
unitID=3
advancement=0
xyArea=197,89
text=Midwest and East Coast national guard are called in to reinforce American forces on the West coast
addReportTo=All
$End

$GiveUnit
if_Date=1/1/1939
actionCountry=3
//Japan lands in USA
landUnitInRadius=194,86,1,20,Axis
lifespan=tillTrigger
unitID=11
advancement=2
xyArea=197,84
addReportTo=All
$End

$GiveUnit
if_Date=1/1/1939
actionCountry=3
//Japan lands in USA
landUnitInRadius=194,86,1,20,Axis
lifespan=tillTrigger
unitID=10
advancement=2
xyArea=197,89
addReportTo=All
$End

$GiveUnit
if_Date=1/1/1939
actionCountry=3
//Japan lands in USA
landUnitInRadius=194,86,1,20,Axis
lifespan=tillTrigger
unitID=3
advancement=0
xyArea=197,89
addReportTo=All
$End

$GiveUnit
if_Date=1/1/1939
actionCountry=3
//Japan lands in USA
landUnitInRadius=194,86,1,20,Axis
lifespan=tillTrigger
unitID=0
advancement=1
xyArea=194,86
addReportTo=All
$End

//Canada calls up reserves also
$GiveUnit
if_Date=1/1/1939
actionCountry=15
//Japan lands in USA
landUnitInRadius=194,86,1,20,Axis
lifespan=tillTrigger
unitID=3
advancement=0
xyArea=197,100
addReportTo=All
$End

$GiveUnit
if_Date=1/1/1939
actionCountry=15
//Japan lands in USA
landUnitInRadius=194,86,1,20,Axis
lifespan=tillTrigger
unitID=11
advancement=3
xyArea=197,98
addReportTo=All
$End

$GiveUnit
if_Date=1/1/1939
actionCountry=15
//Japan lands in USA
landUnitInRadius=194,86,1,20,Axis
lifespan=tillTrigger
unitID=0
advancement=1
xyArea=197,98
addReportTo=All
$End

//USSR increases entry if Japan doesn't keep 160 man garrison with 10 hexes
$ChangeEntry
if_Date=1/1/1939
if_Country=4
if_Alliance=Neutral
//less than 160 total strength points
landStrengthInRadius=65,91,-160,10,Axis
lifespan=continuous
targetCountry=4
entryShift=5
text=Japan is under garrisoned in Manchuria. 160 land strength is required. USSR +5% entry status
addReportTo=All
$End

//USSR increases entry 1943
$ChangeEntry
if_Date=1/1/1943
if_Country=4
if_Alliance=Neutral
lifespan=tillTrigger
targetCountry=4
entryShift=40
$End

//USSR increases entry 1943
$ChangeEntry
if_Date=6/1/1943
if_Country=4
if_Alliance=Neutral
lifespan=tillTrigger
targetCountry=4
entryShift=25
$End

//USSR increases entry 1944
$ChangeEntry
if_Date=1/1/1944
if_Country=4
if_Alliance=Neutral
lifespan=tillTrigger
targetCountry=4
entryShift=20
$End

//Mongolia joins the Allies
$ChangeEntry
if_Date=8/9/1945
if_Country=4
if_Alliance=Allies
lifespan=tillTrigger
targetCountry=34
entryShift=200
$End

//USSR declares war on Japan
$ChangeEntry
if_Date=8/9/1945
if_Country=4
if_Alliance=Neutral
lifespan=tillTrigger
targetCountry=4
entryShift=200
$End

//USSR at 100% message for players
$Information
if_Date=1/1/1939
if_Country=4
if_Alliance=Allies
lifespan=tillTrigger
text=The USSR has joined the Western Allies and may declare war on all other countries that are neutral or the Axis.
addReportTo=Allies
$End

//UK and India get jungle fighter in 1943
$ModifyCountry
if_Date=6/1/1943
actionCountry=1
lifespan=tillTrigger
jungleFighterOn
text=UK and India learn the tactics and operations of jungle fighting.
addReportTo=All
$End

$ModifyCountry
if_Date=6/1/1943
actionCountry=25
lifespan=tillTrigger
jungleFighterOn
text=The UK and India learn the tactics and operations of jungle fighting.
addReportTo=All
$End

$ModifyCountry
if_Date=1/1/1944
actionCountry=3
lifespan=tillTrigger
jungleFighterOn
text=The USA learns the tactics and operations of jungle fighting.
addReportTo=All
$End

//##########################################
//UK give A.I. transports and landing craft
$ModifyCountry
if_Date=3/1/1942
actionCountry=1
lifespan=tillTrigger
AIOnlyEvent=Allies
transports=10
landingCraft=10
$End

$ModifyCountry
if_Date=6/1/1942
actionCountry=1
lifespan=tillTrigger
AIOnlyEvent=Allies
transports=10
landingCraft=10
$End

$ModifyCountry
if_Date=9/1/1942
actionCountry=1
lifespan=tillTrigger
AIOnlyEvent=Allies
transports=10
landingCraft=10
$End

$ModifyCountry
if_Date=1/1/1943
actionCountry=1
lifespan=tillTrigger
AIOnlyEvent=Allies
transports=10
landingCraft=10
$End

$ModifyCountry
if_Date=3/1/1943
actionCountry=1
lifespan=tillTrigger
AIOnlyEvent=Allies
transports=10
landingCraft=10
$End

$ModifyCountry
if_Date=6/1/1943
actionCountry=1
lifespan=tillTrigger
AIOnlyEvent=Allies
transports=10
landingCraft=10
$End

$ModifyCountry
if_Date=9/1/1943
actionCountry=1
lifespan=tillTrigger
AIOnlyEvent=Allies
transports=10
landingCraft=10
$End

$ModifyCountry
if_Date=1/1/1944
actionCountry=1
lifespan=tillTrigger
AIOnlyEvent=Allies
transports=10
landingCraft=10
$End

//##########################################
//USA give A.I. transports and landing craft
$ModifyCountry
if_Date=3/1/1942
actionCountry=3
lifespan=tillTrigger
AIOnlyEvent=Allies
transports=20
landingCraft=10
$End

$ModifyCountry
if_Date=6/1/1942
actionCountry=3
lifespan=tillTrigger
AIOnlyEvent=Allies
transports=20
landingCraft=10
$End

$ModifyCountry
if_Date=9/1/1942
actionCountry=3
lifespan=tillTrigger
AIOnlyEvent=Allies
transports=20
landingCraft=10
$End

$ModifyCountry
if_Date=1/1/1943
actionCountry=3
lifespan=tillTrigger
AIOnlyEvent=Allies
transports=20
landingCraft=10
$End

$ModifyCountry
if_Date=3/1/1943
actionCountry=3
lifespan=tillTrigger
AIOnlyEvent=Allies
transports=20
landingCraft=10
$End

$ModifyCountry
if_Date=6/1/1943
actionCountry=3
lifespan=tillTrigger
AIOnlyEvent=Allies
transports=40
landingCraft=40
$End

$ModifyCountry
if_Date=9/1/1943
actionCountry=3
lifespan=tillTrigger
AIOnlyEvent=Allies
transports=60
landingCraft=60
$End

$ModifyCountry
if_Date=1/1/1944
actionCountry=3
lifespan=tillTrigger
AIOnlyEvent=Allies
transports=30
landingCraft=200
$End

//########################
//Give Allied A.I. escorts
//1942
$ModifyCountry
if_Date=6/1/1942
actionCountry=1
lifespan=tillTrigger
AIOnlyEvent=Allies
escorts=12
$End

//1943
$ModifyCountry
if_Date=6/1/1943
actionCountry=1
lifespan=tillTrigger
AIOnlyEvent=Allies
escorts=12
$End


//1944
$ModifyCountry
if_Date=6/1/1944
actionCountry=1
lifespan=tillTrigger
AIOnlyEvent=Allies
escorts=7
$End


//1942
$ModifyCountry
if_Date=6/1/1942
actionCountry=3
lifespan=tillTrigger
AIOnlyEvent=Allies
escorts=15
$End

//1943
$ModifyCountry
if_Date=6/1/1943
actionCountry=3
lifespan=tillTrigger
AIOnlyEvent=Allies
escorts=30
$End

//1944
$ModifyCountry
if_Date=6/1/1944
actionCountry=3
lifespan=tillTrigger
AIOnlyEvent=Allies
escorts=30
$End

//USA Oil comes online 1942
$GiveResource
if_Date=7/1/1942
actionCountry=3
lifespan=tillTrigger
xyArea=197,90,48
addReportTo=Allies
text=Allied oil production and storage facilities improvements become available +40 oil at 197,90
addReportTo=Allies
$End

//USA Oil comes online 1942
$GiveResource
if_Date=10/1/1942
actionCountry=3
lifespan=tillTrigger
xyArea=197,91,48
addReportTo=Allies
text=Allied oil production and storage facilities improvements become available +40 oil at 197,90
addReportTo=Allies
$End

//USA Oil comes online 1943
$GiveResource
if_Date=1/1/1943
actionCountry=3
lifespan=tillTrigger
xyArea=197,83,48
addReportTo=Allies
text=Allied oil production and storage facilities improvements become available +40 oil at 197,83
addReportTo=Allies
$End

//USA Oil comes online 1943
$GiveResource
if_Date=4/1/1943
actionCountry=3
lifespan=tillTrigger
xyArea=197,82,48
addReportTo=Allies
text=Allied oil production and storage facilities improvements become available +40 oil at 197,82
addReportTo=Allies
$End

//USA submarines improve torpedoes
$ChangeUnitAttributes
if_Date=8/1/1942
lifespan=tillTrigger
targetCountry=3
unitID=15
stats=3,0,0,0,0,0,0,0,0,2,0,0,6,2,3,100,80,1,1
text=USA's engineers correct the depth problems plaguing the Mark 14 torpedoes. +1 surface combat USA submarines.
addReportTo=Allies
$End

//USA submarines improve torpedoes
$ChangeUnitAttributes
if_Date=1/1/1943
lifespan=tillTrigger
targetCountry=3
unitID=15
stats=3,0,0,0,0,0,0,0,0,3,0,0,6,2,3,100,80,1,1
addReportTo=Allies
text=USA's Submariners in the field correct more problems with the Mark 14 torpedo. +1 surface combat USA submarines.
$End

//USA submarines improve torpedoes
$ChangeUnitAttributes
if_Date=5/1/1943
lifespan=tillTrigger
targetCountry=3
unitID=15
stats=3,0,0,0,0,0,0,0,0,4,0,0,6,2,3,100,80,1,1
addReportTo=Allies
text=USA's navy and engineers fully repair all the defects in the Mark 14 torpedo. +1 surface combat USA submarines.
$End


//USA extra supply depots for the large Philippines invasion
$ModifyCountry
if_Date=3/1/1945
actionCountry=3
lifespan=tillTrigger
AIOnlyEvent=Allies
supplyTruck=100
$End

//Burma Road
$ModifyCountry
if_Date=1/1/1939
lifespan=continuous
actionCountry=5
PP=10
OP=3
xyControl=30,63,Allies
xyControl=30,64,Allies
xyControl=31,56,Allies
xyControl=31,57,Allies
xyControl=31,58,Allies
xyControl=31,59,Allies
xyControl=31,60,Allies
xyControl=31,61,Allies
xyControl=31,62,Allies
xyControl=31,64,Allies
xyControl=32,65,Allies
xyControl=33,64,Allies
xyControl=34,65,Allies
xyControl=34,66,Allies
xyControl=35,66,Allies
xyControl=36,66,Allies
xyControl=37,66,Allies
xyControl=38,66,Allies
xyControl=39,65,Allies
xyControl=40,66,Allies
xyControl=41,66,Allies
xyControl=41,68,Allies
xyControl=41,69,Allies
xyControl=42,67,Allies
xyControl=42,68,Allies
xyControl=42,70,Allies
xyControl=43,70,Allies
xyControl=44,71,Allies
addReportTo=All
text=Allies deliver resources to China via the Burma Road: +5 production, +2 oil
$End

//Air Hump
$ModifyCountry
if_Date=4/1/1942
lifespan=continuous
actionCountry=5
PP=5
OP=1
//Ledo
xyControl=30,67,Allies
//Kunming
xyControl=39,65,Allies
addReportTo=All
text=Allies deliver resources to China via the Air Hump From Ledo to Kunming: +5 production, +1 oil
$End

//Ledo Road
$ModifyCountry
if_Date=5/20/1945
lifespan=continuous
actionCountry=5
PP=10
OP=10
xyControl=23,63,Allies
xyControl=24,64,Allies
xyControl=25,64,Allies
xyControl=25,65,Allies
xyControl=25,66,Allies
xyControl=26,66,Allies
xyControl=27,66,Allies
xyControl=28,66,Allies
xyControl=29,66,Allies
xyControl=30,67,Allies
xyControl=31,65,Allies
xyControl=31,66,Allies
xyControl=32,65,Allies
xyControl=33,64,Allies
xyControl=34,65,Allies
xyControl=34,66,Allies
xyControl=35,66,Allies
xyControl=36,66,Allies
xyControl=37,66,Allies
xyControl=38,66,Allies
xyControl=39,65,Allies
xyControl=40,66,Allies
xyControl=41,66,Allies
xyControl=41,68,Allies
xyControl=41,69,Allies
xyControl=42,67,Allies
xyControl=42,68,Allies
xyControl=42,70,Allies
xyControl=43,70,Allies
xyControl=44,71,Allies
addReportTo=All
text=Allies deliver resources to China via the Ledo Road: +10 production, +10 oil
$End

//Japan and USSR oil agreement minor flavor agreement
$ModifyCountry
if_Date=3/30/1944
actionCountry=8
lifespan=tillTrigger
OP=5
text=Japan and the USSR make an agreement on the Okha oil fields. Japan +5 oil.
addReportTo=Allies
$End

//USA is allowed in Sea of Japan
$GiveResource
if_Date=8/1/1943
actionCountry=8
lifespan=tillTrigger
//remove mine in Sea of Japan
xyArea=70,77,0
addReportTo=Allies
text=Allied submarine improvements allow submarines access to the Sea of Japan. Minefield at 70, 77 removed.
addReportTo=All
$End

//Japanese may not get supply at Pearl Harbor if the Allies control these victory locations
$SuppressPort
if_Date=1/1/1939
lifespan=continuous
//Kwajalein
xyControl=126,53,Allies
//Pearl Harbor
xyArea=166,68,1
xyArea=168,68,1
xyArea=169,66,1
$End

//Japanese may not get supply at Pearl Harbor if the Allies control these victory locations
$SuppressPort
if_Date=1/1/1939
lifespan=continuous
//Truk
xyControl=95,50,Allies
//Pearl Harbor
xyArea=166,68,1
xyArea=168,68,1
xyArea=169,66,1
$End

//Japanese may not get supply at Pearl Harbor if the Allies control these victory locations
$SuppressPort
if_Date=1/1/1939
lifespan=continuous
//Saipan
xyControl=95,50,Allies
//Pearl Harbor
xyArea=166,68,1
xyArea=168,68,1
xyArea=169,66,1
$End

//Japanese may not get supply in East Australia if the Allies control these victory locations
$SuppressPort
if_Date=1/1/1939
lifespan=continuous
//Rabaul
xyControl=95,35,Allies
//Pearl Harbor
xyArea=78,8,1
xyArea=80,6,1
xyArea=85,2,1
xyArea=87,25,1
xyArea=88,22,1
xyArea=90,20,1
xyArea=93,6,1
xyArea=93,17,1
xyArea=94,8,1
xyArea=95,13,1
$End

//Japanese may not get supply in East Australia if the Allies control Rabaul
$SuppressPort
if_Date=1/1/1939
lifespan=continuous
//Rabaul
xyControl=95,35,Allies
//Rabaul
xyArea=78,8,1
xyArea=80,6,1
xyArea=82,24,1
xyArea=85,2,1
xyArea=87,25,1
xyArea=88,22,1
xyArea=90,20,1
xyArea=93,6,1
xyArea=93,17,1
xyArea=94,8,1
xyArea=95,13,1
$End

//Japanese may not get supply in West Australia if the Allies control Batavia
$SuppressPort
if_Date=1/1/1939
lifespan=continuous
//Batavia
xyControl=44,35,Allies
//Pearl Harbor
xyArea=51,16,1
xyArea=52,12,1
xyArea=53,7,1
xyArea=53,9,1
xyArea=57,6,1
xyArea=57,20,1
xyArea=63,23,1
xyArea=70,29,1
$End

//Atomic bombs
$GiveResource
if_Date=8/12/1945
//Hiroshima, Nagasaki
xyControl=73,77,Axis
xyControl=70,75,Axis
actionCountry=8
lifespan=once
xyArea=73,77,131
xyArea=70,75,132
addReportTo=All
text=The USA drops the atomic bomb on Hiroshima and Nagasaki.
$End

$GiveResource
if_Date=8/12/1945
//Hiroshima, Nagasaki
xyControl=73,77,Allies
xyControl=70,75,Axis
actionCountry=8
lifespan=once
xyArea=70,75,132
addReportTo=All
text=The USA drops the atomic bomb on Nagasaki.
$End

$GiveResource
if_Date=8/12/1945
//Hiroshima, Nagasaki
xyControl=73,77,Axis
xyControl=70,75,Allies
actionCountry=8
lifespan=once
xyArea=73,77,131
addReportTo=All
text=The USA drops the atomic bomb on Hiroshima.
$End