
PluginHeader{
	RailSimVersion = 2.00;
	PluginType = Train;
	PluginName = "東京地下鉄 05系 北綾瀬支線";
	PluginAuthor = "n";
	IconTexture = "icon.png";
	Description = "！先頭車同士の連結は対応していません！";
	Description = "-列車パターン(参考)";
	Description = "・96S(毎日終日)・98S(平日朝のみ)";
	Description = "　[ﾜﾝﾏﾝ 綾瀬-北綾瀬] 綾瀬 - 北綾瀬";
	Description = "　[ﾜﾝﾏﾝ 北綾瀬] 綾瀬 → 北綾瀬(入庫)";
}
TrainInfo{
	FrontLimit = 10.00;
	TailLimit = -10.00;
	MaxVelocity = 110.0;
	MaxAcceleration = 3.3;
	MaxDeceleration = 3.7;
	DoorClosingTime = 5.0;
}
DefineSwitch "■基本設定"{
}
DefineSwitch "電源"{
GroupCommon = "n05c電源";
	Entry = "入";
	Entry = "切";
}
DefineSwitch "パンタ高さ"{
	GroupCommon = "n05cpt";
	Entry = "自動(基準：シンプルカテナリ)";
	Entry = "剛体架線";
}
DefineSwitch "■灯火類設定-"{
}
DefineSwitch "前照灯"{
GroupCommon = "n05c前照灯";
	Entry = "自動";
	Entry = "入";
	Entry = "切";
}
DefineSwitch "尾灯"{
GroupCommon = "n05c尾灯";
	Entry = "自動";
	Entry = "入(入替)";
	Entry = "切";
}
DefineSwitch "レンズフレア"{
GroupCommon = "n05cLF";
	Entry = "入";
	Entry = "切";
}
DefineSwitch "運転室灯"{
GroupCommon = "n05c運転室灯";
	Entry = "自動";
	Entry = "入";
	Entry = "切";
}
DefineSwitch "客室照明"{
GroupCommon = "n05c客室灯";
	Entry = "入";
	Entry = "切";
}
DefineSwitch "■列車設定"{
}
DefineSwitch "行先"{
GroupCommon = "n05c行先";
	Entry = "無表示";
	Entry = "96S ワンマン 綾瀬-北綾瀬";
	Entry = "96S ワンマン 北綾瀬";
	Entry = "98S ワンマン 綾瀬-北綾瀬";
	Entry = "98S ワンマン 北綾瀬";
	Entry = "80S 回送";
	Entry = "82S 試運転";
}
DefineSwitch "■車両設定"{
}
DefineSwitch "編成"{
GroupCommon = "n05c編成";
	Entry = "06";
	Entry = "13";
}
DefineSwitch "号車"{
	Entry = "1号車(綾瀬方先頭)";	//( 07-100)
	Entry = "2号車";
	Entry = "3号車(北綾瀬方先頭)";	//( 07-000)
}
DefineSwitch "仕様"{
GroupCommon = "n05c仕様";
	Entry = "メトロ1";
	Entry = "メトロ2";
}
DefineSwitch "遮光幕"{
	Entry = "自動";
	Entry = "開";
	Entry = "閉";
}
DefineSwitch "床下汚し"{
GroupCommon = "n05c床下汚し";
//	Entry = "切";
	Entry = "入";
}
DefineSwitch "簡易影"{
	GroupCommon = "n05c簡易陰";
	Entry = "自動";
	Entry = "切";
}
DefineSwitch "PBR"{
	GroupCommon = "n05cPBR";
	Entry = "準備中";
}
DefineAnimation "C19C20"{
	Frame = "tex/LED.png", 90;
	ShiftTexture = 0.0, 0.0;
	Frame = "tex/LED.png", 90;
	ShiftTexture = 0.0, 0.0625;
}
DefineAnimation "C20"{
	Frame = "tex/LED.png", 90;
	ShiftTexture = 0.0, 0.0;
	Frame = "tex/LED.png", 90;
	ShiftTexture = 0.0, 0.125;
}
PrimaryAssembly{
	Axle "wheel1"{
		ModelFileName = "wheel.x";
		CastShadow = no;
		AlphaZeroTest = 0,1;
		Diameter = 0.86;
		Symmetric = 16;
		Coord = (7.95,0.43);
	}
	Axle "wheel2"{
		ModelFileName = "wheel.x";
		CastShadow = no;
		AlphaZeroTest = 0,1;
		Diameter = 0.86;
		Symmetric = 16;
		Coord = (5.85,0.43);
	}
	Axle "wheel3"{
		ModelFileName = "wheel.x";
		CastShadow = no;
		AlphaZeroTest = 0,1;
		Diameter = 0.86;
		Symmetric = 16;

		Coord = (-7.95,0.43);
	}
	Axle "wheel4"{
		ModelFileName = "wheel.x";
		CastShadow = no;
		AlphaZeroTest = 0,1;
		Diameter = 0.86;
		Symmetric = 16;
		Coord = (-5.85,0.43);
	}
	Body "Bogie1"{
		ModelFileName = "bogie_101.x";
		ApplySwitch "床下汚し"{
			Case 1:
				ShiftTexture = 0, 0.0, 0.5;
				ShiftTexture = 1, 0.0, 0.5;
				ShiftTexture = 2, 0.0, 0.5;
				ShiftTexture = 3, 0.0, 0.5;
		}
		JointZY "wheel1"{
			AttachCoord = (0,0);
			LocalCoord = (1.05,0);
		}
		JointZY "wheel2"{
			AttachCoord = (0,0);
			LocalCoord = (-1.05,0);
		}
	}
	Body "Bogie2"{
		ModelFileName = "bogie_101.x";
		Turn = yes;
		ApplySwitch "床下汚し"{
			Case 1:
				ShiftTexture = 0, 0.0, 0.5;
				ShiftTexture = 1, 0.0, 0.5;
				ShiftTexture = 2, 0.0, 0.5;
				ShiftTexture = 3, 0.0, 0.5;
		}
		JointZY "wheel3"{
			AttachCoord = (0,0);
			LocalCoord = (1.05,0);
		}
		JointZY "wheel4"{
			AttachCoord = (0,0);
			LocalCoord = (-1.05,0);
		}
	}
	Body "Dummy"{
		ModelFileName = "";
		JointZY "Bogie1"{
			AttachCoord = (0.0, 0.57);
			LocalCoord = (6.9, 1.0);
		}
		JointZY "Bogie2"{
			AttachCoord = (0.0, 0.57);
			LocalCoord = (-6.9, 1.0);
		}
	}
	Object3D "Doorll"{
		ModelFileName = "Doorl.x";
		Transparent = 3;
		If "電源"==0 && "客室照明"==0{
				ChangeMaterial{
					MaterialID = 0;
					Emissive = 1.0, 1.0, 1.0;
				}
　　　　　　　　}
		If "_DOOR1"{
			StaticMove{
				Displacement = (0.0, 0.0, 0.6);
				PreAnimationDelay = 1.0;
				AnimationTime = 1.5;
				 PreReverseDelay = 0.5;
				ReverseTime = 1.5;
			}
			StaticMove{
				Displacement = (0.0, 0.0, 0.05);
				PreAnimationDelay = 2.5;
				AnimationTime = 0.5;
				 PreReverseDelay = 2.0;
				ReverseTime = 0.5;
			}
		}
		Joint3D "Dummy"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}

	Object3D "Doorlr"{
		ModelFileName = "Doorr.x";
		Transparent = 3;
		If "電源"==0 && "客室照明"==0{
			ChangeMaterial{
				MaterialID = 0;
				Emissive = 1.0, 1.0, 1.0;
			}
　　　　　　}
		If "_DOOR1" {
			StaticMove{
				Displacement = (0.0, 0.0, -0.6);
				PreAnimationDelay = 1.0;
				AnimationTime = 1.5;
				 PreReverseDelay = 0.5;
				ReverseTime = 1.5;
			}
			StaticMove{
				Displacement = (0.0, 0.0, -0.05);
				PreAnimationDelay = 2.5;
				AnimationTime = 0.5;
				 PreReverseDelay = 2.0;
				ReverseTime = 0.5;
			}
		}
		Joint3D "Dummy"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}
	Object3D "Doorrl"{
		ModelFileName = "Doorr.x";
		Transparent = 3;
		If "電源"==0 && "客室照明"==0{
			ChangeMaterial{
				MaterialID = 0;
				Emissive = 1.0, 1.0, 1.0;
			}
　　　　　　}
		If "_DOOR2"{
			StaticMove{
				Displacement = (0.0, 0.0, -0.6);
				PreAnimationDelay = 1.0;
				AnimationTime = 1.5;
				 PreReverseDelay = 0.5;
				ReverseTime = 1.5;
			}
			StaticMove{
				Displacement = (0.0, 0.0, -0.05);
				PreAnimationDelay = 2.5;
				AnimationTime = 0.5;
				 PreReverseDelay = 2.0;
				ReverseTime = 0.5;
			}
		}
		Joint3D "Dummy"{
			AttachCoord = (0.0, 0.0, 0.0);
			AttachDir = (0.0, 0.0, -1.0);
		}
	}

	Object3D "Doorrr"{
		ModelFileName = "Doorl.x";
		Transparent = 3;
		If "電源"==0 && "客室照明"==0{
				ChangeMaterial{
					MaterialID = 0;
					Emissive = 1.0, 1.0, 1.0;
				}
　　　　　　　　}
		If "_DOOR2" {
			StaticMove{
				Displacement = (0.0, 0.0, 0.6);
				PreAnimationDelay = 1.0;
				AnimationTime = 1.5;
				 PreReverseDelay = 0.5;
				ReverseTime = 1.5;
			}
			StaticMove{
				Displacement = (0.0, 0.0, 0.05);
				PreAnimationDelay = 2.5;
				AnimationTime = 0.5;
				 PreReverseDelay = 2.0;
				ReverseTime = 0.5;
			}
		}
		Joint3D "Dummy"{
			AttachCoord = (0.0, 0.0, 0.0);
			AttachDir = (0.0, 0.0, -1.0);
		}
	}






	Object3D "LED"{
		ModelFileName = "led.x";
		//NoShadow = 1,2,3,4;
		ApplySwitch "号車"{
		Case 1:
			ChangeModel = "", 1.0;
		}
		If !"電源"&& !"_CONNECT1"{
			ApplySwitch "行先"{
			Case 1,2,3,4,5,6:
				ChangeAlpha = 1, 1.0;
				ChangeAlpha = 2, 1.0;
				ChangeAlpha = 3, 1.0;
				ChangeAlpha = 4, 1.0;
			Case 1:
				SetAnimation = 1, "C19C20";
			Case 2:
				SetAnimation = 1, "C20";
			Case 3:
				SetAnimation = 1, "C19C20";
				ShiftTexture = 3, -0.125, 0.3125;
			Case 4:
				SetAnimation = 1, "C20";
				ShiftTexture = 3, -0.125, 0.3125;
			Case 5:
				ShiftTexture = 1, 0.0, 0.1875;
				ShiftTexture = 2, -0.125, 0.25;
				ShiftTexture = 3, -0.125, -0.0625;
			Case 6:
				ShiftTexture = 1, 0.0, 0.25;
				ShiftTexture = 2, -0.125, 0.25;
				ShiftTexture = 3, -0.125, 0.0625;
			}
		}
		Joint3D "Dummy"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}
	Object3D "Light"{
		ModelFileName = "Light_1.x";
		NoShadow = 2,3;
		ApplySwitch "号車"{
		Case 1:
			ChangeModel = "", 1.0;
		}
		If "仕様"==0{
			ChangeModel = "Light_0.x", 1.0;
		}
		If !"電源"&& !"_CONNECT1"{
			If ("前照灯"==0&&!"_FRONT")||"前照灯"==1{
				ChangeAlpha = 2, 1.0;
			}
			If ("尾灯"==0&&"_FRONT")||"尾灯"==1{
				ChangeAlpha = 3, 1.0;
			}	
		}
		Joint3D "Dummy"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}
	Object3D "MainBody"{
		ModelFileName = "body_100.x";
		Transparent = 40,41,42,43,45,46,47,48,50;
		//Transparent = 59,60,61,62,63;
		If ("遮光幕"==0 && !"_FRONT"&&!"_CONNECT1"&&"_NIGHT")||"遮光幕"==2{
			ShiftTexture = 44, 0.25, 0.0;
		}Else{
			Transparent = 44;
		}

		If "電源"==0{
			If "客室照明"==0{
				ChangeMaterial{
					MaterialID = 12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,32,33,34;
					Emissive = 1.0, 1.0, 1.0;
　　　　　	　　		}
			}
			If "運転室灯"==1 || ("運転室灯"==0 && "_FRONT"){
					ChangeMaterial{
						MaterialID = 35,36;
						Emissive = 1.0, 1.0, 1.0;
　　　　　	　　		}
			}
		}
		ApplySwitch "号車"{
		Case 1:
			ChangeModel = "body_200.x", 1.0;
		Case 2:
			ShiftTexture = 52, 0.0625, 0.0;
		}
		ApplySwitch "仕様"{
		Case 1:
			ShiftTexture = 47, 0.0, 0.3125;
		}
		ApplySwitch "編成"{
		Case 0:
			ApplySwitch "号車"{
			Case 2:
				ShiftTexture = 40, 0.25, 0.0;
				ShiftTexture = 41, 0.25, 0.0;
				ShiftTexture = 42, 0.25, 0.0;
			}
		Case 1:
			ApplySwitch "号車"{
			Case 0:
				ShiftTexture = 40, 0.0, 0.0625;
				ShiftTexture = 41, 0.0, 0.0625;
				ShiftTexture = 42, 0.0, 0.0625;
			Case 2:
				ShiftTexture = 40, 0.25, 0.0625;
				ShiftTexture = 41, 0.25, 0.0625;
				ShiftTexture = 42, 0.25, 0.0625;
			}
			ShiftTexture = 39, 0.03125, 0.0;
		}
		Joint3D "Dummy"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}
	Object3D "yuka"{
		ModelFileName = "";
		ApplySwitch "床下汚し"{
			Case 1:
				ChangeTexture = 0, "tex/床下1.png";
		}
		ApplySwitch "号車"{
			Case 0:ChangeModel = "yuka100.x", 1.0;
			Case 1:ChangeModel = "yuka200.x", 1.0;
			Case 2:ChangeModel = "yuka100.x", 1.0;
		}
		Joint3D "Dummy"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}
	Object3D "antenna"{
		ModelFileName = "";
		If "仕様"==1{
			ChangeModel = "antenna.x", 1.0;
		}
		Joint3D "Dummy"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}
	Object3D "Doorl"{
		ModelFileName = "tojime.x";
		StaticRotation{
			RotationAxis = (0.0, 1.0, 0.0);
			RotationAngle = 180;
		}
		If "編成" <=5 && "仕様" ==3{
			ChangeModel = "tojime1.x", 1.0;
		}
		If "_DOOR2"{
			StaticRotation{
				RotationAxis = (0.0, 1.0, 0.0);
				RotationAngle = 180;
				PreAnimationDelay = 1.0;
				AnimationTime = 0.0;
				 PreReverseDelay = 2.5;
				ReverseTime = 0.0;
			}
		}
		Joint3D "MainBody"{
			AttachCoord = (1.4, 3.25, -0.48);
		}
	}
	Object3D "Doorr"{
		ModelFileName = "tojime.x";
		If "_DOOR1"{
			StaticRotation{
				RotationAxis = (0.0, 1.0, 0.0);
				RotationAngle = 180;
				PreAnimationDelay = 1.0;
				AnimationTime = 0.0;
				 PreReverseDelay = 2.5;
				ReverseTime = 0.0;
			}
		}
		Joint3D "MainBody"{
			AttachCoord = (-1.4, 3.25, 0.48);
		}
	}
	Object3D "ptparts"{
		ModelFileName = "";
		If "号車" ==1{
			ChangeModel = "ptparts.x", 1.0;
		}
		Joint3D "MainBody"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}
	Object3D "HishiBase1"{
		ModelFileName = "";
		Joint3D "MainBody"{
			AttachCoord = (0.0, 3.81, 6.9);
			AttachDir = (0.0, 0.0, -1.0);
		}
	}
	Object3D "HishiShoe1"{
		ModelFileName = "";
		If "号車" ==1{
			ChangeModel = "HishiShoe.x", 1.0;
		}
		ApplySwitch "電源"{
		Case 0:
		ApplySwitch "パンタ高さ"{
		Case 0:
			StaticMove{
				Displacement = (0.0, 0.95, 0.0);
				PreAnimationDelay = 0.1;
				AnimationTime = 1.0;
			}
		Case 1:
			StaticMove{
				Displacement = (0.0, 0.26, 0.0);
				PreAnimationDelay = 0.1;
				AnimationTime = 1.0;
			}
		}
		}
		Joint3D "HishiBase1"{
			AttachCoord = (0.0, 0.33, 0.0);
		}
	}
	TriangleZY{
		Link "HishiArm-y-z1"{
			ModelFileName = "";
			If "号車" ==1{
				ChangeModel = "HishiArm-y.x", 1.0;
			}
			JointZYX "HishiBase1"{
				AttachCoord = (0.485, 0.05);
				LocalCoord = (0.0, 0.0);
			}
			LinkCoord = (0.99, 0.00);
		}
		Link "HishiArmy-z1"{
			ModelFileName = "";
			If "号車" ==1{
				ChangeModel = "HishiArmy.x", 1.0;
			}
			JointZYX "HishiShoe1"{
				AttachCoord = (0.0, -0.12);
				LocalCoord = (0.0, 0.0);
			}
			LinkCoord = (1.48, -0.00);
		}
	}
	TriangleZY{
		Link "HishiArmyz1"{
			ModelFileName = "";
			If "号車" ==1{
				ChangeModel = "HishiArmy.x", 1.0;
			}
			JointZYX "HishiShoe1"{
				AttachCoord = (0.0, -0.12);
				LocalCoord = (0.0, 0.0);
			}
			LinkCoord = (1.48, 0.0);
		}
		Link "HishiArm-yz1"{
			ModelFileName = "";
			If "号車" ==1{
				ChangeModel = "HishiArm-y.x", 1.0;
			}
			JointZYX "HishiBase1"{
				AttachCoord = (-0.485, 0.05);
				LocalCoord = (0.0, 0.00);
			}
			LinkCoord = (0.99, 0.00);
		}
	}
	Object3D "HishiBase2"{
		ModelFileName = "";
		Joint3D "MainBody"{
			AttachCoord = (0.0, 3.81, -6.9);
			AttachDir = (0.0, 0.0, -1.0);
		}
	}
	Object3D "HishiShoe2"{
		ModelFileName = "";
		If "号車" ==1{
			ChangeModel = "HishiShoe.x", 1.0;
		}
		ApplySwitch "電源"{
		Case 0:
		ApplySwitch "パンタ高さ"{
		Case 0:
			StaticMove{
				Displacement = (0.0, 0.95, 0.0);
				PreAnimationDelay = 0.1;
				AnimationTime = 1.0;
			}
		Case 1:
			StaticMove{
				Displacement = (0.0, 0.26, 0.0);
				PreAnimationDelay = 0.1;
				AnimationTime = 1.0;
			}
		}
		}
		Joint3D "HishiBase2"{
			AttachCoord = (0.0, 0.33, 0.0);
		}
	}
	TriangleZY{
		Link "HishiArm-y-z2"{
			ModelFileName = "";
			If "号車" ==1{
				ChangeModel = "HishiArm-y.x", 1.0;
			}
			JointZYX "HishiBase2"{
				AttachCoord = (0.485, 0.05);
				LocalCoord = (0.0, 0.0);
			}
			LinkCoord = (0.99, 0.00);
		}
		Link "HishiArmy-z2"{
			ModelFileName = "";
			If "号車" ==1{
				ChangeModel = "HishiArmy.x", 1.0;
			}
			JointZYX "HishiShoe2"{
				AttachCoord = (0.0, -0.12);
				LocalCoord = (0.0, 0.0);
			}
			LinkCoord = (1.48, -0.00);
		}
	}
	TriangleZY{
		Link "HishiArmyz2"{
			ModelFileName = "";
			If "号車" ==1{
				ChangeModel = "HishiArmy.x", 1.0;
			}
			JointZYX "HishiShoe2"{
				AttachCoord = (0.0, -0.12);
				LocalCoord = (0.0, 0.0);
			}
			LinkCoord = (1.48, 0.0);
		}
		Link "HishiArm-yz2"{
			ModelFileName = "";
			If "号車" ==1{
				ChangeModel = "HishiArm-y.x", 1.0;
			}
			JointZYX "HishiBase2"{
				AttachCoord = (-0.485, 0.05);
				LocalCoord = (0.0, 0.00);
			}
			LinkCoord = (0.99, 0.00);
		}
	}
	Object3D "Shadow"{
		ModelFileName = "";
		If!"簡易影"&&!"_SHADOW" { 
			ChangeModel = "Shadow.x", 1.0;
		}
		Joint3D "MainBody"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}
	If ("号車"==0 || "号車"==2)&& "電源"==0 && (("前照灯"==0 && !"_FRONT")|| "前照灯"==1) && "レンズフレア"==0 && !"_CONNECT1" {
		If "仕様" ==0{
			Headlight{
			    AttachObject = "Dummy";
			    SourceCoord = (0.925, 1.565, 10.1);
			    Direction = (0.0, 0.0, 1.0);
			    MaxDistance = 10.0;
				LensFlare{
				    StartAngle = 50.0;
				    Twinkle = 0.1;
					Texture{
					    Distance = 0.005;
					    Radius = 0.5;
					    TexFileName = "tex/フレア.png";
					    Color = #FFE2AC7C;
					}
				}
			}
			Headlight{
			    AttachObject = "Dummy";
			    SourceCoord = (-0.925, 1.565, 10.1);
			    Direction = (0.0, 0.0, 1.0);
			    MaxDistance = 10.0;
			}
		}Else{
			Headlight{
			    AttachObject = "Dummy";
			    SourceCoord = (0.925, 1.565, 10.03);
			    Direction = (0.0, 0.0, 1.0);
			    MaxDistance = 10.0;
				LensFlare{
				    StartAngle = 40.0;
				    Twinkle = 0.1;
					Texture{
					    Distance = 0.005;
					    Radius = 0.5;
					    TexFileName = "tex/フレア1.png";
					    Color = #FFFFFFFF;
					}
				}
			}
			Headlight{
			    AttachObject = "Dummy";
			    SourceCoord = (-0.925, 1.565, 10.03);
			    Direction = (0.0, 0.0, 1.0);
			    MaxDistance = 10.0;
			}
		}
		
	}
	If ("号車"==0 || "号車"==2) && "電源"==0 && (("尾灯"==0 && "_FRONT")|| "尾灯"==1) && "レンズフレア"==0 && !"_CONNECT1" {
		Headlight{
		    AttachObject = "Dummy";
		    SourceCoord = (1.155, 1.565, 10.05);
		    Direction = (0.0, 0.0, 1.0);
		    MaxDistance = 10.0;
			LensFlare{
			    StartAngle = 30.0;
			    Twinkle = 0.1;
				Texture{
				    Distance = 0.005;
				    Radius = 0.45;
				    TexFileName = "tex/フレア.png";
				    Color = #FFDD0014;
				}
			}
		}
		Headlight{
		    AttachObject = "Dummy";
		    SourceCoord = (-1.155, 1.565, 10.05);
		    Direction = (0.0, 0.0, 1.0);
		    MaxDistance = 10.0;
		}
	}
	FrontCabin{
		Joint3D "MainBody"{
			AttachCoord = (0.0,0.0,0.0);
		}
	}
}

