/*
 *	RailSim II Train Plugin
 *	Copyright (c) 2006 インターネット停留所
 */

PluginHeader{
	RailSimVersion = 2.00;
	PluginType = Train;
	PluginName = "アイゼントランザ中間車輌";
	PluginAuthor = "おかづ";
	IconTexture = "..\Aizentranza01\Icon.png";
	Description = "アイゼントランザの中間車両です。";
}

TrainInfo{
	FrontLimit = 10.3;
	TailLimit = -10.3;
	MaxVelocity = 130.0;
	MaxAcceleration = 3.0;
	MaxDeceleration = 4.0;
	TiltSpeed = 0.1;
	DoorClosingTime = 1.5;
}

DefineSwitch "車体"{
	Entry = "水色";
	Entry = "ぶどう色";
	Entry = "ステンレス";
}

DefineSwitch "方向幕"{
	GroupCommon = "Aizentranza 方向幕";
	Entry = "快速 大阪行";
	Entry = "普通 京都行";
	Entry = "回送";
}

DefineSwitch "パンタグラフ"{
	Entry = "なし";
	Entry = "収納";
	Entry = "展開";
}

PrimaryAssembly{
	Axle "Wheel1"{
		ModelFileName = "..\Aizentranza01\Wheel.x";
		ModelScale = 1.0;
		Diameter = 0.8;
		Symmetric = 8;
		Coord = (8.4, 0.4);
	}
	Axle "Wheel2"{
		ModelFileName = "..\Aizentranza01\Wheel.x";
		ModelScale = 1.0;
		Diameter = 0.8;
		Symmetric = 8;
		Coord = (6.6, 0.4);
	}
	Axle "Wheel3"{
		ModelFileName = "..\Aizentranza01\Wheel.x";
		ModelScale = 1.0;
		Diameter = 0.8;
		Symmetric = 8;
		Coord = (-6.6, 0.4);
	}
	Axle "Wheel4"{
		ModelFileName = "..\Aizentranza01\Wheel.x";
		ModelScale = 1.0;
		Diameter = 0.8;
		Symmetric = 8;
		Coord = (-8.4, 0.4);
	}
	Body "Bogie1"{
		ModelFileName = "..\Aizentranza01\Bogie.x";
		ModelScale = 1.0;
		JointZY "Wheel1"{
			AttachCoord = (0.0, 0.0);
			LocalCoord = (0.9, 0.0);
		}
		JointZY "Wheel2"{
			AttachCoord = (0.0, 0.0);
			LocalCoord = (-0.9, 0.0);
		}
	}
	Body "Bogie2"{
		ModelFileName = "..\Aizentranza01\Bogie.x";
		ModelScale = 1.0;
		Turn = yes;
		JointZY "Wheel3"{
			AttachCoord = (0.0, 0.0);
			LocalCoord = (-0.9, 0.0);
		}
		JointZY "Wheel4"{
			AttachCoord = (0.0, 0.0);
			LocalCoord = (0.9, 0.0);
		}
	}
	Body "MainBody"{
		ModelFileName = "Body.x";
		ModelScale = 1.0;
		NoShadow = 4, 5;
		NoReceiveShadow = 7;
		ApplySwitch "方向幕"{
		Case 2:	//	回送のとき室内灯 OFF
			ChangeAlpha = 5, 0.0;
		Default:	//	回送以外のとき室内灯 ON
			ChangeAlpha = 5, NightAlpha;
		}
		ApplySwitch "車体"{
		Case 1:
			ChangeTexture = 2, "..\Aizentranza01\Face2.png";
			ChangeTexture = 3, "..\Aizentranza01\Body2.png";
		Case 2:
			ChangeTexture = 2, "..\Aizentranza01\Face3.png";
			ChangeTexture = 3, "..\Aizentranza01\Body3.png";
			EnvMap = 2, 3;
			ChangeMaterial{
				MaterialID = 2, 3;
				Specular = 1.0, 1.0, 1.0;
				Power = 10.0;
			}
		}
		ApplySwitch "方向幕"{
		Case 1:
			ChangeTexture = 4, "..\Aizentranza01\Side2.png";
		Case 2:
			ChangeTexture = 4, "..\Aizentranza01\Side3.png";
		}
		JointZY "Bogie1"{
			AttachCoord = (0.0, 0.6);
			LocalCoord = (7.5, 1.0);
		}
		JointZY "Bogie2"{
			AttachCoord = (0.0, 0.6);
			LocalCoord = (-7.5, 1.0);
		}
		Tilt{
			TiltRatio = 0.5;
			MaxAngle = 6.0;
			BaseAlt = 2.3;
		}
	}
	//	ドア
	Object3D "DoorLL"{
		ModelFileName = "..\Aizentranza01\DoorLeft.x";
		ModelScale = 1.0;
		NoShadow = 1;
		NoReceiveShadow = 2;
		ApplySwitch "方向幕"{
		Case 2: ChangeAlpha = 1, 0.0;
		Default: ChangeAlpha = 1, NightAlpha;
		}
		ApplySwitch "車体"{
		Case 1:
			ChangeTexture = 0, "..\Aizentranza01\Body2.png";
		Case 2:
			ChangeTexture = 0, "..\Aizentranza01\Body3.png";
			EnvMap = 0;
			ChangeMaterial{
				MaterialID = 0;
				Specular = 1.0, 1.0, 1.0;
				Power = 15.0;
			}
		}
		If "_DOOR1"{
			StaticMove{
				Displacement = (0.03, 0.0, 0.0);
				AnimationTime = 0.5;
				PostAnimationDelay = 1.0;
			}
			StaticMove{
				Displacement = (0.0, 0.0, 0.78);
				PreAnimationDelay = 0.5;
				AnimationTime = 1.0;
			}
		}
		Joint3D "MainBody"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}
	Object3D "DoorLR"{
		ModelFileName = "..\Aizentranza01\DoorRight.x";
		ModelScale = 1.0;
		NoShadow = 1;
		NoReceiveShadow = 2;
		ApplySwitch "方向幕"{
		Case 2: ChangeAlpha = 1, 0.0;
		Default: ChangeAlpha = 1, NightAlpha;
		}
		ApplySwitch "車体"{
		Case 1:
			ChangeTexture = 0, "..\Aizentranza01\Body2.png";
		Case 2:
			ChangeTexture = 0, "..\Aizentranza01\Body3.png";
			EnvMap = 0;
			ChangeMaterial{
				MaterialID = 0;
				Specular = 1.0, 1.0, 1.0;
				Power = 15.0;
			}
		}
		If "_DOOR1"{
			StaticMove{
				Displacement = (0.03, 0.0, 0.0);
				AnimationTime = 0.5;
				PostAnimationDelay = 1.0;
			}
			StaticMove{
				Displacement = (0.0, 0.0, -0.78);
				PreAnimationDelay = 0.5;
				AnimationTime = 1.0;
			}
		}
		Joint3D "MainBody"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}
	Object3D "DoorRL"{
		ModelFileName = "..\Aizentranza01\DoorLeft.x";
		ModelScale = 1.0;
		NoShadow = 1;
		NoReceiveShadow = 2;
		ApplySwitch "方向幕"{
		Case 2: ChangeAlpha = 1, 0.0;
		Default: ChangeAlpha = 1, NightAlpha;
		}
		ApplySwitch "車体"{
		Case 1:
			ChangeTexture = 0, "..\Aizentranza01\Body2.png";
		Case 2:
			ChangeTexture = 0, "..\Aizentranza01\Body3.png";
			EnvMap = 0;
			ChangeMaterial{
				MaterialID = 0;
				Specular = 1.0, 1.0, 1.0;
				Power = 15.0;
			}
		}
		If "_DOOR2"{
			StaticMove{
				Displacement = (0.03, 0.0, 0.0);
				AnimationTime = 0.5;
				PostAnimationDelay = 1.0;
			}
			StaticMove{
				Displacement = (0.0, 0.0, 0.78);
				PreAnimationDelay = 0.5;
				AnimationTime = 1.0;
			}
		}
		Joint3D "MainBody"{
			AttachCoord = (0.0, 0.0, 0.0);
			AttachDir = (0.0, 0.0, -1.0);
		}
	}
	Object3D "DoorRR"{
		ModelFileName = "..\Aizentranza01\DoorRight.x";
		ModelScale = 1.0;
		NoShadow = 1;
		NoReceiveShadow = 2;
		ApplySwitch "方向幕"{
		Case 2: ChangeAlpha = 1, 0.0;
		Default: ChangeAlpha = 1, NightAlpha;
		}
		ApplySwitch "車体"{
		Case 1:
			ChangeTexture = 0, "..\Aizentranza01\Body2.png";
		Case 2:
			ChangeTexture = 0, "..\Aizentranza01\Body3.png";
			EnvMap = 0;
			ChangeMaterial{
				MaterialID = 0;
				Specular = 1.0, 1.0, 1.0;
				Power = 15.0;
			}
		}
		If "_DOOR2"{
			StaticMove{
				Displacement = (0.03, 0.0, 0.0);
				AnimationTime = 0.5;
				PostAnimationDelay = 1.0;
			}
			StaticMove{
				Displacement = (0.0, 0.0, -0.78);
				PreAnimationDelay = 0.5;
				AnimationTime = 1.0;
			}
		}
		Joint3D "MainBody"{
			AttachCoord = (0.0, 0.0, 0.0);
			AttachDir = (0.0, 0.0, -1.0);
		}
	}
	//	ヨーダンパー
	PistonZY{
		Link "YawDamper11"{
			ModelFileName = "..\Aizentranza01\YawDamper1.x";
			ModelScale = 1.0;
			JointZYX "Bogie1"{
				AttachX = -1.1;
				AttachCoord = (0.0, 0.05);
				LocalCoord = (0.0, 0.0);
			}
			LinkCoord = (-0.8, 0.0);
		}
		Link "YawDamper12"{
			ModelFileName = "..\Aizentranza01\YawDamper2.x";
			ModelScale = 1.0;
			JointZYX "MainBody"{
				AttachX = -1.1;
				AttachCoord = (6.7, 0.45);
				LocalCoord = (0.0, 0.0);
			}
			LinkCoord = (0.8, 0.0);
		}
	}
	PistonZY{
		Link "YawDamper21"{
			ModelFileName = "..\Aizentranza01\YawDamper1.x";
			ModelScale = 1.0;
			JointZYX "Bogie1"{
				AttachX = 1.1;
				AttachCoord = (0.0, 0.05);
				LocalCoord = (0.0, 0.0);
			}
			LinkCoord = (-0.8, 0.0);
		}
		Link "YawDamper22"{
			ModelFileName = "..\Aizentranza01\YawDamper2.x";
			ModelScale = 1.0;
			JointZYX "MainBody"{
				AttachX = 1.1;
				AttachCoord = (6.7, 0.45);
				LocalCoord = (0.0, 0.0);
			}
			LinkCoord = (0.8, 0.0);
		}
	}
	PistonZY{
		Link "YawDamper31"{
			ModelFileName = "..\Aizentranza01\YawDamper1.x";
			ModelScale = 1.0;
			Turn = yes;
			JointZYX "Bogie2"{
				AttachX = 1.1;
				AttachCoord = (0.0, 0.05);
				LocalCoord = (0.0, 0.0);
			}
			LinkCoord = (-0.8, 0.0);
		}
		Link "YawDamper32"{
			ModelFileName = "..\Aizentranza01\YawDamper2.x";
			ModelScale = 1.0;
			Turn = yes;
			JointZYX "MainBody"{
				AttachX = -1.1;
				AttachCoord = (-6.7, 0.45);
				LocalCoord = (0.0, 0.0);
			}
			LinkCoord = (0.8, 0.0);
		}
	}
	PistonZY{
		Link "YawDamper41"{
			ModelFileName = "..\Aizentranza01\YawDamper1.x";
			ModelScale = 1.0;
			Turn = yes;
			JointZYX "Bogie2"{
				AttachX = -1.1;
				AttachCoord = (0.0, 0.05);
				LocalCoord = (0.0, 0.0);
			}
			LinkCoord = (-0.8, 0.0);
		}
		Link "YawDamper42"{
			ModelFileName = "..\Aizentranza01\YawDamper2.x";
			ModelScale = 1.0;
			Turn = yes;
			JointZYX "MainBody"{
				AttachX = 1.1;
				AttachCoord = (-6.7, 0.45);
				LocalCoord = (0.0, 0.0);
			}
			LinkCoord = (0.8, 0.0);
		}
	}
	//	連結器
	Object3D "Connector1"{
		ModelFileName = "..\Aizentranza01\ConnectorNormal.x";
		ModelScale = 1.0;
		Joint3D "MainBody"{
			AttachCoord = (0.0, 0.85, 9.7);
			LocalCoord = (0.0, 0.0, -0.3);
			DirLink = "Bogie1";
		}
	}
	Object3D "Connector2"{
		ModelFileName = "..\Aizentranza01\ConnectorNormal.x";
		ModelScale = 1.0;
		Joint3D "MainBody"{
			AttachCoord = (0.0, 0.85, -9.7);
			LocalCoord = (0.0, 0.0, -0.3);
			DirLink = "Bogie2";
		}
	}
	//	幌
	Object3D "Hood1"{
		ModelFileName = "..\Aizentranza01\Hood.x";
		ModelScale = 1.0;
		Turn = yes;
		Joint3D "MainBody"{
			AttachCoord = (0.0, 2.2, 10.0);
			DirLink = "Bogie1";
		}
	}
	Object3D "Hood2"{
		ModelFileName = "..\Aizentranza01\Hood.x";
		ModelScale = 1.0;
		Turn = yes;
		Joint3D "MainBody"{
			AttachCoord = (0.0, 2.2, -10.0);
			DirLink = "Bogie2";
		}
	}
	//	パンタグラフ
	Object3D "Pantograph0"{
		ModelFileName = "..\Aizentranza01\Pantograph0.x";
		ModelScale = 1.0;
		ApplySwitch "パンタグラフ"{
		Case 0:
			ChangeModel = "", 1.0;
		}
		Joint3D "MainBody"{
			AttachCoord = (0.0, 3.7, 6.0);
			UpLink = "Bogie1";
		}
	}
	Object3D "Pantograph1"{
		ModelFileName = "..\Aizentranza01\Pantograph1.x";
		ModelScale = 1.0;
		ApplySwitch "パンタグラフ"{
		Case 0:
			ChangeModel = "", 1.0;
		Case 1:
			StaticRotation{
				RotationAxis = (1.0, 0.0, 0.0);
				RotationAngle = 27.03;
				AnimationTime = 5.0;
			}
		}
		Joint3D "Pantograph0"{
			AttachCoord = (0.0, 0.3, 0.0);
		}
	}
	Object3D "Pantograph2"{
		ModelFileName = "..\Aizentranza01\Pantograph2.x";
		ModelScale = 1.0;
		ApplySwitch "パンタグラフ"{
		Case 0:
			ChangeModel = "", 1.0;
		Case 1:
			StaticRotation{
				RotationAxis = (1.0, 0.0, 0.0);
				RotationAngle = -44.36;
				AnimationTime = 5.0;
			}
		}
		Joint3D "Pantograph1"{
			AttachCoord = (0.0, 0.5, 0.98);
		}
	}
	Object3D "Pantograph3"{
		ModelFileName = "..\Aizentranza01\Pantograph3.x";
		ModelScale = 1.0;
		ApplySwitch "パンタグラフ"{
		Case 0:
			ChangeModel = "", 1.0;
		}
		Joint3D "Pantograph2"{
			AttachCoord = (0.0, 0.495, -1.298);
			DirLink = "Pantograph0";
			UpLink = "Pantograph0";
		}
	}
}
