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

PluginHeader{
	RailSimVersion = 2.00;
	PluginType = Train;
	PluginName = "【東京地下鉄(東京メトロ)】半蔵門線08系中間車";
	PluginAuthor = "篠ノ之隼(IS学園産業デザイン部RailSim課)";
	IconTexture = "../common_hayabusa/hayabusa_metro08_tex/z_icon.png";
	Description = "";
}

TrainInfo{
	FrontLimit = 10.2;	//	前方連結位置 Z 座標
	TailLimit = -10.2;	//	後方連結位置 Z 座標
	MaxVelocity = 120.0;	//	最高速度
	MaxAcceleration = 3.0;	//	最高加速度
	MaxDeceleration = 4.0;	//	最高減速度
	TiltSpeed = 0.1;	//	振り子反応速度
	DoorClosingTime = 6.0;	//	ドア閉め所要時間
}
DefineSwitch "種別"{
GroupCommon = "種別";
	Entry = "表示無";
	Entry = "急行";
	Entry = "準急";
	Entry = "区間準急";
	Entry = "通勤準急";
	Entry = "試運転";
	Entry = "回送";
}
DefineSwitch "行先"{
GroupCommon = "行先";
	Entry = "表示無";
	Entry = "中央林間";
	Entry = "長津田";
	Entry = "鷺沼";
	Entry = "渋谷";
	Entry = "半蔵門";
	Entry = "清澄白河";
	Entry = "押上";
	Entry = "久喜";
	Entry = "南栗橋";
}
DefineSwitch "ドア"{
GroupCommon = "ドア";
	Entry = "自動";
	Entry = "左";
	Entry = "右";
}
DefineSwitch "転落防止幌"{
	Entry = "通常";
	Entry = "誘導無線アンテナ搭載";
}
DefineSwitch "車種"{
	Entry = "パンタ無";
	Entry = "パンタ1基";
	Entry = "パンタ2基";
}
DefineSwitch "床下機器"{
	Entry = "M車";
	Entry = "T車";
}
DefineSwitch "サウンド"{
GroupCommon = "サウンド";
	Entry = "OFF";
	Entry = "ON";
}
DefineSwitch "簡易シャドウ"{
GroupCommon = "簡易シャドウ";
	Entry = "無";
	Entry = "有";
}

PrimaryAssembly{
	Axle "Wheel1"{
		ModelFileName = "../hayabusa_metro08_1,10/Wheel.x";
		ModelScale = 1.0;
		Diameter = 0.8;
		Symmetric = 8;
		Coord = (8.1, 0.4);
	}
	Axle "Wheel2"{
		ModelFileName = "../hayabusa_metro08_1,10/Wheel.x";
		ModelScale = 1.0;
		Diameter = 0.8;
		Symmetric = 8;
		Coord = (5.9, 0.4);
	}
	Axle "Wheel3"{
		ModelFileName = "../hayabusa_metro08_1,10/Wheel.x";
		ModelScale = 1.0;
		Diameter = 0.8;
		Symmetric = 8;
		Coord = (-5.9, 0.4);
	}
	Axle "Wheel4"{
		ModelFileName = "../hayabusa_metro08_1,10/Wheel.x";
		ModelScale = 1.0;
		Diameter = 0.8;
		Symmetric = 8;
		Coord = (-8.1, 0.4);
	}
	Body "Bogie1"{
		ModelFileName = "../hayabusa_metro08_1,10/Bogie.x";
		ModelScale = 1.0;
		JointZY "Wheel1"{
			AttachCoord = (0.0, 0.0);
			LocalCoord = (1.0, 0.0);
		}
		JointZY "Wheel2"{
			AttachCoord = (0.0, 0.0);
			LocalCoord = (-1.0, 0.0);
		}
	}
	Body "Bogie2"{
		ModelFileName = "../hayabusa_metro08_1,10/Bogie.x";
		ModelScale = 1.0;
		Turn = yes;
		JointZY "Wheel3"{
			AttachCoord = (0.0, 0.0);
			LocalCoord = (-1.0, 0.0);
		}
		JointZY "Wheel4"{
			AttachCoord = (0.0, 0.0);
			LocalCoord = (1.0, 0.0);
		}
	}
	Body "MainBody"{
		ModelFileName = "body.x";
		ModelScale = 1.0;
		Turn = yes;
		AlphaZeroTest = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15;
		ApplySwitch "行先"{
		Case 0:
			ChangeTexture = 1,"../common_hayabusa/hayabusa_metro08_tex/LED表示/側面行先/Non.png";
			ChangeTexture = 2,"../common_hayabusa/hayabusa_metro08_tex/LED表示/側面行先(種別表示の際に使用)/Non.png";
		Case 1:
			ChangeTexture = 1,"../common_hayabusa/hayabusa_metro08_tex/LED表示/側面行先/中央林間.png";
			ChangeTexture = 2,"../common_hayabusa/hayabusa_metro08_tex/LED表示/側面行先(種別表示の際に使用)/中央林間.png";
		Case 2:
			ChangeTexture = 1,"../common_hayabusa/hayabusa_metro08_tex/LED表示/側面行先/長津田.png";
			ChangeTexture = 2,"../common_hayabusa/hayabusa_metro08_tex/LED表示/側面行先(種別表示の際に使用)/長津田.png";
		Case 3:
			ChangeTexture = 1,"../common_hayabusa/hayabusa_metro08_tex/LED表示/側面行先/鷺沼.png";
			ChangeTexture = 2,"../common_hayabusa/hayabusa_metro08_tex/LED表示/側面行先(種別表示の際に使用)/鷺沼.png";
		Case 4:
			ChangeTexture = 1,"../common_hayabusa/hayabusa_metro08_tex/LED表示/側面行先/渋谷.png";
			ChangeTexture = 2,"../common_hayabusa/hayabusa_metro08_tex/LED表示/側面行先(種別表示の際に使用)/渋谷.png";
		Case 5:
			ChangeTexture = 1,"../common_hayabusa/hayabusa_metro08_tex/LED表示/側面行先/半蔵門.png";
			ChangeTexture = 2,"../common_hayabusa/hayabusa_metro08_tex/LED表示/側面行先(種別表示の際に使用)/半蔵門.png";
		Case 6:
			ChangeTexture = 1,"../common_hayabusa/hayabusa_metro08_tex/LED表示/側面行先/清澄白河.png";
			ChangeTexture = 2,"../common_hayabusa/hayabusa_metro08_tex/LED表示/側面行先(種別表示の際に使用)/清澄白河.png";
		Case 7:
			ChangeTexture = 1,"../common_hayabusa/hayabusa_metro08_tex/LED表示/側面行先/押上.png";
			ChangeTexture = 2,"../common_hayabusa/hayabusa_metro08_tex/LED表示/側面行先(種別表示の際に使用)/押上.png";
		Case 8:
			ChangeTexture = 1,"../common_hayabusa/hayabusa_metro08_tex/LED表示/側面行先/久喜.png";
			ChangeTexture = 2,"../common_hayabusa/hayabusa_metro08_tex/LED表示/側面行先(種別表示の際に使用)/久喜.png";
		Case 9:
			ChangeTexture = 1,"../common_hayabusa/hayabusa_metro08_tex/LED表示/側面行先/南栗橋.png";
			ChangeTexture = 2,"../common_hayabusa/hayabusa_metro08_tex/LED表示/側面行先(種別表示の際に使用)/南栗橋.png";
                      }
		ApplySwitch "種別"{
		Case 0:
			ChangeTexture = 3,"../common_hayabusa/hayabusa_metro08_tex/LED表示/種別/Non.png";
		Case 1:
			ChangeTexture = 3,"../common_hayabusa/hayabusa_metro08_tex/LED表示/種別/急行.png";
			ChangeTexture = 1,"../common_hayabusa/hayabusa_metro08_tex/LED表示/側面行先/Non1.png";
		Case 2:
			ChangeTexture = 3,"../common_hayabusa/hayabusa_metro08_tex/LED表示/種別/準急.png";
			ChangeTexture = 1,"../common_hayabusa/hayabusa_metro08_tex/LED表示/側面行先/Non1.png";
		Case 3:
			ChangeTexture = 3,"../common_hayabusa/hayabusa_metro08_tex/LED表示/種別/区間準急.png";
			ChangeTexture = 1,"../common_hayabusa/hayabusa_metro08_tex/LED表示/側面行先/Non1.png";
		Case 4:
			ChangeTexture = 3,"../common_hayabusa/hayabusa_metro08_tex/LED表示/種別/通勤準急.png";
			ChangeTexture = 1,"../common_hayabusa/hayabusa_metro08_tex/LED表示/側面行先/Non1.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);
		}
	}
	Object3D "syasyu"{
		ModelFileName = "p1.x";
		ModelScale = 1.0;
		Turn = yes;
		ApplySwitch "車種"{
		Case 0:
　　　　　　　　　　　　ChangeModel = "",1.0;
		Case 1:
　　　　　　　　　　　　ChangeModel = "p1.x",1.0;
		Case 2:
　　　　　　　　　　　　ChangeModel = "p2.x",1.0;
		}
		Joint3D "MainBody"{
			AttachCoord = (0.0, 0.0, 0.0);
			}
		}
	Object3D "horo"{
		ModelFileName = "horo1.x";
		ModelScale = 1.0;
		Turn = yes;
		ApplySwitch "転落防止幌"{
		Case 0:
　　　　　　　　　　　　ChangeModel = "horo1.x",1.0;
		Case 1:
　　　　　　　　　　　　ChangeModel = "horo2.x",1.0;
		}
		Joint3D "MainBody"{
			AttachCoord = (0.0, 0.0, 0.0);
			}
		}
	Object3D "shadow"{
		ModelFileName = "../hayabusa_metro15000_1,10/shadow.x";
		ModelScale = 1.0;
		Turn = yes;
		ApplySwitch "簡易シャドウ"{
		Case 0:
　　　　　　　　　　　　ChangeModel = "",1.0;
			}
		Joint3D "MainBody"{
			AttachCoord = (0.0, 0.0, 0.0);
			}
		}
	Object3D "yukashita"{
		ModelFileName = "M.x";
		ModelScale = 1.0;
		Turn = yes;
		ApplySwitch "床下機器"{
		Case 0:
　　　　　　　　　　　　ChangeModel = "M.x",1.0;
		Case 1:
　　　　　　　　　　　　ChangeModel = "T.x",1.0;
		}
		Joint3D "MainBody"{
			AttachCoord = (0.0, 0.0, 0.0);
			}
		}
	Object3D "DoorL"{
		ModelFileName = "doorl-l.x";
		ModelScale = 1.0;
		AlphaZeroTest = 0,1;
		If("_DOOR1" && "ドア"==0) || ("ドア"==1){
				StaticMove{
				Displacement = (0.0, 0.0, 0.75);
				PreAnimationDelay = 0.5;
				AnimationTime = 3.0;
			}
		}
		
		Joint3D "MainBody"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}
	Object3D "DoorL2"{
		ModelFileName = "doorl-r.x";
		ModelScale = 1.0;
		AlphaZeroTest = 0,1;
		If("_DOOR1" && "ドア"==0) || ("ドア"==1){
				StaticMove{
				Displacement = (0.0, 0.0, -0.75);
				PreAnimationDelay = 0.5;
				AnimationTime = 3.0;
			}
		}
		
		Joint3D "MainBody"{
			AttachCoord = (0.0, 0.0, 0.0);

		}
	}
	
	Object3D "DoorR"{
		ModelFileName = "doorr-l.x";
		ModelScale = 1.0;
		AlphaZeroTest = 0,1;
		If("_DOOR2" && "ドア"==0) || ("ドア"==2){
				StaticMove{
				Displacement = (-0.0, 0.0, 0.75);
				PreAnimationDelay = 0.5;
				AnimationTime = 3.0;
			}
		}
		
		Joint3D "MainBody"{
			AttachCoord = (0.0, 0.0, 0.0);
			AttachDir = (0.0, 0.0, -1.0);
		}
	}
	Object3D "DoorR2"{
		ModelFileName = "doorr-r.x";
		ModelScale = 1.0;
		AlphaZeroTest = 0,1;
		If("_DOOR2" && "ドア"==0) || ("ドア"==2){
			StaticMove{
				Displacement = (-0.0, 0.0, -0.75);
				PreAnimationDelay = 0.5;
				AnimationTime = 3.0;
			}
		}
		
		Joint3D "MainBody"{
			AttachCoord = (0.0, 0.0, 0.0);
			AttachDir = (0.0, 0.0, -1.0);
		}
	}
	Object3D "doorlampL"{
		ModelFileName = "../hayabusa_metro08_1,10/車側灯.x";
		ModelScale = 1.0;
		NoShadow = 0,1;

		If("_DOOR1" && "ドア"==0) || ("ドア"==1){
			StaticRotation{
				RotationAxis = (0.0, -1.0, 0.0);
				RotationAngle = 180;
				PreAnimationDelay = 0.4;
				PreReverseDelay = 4.1;
			}
		}
		Joint3D "MainBody"{
			AttachCoord = (1.4, 0.0, -0.2);
		}
	}

	Object3D "doorlampR"{
		ModelFileName = "../hayabusa_metro08_1,10/車側灯.x";
		ModelScale = 1.0;
		NoShadow = 0,1;


		StaticRotation{
			RotationAxis = (0.0, 1.0, 0.0);
			RotationAngle = 180;
		}

		If("_DOOR2" && "ドア"==0) || ("ドア"==2){
			StaticRotation{
				RotationAxis = (0.0, -1.0, 0.0);
				RotationAngle = 180;
				PreAnimationDelay = 0.4;
				PreReverseDelay = 4.1;
			}
		}
		Joint3D "MainBody"{
			AttachCoord = (-1.4, 0.0, 0.2);
		}
	}

//サウンドエフェクト
	
//ドア
If ("サウンド"==1 && "ドア"==0) || ("サウンド"==1 && "ドア"==1) || ("サウンド"==1 && "ドア"==2){
	ApplySwitch "_DOOR1"|"_DOOR2"{
	Case 0:
	If 0=="_VELOCITY"{
		SoundEffect{
		WaveFileName = "../common_hayabusa/hayabusa_metro08_tex/sound/doorcls.wav";
		AttachObject = "MainBody";
		SourceCoord = (0.0, 3.0 ,0.0);
		Loop = no;
		}
	}
	Case 1:
		SoundEffect{
		WaveFileName = "../common_hayabusa/hayabusa_metro08_tex/sound/dooropn.wav";
		AttachObject = "MainBody";
		SourceCoord = (0.0, 3.0 ,0.0);
		Loop = no;
		}
	}
}
	FrontCabin{
		Joint3D "MainBody"{
			AttachCoord = (0.3, 2.9, -9.50);
			DirLink = "Bogie1";
		}
	}
}
