
PluginHeader{
	RailSimVersion = 2.00;
	PluginType = Train;
	PluginName = "東京都交通局 日暮里・舎人ライナー 300形 (未完成版)";
	PluginAuthor = "n";
	IconTexture = "..//..//Train/n_ntl300_1/tex/n_ntl1.png";
	Description = "";
}

TrainInfo{
	FrontLimit = 4.5;
	TailLimit = -4.5;
	MaxVelocity = 60.0;
	MaxAcceleration = 3.5;
	MaxDeceleration = 3.5;
	DoorClosingTime = 3.0;
}
DefineSwitch "灯具"{
	Entry = "入";
	Entry = "切";
}
DefineSwitch "ライトフレア"{
	Entry = "入";
	Entry = "切";
}
DefineSwitch "客室照明"{
GroupCommon = "nNTL300客室灯";
	Entry = "入";
	Entry = "切";
}
DefineSwitch "■号車設定"{
}
DefineSwitch "編成"{
GroupCommon = "nNTL300編成";
	Entry = "01F";
	Entry = "02F";
	Entry = "03F";
	Entry = "04F";
	Entry = "05F";
	Entry = "06F";
	Entry = "07F";
	Entry = "08F";
	Entry = "09F";
	Entry = "10F";
	Entry = "11F";
	Entry = "12F";
	Entry = "13F";
	Entry = "14F";
	Entry = "15F";
	Entry = "16F";
}
DefineSwitch "号車"{
	Entry = "1号車(日暮里方先頭)";
	Entry = "2号車";
	Entry = "3号車";
	Entry = "4号車";
	Entry = "5号車(見沼代親水公園方先頭)";
}
DefineSwitch "仕様"{
GroupCommon = "nNTL300仕様";
	Entry = "2006〜(試運転時)";
	Entry = "2008〜(開業直後)";
	Entry = "2009〜(13編成登場以降)";
	Entry = "2017〜";
}
DefineSwitch "PBR"{
GroupCommon = "nNTL300PBR";
	Entry = "入";
	Entry = "切";
}
DefineSwitch "簡易陰"{
	GroupCommon = "nNTL300簡易陰";
	Entry = "入";
	Entry = "切";
}
PrimaryAssembly{
	Axle "FrontDummyWheel"{
		ModelFileName = "";
		ModelScale = 1.0;
		Diameter = 0.44;
		Symmetric = 1;
		Coord = (2.5, 0.47);
	}
	Axle "TailDummyWheel"{
		ModelFileName = "";
		ModelScale = 1.0;
		Diameter = 0.44;
		Symmetric = 1;
		Coord = (-2.5, 0.47);
	}
	Body "Dummy"{
		ModelFileName = "";
		ApplySwitch "号車"{
		Case 0,2,4:ChangeModel = "Bogie1_1.x", 1.0;
		Default:ChangeModel = "Bogie1_2.x", 1.0;
		}
		JointZY "FrontDummyWheel"{
			AttachCoord = (0.0, 0.0);
			LocalCoord = (2.5, 0.47);
		}
		JointZY "TailDummyWheel"{
			AttachCoord = (0.0, 0.0);
			LocalCoord = (-2.5, 0.47);
		}
	}
	Object3D "FrontRightWheel"{
		ModelFileName = "Wheel.x";
		ModelScale = 1.0;
		Joint3D "Dummy"{
			AttachCoord = (0.85, 0.47, 2.5);
			DirLink = "FrontDummyWheel";
			AttachDir = (1.0, 0.0, 0.0);
			UpLink = "FrontDummyWheel";
			AttachUp = (0.0, 0.0, 1.0);
		}
	}
	Object3D "FrontLeftWheel"{
		ModelFileName = "Wheel.x";
		ModelScale = 1.0;
		Joint3D "Dummy"{
			AttachCoord = (-0.85, 0.47, 2.5);
			DirLink = "FrontDummyWheel";
			AttachDir = (-1.0, 0.0, 0.0);
			UpLink = "FrontDummyWheel";
			AttachUp = (0.0, 0.0, 1.0);
		}
	}
	Object3D "TailRightWheel"{
		ModelFileName = "Wheel.x";
		ModelScale = 1.0;
		Joint3D "Dummy"{
			AttachCoord = (0.85, 0.47, -2.5);
			DirLink = "Dummy";
			AttachDir = (1.0, 0.0, 0.0);
			UpLink = "FrontDummyWheel";
			AttachUp = (0.0, 0.0, 1.0);
		}
	}
	Object3D "TailLeftWheel"{
		ModelFileName = "Wheel.x";
		ModelScale = 1.0;
		Joint3D "Dummy"{
			AttachCoord = (-0.85, 0.47, -2.5);
			DirLink = "Dummy";
			AttachDir = (-1.0, 0.0, 0.0);
			UpLink = "FrontDummyWheel";
			AttachUp = (0.0, 0.0, 1.0);
		}
	}
	Object3D "Interior"{
		ModelFileName = "";
		ModelScale = 1.0;
		AlphaZeroTest = 0;
		NoShadow = 0,1,2,3,4,5,6,7;
			If "客室照明"==0 {
				ChangeMaterial{
				    MaterialID = 0,1,2,3,4,5,6,7;
				    Emissive = 0.8, 0.8, 0.8; 
				}
　　　　　		}
		ApplySwitch "号車"{
			Case 0:
				ApplySwitch "仕様"{
					Case 0:
						ChangeModel = "interior1_0.x", 1.0;
					Case 1:
						ChangeModel = "interior1_1.x", 1.0;
					Case 2,3:
						ChangeModel = "interior1_2.x", 1.0;
				}
			Case 1:
				ApplySwitch "編成"{
					Case 12,13,14,15:
						ChangeModel = "interior2_2.x", 1.0;
					Default:
						ApplySwitch "仕様"{
							Case 0:
								ChangeModel = "interior2_0.x", 1.0;
							Case 1:
								ChangeModel = "interior2_1.x", 1.0;
							Case 2,3:
								ChangeModel = "interior2_2.x", 1.0;
						}
				}
			Case 2:
				ApplySwitch "編成"{
					Case 12,13,14,15:
						ChangeModel = "interior3_13.x", 1.0;
					Default:
						ApplySwitch "仕様"{
							Case 0:
								ChangeModel = "interior3_0.x", 1.0;
							Case 1:
								ChangeModel = "interior3_1.x", 1.0;
							Case 2,3:
								ApplySwitch "編成"{
									Case 12,13,14,15:
										ChangeModel = "interior3_13.x", 1.0;
									Default:
										ChangeModel = "interior3_2.x", 1.0;
								}
						}
				}
			Case 3:
				ApplySwitch "編成"{
					Case 12,13,14,15:
						ChangeModel = "interior4_2.x", 1.0;
					Default:
						ApplySwitch "仕様"{
							Case 0:
								ChangeModel = "interior4_0.x", 1.0;
							Case 1:
								ChangeModel = "interior4_1.x", 1.0;
							Case 2,3:
								ChangeModel = "interior4_2.x", 1.0;
						}
				}

			Case 4:
				ApplySwitch "仕様"{
					Case 0:
						ChangeModel = "interior5_0.x", 1.0;
					Case 1:
						ChangeModel = "interior5_1.x", 1.0;
					Case 2,3:
						ChangeModel = "interior5_2.x", 1.0;
				}
		}
		Joint3D "Dummy"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}
	Object3D "Body"{
		ModelFileName = "Body1.x";
		Transparent = 14,15,16;
		NoShadow = 7,8,9,10,24;
		NoCastShadow = 11,12,13;
		If "客室照明"==0 {
			ChangeMaterial{
			    MaterialID = 7,8,9,10;
			    Emissive = 0.8, 0.8, 0.8; 
			}
　　　　　	}
		ApplySwitch "仕様"{
		Case 0:
			If "編成">5{
				ShiftTexture = 14, 0.15625, 0.0;
			}
			If "編成">11{
				ChangeAlpha = 11, 0.0;
				ChangeAlpha = 13, 0.0;
			}
			ChangeAlpha = 12, 0.0;
		Case 1:
			If "編成">5{
				ShiftTexture = 14, 0.15625, 0.0;
			}
			If "編成">11{
				ChangeAlpha = 11, 0.0;
				ChangeAlpha = 13, 0.0;
			}
		Case 2,3:
			ShiftTexture = 14, 0.3125, 0.0;
			ChangeTexture = 10, "tex/座面2.png";
		}
		ApplySwitch "号車"{
			Case 1:
				ChangeModel = "body2.x", 1.0;
			Case 2:
				If "編成">11{
					ChangeModel = "body3_13.x", 1.0;
				}Else{
					ChangeModel = "body3.x", 1.0;
				}
			Case 3:
				ChangeModel = "body4.x", 1.0;
			Case 4:
				ChangeModel = "body5.x", 1.0;
		}
		ApplySwitch "編成"{
			Case 1:
				ShiftTexture = 11, 0.0, 0.046875;
			Case 2:
				ShiftTexture = 11, 0.0, 0.09375;
			Case 3:
				ShiftTexture = 11, 0.0, 0.140625;
			Case 4:
				ShiftTexture = 11, 0.0, 0.1875;
			Case 5:
				ShiftTexture = 11, -0.03125, -0.234375;
			Case 6:
				ShiftTexture = 11, -0.03125, -0.1875;
			Case 7:
				ShiftTexture = 11, -0.03125, -0.140625;
			Case 8:
				ShiftTexture = 11, -0.03125, -0.09375;
			Case 9:
				ShiftTexture = 11, -0.03125, -0.046875;
			Case 10:
				ShiftTexture = 11, 0.03125, -0.234375;
			Case 11:
				ShiftTexture = 11, 0.03125, -0.1875;
			Case 12:
				ShiftTexture = 11, 0.03125, -0.140625;
			Case 13:
				ShiftTexture = 11, 0.03125, -0.09375;
			Case 14:
				ShiftTexture = 11, 0.03125, -0.046875;
			Case 15:
				ShiftTexture = 11, 0.09375, -0.171875;
		}
		Joint3D "Dummy"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}
	Object3D "light"{
		ModelFileName = "light0.x";
		If !("仕様"<3){
			ChangeModel = "light1.x", 1.0;	
			NoShadow = 1;
		}
		If !"灯具" && !"_CONNECT1"{
			If !"_FRONT"{
				If "仕様"<3{
					ChangeMaterial{
			 		   MaterialID = 1;
			 		   Emissive = 1.0, 1.0, 1.0; 
					}
					ShiftTexture = 1, 0.125, 0.0;
					NoShadow = 1;
				}Else{
					ChangeAlpha = 1, 1.0;
				}
			}Else{
				ChangeAlpha = 2, 1.0;
				NoShadow = 2;
			}
		}
		Joint3D "Body"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}



	Object3D "door"{
		ModelFileName = "d.x";
		Transparent = 5;
		NoShadow = 0;
		If "客室照明"==0 {
			ChangeMaterial{
			    MaterialID = 0;
			    Emissive = 0.8, 0.8, 0.8; 
			}
　　　　　	}
		Joint3D "Dummy"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}
	Object3D "sidelamp1"{
		ModelFileName = "sidelamp1.x";
/*
		If "_DOOR1"{
				StaticRotation{
				    RotationAxis = (0.0, 1.0, 0.0);
				    RotationAngle = 180;
				PreAnimationDelay = 3.0;
				AnimationTime = 0.0;
				PreReverseDelay = 4.0;
				ReverseTime = 0.0;
				PostReverseDelay = 3.0;
			}
		}
*/
		Joint3D "Dummy"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}
	Object3D "sidelamp2"{
		ModelFileName = "sidelamp2.x";
/*
		If "_DOOR2"{
				StaticRotation{
				    RotationAxis = (0.0, 1.0, 0.0);
				    RotationAngle = 180;
				PreAnimationDelay = 3.0;
				AnimationTime = 0.0;
				PreReverseDelay = 4.0;
				ReverseTime = 0.0;
				PostReverseDelay = 3.0;
			}
		}
*/
		Joint3D "Dummy"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}
	Object3D "shadow"{
		ModelFileName = "";
		Transparent = 0;
		ApplySwitch "簡易陰"{
		Case 0:ChangeModel = "shadow.x", 1.0;
		}
		Joint3D "Dummy"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}
	If  ("号車"==0||"号車"==4)&&("灯具"==0 && !"_FRONT")&& "ライトフレア"==0 && !"_CONNECT1" {
		If "仕様"<=2 {
			Headlight{
			    AttachObject = "Dummy";
			    SourceCoord = (0.62, 1.23, 4.35);
			    Direction = (0.0, 0.0, 1.0);
			    MaxDistance = 10.0;
				LensFlare{
				    StartAngle = 30.0;
				    Twinkle = 0.1;
					Texture{
					    Distance = 0.005;
					    Radius = 0.3;
					    TexFileName = "tex/フレア.png";
					    Color = #FFe2d4b4;
					}
				}
			}
			Headlight{
			    AttachObject = "Dummy";
			    SourceCoord = (-0.62, 1.23, 4.35);
			    Direction = (0.0, 0.0, 1.0);
			    MaxDistance = 10.0;
			}
		}If "仕様">=3 {
			Headlight{
			    AttachObject = "Dummy";
			    SourceCoord = (0.62, 1.23, 4.35);
			    Direction = (0.0, 0.0, 1.0);
			    MaxDistance = 10.0;
				LensFlare{
				    StartAngle = 30.0;
				    Twinkle = 0.2;
					Texture{
					    Distance = 0.005;
					    Radius = 0.3;
					    TexFileName = "tex/フレア1.png";
					    Color = #FFffffff;
					}
				}
			}
			Headlight{
			    AttachObject = "Dummy";
			    SourceCoord = (-0.62, 1.23, 4.35);
			    Direction = (0.0, 0.0, 1.0);
			    MaxDistance = 10.0;
			}
		}
	}
	If ("号車"==0||"号車"==4)&&("灯具"==0 && "_FRONT") && "ライトフレア"==0 && !"_CONNECT1" {
		Headlight{
		    AttachObject = "Dummy";
		    SourceCoord = (0.8, 1.23, 4.35);
		    Direction = (0.0, 0.0, 1.0);
		    MaxDistance = 10.0;
			LensFlare{
			    StartAngle = 30.0;
			    Twinkle = 0.1;
				Texture{
				    Distance = 0.005;
				    Radius = 0.3;
				    TexFileName = "tex/フレア.png";
				    Color = #FFd20046;
				}
			}
		}
		Headlight{
		    AttachObject = "Dummy";
		    SourceCoord = (-0.8, 1.23, 4.35);
		    Direction = (0.0, 0.0, 1.0);
		    MaxDistance = 10.0;
		}
	}
	FrontCabin{
		Joint3D "Dummy"{
			AttachCoord = (0.6, 2.2, 3.2);
		}
	}
}
