PluginHeader{
	RailSimVersion = 2.15;
	PluginType = Train;
	PluginName = "【Enth架空車】NRR５００形_V２";
	PluginAuthor = "Enthiesia";
	IconTexture = "../Common_Enth/enthiesiaicon.png";
	Description = "定義ファイル更新:211231";
}
TrainInfo{
	FrontLimit = 8.0;
	TailLimit = -8.0;
	MaxVelocity = 105.0;
	MaxAcceleration = 3.0;
	MaxDeceleration = 3.0;
	DoorClosingTime = 7;
}
DefineSwitch"――電源――"{
	Entry = "　";
}
DefineSwitch"電源"{
	GroupCommon = "電源"; 
	Entry = "入";
	Entry = "回送モード（照明のみ切）";
	Entry = "切（ランプ・照明を全消灯）";
	Entry = "パンタも下げる";
}
DefineSwitch"――見た目――"{
	Entry = "　";
}
DefineSwitch""{
	GroupCommon = "PBR効果";
	Entry = "純正版では無効なスイッチです";
	Entry = "";
	Entry = "";
}
DefineSwitch"方向幕"{
	GroupCommon = "方向幕";
	Entry = "基準(黒幕)";		//0
	Entry = "各停　東京";
	Entry = "各停　新宿";
	Entry = "各停　横浜";
	Entry = "各停　大宮";
	Entry = "各停　千葉";
	Entry = "各停　高崎";
	Entry = "各停　宇都宮";
	Entry = "各停　水戸";
	Entry = "回送";
	Entry = "試運転";	//10
	Entry = "各停　御ヶ崎";
	Entry = "急行　御ヶ崎";
	Entry = "各停　江下清水";
	Entry = "急行　江下清水";
	Entry = "各停　香坂";
}
DefineSwitch"ドア開閉"{
	GroupCommon = "ドア開閉";
	Entry = "自動（ホーム停車時に開。このモードのみ開扉ランプが点灯します）";
	Entry = "常時閉";
	Entry = "常時進行方向左側開";
	Entry = "常時進行方向右側開";
	Entry = "常時両側開";
}
DefineSwitch"パンタグラフ"{
	Entry = "なし";
	Entry = "あり（上昇）";
	Entry = "あり（下降）";
}
DefineSwitch"――基礎設定――"{
	Entry = "　";
}
DefineSwitch"内装"{
	GroupCommon = "内装";
	Entry = "あり";
	Entry = "なし";
}
DefineSwitch"車幅灯"{
	GroupCommon = "車幅灯"; 
	Entry = "夜間のみ点灯";
	Entry = "常時切";
	Entry = "常時入";
}
DefineSwitch"簡易シャドウ"{
	GroupCommon = "簡易シャドウ";
	Entry = "あり";
	Entry = "なし";
}
DefineSwitch"軌間"{
	GroupCommon = "軌間"; 
	Entry = "狭軌1067mm";
	Entry = "標準軌1435mm";
}
DefineSwitch"車番"{
	Entry = "501";
	Entry = "502";
	Entry = "503";
	Entry = "504";
	Entry = "505";
	Entry = "506";
	Entry = "507";
	Entry = "508";
	Entry = "551";
	Entry = "552";
	Entry = "553";
	Entry = "554";
	Entry = "555";
	Entry = "556";
	Entry = "557";
	Entry = "558";
}
DefineSwitch"先頭中間"{
	Entry = "先頭車";
	Entry = "中間車";
}
DefineSwitch"号車"{
	Entry = "１号車";
	Entry = "２号車";
	Entry = "３号車";
	Entry = "４号車";
	Entry = "５号車";
	Entry = "６号車";
}
DefineSwitch"電連"{
	Entry = "なし";
	Entry = "あり";
}
DefineAnimation"500LCD"{
	Frame="tex_exterior.png",180;
	ShiftTexture=0.0, 0.00;
	Frame="tex_exterior.png",180;
	ShiftTexture=0.0, 0.05;
	Frame="tex_exterior.png",180;
	ShiftTexture=0.0, 0.10;
}
PrimaryAssembly{
	Axle"syarinn1"{
		ModelFileName = "model_syarin80_n.x";
		ModelScale = 1.0;
		Turn = no;
		CastShadow = yes;

		ApplySwitch"軌間"{
			Case 1: ChangeModel = "model_syarin80_w.x",1.0;
		}//順番に注意

		Diameter = 0.8;
		Symmetric = 32;
		Coord = (6.2,0.4);
		WheelSound = yes;
	}
	Axle"syarinn2"{
		ModelFileName = "model_syarin80_n.x";
		ModelScale = 1.0;
		Turn = no;
		CastShadow = yes;

		ApplySwitch"軌間"{
			Case 1: ChangeModel = "model_syarin80_w.x",1.0;
		}//順番に注意

		Diameter = 0.8;
		Symmetric = 32;
		Coord = (4.2,0.4);
		WheelSound = yes;
	}
	Axle"syarinn3"{
		ModelFileName = "model_syarin80_n.x";
		ModelScale = 1.0;
		Turn = no;
		CastShadow = yes;

		ApplySwitch"軌間"{
			Case 1: ChangeModel = "model_syarin80_w.x",1.0;
		}//順番に注意

		Diameter = 0.8;
		Symmetric = 32;
		Coord = (-4.2,0.4);
		WheelSound = yes;
	}
	Axle"syarinn4"{
		ModelFileName = "model_syarin80_n.x";
		ModelScale = 1.0;
		Turn = no;
		CastShadow = yes;

		ApplySwitch"軌間"{
			Case 1: ChangeModel = "model_syarin80_w.x",1.0;
		}//順番に注意

		Diameter = 0.8;
		Symmetric = 32;
		Coord = (-6.2,0.4);
		WheelSound = yes;
	}
	Body"daisya1"{
		ModelFileName = "model_daisya_n.x";
		ModelScale = 1.0;
		Turn = no;
		CastShadow = yes;

		ApplySwitch"軌間"{
			Case 1: ChangeModel = "model_daisya_w.x",1.0;
		}

		JointZY"syarinn1"{
			AttachCoord = (0.0,0.0);
			LocalCoord = (1.0,0.4);
		}
		JointZY"syarinn2"{
			AttachCoord = (0.0,0.0);
			LocalCoord = (-1.0,0.4);
		}
	}
	Body"daisya2"{
		ModelFileName = "model_daisya_n.x";
		ModelScale = 1.0;
		Turn = no;
		CastShadow = yes;

		ApplySwitch"軌間"{
			Case 1: ChangeModel = "model_daisya_w.x",1.0;
		}

		JointZY"syarinn3"{
			AttachCoord = (0.0,0.0);
			LocalCoord = (1.0,0.4);
		}
		JointZY"syarinn4"{
			AttachCoord = (0.0,0.0);
			LocalCoord = (-1.0,0.4);
		}
	}

	Body"syatai"{ //interior
		ModelFileName = "";
		ModelScale = 1.0;
		CastShadow = no;

		NoCastShadow = 3,4;
		Transparent = 4;

		If!"内装"{
		ApplySwitch"先頭中間"{
			Case 0:
				If("電源" < 1){ //ON
					ChangeModel = "model_interior_s_light.x", 1.0;
				} Else { //OFF
					ChangeModel = "model_interior_s.x", 1.0;
					ChangeAlpha = 2, 0.0;
				}
			Case 1:
				If("電源" < 1){ //ON
					ChangeModel = "model_interior_t_light.x", 1.0;
				} Else { //OFF
					ChangeModel = "model_interior_t.x", 1.0;
					ChangeAlpha = 2, 0.0;
				}
		}
		}

		SetAnimation = 2,"500LCD";

		JointZY"daisya1"{
			AttachCoord = (0.0,-0.0);
			LocalCoord = (5.2,0.0);
		}
		JointZY"daisya2"{
			AttachCoord = (0.0,-0.0);
			LocalCoord = (-5.2,0.0);
		}
	}

	Object3D"exterior"{
		ModelFileName = "";
		ModelScale = 1.0;
		Turn = no;

		NoReceiveShadow = 4, 5, 6, 7, 8;
		NoCastShadow = 9, 12;
		Transparent = 10, 11;

		ApplySwitch"先頭中間"{
			Case 0:ChangeModel = "model_body_s.x", 1.0;
			Case 1:ChangeModel = "model_body_t.x", 1.0;
		}
		//PBR記述跡地
		ChangeAlpha =4, 0.0; ChangeAlpha =5, 0.0; ChangeAlpha =7, 0.0;
		If"_FRONT" == 0 && "_CONNECT1" == 0{	//先頭
			ChangeAlpha =4, 1.0;
		}
		If"_FRONT" && "_CONNECT1" == 0{	//最後尾
			ChangeAlpha =5, 1.0;
		}
		ApplySwitch"車幅灯"{
			Case 0:
			If"_NIGHT"{
				ChangeAlpha =7, 1.0;
			}
			Case 2:
				ChangeAlpha =7, 1.0;
		}
		If("電源" < 2){	//ドアが閉まっているとき、戸閉灯を消す
			If ("_DOOR1" == 0 && "_DOOR2" == 0 && "ドア開閉" == 0) || "ドア開閉" == 1{
				ChangeAlpha = 6, 0.0;
			}
		}
		If("電源" > 1){
			ChangeAlpha = 4, 0.0;
			ChangeAlpha = 5, 0.0;
			ChangeAlpha = 6, 0.0;
			ChangeAlpha = 7, 0.0;
			ChangeAlpha = 8, 0.0;
		}

//方向幕制御。DefineSwitch欄で対照
		ApplySwitch"方向幕"{
			Case 1:ShiftTexture = 8, 0.00, 0.0625;
			Case 2:ShiftTexture = 8, 0.00, 0.125;
			Case 3:ShiftTexture = 8, 0.00, 0.1875;
			Case 4:ShiftTexture = 8, 0.00, 0.25;
			Case 5:ShiftTexture = 8, 0.00, 0.3125;
			Case 6:ShiftTexture = 8, 0.00, 0.375;
			Case 7:ShiftTexture = 8, 0.00, 0.4375;
			Case 8:ShiftTexture = 8, 0.00, 0.5;
			Case 9:ShiftTexture = 8, 0.00, 0.5625;
			Case 10:ShiftTexture =8, 0.00, 0.625;
			Case 11:ShiftTexture = 8, 0.00, 0.6875;
			Case 12:ShiftTexture = 8, 0.00, 0.75;
			Case 13:ShiftTexture = 8, 0.00, 0.8125;
			Case 14:ShiftTexture = 8, 0.00, 0.875;
			Case 15:ShiftTexture = 8, 0.00, 0.9375;
		}
		ApplySwitch"車番"{
			Case 1:ShiftTexture = 9, 0.00, 0.0625;
			Case 2:ShiftTexture = 9, 0.00, 0.125;
			Case 3:ShiftTexture = 9, 0.00, 0.1875;
			Case 4:ShiftTexture = 9, 0.00, 0.25;
			Case 5:ShiftTexture = 9, 0.00, 0.3125;
			Case 6:ShiftTexture = 9, 0.00, 0.375;
			Case 7:ShiftTexture = 9, 0.00, 0.4375;
			Case 8:ShiftTexture = 9, 0.00, 0.5;
			Case 9:ShiftTexture = 9, 0.00, 0.5625;
			Case 10:ShiftTexture = 9, 0.00, 0.625;
			Case 11:ShiftTexture = 9, 0.00, 0.6875;
			Case 12:ShiftTexture = 9, 0.00, 0.75;
			Case 13:ShiftTexture = 9, 0.00, 0.8125;
			Case 14:ShiftTexture = 9, 0.00, 0.875;
			Case 15:ShiftTexture = 9, 0.00, 0.9375;
		}
		ApplySwitch"号車"{
			Case 1:ShiftTexture = 12, 0.05, 0.00;
			Case 2:ShiftTexture = 12, 0.00, 0.05;
			Case 3:ShiftTexture = 12, 0.05, 0.05;
			Case 4:ShiftTexture = 12, 0.00, 0.10;
			Case 5:ShiftTexture = 12, 0.05, 0.10;
			Case 6:ShiftTexture = 12, 0.00, 0.15;
			Case 7:ShiftTexture = 12, 0.05, 0.15;
		}

		Joint3D"syatai"{
			AttachCoord = (0, 0, 0);
		}
	}

	Object3D"bodyshadow"{
		ModelFileName = "";
		ModelScale = 1.0;
		CastShadow = no;

		NoReceiveShadow = 0;
		Transparent = 0;

		ApplySwitch"簡易シャドウ"{
			Case 0:ChangeModel = "model_bodyshadow.x", 1.0;
		}

		Joint3D"syatai"{
			AttachCoord = (0, 0, 0);
		}
	}

	Object3D"panta"{
		ModelFileName = "";
		ModelScale = 1.0;
		ApplySwitch"パンタグラフ"{
			Case 1:
				If("電源" < 3){
					ChangeModel = "model_panta_a.x", 1.0;
				} Else {
					ChangeModel = "model_panta_b.x", 1.0;
				}
			Case 2:ChangeModel = "model_panta_b.x", 1.0;
		}
		Joint3D"syatai"{
			AttachCoord = (0, 0, 0);
		}
	}

	Object3D"coupler"{
		ModelFileName = "";
		ModelScale = 1.0;
		If!"先頭中間"{
			ApplySwitch"電連"{
				Case 0:ChangeModel = "model_coup_a.x", 1.0;
				Case 1:ChangeModel = "model_coup_b.x", 1.0;
			}
		}
		Joint3D"syatai"{
			AttachCoord = (0, 0, 0);
		}
	}

	Object3D"airspring"{
		ModelFileName = "";
		ModelScale = 1.0;
		ApplySwitch"軌間"{
			Case 0:ChangeModel = "model_airspring_n.x", 1.0;
			Case 1:ChangeModel = "model_airspring_w.x", 1.0;
		}
		Joint3D"syatai"{
			AttachCoord = (0, 0, 0);
		}
	}

	Object3D"daisyatan"{
		ModelFileName = "";
		ModelScale = 1.0;
		If!"先頭中間"{
			If!"軌間"{
				ChangeModel = "model_daisyatan_n.x", 1.0;
			} Else {
				ChangeModel = "model_daisyatan_w.x", 1.0;
			}
		}
		Joint3D"daisya1"{
			AttachCoord = (0, 0, 0);
		}
	}

//ドア開閉制御。DOORスイッチはZ正方向が基準。注意
//左左
	Object3D"doorRL"{
		ModelFileName = "model_door_LL.x";
		ModelScale = 1.0;
		NoShadow = 4,5;
//		Transparent = 4;
		If("電源" > 0){
			ChangeAlpha =2, 0.0;
		}
		//PBR記述跡地
		If"_FRONT"{
			ApplySwitch"ドア開閉"{
			Case 3:
				StaticMove{
					Displacement = (0,0,0.645);
					PreAnimationDelay = 0;
					AnimationTime = 3;
					PostAnimationDelay = 0;
				}
			}
		}
		If!"_FRONT"{
			ApplySwitch"ドア開閉"{
			Case 2:
				StaticMove{
					Displacement = (0,0,0.645);
					PreAnimationDelay = 0;
					AnimationTime = 3;
					PostAnimationDelay = 0;
				}
			}
		}
		ApplySwitch"ドア開閉"{
		Case 4:
			StaticMove{
				Displacement = (0,0,0.645);
				PreAnimationDelay = 0;
				AnimationTime = 3;
				PostAnimationDelay = 0;
			}
		}
		If"_DOOR1"{
			ApplySwitch"ドア開閉"{
			Case 0:
				StaticMove{
					Displacement = (0,0,0.645);
					PreAnimationDelay = 1;
					AnimationTime = 3;
					PostAnimationDelay = 2;
				}
			}
		}
		Joint3D"syatai"{
			AttachCoord = (0,0,0);
		}
	}
//左右
	Object3D"doorRR"{
		ModelFileName = "model_door_LR.x";
		ModelScale = 1.0;
		NoShadow = 4,5;
//		Transparent = 4;
		If("電源" > 0){
			ChangeAlpha =2, 0.0;
		}
		//PBR記述跡地
		If"_FRONT"{
			ApplySwitch"ドア開閉"{
				Case 3:StaticMove{
					Displacement = (0,0,-0.645);
					PreAnimationDelay = 0;
					AnimationTime = 3;
					PostAnimationDelay = 0;
				}
			}
		}
		If!"_FRONT"{
			ApplySwitch"ドア開閉"{
				Case 2:StaticMove{
					Displacement = (0,0,-0.645);
					PreAnimationDelay = 0;
					AnimationTime = 3;
					PostAnimationDelay = 0;
				}
			}
		}
		ApplySwitch"ドア開閉"{
			Case 4:StaticMove{
					Displacement = (0,0,-0.645);
					PreAnimationDelay = 0;
					AnimationTime = 3;
					PostAnimationDelay = 0;
			}
		}
		If"_DOOR1"{
			ApplySwitch"ドア開閉"{
				Case 0:StaticMove{
					Displacement = (0,0,-0.645);
					PreAnimationDelay = 1;
					AnimationTime = 3;
					PostAnimationDelay = 2;
				}
			}
		}
		Joint3D"syatai"{
			AttachCoord = (0,0,0);
		}
	}
//右左
	Object3D"doorLL"{
		ModelFileName = "model_door_RL.x";
		ModelScale = 1.0;
		NoShadow = 4,5;
//		Transparent = 4;
		If("電源" > 0){
			ChangeAlpha =2, 0.0;
		}
		//PBR記述跡地
		If"_FRONT"{
			ApplySwitch"ドア開閉"{
				Case 2:StaticMove{
					Displacement = (0,0,-0.645);
					PreAnimationDelay = 0;
					AnimationTime = 3;
					PostAnimationDelay = 0;
				}
			}
		}
		If!"_FRONT"{
			ApplySwitch"ドア開閉"{
				Case 3:StaticMove{
					Displacement = (0,0,-0.645);
					PreAnimationDelay = 0;
					AnimationTime = 3;
					PostAnimationDelay = 0;
				}
			}
		}
		ApplySwitch"ドア開閉"{
			Case 4:StaticMove{
					Displacement = (0,0,-0.645);
					PreAnimationDelay = 0;
					AnimationTime = 3;
					PostAnimationDelay = 0;
			}
		}
		If"_DOOR2"{
			ApplySwitch"ドア開閉"{
				Case 0:StaticMove{
					Displacement = (0,0,-0.645);
					PreAnimationDelay = 1;
					AnimationTime = 3;
					PostAnimationDelay = 2;
				}
			}
		}
		Joint3D"syatai"{
			AttachCoord = (0,0,0);
		}
	}
//右右
	Object3D"doorLR"{
		ModelFileName = "model_door_RR.x";
		ModelScale = 1.0;
		NoShadow = 4,5;
//		Transparent = 4;
		If("電源" > 0){
			ChangeAlpha =2, 0.0;
		}
		//PBR記述跡地
		If"_FRONT"{
			ApplySwitch"ドア開閉"{
				Case 2:StaticMove{
					Displacement = (0,0,0.645);
					PreAnimationDelay = 0;
					AnimationTime = 3;
					PostAnimationDelay = 0;
				}
			}
		}
		If!"_FRONT"{
			ApplySwitch"ドア開閉"{
				Case 3:StaticMove{
					Displacement = (0,0,0.645);
					PreAnimationDelay = 0;
					AnimationTime = 3;
					PostAnimationDelay = 0;
				}
			}
		}
		ApplySwitch"ドア開閉"{
			Case 4:StaticMove{
					Displacement = (0,0,0.645);
					PreAnimationDelay = 0;
					AnimationTime = 3;
					PostAnimationDelay = 0;
			}
		}
		If"_DOOR2"{
			ApplySwitch"ドア開閉"{
				Case 0:StaticMove{
					Displacement = (0,0,0.645);
					PreAnimationDelay = 1;
					AnimationTime = 3;
					PostAnimationDelay = 2;
				}
			}
		}
		Joint3D"syatai"{
			AttachCoord = (0,0,0);
		}
	}
	If"_FRONT" == 0 && "_CONNECT1" == 0 && ("電源" < 2){	//進行方向が正かつ正方向の先頭車であり、電源がオン
		Headlight{
			AttachObject = "syatai";
			SourceCoord = (-0.92, 1.33, 7.63);
			Direction = (0.0, 0.0, 15.0);
			MaxDistance = 100.0;
			LensFlare{
				StartAngle = 90.0;
				Circle{
					Distance = 0.0;
					Radius = 0.2;
					InnerColor = #f3ffffff;
					//InnerColor = #f3ffff9a;
					OuterColor = #00000000;
					//OuterColer = #00ffff75;
				}
			}
		}
		Headlight{
			AttachObject = "syatai";
			SourceCoord = (0.92, 1.33, 7.63);
			Direction = (0.0, 0.0, 15.0);
			MaxDistance = 100.0;
			LensFlare{
				StartAngle = 90.0;
				Circle{
					Distance = 0.0;
					Radius = 0.2;
					InnerColor = #f3ffffff;
					//InnerColor = #f3ffff9a;
					OuterColor = #00000000;
					//OuterColer = #00ffff75;
				}
			}
		}
	}
	FrontCabin{
		Joint3D "syatai"{
			AttachCoord = (-0.2, 2.4, 6.4);
			DirLink = "syatai";
		}
	}
}