PluginHeader{
	RailSimVersion = 2.00;
	PluginType = Train;
	PluginName = "都電7500形更新車(k)";
	PluginAuthor = "n";
	IconTexture = "icon.png";
	Description = "";
}

TrainInfo{
	FrontLimit = 7.0;
	TailLimit = -7.0;
	MaxVelocity = 40.0;
	MaxAcceleration = 3.0;
	MaxDeceleration = 3.5;
	DoorClosingTime = 5.0;
}
DefineSwitch "電源"{
	Entry = "入";
	Entry = "切";
}
DefineSwitch "ビューゲル向き"{
	Entry = "自動";
	Entry = "正方向";
	Entry = "負方向";
}
DefineSwitch "ライト"{
	Entry = "入";
	Entry = "切";
}
DefineSwitch "ブレーキライト"{
	Entry = "入";
	Entry = "切";
}
DefineSwitch "室内灯"{
	Entry = "入";
	Entry = "切";
}
DefineSwitch "幕灯"{
	Entry = "入";
	Entry = "切";
}
DefineSwitch "行先"{
	Entry = "試運転";
	Entry = "回送車";
	Entry = "貸切車";
	Entry = "早稲田";
	Entry = "三ノ輪橋";
	Entry = "大塚駅前";
	Entry = "町屋駅前";
	Entry = "荒川車庫前";
	Entry = "王子駅前";
	Entry = "早稲田(終前)";
	Entry = "三ノ輪橋(終前)";
	Entry = "大塚駅前(終前)";
	Entry = "町屋駅前(終前)";
	Entry = "荒川車庫前(終前)";
	Entry = "王子駅前(終前)";
	Entry = "早稲田(終車)";
	Entry = "三ノ輪橋(終車)";
	Entry = "大塚駅前(終車)";
	Entry = "町屋駅前(終車)";
	Entry = "荒川車庫前(終車)";
	Entry = "王子駅前(終車)";
}
DefineSwitch "ドア開閉"{
	Entry = "未実装";
//	Entry = "自動";
//	Entry = "自動(乗車扉)";
//	Entry = "自動(降車扉)";
//	Entry = "全開";
//	Entry = "締切";
}
DefineSwitch "窓"{
	Entry = "未実装";
//	Entry = "閉";
//	Entry = "一部開1";
//	Entry = "一部開2";
}
DefineSwitch "混雑度"{
	Entry = "低";
	Entry = "高";
}
DefineSwitch "車両"{
	Entry = "7501";
	Entry = "7503";
	Entry = "7505";
	Entry = "7506";
	Entry = "7507";
	Entry = "7510";
	Entry = "7511";
	Entry = "7512";
	Entry = "7513";
	Entry = "7515";
	Entry = "7516";
	Entry = "7518";
	Entry = "7520";
}
DefineSwitch "形態"{
	Entry = "登場時";
	Entry = "1990年〜";//集電機器更新
	Entry = "1993年〜";//銀杏マーク追加
	Entry = "200x年〜";//集電機器交換(一部)・冷房更新(一部)
//	Entry = "2011年〜";//引退
}
DefineSwitch "床下汚れ"{
	Entry = "無";
	Entry = "有";
}
DefineSwitch "広告サボ"{
	Entry = "無";
	Entry = "1";
//	Entry = "2";
//	Entry = "3";
}
DefineSwitch "車外広告"{
	Entry = "無";
//	Entry = "1";
//	Entry = "2";
//	Entry = "3";
}
PrimaryAssembly{
	Axle "wheel1"{
		ModelFileName = "Wheel.x";
		ModelScale = 1.0;
		Diameter = 0.66;
		Symmetric = 24;
		Coord = (4.05,0.33);
	}
	Axle "wheel2"{
		ModelFileName = "Wheel.x";
		ModelScale = 1.0;
		Diameter = 0.66;
		Symmetric = 24;
		Coord = (2.65,0.33);
	}
	Axle "wheel3"{
		ModelFileName = "Wheel.x";
		ModelScale = 1.0;
		Diameter = 0.66;
		Symmetric = 24;
		Coord = (-2.65,0.33);
	}
	Axle "wheel4"{
		ModelFileName = "Wheel.x";
		ModelScale = 1.0;
		Diameter = 0.66;
		Symmetric = 24;
		Coord = (-4.05,0.33);
	}
	Body "Bogie1"{
		ModelFileName = "bogie.x";
		ModelScale = 1.0;
		ApplySwitch "床下汚れ"{
		Case 1:ChangeTexture = 0, "tex/台車1.png";ChangeTexture = 1, "tex/台車1.png";
		}  
		JointZY "wheel1"{
			AttachCoord = (0.0,0.0);
			LocalCoord = (0.7,0.0);
		}
		JointZY "wheel2"{
			AttachCoord = (0.0,0.0);
			LocalCoord = (-0.7,0.0);
		}
	}
	Body "Bogie2"{
		ModelFileName = "bogie.x";
		ModelScale = 1.0;
		ApplySwitch "床下汚れ"{
		Case 1:ChangeTexture = 0, "tex/台車1.png";ChangeTexture = 1, "tex/台車1.png";
		}  
		JointZY "wheel3"{
			AttachCoord = (0,0.0);
			LocalCoord = (0.7,0.0);
		}
		JointZY "wheel4"{
			AttachCoord = (0,0.0);
			LocalCoord = (-0.7,0.0);
		}
	}
	Body "Dummy"{
		ModelFileName = "";
		JointZY "Bogie1"{
			AttachCoord = (0.0, 0.0);
			LocalCoord = (3.35, 0.33);
		}
		JointZY "Bogie2"{
			AttachCoord = (0.0, 0.0);
			LocalCoord = (-3.35, 0.33);
		}
	}
	Object3D "mirrorz"{
		ModelFileName = "mirror0.x";
		EnvMap = 3;
		If "_FRONT"{
			StaticRotation{
				RotationAxis = (0.0, 1.0, 0.0);
				RotationAngle = 180;
			}
		}
		Joint3D "Dummy"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}
	Object3D "brakez"{
		ModelFileName = "";
		ApplySwitch "形態"{
		Case 3: 
		ApplySwitch "_FRONT"{
		Case 0:ChangeModel = "brake.x", 1.0;
		}
		}
		If "電源"==0 && "ブレーキライト"==0 && "_ACCEL"<-0{
		ChangeAlpha = 1, 1.0;
		}
		Else {
		ChangeAlpha = 1, 0.0;
		}
		Joint3D "Dummy"{
			AttachCoord = (0.0, -0.08, 0.0);
		}
	}
	Object3D "brake-z"{
		ModelFileName = "";
		ApplySwitch "形態"{
		Case 3: 
		ApplySwitch "_FRONT"{
		Case 1:ChangeModel = "brake.x", 1.0;
		}
		}
		If "電源"==0 && "ブレーキライト"==0 && "_ACCEL"<-0{
		ChangeAlpha = 1, 1.0;
		}
		Else {
		ChangeAlpha = 1, 0.0;
		}
		Joint3D "Dummy"{
			AttachCoord = (0.0, -0.08, 0.0);
			AttachDir = (0.0, 0.0, -1.0);
		}
	}
	Object3D "connector"{
		ModelFileName = "";
		If"_CONNECT2"{
		ChangeModel = "connector.x", 1.0;
		}
		Joint3D "Dummy"{
			AttachCoord = (0.0, 0.705, -7.0);
		}
	}
	Object3D "MainBody"{
		ModelFileName = "body.x";
		AlphaZeroTest = 16;
		//NoShadow = 6,7,8,9,10,11,12,13,14,15,16,17,18,19;
		NoCastShadow = 30,31,32,33,34,35;
		If !"電源"{
			If !"室内灯"{
				ChangeMaterial{
					MaterialID = 3,4,5,6,7,8,9,10,11,12,13,14,15,16,17;
					Emissive = 0.6, 0.6, 0.6; 
				}
			}
			If !"幕灯"{
				ChangeMaterial{
					MaterialID = 0;
					Emissive = 1.0, 1.0, 1.0; 
				}
			}
　　　　　　}
		ApplySwitch "行先"{
		Case 0:
			ShiftTexture = 0, -0.125, -0.0625;
		Case 1:
			ShiftTexture = 0, -0.125, -0.03125;
		Case 2:
			ShiftTexture = 0, -0.125, 0.0;
		Case 3:
			ShiftTexture = 0, 0.0, -0.0625;
		Case 4:
			ShiftTexture = 0, 0.0, -0.03125;
		Case 5:
			ShiftTexture = 0, 0.0, 0.0;
		Case 6:
			ShiftTexture = 0, 0.0, 0.03125;
		Case 7:
			ShiftTexture = 0, 0.0, 0.0625;
		Case 8:
			ShiftTexture = 0, 0.0, 0.09375;
		Case 9:
			ShiftTexture = 0, 0.125, -0.0625;
		Case 10:
			ShiftTexture = 0, 0.125, -0.03125;
		Case 11:
			ShiftTexture = 0, 0.125, 0.0;
		Case 12:
			ShiftTexture = 0, 0.125, 0.03125;
		Case 13:
			ShiftTexture = 0, 0.125, 0.0625;
		Case 14:
			ShiftTexture = 0, 0.125, 0.09375;
		Case 15:
			ShiftTexture = 0, 0.25, -0.0625;
		Case 16:
			ShiftTexture = 0, 0.25, -0.03125;
		Case 17:
			ShiftTexture = 0, 0.25, 0.0;
		Case 18:
			ShiftTexture = 0, 0.25, 0.03125;
		Case 19:
			ShiftTexture = 0, 0.25, 0.0625;
		Case 20:
			ShiftTexture = 0, 0.25, 0.09375;
		}
		ApplySwitch "車両"{
		Case 0:
			ShiftTexture = 32, -0.125, -0.09375;
			ShiftTexture = 33, -0.125, -0.09375;
		Case 1:
			ShiftTexture = 32, -0.125, -0.046875;
			ShiftTexture = 33, -0.125, -0.046875;
		Case 2:
			ShiftTexture = 32, -0.125, 0.0;
			ShiftTexture = 33, -0.125, 0.0;
		Case 3:
			ShiftTexture = 32, -0.125, 0.046875;
			ShiftTexture = 33, -0.125, 0.046875;
		Case 4:
			ShiftTexture = 32, -0.125, 0.09375;
			ShiftTexture = 33, -0.125, 0.09375;
		Case 5:
			ShiftTexture = 32, 0.0, -0.09375;
			ShiftTexture = 33, 0.0, -0.09375;
		Case 6:
			ShiftTexture = 32, 0.0, -0.046875;
			ShiftTexture = 33, 0.0, -0.046875;
		Case 7:
			ShiftTexture = 32, 0.0, 0.0;
			ShiftTexture = 33, 0.0, 0.0;
		Case 8:
			ShiftTexture = 32, 0.0, 0.046875;
			ShiftTexture = 33, 0.0, 0.046875;
		Case 9:
			ShiftTexture = 32, 0.0, 0.09375;
			ShiftTexture = 33, 0.0, 0.09375;
		Case 10:
			ShiftTexture = 32, 0.125, -0.09375;
			ShiftTexture = 33, 0.0, 0.09375;
		Case 11:
			ShiftTexture = 32, 0.125, -0.046875;
			ShiftTexture = 33, 0.125, -0.046875;
		Case 12:
			ShiftTexture = 32, 0.125, 0.0;
			ShiftTexture = 33, 0.125, 0.0;
		}
		If "形態"<2{
			ChangeAlpha = 30, 0.0;
			ChangeAlpha = 31, 0.0;
		}
		If "形態"<3{
		ApplySwitch "混雑度"{
		Case 0: ChangeTexture = 35, "tex/窓車外1.png";  
		Case 1:ChangeTexture = 35, "tex/窓車外1_混.png";  
		}
		}Else{
		ApplySwitch "混雑度"{
		Case 0: ChangeTexture = 35, "tex/窓車外2.png";  
		Case 1:ChangeTexture = 35, "tex/窓車外2_混.png";  
		}
		}
		Joint3D "Dummy"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}
	Object3D "window"{
		ModelFileName = "";
		NoCastShadow = 1,2;
		ApplySwitch "窓"{
		Case 0: ChangeModel = "window0.x", 1.0;
		Case 1: ChangeModel = "window1.x", 1.0;     
		Case 2: ChangeModel = "window2.x", 1.0;
		}
		ApplySwitch "混雑度"{
		Case 0: ChangeTexture = 1, "tex/窓車外1.png";  
		Case 1: ChangeTexture = 1, "tex/窓車外1_混.png";  ShiftTexture = 2, 0.0, 0.078125;
		}
		Joint3D "Dummy"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}
	Object3D "Lightz"{
		ModelFileName = "light.x";
		If "電源"==0 &&"ライト"==0{
			If"_FRONT"==0{
				ChangeAlpha = 3, 0.0;
				NoReceiveShadow = 1;
				ChangeTexture = 1, "tex/前照灯入.png";  
				ChangeMaterial{
					MaterialID = 1;
					Emissive = 1.0, 1.0, 1.0;
				}
			}
			If "_FRONT"==1{
				NoReceiveShadow = 2;
				ChangeTexture = 2, "tex/後部灯入.png";  
				ChangeMaterial{
				MaterialID = 2;
					Emissive = 1.0, 1.0, 1.0;
				}
			}
		}
		Joint3D "MainBody"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}

	Object3D "Light-z"{
		ModelFileName = "light.x";
		If "電源"==0 &&"ライト"==0{
			If"_FRONT"==1{
				ChangeAlpha = 3, 0.0;
				NoReceiveShadow = 1;
				ChangeTexture = 1, "tex/前照灯入.png";  
				ChangeMaterial{
					MaterialID = 1;
					Emissive = 1.0, 1.0, 1.0;
				}
			}
			If "_FRONT"==0{
				NoReceiveShadow = 2;
				ChangeTexture = 2, "tex/後部灯入.png";  
				ChangeMaterial{
				MaterialID = 2;
					Emissive = 1.0, 1.0, 1.0;
				}
			}
		}
		Joint3D "MainBody"{
			AttachCoord = (0.0, 0.0, 0.0);
			AttachDir = (0.0, 0.0, -1.0);
		}
	}
	Object3D "sideboard"{
		ModelFileName = "";
		If "形態"<3{
			ChangeModel = "sideboard.x", 1.0;
		}
		ApplySwitch "広告サボ"{
		Case 0: ChangeAlpha = 1, 0.0;ChangeAlpha = 2, 0.0;NoShadow = 1,2;
		Case 1:ChangeTexture = 1, "広告/車外広告1.png";ChangeTexture = 2, "広告/車外広告2.png";       
		Case 2:ChangeTexture = 1, "広告/車外広告3.png";ChangeTexture = 2, "広告/車外広告4.png";       
		Case 3:ChangeTexture = 1, "広告/車外広告0.png";ChangeTexture = 2, "広告/車外広告0.png";
		}
		Joint3D "MainBody"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}
	Object3D "speaker"{
		ModelFileName = "speaker1.x";
		NoCastShadow = 1;
		Joint3D "MainBody"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}
	Object3D "cooler"{
		ModelFileName = "cooler1.x";
		ApplySwitch "車両"{
		Case 0,1,3,8:
			ApplySwitch "形態"{
			Case 3:
				ChangeModel = "cooler2.x", 1.0;
			}
		}
		Joint3D "MainBody"{
			AttachCoord = (0.0, 0.02, 0.0);
		}
	}
	Object3D "siv"{
		ModelFileName = "siv1.x";
		If "形態">2{
			ChangeModel = "siv2.x", 1.0;
			ChangeTexture = 0, "tex/補助電源1.png"; 
		}
		Joint3D "MainBody"{
			AttachCoord = (0.0, 0.02, 0.0);
		}
	}
	Object3D "yukasita"{
		ModelFileName = "yuka1.x";
		ApplySwitch "床下汚れ"{
		Case 0:
			ChangeTexture = 0, "tex/床下.png";  ChangeTexture = 1, "tex/床下.png";  
		Case 1:
			ChangeTexture = 0, "tex/床下1.png"; ChangeTexture = 1, "tex/床下1.png";    
		}
		Joint3D "MainBody"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}
	Object3D "BugelBasez"{
		ModelFileName = "";
		If !"形態"{
			ChangeModel = "bugelbase.x", 1.0;
		}
		Joint3D "MainBody"{
			AttachCoord = (0.0, 3.42, 0.0);
			AttachDir = (0.0, 0.0, 1.0);
		}
	}
	Object3D "Bugelz"{
		ModelFileName = "";
		If !"形態"&&((!"ビューゲル向き"&&!"_FRONT")||"ビューゲル向き"==1){
			If !"電源"{
				TrackingRotation{
					TrackingID = "Trolley";
					RotationRadius = 2.01;
					SliderRange = 0.8;
					RotationAxis = (1.0, 0.0, 0.0);
					RotationAngle = 51.0;
					AnimationTime = 3.0;
				}
			}
			ChangeModel = "bugel.x", 1.0;
		}
		Joint3D "BugelBasez"{
			AttachCoord = (0.0, 0.1, 0.0);
		}
	}
	Object3D "BugelBase-z"{
		ModelFileName = "";
		Joint3D "MainBody"{
			AttachCoord = (0.0, 3.42, 0.0);
			AttachDir = (0.0, 0.0, 1.0);
		}
	}
	Object3D "Bugel-z"{
		ModelFileName = "";
		If !"形態"&&((!"ビューゲル向き"&&"_FRONT")||"ビューゲル向き"==2){
			If !"電源"{
				TrackingRotation{
					TrackingID = "Trolley";
					RotationRadius = 2.01;
					SliderRange = 0.8;
					RotationAxis = (-1.0, 0.0, 0.0);
					RotationAngle = 51.0;
					AnimationTime = 3.0;
				}
			}
			ChangeModel = "bugel1.x", 1.0;
		}
		Joint3D "BugelBasez"{
			AttachCoord = (0.0, 0.1, 0.0);
		}
	}
	Object3D "HishiBase"{
		ModelFileName = "HishiBase.x";
		If !"形態"||("車両"==0 && "形態">2){
			ChangeModel = "", 1.0;
		}
		Joint3D "MainBody"{
			AttachCoord = (0.0, 3.22, 0.0);
			AttachDir = (0.0, 0.0, -1.0);
		}
	}
	Object3D "HishiShoe"{
		ModelFileName = "HishiShoe.x";
		If !"形態"||("車両"==0 && "形態">2){
			ChangeModel = "", 1.0;
		}
		ApplySwitch "電源"{
		Case 0:
			TrackingMove{
				TrackingID = "Trolley";			
				AscentRange = 1.48;
				SliderRange = 1.0;
				Displacement = (0.0, 1.48, 0.0);
				PreAnimationDelay = 0.1;
				AnimationTime = 2.0;
			}
		}
		Joint3D "HishiBase"{
			AttachCoord = (0.0, 0.4, 0.0);
		}
	}
	TriangleZY{
		Link "HishiArm-y-z"{
			ModelFileName = "HishiArm-y.x";
			If !"形態"||("車両"==0 && "形態">2){
				ChangeModel = "", 1.0;
			}
			JointZYX "HishiBase"{
				AttachCoord = (0.40, 0.15);
				LocalCoord = (0.0, 0.0);
			}
			LinkCoord = (1.00, 0.00);
		}
		Link "HishiArmy-z"{
			ModelFileName = "HishiArmy.x";
			If !"形態"||("車両"==0 && "形態">2){
				ChangeModel = "", 1.0;
			}
			JointZYX "HishiShoe"{
				AttachCoord = (0.0, -0.1);
				LocalCoord = (0.0, 0.0);
			}
			LinkCoord = (1.4, -0.00);
		}
	}
	TriangleZY{
		Link "HishiArmyz"{
			ModelFileName = "HishiArmy.x";
			Turn = yes;
			If !"形態"||("車両"==0 && "形態">2){
				ChangeModel = "", 1.0;
			}
			JointZYX "HishiShoe"{
				AttachCoord = (0.0, -0.1);
				LocalCoord = (0.0, 0.0);
			}
			LinkCoord = (1.4, -0.00);
		}
		Link "HishiArm-yz"{
			ModelFileName = "HishiArm-y.x";
			Turn = yes;
			If !"形態"||("車両"==0 && "形態">2){
				ChangeModel = "", 1.0;
			}
			JointZYX "HishiBase"{
				AttachCoord = (-0.40, 0.15);
				LocalCoord = (0.0, 0.02);
			}
			LinkCoord = (1.00, 0.00);
		}
	}
	Object3D "SingleBase"{
		ModelFileName = "";
		If "車両"==0 && "形態">2{
			ChangeModel = "SingleBase.x", 1.0;
		}
		Joint3D "MainBody"{
			AttachCoord = (0.0, 3.22, 0.0);
			AttachDir = (0.0, 0.0, 1.0);
		}
	}
	Object3D "SingleShoe"{
		ModelFileName = "";
		If "車両"==0 && "形態">2{
			ChangeModel = "HishiShoe.x", 1.0;
		}
		ApplySwitch "電源"{
		Case 0:
			TrackingMove{
				TrackingID = "Trolley";			
				AscentRange = 1.48;
				SliderRange = 1.0;
				Displacement = (0.0, 1.48, 0.0);
				PreAnimationDelay = 0.1;
				AnimationTime = 3.0;
			}
		}
		Joint3D "SingleBase"{
			AttachCoord = (0.0, 0.4, -0.3);
		}
	}
	TriangleZY{
		Link "Single-y"{
			ModelFileName = "";
			If "車両"==0 && "形態">2{
				ChangeModel = "Single-y.x", 1.0;
			}
			JointZYX "SingleBase"{
				AttachCoord = (-0.2, 0.2);
				LocalCoord = (0.0, 0.0);
			}
			LinkCoord = (1.2, 0.0);
		}
		Link "Singley"{
			ModelFileName = "";
			If "車両"==0 && "形態">2{
				ChangeModel = "Singley.x", 1.0;
			}
			JointZYX "SingleShoe"{
				AttachCoord = (0.0, -0.1);
				LocalCoord = (0.0, 0.0);
			}
			LinkCoord = (1.3, 0.0);
		}
	}

	TriangleZY{
		Link "Single-y1"{
			ModelFileName = "";
			If "車両"==0 && "形態">2{
				ChangeModel = "Single-y1.x", 1.0;
			}
			JointZYX "SingleBase"{
				AttachCoord = (0.3, 0.15);
				LocalCoord = (0.0, 0.0);
			}
			LinkCoord = (0.85, -0.0);
		}
		Link "SingleDummy"{
			ModelFileName = "";
			JointZYX "Singley"{
				AttachCoord = (1.38, -0.0);
				LocalCoord = (0.0, 0.0);
			}
			LinkCoord = (0.0, -0.1);
		}
	}

	FrontCabin{
		Joint3D "Dummy"{
			AttachCoord = (0.0,0.0,0.0);
		}
	}
}

