using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.CompilerServices;
using MaidStatus;
using Schedule;
using script;
using UnityEngine;
using wf;

public class BaseKagManager : IDisposable
{
	public BaseKagManager(TJSScript tjs, ScriptManager script_mgr)
	{
		NDebug.AssertNull(tjs != null);
		this.maidOffsetSetList = new List<Maid>();
		this.tjs_ = tjs;
		this.script_mgr_ = script_mgr;
		this.kag_ = new KagScript(this.tjs_);
		this.kag_.SetReplaceEvent(new KagScript.ReplaceCallBack(this.ReplaceFileNameCallBack));
		this.kag_.onScenarioLoadEventList.Add(new KagScript.OnScenarioLoadCallBack(this.OnScenarioLoadEvent));
		this.exec_wait_data_.Clear();
	}

	~BaseKagManager()
	{
		this.Dispose(false);
	}

	public virtual void Initialize()
	{
		this.kag_.AddTagCallBack("wait", new KagScript.KagTagCallBack(this.TagWait));
		this.kag_.AddTagCallBack("face", new KagScript.KagTagCallBack(this.TagFace));
		this.kag_.AddTagCallBack("faceblend", new KagScript.KagTagCallBack(this.TagFaceBlend));
		this.kag_.AddTagCallBack("faceblend2", new KagScript.KagTagCallBack(this.TagFaceBlend2));
		this.kag_.AddTagCallBack("startkuchipakupattern", new KagScript.KagTagCallBack(this.TagStartKuchipakuPattern));
		this.kag_.AddTagCallBack("stopkuchipakupattern", new KagScript.KagTagCallBack(this.TagStopKuchipakuPattern));
		this.kag_.AddTagCallBack("motion", new KagScript.KagTagCallBack(this.TagMotion));
		this.kag_.AddTagCallBack("motionnext", new KagScript.KagTagCallBack(this.TagMotionNext));
		this.kag_.AddTagCallBack("motionnextabs", new KagScript.KagTagCallBack(this.TagMotionNextAbs));
		this.kag_.AddTagCallBack("motionstop", new KagScript.KagTagCallBack(this.TagMotionStop));
		this.kag_.AddTagCallBack("motionlayerstop", new KagScript.KagTagCallBack(this.TagMotionLayerStop));
		this.kag_.AddTagCallBack("motionautotwist", new KagScript.KagTagCallBack(this.TagMotionAutoTwist));
		this.kag_.AddTagCallBack("motionblendenabled", new KagScript.KagTagCallBack(this.TagMotionBlendEnabled));
		this.kag_.AddTagCallBack("motionscript", new KagScript.KagTagCallBack(this.TagMotionScript));
		this.kag_.AddTagCallBack("itemanime", new KagScript.KagTagCallBack(this.TagItemAnime));
		this.kag_.AddTagCallBack("hairphisics", new KagScript.KagTagCallBack(this.TagHairPhisics));
		this.kag_.AddTagCallBack("bustmove", new KagScript.KagTagCallBack(this.TagBustMove));
		this.kag_.AddTagCallBack("phisicshit", new KagScript.KagTagCallBack(this.TagPhisicsHit));
		this.kag_.AddTagCallBack("ikattachpoint", new KagScript.KagTagCallBack(this.TagIKAttachPoint));
		this.kag_.AddTagCallBack("ikattachbone", new KagScript.KagTagCallBack(this.TagIKAttachBone));
		this.kag_.AddTagCallBack("ikdetach", new KagScript.KagTagCallBack(this.TagIKDetach));
		this.kag_.AddTagCallBack("allikdetach", new KagScript.KagTagCallBack(this.TagAllIKDetach));
		this.kag_.AddTagCallBack("ikattachodogu", new KagScript.KagTagCallBack(this.TagIKAttachOdogu));
		this.kag_.AddTagCallBack("ikattachikbone", new KagScript.KagTagCallBack(this.TagIKAttachIKBone));
		this.kag_.AddTagCallBack("setbodypos", new KagScript.KagTagCallBack(this.TagSetBodyPos));
		this.kag_.AddTagCallBack("ikcheckthrough", new KagScript.KagTagCallBack(this.TagIKCheckThrough));
		this.kag_.AddTagCallBack("nextikflag", new KagScript.KagTagCallBack(this.TagNextIKFlag));
		this.kag_.AddTagCallBack("ikattachpointnext", new KagScript.KagTagCallBack(this.TagIKAttachPointNext));
		this.kag_.AddTagCallBack("ikattachbonenext", new KagScript.KagTagCallBack(this.TagIKAttachBoneNext));
		this.kag_.AddTagCallBack("ikattachodogunext", new KagScript.KagTagCallBack(this.TagIKAttachOdoguNext));
		this.kag_.AddTagCallBack("ikattachikbonenext", new KagScript.KagTagCallBack(this.TagIKAttachIKBoneNext));
		this.kag_.AddTagCallBack("allpos", new KagScript.KagTagCallBack(this.TagAllPos));
		this.kag_.AddTagCallBack("alloffset", new KagScript.KagTagCallBack(this.TagAllOffSet));
		this.kag_.AddTagCallBack("addalloffset", new KagScript.KagTagCallBack(this.TagAddAllOffset));
		this.kag_.AddTagCallBack("offset", new KagScript.KagTagCallBack(this.TagOffSet));
		this.kag_.AddTagCallBack("allresetpos", new KagScript.KagTagCallBack(this.TagAllResetPos));
		this.kag_.AddTagCallBack("transform", new KagScript.KagTagCallBack(this.TagTransform));
		this.kag_.AddTagCallBack("position", new KagScript.KagTagCallBack(this.TagPosition));
		this.kag_.AddTagCallBack("rotation", new KagScript.KagTagCallBack(this.TagRotation));
		this.kag_.AddTagCallBack("camera", new KagScript.KagTagCallBack(this.TagCamera));
		this.kag_.AddTagCallBack("camerachase", new KagScript.KagTagCallBack(this.TagCameraChase));
		this.kag_.AddTagCallBack("camerachasestop", new KagScript.KagTagCallBack(this.TagCameraChaseStop));
		this.kag_.AddTagCallBack("cameraanimationstart", new KagScript.KagTagCallBack(this.TagCameraAnimationStart));
		this.kag_.AddTagCallBack("cameracontrol", new KagScript.KagTagCallBack(this.TagCameraControl));
		this.kag_.AddTagCallBack("lightmain", new KagScript.KagTagCallBack(this.TagLightMain));
		this.kag_.AddTagCallBack("playbgm", new KagScript.KagTagCallBack(this.TagPlayBgm));
		this.kag_.AddTagCallBack("stopbgm", new KagScript.KagTagCallBack(this.TagStopBgm));
		this.kag_.AddTagCallBack("playenv", new KagScript.KagTagCallBack(this.TagPlayEnv));
		this.kag_.AddTagCallBack("stopenv", new KagScript.KagTagCallBack(this.TagStopEnv));
		this.kag_.AddTagCallBack("playse", new KagScript.KagTagCallBack(this.TagPlaySe));
		this.kag_.AddTagCallBack("stopse", new KagScript.KagTagCallBack(this.TagStopSe));
		this.kag_.AddTagCallBack("playvoice", new KagScript.KagTagCallBack(this.TagPlayVoice));
		this.kag_.AddTagCallBack("stopvoice", new KagScript.KagTagCallBack(this.TagStopVoice));
		this.kag_.AddTagCallBack("stopsound", new KagScript.KagTagCallBack(this.TagStopSound));
		this.kag_.AddTagCallBack("fade3d", new KagScript.KagTagCallBack(this.TagFade3D));
		this.kag_.AddTagCallBack("setbg", new KagScript.KagTagCallBack(this.TagSetBg));
		this.kag_.AddTagCallBack("draw2dtex", new KagScript.KagTagCallBack(this.TagDraw2DTex));
		this.kag_.AddTagCallBack("clear2dtex", new KagScript.KagTagCallBack(this.TagClear2DTex));
		this.kag_.AddTagCallBack("itemchange", new KagScript.KagTagCallBack(this.TagItemChange));
		this.kag_.AddTagCallBack("itemset", new KagScript.KagTagCallBack(this.TagItemSet));
		this.kag_.AddTagCallBack("itemreset", new KagScript.KagTagCallBack(this.TagItemReset));
		this.kag_.AddTagCallBack("itempos", new KagScript.KagTagCallBack(this.TagItemPos));
		this.kag_.AddTagCallBack("allprocpropseqstart", new KagScript.KagTagCallBack(this.TagAllProcPropSeqStart));
		this.kag_.AddTagCallBack("itemmask", new KagScript.KagTagCallBack(this.TagItemMask));
		this.kag_.AddTagCallBack("itemmaskmode", new KagScript.KagTagCallBack(this.TagItemMaskMode));
		this.kag_.AddTagCallBack("maidreset", new KagScript.KagTagCallBack(this.TagMaidReset));
		this.kag_.AddTagCallBack("propset", new KagScript.KagTagCallBack(this.TagPropSet));
		this.kag_.AddTagCallBack("propreset", new KagScript.KagTagCallBack(this.TagPropReset));
		this.kag_.AddTagCallBack("addprefabbg", new KagScript.KagTagCallBack(this.TagAddPrefabBg));
		this.kag_.AddTagCallBack("setprefabbgtransformdata", new KagScript.KagTagCallBack(this.TagSetPrefabBgTransformData));
		this.kag_.AddTagCallBack("delprefabbg", new KagScript.KagTagCallBack(this.TagDelPrefabBg));
		this.kag_.AddTagCallBack("delprefabbgall", new KagScript.KagTagCallBack(this.TagDelPrefabBgAll));
		this.kag_.AddTagCallBack("moveprefabtochara", new KagScript.KagTagCallBack(this.TagMovePrefabToChara));
		this.kag_.AddTagCallBack("addprefabworld", new KagScript.KagTagCallBack(this.TagAddPrefabWorld));
		this.kag_.AddTagCallBack("releaseprefab", new KagScript.KagTagCallBack(this.TagReleasePrefab));
		this.kag_.AddTagCallBack("prefabanimatorsetparam", new KagScript.KagTagCallBack(this.TagPrefabAnimatorSetParam));
		this.kag_.AddTagCallBack("chinko", new KagScript.KagTagCallBack(this.TagChinko));
		this.kag_.AddTagCallBack("setloacalposition", new KagScript.KagTagCallBack(this.TagSetLoacalPosition));
		this.kag_.AddTagCallBack("addlocalposition", new KagScript.KagTagCallBack(this.TagAddLocalPosition));
		this.kag_.AddTagCallBack("openmouth", new KagScript.KagTagCallBack(this.TagOpenMouth));
		this.kag_.AddTagCallBack("eyetoposition", new KagScript.KagTagCallBack(this.TagEyeToPosition));
		this.kag_.AddTagCallBack("eyetotarget", new KagScript.KagTagCallBack(this.TagEyeToTarget));
		this.kag_.AddTagCallBack("eyetocamera", new KagScript.KagTagCallBack(this.TagEyeToCamera));
		this.kag_.AddTagCallBack("eyetoreset", new KagScript.KagTagCallBack(this.TagEyeToReset));
		this.kag_.AddTagCallBack("setmaidoffsetpos", new KagScript.KagTagCallBack(this.TagSetMaidOffsetPos));
		this.kag_.AddTagCallBack("setmaidoffsetmultipos", new KagScript.KagTagCallBack(this.TagSetMaidOffsetMultiPos));
		this.kag_.AddTagCallBack("setmanoffsetpos", new KagScript.KagTagCallBack(this.TagSetManOffsetPos));
		this.kag_.AddTagCallBack("setmaidoffsetposcategory", new KagScript.KagTagCallBack(this.TagSetMaidOffsetPosCategory));
		this.kag_.AddTagCallBack("addprefabchara", new KagScript.KagTagCallBack(this.TagAddPrefabChara));
		this.kag_.AddTagCallBack("delprefabchara", new KagScript.KagTagCallBack(this.TagDelPrefabChara));
		this.kag_.AddTagCallBack("delprefabcharaall", new KagScript.KagTagCallBack(this.TagDelPrefabCharaAll));
		this.kag_.AddTagCallBack("animobjchara", new KagScript.KagTagCallBack(this.TagAnimObjChara));
		this.kag_.AddTagCallBack("charaactivate", new KagScript.KagTagCallBack(this.TagCharaActivate));
		this.kag_.AddTagCallBack("charaactivatefreenpc", new KagScript.KagTagCallBack(this.TagConCharaActivateFreeNPC));
		this.kag_.AddTagCallBack("CharaActivate1stRanking", new KagScript.KagTagCallBack(this.TagConCharaActivate1stRanking));
		this.kag_.AddTagCallBack("CharaActivateLeader", new KagScript.KagTagCallBack(this.TagConCharaActivateLeader));
		this.kag_.AddTagCallBack("manpresetmenuload", new KagScript.KagTagCallBack(this.TagManPresetMenuLoad));
		this.kag_.AddTagCallBack("charadeactivate", new KagScript.KagTagCallBack(this.TagCharaDeactivate));
		this.kag_.AddTagCallBack("charavisible", new KagScript.KagTagCallBack(this.TagCharaVisible));
		this.kag_.AddTagCallBack("charavisiblealloff", new KagScript.KagTagCallBack(this.TagCharaVisibleAllOff));
		this.kag_.AddTagCallBack("texmuladd", new KagScript.KagTagCallBack(this.TagTexMulAdd));
		this.kag_.AddTagCallBack("texmuldel", new KagScript.KagTagCallBack(this.TagTexMulDel));
		this.kag_.AddTagCallBack("startday", new KagScript.KagTagCallBack(this.TagStartDay));
		this.kag_.AddTagCallBack("schedulestartmanage", new KagScript.KagTagCallBack(this.TagScheduleStartManage));
		this.kag_.AddTagCallBack("endday", new KagScript.KagTagCallBack(this.TagEndDay));
		this.kag_.AddTagCallBack("updatemaidpoint", new KagScript.KagTagCallBack(this.TagConUpdateMaidPoint));
		this.kag_.AddTagCallBack("vrbgchangeinit", new KagScript.KagTagCallBack(this.TagVRBGChangeInit));
		this.kag_.AddTagCallBack("vreventobj", new KagScript.KagTagCallBack(this.TagVREventObj));
		this.kag_.AddTagCallBack("vreventgroup", new KagScript.KagTagCallBack(this.TagVREventGroup));
		this.kag_.AddTagCallBack("vrfreescene", new KagScript.KagTagCallBack(this.TagVRFreeScene));
		this.kag_.AddTagCallBack("vrcamera", new KagScript.KagTagCallBack(this.TagVRCamera));
		this.kag_.AddTagCallBack("vrtablet", new KagScript.KagTagCallBack(this.TagVRTablet));
		this.kag_.AddTagCallBack("vrchoicesset", new KagScript.KagTagCallBack(this.TagVRChoicesSet));
		this.kag_.AddTagCallBack("vrchoicesshow", new KagScript.KagTagCallBack(this.TagVRChoicesShow));
		this.kag_.AddTagCallBack("vrchoicesshownonstop", new KagScript.KagTagCallBack(this.TagVRChoicesShowNonStop));
		this.kag_.AddTagCallBack("vrdonexttime", new KagScript.KagTagCallBack(this.TagVRDoNextTime));
		this.kag_.AddTagCallBack("vrresetheadpos", new KagScript.KagTagCallBack(this.TagVRResetHeadPos));
		this.kag_.AddTagCallBack("vrtouchscript", new KagScript.KagTagCallBack(this.TagVRTouchScript));
		this.kag_.AddTagCallBack("vrdaytimeshow", new KagScript.KagTagCallBack(this.TagVRDayTimeShow));
		this.kag_.AddTagCallBack("vrdialog", new KagScript.KagTagCallBack(this.TagVRDialog));
		this.kag_.AddTagCallBack("vrstartmoviemusicplayertv", new KagScript.KagTagCallBack(this.TagVRStartMovieMusicPlayerTV));
		this.kag_.AddTagCallBack("vrmovietv", new KagScript.KagTagCallBack(this.TagVRMovieTV));
		this.kag_.AddTagCallBack("vrplantwindowshow", new KagScript.KagTagCallBack(this.TagVRPlantWindowShow));
		this.kag_.AddTagCallBack("vrplantupdate", new KagScript.KagTagCallBack(this.TagVRPlantUpdate));
		this.kag_.AddTagCallBack("vrtutorialstart", new KagScript.KagTagCallBack(this.TagVRTutorialStart));
		this.kag_.AddTagCallBack("vrphotomodestart", new KagScript.KagTagCallBack(this.TagVRPhotoModeStart));
		this.kag_.AddTagCallBack("vrnochangebg", new KagScript.KagTagCallBack(this.TagVRNoChangeBG));
		this.kag_.AddTagCallBack("vrcamtomanhead", new KagScript.KagTagCallBack(this.TagVRCamToManHead));
		this.kag_.AddTagCallBack("vrtrophytext", new KagScript.KagTagCallBack(this.TagVRTrophyText));
		this.kag_.AddTagCallBack("vrrentalmaidselectstart", new KagScript.KagTagCallBack(this.TagVRRentalMaidSelectStart));
		this.kag_.AddTagCallBack("vrtouchuseselect", new KagScript.KagTagCallBack(this.TagVRTouchUseSelect));
		this.kag_.AddTagCallBack("vrhintshow", new KagScript.KagTagCallBack(this.TagVRHintShow));
		this.kag_.AddTagCallBack("vrkaraokewindowshow", new KagScript.KagTagCallBack(this.TagVRKaraokeWindowShow));
		this.kag_.AddTagCallBack("danceresult", new KagScript.KagTagCallBack(this.TagDanceResultStart));
		this.kag_.AddTagCallBack("setdance", new KagScript.KagTagCallBack(this.TagSetDanceType));
		this.kag_.AddTagCallBack("cutinshoot", new KagScript.KagTagCallBack(this.TagCutinTexShoot));
		this.kag_.AddTagCallBack("battlecutin", new KagScript.KagTagCallBack(this.TagBattleCutInStart));
		this.kag_.AddTagCallBack("motioncheck", new KagScript.KagTagCallBack(this.TagMotionCheckStart));
		this.kag_.AddTagCallBack("setmcskip", new KagScript.KagTagCallBack(this.TagSetMcSkip));
		this.kag_.AddTagCallBack("addeventdisplay", new KagScript.KagTagCallBack(this.TagAddedEventDisplay));
		this.kag_.AddTagCallBack("tutorialstart", new KagScript.KagTagCallBack(this.TagTutorialStart));
		this.kag_.AddTagCallBack("loadsubtitlefile", new KagScript.KagTagCallBack(this.TagLoadSubtitleFile));
		this.kag_.AddTagCallBack("endsubtitledisplay", new KagScript.KagTagCallBack(this.TagEndSubtitleDisplay));
		this.kag_.AddTagCallBack("subtitledisplayforplayvoice", new KagScript.KagTagCallBack(this.TagSubtitleDisplayForPlayVoice));
		this.kag_.AddTagCallBack("subtitledisplay", new KagScript.KagTagCallBack(this.TagSubtitleDisplay));
	}

	public virtual void Update()
	{
		if (!this.enabled)
		{
			return;
		}
		if (this.fade_wait_)
		{
			if (this.IsFadeProc())
			{
				return;
			}
			this.fade_wait_ = false;
			this.Exec();
		}
		if (0 < this.wait_event_list_.Count)
		{
			foreach (KeyValuePair<string, WaitEventList> keyValuePair in this.wait_event_list_)
			{
				keyValuePair.Value.EventCheck();
			}
		}
		if (this.exec_wait_data_.use && this.exec_wait_data_.Check())
		{
			this.exec_wait_data_.Clear();
			this.Exec();
		}
	}

	public virtual bool Exec()
	{
		if (!this.enabled)
		{
			return false;
		}
		if (this.fade_wait_ && this.IsFadeProc())
		{
			return false;
		}
		if (this.exec_wait_data_.use)
		{
			if (!this.exec_wait_data_.Check())
			{
				return false;
			}
			this.exec_wait_data_.Clear();
		}
		this.maidOffsetSetList.Clear();
		return this.kag_.Exec();
	}

	public virtual bool IsExec()
	{
		return !this.exec_wait_data_.use && this.enabled;
	}

	public void SetFadeWait(bool value)
	{
		this.fade_wait_ = value;
	}

	public void SetExecWait(int wait_time, bool skip_possible)
	{
		this.exec_wait_data_.Clear();
		if (wait_time <= 0)
		{
			return;
		}
		this.exec_wait_data_ = new BaseKagManager.ExecWaitData();
		this.exec_wait_data_.wait_time = wait_time;
		this.exec_wait_data_.skip_possible = skip_possible;
		this.exec_wait_data_.start_tick_count = GameMain.tick_count;
		this.exec_wait_data_.use = true;
	}

	public bool SetMaidAllPropSeqWait(Maid maid)
	{
		if (maid == null || !maid.IsBusy)
		{
			return false;
		}
		this.exec_wait_data_ = new BaseKagManager.MaidPropSeqWaitData
		{
			skip_possible = false,
			use = true,
			maid = maid
		};
		return true;
	}

	public bool SetMaidVoiceWait(Maid maid)
	{
		if (maid == null)
		{
			return false;
		}
		this.exec_wait_data_ = new BaseKagManager.MaidVoiceWaitData
		{
			skip_possible = false,
			use = true,
			maid = maid
		};
		return true;
	}

	public bool SetDummyVoiceWait()
	{
		this.exec_wait_data_ = new BaseKagManager.DummyVoiceWaitData
		{
			skip_possible = false,
			use = true
		};
		return true;
	}

	public void ClearExecWait()
	{
		if (this.exec_wait_data_.use && !this.exec_wait_data_.skip_possible)
		{
			return;
		}
		this.exec_wait_data_.Clear();
	}

	public virtual void LoadScriptFile(string file_name, string label_name = "")
	{
		WaitEventList waitEventList = this.GetWaitEventList("se");
		waitEventList.Clear();
		this.exec_wait_data_.Clear();
		this.kag_.LoadScenario(file_name);
		if (label_name != string.Empty)
		{
			this.kag_.GoToLabel(label_name);
		}
	}

	public virtual void JumpLabel(string label_name)
	{
		this.exec_wait_data_.Clear();
		if (label_name != string.Empty)
		{
			this.kag_.GoToLabel(label_name);
		}
	}

	public virtual bool TagWait(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "wait", new string[]
		{
			"time"
		});
		this.exec_wait_data_.Clear();
		int num = tag_data.GetTagProperty("time").AsInteger();
		if (num <= 0)
		{
			return false;
		}
		bool skip_possible = !tag_data.IsValid("skip") || tag_data.GetTagProperty("skip").AsBool();
		this.SetWait(num, skip_possible);
		return true;
	}

	public bool TagFace(KagTagSupport tag_data)
	{
		Maid maid = this.GetMaidAndMan(tag_data);
		if (maid == null)
		{
			return false;
		}
		this.CheckAbsolutelyNecessaryTag(tag_data, "face", new string[]
		{
			"name"
		});
		string face_name = tag_data.GetTagProperty("name").AsString();
		int num = 0;
		if (tag_data.IsValid("wait"))
		{
			num = tag_data.GetTagProperty("wait").AsInteger();
		}
		WaitEventList waitEventList = this.GetWaitEventList("face");
		if (num <= 0)
		{
			maid.FaceAnime(face_name, 1f, 0);
			waitEventList.Clear();
		}
		else
		{
			waitEventList.Add(delegate
			{
				if (maid != null && maid.body0 != null && maid.body0.isLoadedBody)
				{
					maid.FaceAnime(face_name, 1f, 0);
				}
			}, num);
		}
		return false;
	}

	public bool TagFaceBlend(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "faceblend", new string[]
		{
			"name"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		string text = tag_data.GetTagProperty("name").AsString();
		if (text == "なし")
		{
			text = "無し";
		}
		maidAndMan.FaceBlend(text);
		return false;
	}

	public bool TagFaceBlend2(KagTagSupport tag_data)
	{
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		if (tag_data.IsValid("reset"))
		{
			maidAndMan.FaceBlend("無し");
		}
		else
		{
			TMorph.AddBlendType addBlendType = TMorph.AddBlendType.None;
			if (tag_data.IsValid("頬1") || tag_data.IsValid("頬１"))
			{
				addBlendType |= TMorph.AddBlendType.Cheek1;
			}
			if (tag_data.IsValid("頬2") || tag_data.IsValid("頬２"))
			{
				addBlendType |= TMorph.AddBlendType.Cheek2;
			}
			if (tag_data.IsValid("頬3") || tag_data.IsValid("頬３"))
			{
				addBlendType |= TMorph.AddBlendType.Cheek3;
			}
			if (tag_data.IsValid("涙1") || tag_data.IsValid("涙１"))
			{
				addBlendType |= TMorph.AddBlendType.Tear1;
			}
			if (tag_data.IsValid("涙2") || tag_data.IsValid("涙２"))
			{
				addBlendType |= TMorph.AddBlendType.Tear2;
			}
			if (tag_data.IsValid("涙3") || tag_data.IsValid("涙３"))
			{
				addBlendType |= TMorph.AddBlendType.Tear3;
			}
			if (tag_data.IsValid("ショック"))
			{
				addBlendType |= TMorph.AddBlendType.Shock;
			}
			if (tag_data.IsValid("よだれ") || tag_data.IsValid("涎"))
			{
				addBlendType |= TMorph.AddBlendType.Yodare;
			}
			if (tag_data.IsValid("赤面"))
			{
				addBlendType |= TMorph.AddBlendType.Blush;
			}
			if (tag_data.IsValid("玉涙"))
			{
				addBlendType |= TMorph.AddBlendType.TearBig;
			}
			maidAndMan.body0.Face.morph.SetValueOriginalBlendSet(addBlendType);
			maidAndMan.FaceBlend("オリジナル");
		}
		return false;
	}

	public bool TagStartKuchipakuPattern(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "startkuchipakupattern", new string[]
		{
			"offsettime",
			"pattern"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		maidAndMan.StartKuchipakuPattern(tag_data.GetTagProperty("offsettime").AsReal(), tag_data.GetTagProperty("pattern").AsString(), false);
		return false;
	}

	public bool TagStopKuchipakuPattern(KagTagSupport tag_data)
	{
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		maidAndMan.StopKuchipakuPattern();
		return false;
	}

	public bool TagLipsync(KagTagSupport tag_data)
	{
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		maidAndMan.Lipsync(tag_data.IsValid("on"));
		return false;
	}

	public bool TagMotion(KagTagSupport tag_data)
	{
		string text = tag_data.GetTagProperty("mot").AsString() + ".anm";
		Maid maid = this.GetMaidAndMan(tag_data);
		if (maid == null)
		{
			return false;
		}
		this.CheckAbsolutelyNecessaryTag(tag_data, "motion", new string[]
		{
			"mot"
		});
		string play_motion_name = tag_data.GetTagProperty("mot").AsString() + ".anm";
		int blend = 500;
		if (tag_data.IsValid("blend"))
		{
			blend = tag_data.GetTagProperty("blend").AsInteger();
		}
		bool loop = false;
		if (tag_data.IsValid("loop"))
		{
			loop = tag_data.GetTagProperty("loop").AsBool();
		}
		int num = 0;
		if (tag_data.IsValid("wait"))
		{
			num = tag_data.GetTagProperty("wait").AsInteger();
		}
		WaitEventList waitEventList = this.GetWaitEventList("motion");
		if (num <= 0)
		{
			if (maid.Visible)
			{
				this.PlayMaidMotion(maid, play_motion_name, false, loop, false, GameUty.MillisecondToSecond(blend));
			}
			waitEventList.Clear();
		}
		else
		{
			waitEventList.Add(delegate
			{
				if (maid != null && maid.Visible && maid.body0 != null && maid.body0.isLoadedBody)
				{
					this.PlayMaidMotion(maid, play_motion_name, false, loop, false, GameUty.MillisecondToSecond(blend));
				}
			}, num);
		}
		return false;
	}

	public bool TagMotionNext(KagTagSupport tag_data)
	{
		Maid maid = this.GetMaidAndMan(tag_data);
		if (maid == null)
		{
			return false;
		}
		this.CheckAbsolutelyNecessaryTag(tag_data, "motionnext", new string[]
		{
			"mot"
		});
		string play_motion_name = tag_data.GetTagProperty("mot").AsString() + ".anm";
		int blend = 500;
		if (tag_data.IsValid("blend"))
		{
			blend = tag_data.GetTagProperty("blend").AsInteger();
		}
		bool loop = false;
		if (tag_data.IsValid("loop"))
		{
			loop = tag_data.GetTagProperty("loop").AsBool();
		}
		WaitEventList waitEventList = this.GetWaitEventList("motion");
		if (waitEventList.list.Count <= 0)
		{
			if (maid.Visible)
			{
				this.PlayMaidMotion(maid, play_motion_name, false, loop, true, GameUty.MillisecondToSecond(blend));
			}
			waitEventList.Clear();
		}
		else
		{
			int wait_time = waitEventList.list[waitEventList.list.Count - 1].wait_time;
			waitEventList.Add(delegate
			{
				if (maid != null && maid.Visible)
				{
					this.PlayMaidMotion(maid, play_motion_name, false, loop, true, GameUty.MillisecondToSecond(blend));
				}
			}, wait_time);
		}
		return false;
	}

	public bool TagMotionNextAbs(KagTagSupport tag_data)
	{
		Maid maid = this.GetMaidAndMan(tag_data);
		if (maid == null)
		{
			return false;
		}
		this.CheckAbsolutelyNecessaryTag(tag_data, "motionnextabs", new string[]
		{
			"mot"
		});
		string play_motion_name = tag_data.GetTagProperty("mot").AsString() + ".anm";
		int blend = 500;
		if (tag_data.IsValid("blend"))
		{
			blend = tag_data.GetTagProperty("blend").AsInteger();
		}
		bool loop = false;
		if (tag_data.IsValid("loop"))
		{
			loop = tag_data.GetTagProperty("loop").AsBool();
		}
		WaitEventList waitEventList = this.GetWaitEventList("motion");
		if (waitEventList.list.Count <= 0)
		{
			if (maid.Visible)
			{
				this.PlayMaidMotionAbs(maid, play_motion_name, false, loop, true, GameUty.MillisecondToSecond(blend));
			}
			waitEventList.Clear();
		}
		else
		{
			int wait_time = waitEventList.list[waitEventList.list.Count - 1].wait_time;
			waitEventList.Add(delegate
			{
				if (maid != null && maid.Visible)
				{
					this.PlayMaidMotionAbs(maid, play_motion_name, false, loop, true, GameUty.MillisecondToSecond(blend));
				}
			}, wait_time);
		}
		return false;
	}

	public bool TagMotionStop(KagTagSupport tag_data)
	{
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		maidAndMan.StopAnime(string.Empty);
		WaitEventList waitEventList = this.GetWaitEventList("motion");
		waitEventList.Clear();
		return false;
	}

	public bool TagMotionLayerStop(KagTagSupport tag_data)
	{
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		if (tag_data.IsValid("layer"))
		{
			string[] array = tag_data.GetTagProperty("layer").AsString().Split(new char[]
			{
				','
			});
			for (int i = 0; i < array.Length; i++)
			{
				maidAndMan.body0.StopAnimeLayer(int.Parse(array[i]));
			}
		}
		if (tag_data.IsValid("range"))
		{
			string[] array2 = tag_data.GetTagProperty("range").AsString().Split(new char[]
			{
				'-'
			});
			NDebug.Assert(array2.Length == 2, "motionlayerstopのrange設定が不正です.個数不一致");
			int num = int.Parse(array2[0]);
			int num2 = int.Parse(array2[1]);
			NDebug.Assert(num <= num2, "motionlayerstopのrange設定が不正です.範囲不一致");
			for (int j = num; j <= num2; j++)
			{
				maidAndMan.body0.StopAnimeLayer(j);
			}
		}
		return false;
	}

	public bool TagMotionAutoTwist(KagTagSupport tag_data)
	{
		Maid maid = this.GetMaidAndMan(tag_data);
		if (maid == null)
		{
			return false;
		}
		Func<string, Maid.AutoTwist[], bool> func = delegate(string tag_name, Maid.AutoTwist[] change_type_array)
		{
			bool flag = tag_data.IsValid(tag_name);
			if (flag && change_type_array != null)
			{
				string a = tag_data.GetTagProperty(tag_name).AsString();
				bool f_bEnable = a == "on";
				for (int i = 0; i < change_type_array.Length; i++)
				{
					maid.SetAutoTwist(change_type_array[i], f_bEnable);
				}
			}
			return flag;
		};
		if (!func("kata", new Maid.AutoTwist[]
		{
			Maid.AutoTwist.ShoulderL,
			Maid.AutoTwist.ShoulderR
		}))
		{
			func("kata_r", new Maid.AutoTwist[]
			{
				Maid.AutoTwist.ShoulderR
			});
			func("kata_l", new Maid.AutoTwist[1]);
		}
		if (!func("tekubi", new Maid.AutoTwist[]
		{
			Maid.AutoTwist.WristL,
			Maid.AutoTwist.WristR
		}))
		{
			func("tekubi_r", new Maid.AutoTwist[]
			{
				Maid.AutoTwist.WristR
			});
			func("tekubi_l", new Maid.AutoTwist[]
			{
				Maid.AutoTwist.WristL
			});
		}
		if (!func("momo", new Maid.AutoTwist[]
		{
			Maid.AutoTwist.ThighL,
			Maid.AutoTwist.ThighR
		}))
		{
			func("momo_r", new Maid.AutoTwist[]
			{
				Maid.AutoTwist.ThighR
			});
			func("momo_l", new Maid.AutoTwist[]
			{
				Maid.AutoTwist.ThighL
			});
		}
		return false;
	}

	public bool TagMotionBlendEnabled(KagTagSupport tag_data)
	{
		bool is_motion_blend = true;
		if (tag_data.IsValid("false"))
		{
			is_motion_blend = false;
		}
		this.script_mgr_.is_motion_blend = is_motion_blend;
		return false;
	}

	public bool TagMotionScript(KagTagSupport tag_data)
	{
		string maid_guid = string.Empty;
		if (tag_data.IsValid("maid"))
		{
			Maid maidAndMan = this.GetMaidAndMan(tag_data);
			if (maidAndMan != null)
			{
				maid_guid = maidAndMan.status.guid;
			}
		}
		string man_guid = string.Empty;
		if (tag_data.IsValid("man"))
		{
			Maid maidAndMan2 = this.GetMaidAndMan(tag_data);
			if (maidAndMan2 != null)
			{
				man_guid = maidAndMan2.status.guid;
			}
		}
		this.CheckAbsolutelyNecessaryTag(tag_data, "motionscript", new string[]
		{
			"file"
		});
		string file_name = tag_data.GetTagProperty("file").AsString() + ".ks";
		string label_name = string.Empty;
		if (tag_data.IsValid("label"))
		{
			label_name = tag_data.GetTagProperty("label").AsString();
		}
		int num = 0;
		if (tag_data.IsValid("wait"))
		{
			num = tag_data.GetTagProperty("wait").AsInteger();
		}
		bool vailed_pos = !tag_data.IsValid("npos");
		int sloat = 0;
		if (tag_data.IsValid("sloat"))
		{
			sloat = tag_data.GetTagProperty("sloat").AsInteger();
		}
		WaitEventList waitEventList = this.GetWaitEventList("motion_script");
		if (num <= 0)
		{
			this.script_mgr_.LoadMotionScript(sloat, false, file_name, label_name, maid_guid, man_guid, false, vailed_pos);
			waitEventList.Clear();
			if (this.script_mgr_.is_motion_all_prop_seq && this.script_mgr_.motion_all_prop_seq_maid != null)
			{
				this.script_mgr_.motion_all_prop_seq_maid.AllProcPropSeqStart();
				this.SetMaidAllPropSeqWait(this.script_mgr_.motion_all_prop_seq_maid);
				this.script_mgr_.motion_all_prop_seq_maid = null;
				this.script_mgr_.is_motion_all_prop_seq = false;
				return true;
			}
		}
		else
		{
			waitEventList.Add(delegate
			{
				Maid maid = null;
				for (int i = 0; i < GameMain.Instance.CharacterMgr.GetMaidCount(); i++)
				{
					Maid maid2 = GameMain.Instance.CharacterMgr.GetMaid(i);
					if (maid2 != null && maid2.status.guid == maid_guid)
					{
						maid = maid2;
						break;
					}
				}
				if (maid != null && maid.body0 != null && maid.body0.isLoadedBody)
				{
					this.script_mgr_.LoadMotionScript(sloat, false, file_name, label_name, maid_guid, man_guid, false, vailed_pos);
					NDebug.Assert(!this.script_mgr_.is_motion_all_prop_seq, "motionscript wait内でのAllProcPropSeqStartはできません");
				}
			}, num);
		}
		return false;
	}

	public bool TagItemAnime(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "itemanime", new string[]
		{
			"slot"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		TBody.SlotID f_slot = (TBody.SlotID)Enum.Parse(typeof(TBody.SlotID), tag_data.GetTagProperty("slot").AsString(), true);
		string f_strAnimName = tag_data.GetTagProperty("file").AsString();
		maidAndMan.body0.ItemAnimationLoad(f_slot, f_strAnimName);
		if (tag_data.IsValid("start"))
		{
			maidAndMan.body0.ItemAnimationPlay(f_slot, f_strAnimName, tag_data.IsValid("loop"));
		}
		else if (tag_data.IsValid("stop"))
		{
			maidAndMan.body0.ItemAnimationStop(f_slot);
		}
		return false;
	}

	public bool TagHairPhisics(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "hairphisics", new string[]
		{
			"hairr"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		string text = tag_data.GetTagProperty("hairr").AsString();
		if (text == "normal")
		{
			maidAndMan.SetModeHairR(TBody.ModeHirR.Normal);
		}
		else if (text == "nofront")
		{
			maidAndMan.SetModeHairR(TBody.ModeHirR.NoFront);
		}
		else
		{
			NDebug.Assert("hairrの指定[" + text + "]は間違っています", false);
		}
		return false;
	}

	public bool TagBustMove(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "bustmove", new string[]
		{
			"move"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		string a = tag_data.GetTagProperty("move").AsString().ToLower();
		if (a == "stop")
		{
			maidAndMan.body0.MuneYureL(0f);
			maidAndMan.body0.MuneYureR(0f);
		}
		else if (a == "lstop")
		{
			maidAndMan.body0.MuneYureL(0f);
		}
		else if (a == "rstop")
		{
			maidAndMan.body0.MuneYureR(0f);
		}
		else if (a == "non")
		{
			maidAndMan.body0.MuneYureL(1f);
			maidAndMan.body0.MuneYureR(1f);
		}
		return false;
	}

	public bool TagPhisicsHit(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "phisicshit", new string[]
		{
			"height"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		maidAndMan.body0.SetBoneHitHeightY(tag_data.GetTagProperty("height").AsReal());
		return false;
	}

	public bool TagIKAttachPoint(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "ikattachpoint", new string[]
		{
			"src",
			"srcbone",
			"target",
			"targetobj",
			"targetpoint"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data.GetTagProperty("src").AsString());
		Maid maidAndMan2 = this.GetMaidAndMan(tag_data.GetTagProperty("target").AsString());
		if (maidAndMan == null || maidAndMan2 == null)
		{
			return false;
		}
		string text = tag_data.GetTagProperty("srcbone").AsString();
		string attachpoint_name = tag_data.GetTagProperty("targetpoint").AsString();
		string tgt_name = tag_data.GetTagProperty("targetobj").AsString();
		IKCtrlData ikdata = maidAndMan.IKCtrl.GetIKData(text);
		if (!ikdata)
		{
			return false;
		}
		Vector3 zero = Vector3.zero;
		if (tag_data.IsValid("offsetx"))
		{
			zero.x = tag_data.GetTagProperty("offsetx").AsReal();
		}
		if (tag_data.IsValid("offsety"))
		{
			zero.y = tag_data.GetTagProperty("offsety").AsReal();
		}
		if (tag_data.IsValid("offsetz"))
		{
			zero.z = tag_data.GetTagProperty("offsetz").AsReal();
		}
		IKCtrlData.IKAttachType attach_type = IKCtrlData.IKAttachType.Point;
		if (tag_data.IsValid("attach_type"))
		{
			attach_type = (IKCtrlData.IKAttachType)Enum.Parse(typeof(IKCtrlData.IKAttachType), tag_data.GetTagProperty("attach_type").AsString());
		}
		string axisbone = string.Empty;
		if (tag_data.IsValid("axisbone"))
		{
			axisbone = tag_data.GetTagProperty("axisbone").AsString();
		}
		float blend_time = 0f;
		if (tag_data.IsValid("blendtime"))
		{
			blend_time = GameUty.MillisecondToSecond(tag_data.GetTagProperty("blendtime").AsInteger());
		}
		bool do_animation = false;
		if (tag_data.IsValid("do_animation"))
		{
			do_animation = true;
		}
		maidAndMan.IKTargetToAttachPoint(text, maidAndMan2, tgt_name, attachpoint_name, zero, attach_type, axisbone, blend_time, do_animation, false);
		return false;
	}

	public bool TagIKAttachBone(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "ikattachbone", new string[]
		{
			"src",
			"srcbone",
			"target",
			"targetbone"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data.GetTagProperty("src").AsString());
		Maid maidAndMan2 = this.GetMaidAndMan(tag_data.GetTagProperty("target").AsString());
		if (maidAndMan == null || maidAndMan2 == null)
		{
			return false;
		}
		string text = tag_data.GetTagProperty("srcbone").AsString();
		string tgtbone_name = tag_data.GetTagProperty("targetbone").AsString();
		IKCtrlData ikdata = maidAndMan.IKCtrl.GetIKData(text);
		if (!ikdata)
		{
			return false;
		}
		bool search_sm = tag_data.IsValid("Search_SM_Body");
		Vector3 zero = Vector3.zero;
		if (tag_data.IsValid("offsetx"))
		{
			zero.x = tag_data.GetTagProperty("offsetx").AsReal();
		}
		if (tag_data.IsValid("offsety"))
		{
			zero.y = tag_data.GetTagProperty("offsety").AsReal();
		}
		if (tag_data.IsValid("offsetz"))
		{
			zero.z = tag_data.GetTagProperty("offsetz").AsReal();
		}
		IKCtrlData.IKAttachType ikattachType = IKCtrlData.IKAttachType.Point;
		if (tag_data.IsValid("attach_type"))
		{
			ikattachType = (IKCtrlData.IKAttachType)Enum.Parse(typeof(IKCtrlData.IKAttachType), tag_data.GetTagProperty("attach_type").AsString());
		}
		if (ikattachType == IKCtrlData.IKAttachType.NewPoint)
		{
			ikdata.OffsetWorld = tag_data.IsValid("offset_world");
			ikdata.OffsetBone = tag_data.IsValid("offset_bone");
		}
		float blend_time = 0f;
		if (tag_data.IsValid("blendtime"))
		{
			blend_time = GameUty.MillisecondToSecond(tag_data.GetTagProperty("blendtime").AsInteger());
		}
		bool do_animation = false;
		if (tag_data.IsValid("do_animation"))
		{
			do_animation = true;
		}
		maidAndMan.IKTargetToBone(text, maidAndMan2, tgtbone_name, zero, ikattachType, search_sm, blend_time, do_animation, false);
		return false;
	}

	public bool TagIKDetach(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "ikdetach", new string[]
		{
			"src",
			"srcbone"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data.GetTagProperty("src").AsString());
		if (maidAndMan == null)
		{
			return false;
		}
		string text = tag_data.GetTagProperty("srcbone").AsString();
		IKCtrlData ikdata = maidAndMan.IKCtrl.GetIKData(text);
		if (!ikdata)
		{
			return false;
		}
		float blendtime = 0f;
		if (tag_data.IsValid("blendtime"))
		{
			blendtime = GameUty.MillisecondToSecond(tag_data.GetTagProperty("blendtime").AsInteger());
		}
		maidAndMan.IKDetach(text, blendtime);
		return false;
	}

	public bool TagAllIKDetach(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "allikdetach", new string[]
		{
			"src"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data.GetTagProperty("src").AsString());
		if (maidAndMan == null)
		{
			return false;
		}
		float blendtime = 0f;
		if (tag_data.IsValid("blendtime"))
		{
			blendtime = GameUty.MillisecondToSecond(tag_data.GetTagProperty("blendtime").AsInteger());
		}
		maidAndMan.IKDetach(blendtime);
		return false;
	}

	public bool TagIKAttachOdogu(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "ikattachodogu", new string[]
		{
			"src",
			"srcbone",
			"odogu"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data.GetTagProperty("src").AsString());
		if (!maidAndMan)
		{
			return false;
		}
		string text = tag_data.GetTagProperty("srcbone").AsString();
		string odogu_name = tag_data.GetTagProperty("odogu").AsString();
		IKCtrlData ikdata = maidAndMan.IKCtrl.GetIKData(text);
		if (!ikdata)
		{
			return false;
		}
		string tgt_name = string.Empty;
		if (tag_data.IsValid("target"))
		{
			tgt_name = tag_data.GetTagProperty("target").AsString();
		}
		Vector3 zero = Vector3.zero;
		if (tag_data.IsValid("offsetx"))
		{
			zero.x = tag_data.GetTagProperty("offsetx").AsReal();
		}
		if (tag_data.IsValid("offsety"))
		{
			zero.y = tag_data.GetTagProperty("offsety").AsReal();
		}
		if (tag_data.IsValid("offsetz"))
		{
			zero.z = tag_data.GetTagProperty("offsetz").AsReal();
		}
		IKCtrlData.IKAttachType ikattachType = IKCtrlData.IKAttachType.Point;
		if (tag_data.IsValid("attach_type"))
		{
			ikattachType = (IKCtrlData.IKAttachType)Enum.Parse(typeof(IKCtrlData.IKAttachType), tag_data.GetTagProperty("attach_type").AsString());
		}
		if (ikattachType == IKCtrlData.IKAttachType.NewPoint)
		{
			ikdata.OffsetWorld = tag_data.IsValid("offset_world");
			ikdata.OffsetBone = tag_data.IsValid("offset_bone");
		}
		float blend_time = 0f;
		if (tag_data.IsValid("blendtime"))
		{
			blend_time = GameUty.MillisecondToSecond(tag_data.GetTagProperty("blendtime").AsInteger());
		}
		bool do_animation = false;
		if (tag_data.IsValid("do_animation"))
		{
			do_animation = true;
		}
		maidAndMan.IKTargetToOdogu(text, odogu_name, tgt_name, zero, ikattachType, blend_time, do_animation, false);
		return false;
	}

	public bool TagIKAttachIKBone(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "ikattachbone", new string[]
		{
			"src",
			"srcbone",
			"target",
			"targetbone"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data.GetTagProperty("src").AsString());
		Maid maidAndMan2 = this.GetMaidAndMan(tag_data.GetTagProperty("target").AsString());
		if (maidAndMan == null || maidAndMan2 == null)
		{
			return false;
		}
		string text = tag_data.GetTagProperty("srcbone").AsString();
		string bone_name = tag_data.GetTagProperty("targetbone").AsString();
		IKCtrlData ikdata = maidAndMan.IKCtrl.GetIKData(text);
		if (!ikdata)
		{
			return false;
		}
		Vector3 zero = Vector3.zero;
		if (tag_data.IsValid("offsetx"))
		{
			zero.x = tag_data.GetTagProperty("offsetx").AsReal();
		}
		if (tag_data.IsValid("offsety"))
		{
			zero.y = tag_data.GetTagProperty("offsety").AsReal();
		}
		if (tag_data.IsValid("offsetz"))
		{
			zero.z = tag_data.GetTagProperty("offsetz").AsReal();
		}
		IKCtrlData.IKAttachType ikattachType = IKCtrlData.IKAttachType.Point;
		if (tag_data.IsValid("attach_type"))
		{
			ikattachType = (IKCtrlData.IKAttachType)Enum.Parse(typeof(IKCtrlData.IKAttachType), tag_data.GetTagProperty("attach_type").AsString());
		}
		if (ikattachType == IKCtrlData.IKAttachType.NewPoint)
		{
			ikdata.OffsetWorld = tag_data.IsValid("offset_world");
			ikdata.OffsetBone = tag_data.IsValid("offset_bone");
		}
		float blend_time = 0f;
		if (tag_data.IsValid("blendtime"))
		{
			blend_time = GameUty.MillisecondToSecond(tag_data.GetTagProperty("blendtime").AsInteger());
		}
		bool do_animation = tag_data.IsValid("do_animation");
		maidAndMan.IKTargetToIKBone(text, maidAndMan2, bone_name, zero, ikattachType, blend_time, do_animation, false);
		return false;
	}

	public bool TagSetBodyPos(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "setbodypos", new string[]
		{
			"src",
			"srcbone",
			"target",
			"targetbone"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data.GetTagProperty("src").AsString());
		Maid maidAndMan2 = this.GetMaidAndMan(tag_data.GetTagProperty("target").AsString());
		if (maidAndMan == null || maidAndMan2 == null)
		{
			return false;
		}
		string tgtbone_name = tag_data.GetTagProperty("targetbone").AsString();
		Vector3 zero = Vector3.zero;
		if (tag_data.IsValid("offsetx"))
		{
			zero.x = tag_data.GetTagProperty("offsetx").AsReal();
		}
		if (tag_data.IsValid("offsety"))
		{
			zero.y = tag_data.GetTagProperty("offsety").AsReal();
		}
		if (tag_data.IsValid("offsetz"))
		{
			zero.z = tag_data.GetTagProperty("offsetz").AsReal();
		}
		IKCtrlData.IKAttachType attach_type = IKCtrlData.IKAttachType.NewPoint;
		float blend_time = 0f;
		if (tag_data.IsValid("blendtime"))
		{
			blend_time = GameUty.MillisecondToSecond(tag_data.GetTagProperty("blendtime").AsInteger());
		}
		bool search_sm = tag_data.IsValid("Search_SM_Body");
		maidAndMan.IKCtrl.BodyCtrlData.OffsetEnable.Recet();
		if (tag_data.IsValid("disable"))
		{
			string[] array = tag_data.GetTagProperty("disable").AsString().Split(new char[]
			{
				','
			});
			int i = 0;
			while (i < array.Length)
			{
				string text = array[i];
				string text2 = text.ToLower();
				if (text2 != null)
				{
					if (!(text2 == "x"))
					{
						if (!(text2 == "y"))
						{
							if (text2 == "z")
							{
								maidAndMan.IKCtrl.BodyCtrlData.OffsetEnable.EnableZ = false;
							}
						}
						else
						{
							maidAndMan.IKCtrl.BodyCtrlData.OffsetEnable.EnableY = false;
						}
					}
					else
					{
						maidAndMan.IKCtrl.BodyCtrlData.OffsetEnable.EnableX = false;
					}
				}
				IL_238:
				i++;
				continue;
				goto IL_238;
			}
		}
		if (tag_data.IsValid("heighttype"))
		{
			BodyCtrlData.HeightFitType heightFit = (BodyCtrlData.HeightFitType)Enum.Parse(typeof(BodyCtrlData.HeightFitType), tag_data.GetTagProperty("heighttype").AsString());
			maidAndMan.IKCtrl.BodyCtrlData.HeightFit = heightFit;
		}
		maidAndMan.IKCtrl.BodyCtrlData.PosBaseBone = maidAndMan.body0.GetBone(tag_data.GetTagProperty("srcbone").AsString());
		maidAndMan.IKCtrl.BodyCtrlData.OffsetWorld = tag_data.IsValid("offset_world");
		maidAndMan.IKCtrl.BodyCtrlData.OffsetBone = tag_data.IsValid("offset_bone");
		maidAndMan.IKTargetToBone("体全体", maidAndMan2, tgtbone_name, zero, attach_type, search_sm, blend_time, false, false);
		return false;
	}

	public bool TagIKCheckThrough(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "ikcheckthrough", new string[]
		{
			"src",
			"srcbone",
			"checkobj"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data.GetTagProperty("src").AsString());
		if (maidAndMan == null)
		{
			return false;
		}
		string tag_name = tag_data.GetTagProperty("srcbone").AsString();
		BipedIKCtrlData ikdata = maidAndMan.IKCtrl.GetIKData<BipedIKCtrlData>(tag_name);
		if (tag_data.IsValid("correctbone"))
		{
			ikdata.ToCorrectBone = maidAndMan.body0.GetBone(tag_data.GetTagProperty("correctbone").AsString());
		}
		string text = tag_data.GetTagProperty("checkobj").AsString();
		float weight = 1f;
		if (tag_data.IsValid("bendweight"))
		{
			weight = tag_data.GetTagProperty("bendweight").AsReal();
		}
		BipedIKCtrlData.BorderCorrectData borderCorrectData;
		if (text.Contains("Floor"))
		{
			borderCorrectData = ikdata.FloorCorrect;
		}
		else
		{
			if (!text.Contains("Wall"))
			{
				Debug.LogErrorFormat("{0}は定義できません", new object[]
				{
					text
				});
				return false;
			}
			borderCorrectData = ikdata.WallCorrect;
		}
		if (tag_data.IsValid("correcttype"))
		{
			ikdata.CorrectType = (BipedIKCtrlData.BorderCorrectType)Enum.Parse(typeof(BipedIKCtrlData.BorderCorrectType), tag_data.GetTagProperty("correcttype").AsString());
			if (ikdata.CorrectType == BipedIKCtrlData.BorderCorrectType.HalfBody)
			{
				ikdata.RootEffector.positionWeight = 1f;
			}
		}
		float blend_time = 0f;
		if (tag_data.IsValid("blendtime"))
		{
			blend_time = GameUty.MillisecondToSecond(tag_data.GetTagProperty("blendtime").AsInteger());
		}
		ikdata.ForceIK = true;
		ikdata.Chain.bendConstraint.weight = weight;
		ikdata.SetIKSetting(IKCtrlData.IKAttachType.NewPoint, false, null, null, Vector3.zero, false, blend_time);
		borderCorrectData.Enable = true;
		borderCorrectData.Border = float.Parse(text.Split(new char[]
		{
			':'
		})[1]);
		return false;
	}

	public bool TagNextIKFlag(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "nextikflag", new string[]
		{
			"src",
			"srcbone",
			"flagobj"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data.GetTagProperty("src").AsString());
		if (maidAndMan == null)
		{
			return false;
		}
		string tag_name = tag_data.GetTagProperty("srcbone").AsString();
		IKCtrlData ik_data = maidAndMan.IKCtrl.GetIKData(tag_name);
		if (!ik_data)
		{
			return false;
		}
		Action<IKCtrlData.IKAttachType> action = delegate(IKCtrlData.IKAttachType attach_type)
		{
			if (tag_data.IsValid("axis"))
			{
				ik_data.GetFlagData(attach_type).Axis = KasaiUtility.Vec3Parse(tag_data.GetTagProperty("axis").AsString(), ',');
			}
			if (tag_data.IsValid("value"))
			{
				ik_data.GetFlagData(attach_type).OnValue = tag_data.GetTagProperty("value").AsReal();
			}
			ik_data.GetFlagData(attach_type).BlendCtrlSelf = tag_data.IsValid("blendself");
			string name = tag_data.GetTagProperty("flagobj").AsString();
			ik_data.SetFlagTarget(attach_type, name);
		};
		if (tag_data.IsValid("attach_type"))
		{
			IKCtrlData.IKAttachType obj = (IKCtrlData.IKAttachType)Enum.Parse(typeof(IKCtrlData.IKAttachType), tag_data.GetTagProperty("attach_type").AsString());
			action(obj);
		}
		else
		{
			action(IKCtrlData.IKAttachType.NewPoint);
			action(IKCtrlData.IKAttachType.Rotate);
		}
		return false;
	}

	public bool TagIKAttachPointNext(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "ikattachpointnext", new string[]
		{
			"src",
			"srcbone",
			"target",
			"targetobj",
			"targetpoint"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data.GetTagProperty("src").AsString());
		Maid maidAndMan2 = this.GetMaidAndMan(tag_data.GetTagProperty("target").AsString());
		if (maidAndMan == null || maidAndMan2 == null)
		{
			return false;
		}
		string text = tag_data.GetTagProperty("srcbone").AsString();
		string attachpoint_name = tag_data.GetTagProperty("targetpoint").AsString();
		string tgt_name = tag_data.GetTagProperty("targetobj").AsString();
		IKCtrlData ikdata = maidAndMan.IKCtrl.GetIKData(text);
		if (!ikdata)
		{
			return false;
		}
		Vector3 zero = Vector3.zero;
		if (tag_data.IsValid("offsetx"))
		{
			zero.x = tag_data.GetTagProperty("offsetx").AsReal();
		}
		if (tag_data.IsValid("offsety"))
		{
			zero.y = tag_data.GetTagProperty("offsety").AsReal();
		}
		if (tag_data.IsValid("offsetz"))
		{
			zero.z = tag_data.GetTagProperty("offsetz").AsReal();
		}
		IKCtrlData.IKAttachType ikattachType = IKCtrlData.IKAttachType.Point;
		if (tag_data.IsValid("attach_type"))
		{
			ikattachType = (IKCtrlData.IKAttachType)Enum.Parse(typeof(IKCtrlData.IKAttachType), tag_data.GetTagProperty("attach_type").AsString());
		}
		if (ikattachType == IKCtrlData.IKAttachType.NewPoint)
		{
			ikdata.OffsetWorld = tag_data.IsValid("offset_world");
			ikdata.OffsetBone = tag_data.IsValid("offset_bone");
		}
		string axisbone = string.Empty;
		if (tag_data.IsValid("axisbone"))
		{
			axisbone = tag_data.GetTagProperty("axisbone").AsString();
		}
		float blend_time = 0f;
		if (tag_data.IsValid("blendtime"))
		{
			blend_time = GameUty.MillisecondToSecond(tag_data.GetTagProperty("blendtime").AsInteger());
		}
		bool do_animation = false;
		if (tag_data.IsValid("do_animation"))
		{
			do_animation = true;
		}
		maidAndMan.IKTargetToAttachPoint(text, maidAndMan2, tgt_name, attachpoint_name, zero, ikattachType, axisbone, blend_time, do_animation, true);
		return false;
	}

	public bool TagIKAttachBoneNext(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "ikattachbonenext", new string[]
		{
			"src",
			"srcbone",
			"target",
			"targetbone"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data.GetTagProperty("src").AsString());
		Maid maidAndMan2 = this.GetMaidAndMan(tag_data.GetTagProperty("target").AsString());
		if (maidAndMan == null || maidAndMan2 == null)
		{
			return false;
		}
		string text = tag_data.GetTagProperty("srcbone").AsString();
		string tgtbone_name = tag_data.GetTagProperty("targetbone").AsString();
		IKCtrlData ikdata = maidAndMan.IKCtrl.GetIKData(text);
		if (!ikdata)
		{
			return false;
		}
		bool search_sm = tag_data.IsValid("Search_SM_Body");
		Vector3 zero = Vector3.zero;
		if (tag_data.IsValid("offsetx"))
		{
			zero.x = tag_data.GetTagProperty("offsetx").AsReal();
		}
		if (tag_data.IsValid("offsety"))
		{
			zero.y = tag_data.GetTagProperty("offsety").AsReal();
		}
		if (tag_data.IsValid("offsetz"))
		{
			zero.z = tag_data.GetTagProperty("offsetz").AsReal();
		}
		IKCtrlData.IKAttachType ikattachType = IKCtrlData.IKAttachType.Point;
		if (tag_data.IsValid("attach_type"))
		{
			ikattachType = (IKCtrlData.IKAttachType)Enum.Parse(typeof(IKCtrlData.IKAttachType), tag_data.GetTagProperty("attach_type").AsString());
		}
		if (ikattachType == IKCtrlData.IKAttachType.NewPoint)
		{
			ikdata.OffsetWorld = tag_data.IsValid("offset_world");
			ikdata.OffsetBone = tag_data.IsValid("offset_bone");
		}
		float blend_time = 0f;
		if (tag_data.IsValid("blendtime"))
		{
			blend_time = GameUty.MillisecondToSecond(tag_data.GetTagProperty("blendtime").AsInteger());
		}
		bool do_animation = false;
		if (tag_data.IsValid("do_animation"))
		{
			do_animation = true;
		}
		maidAndMan.IKTargetToBone(text, maidAndMan2, tgtbone_name, zero, ikattachType, search_sm, blend_time, do_animation, true);
		return false;
	}

	public bool TagIKAttachOdoguNext(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "ikattachodogunext", new string[]
		{
			"src",
			"srcbone",
			"odogu"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data.GetTagProperty("src").AsString());
		if (!maidAndMan)
		{
			return false;
		}
		string text = tag_data.GetTagProperty("srcbone").AsString();
		string odogu_name = tag_data.GetTagProperty("odogu").AsString();
		IKCtrlData ikdata = maidAndMan.IKCtrl.GetIKData(text);
		if (!ikdata)
		{
			return false;
		}
		string tgt_name = string.Empty;
		if (tag_data.IsValid("target"))
		{
			tgt_name = tag_data.GetTagProperty("target").AsString();
		}
		Vector3 zero = Vector3.zero;
		if (tag_data.IsValid("offsetx"))
		{
			zero.x = tag_data.GetTagProperty("offsetx").AsReal();
		}
		if (tag_data.IsValid("offsety"))
		{
			zero.y = tag_data.GetTagProperty("offsety").AsReal();
		}
		if (tag_data.IsValid("offsetz"))
		{
			zero.z = tag_data.GetTagProperty("offsetz").AsReal();
		}
		IKCtrlData.IKAttachType ikattachType = IKCtrlData.IKAttachType.Point;
		if (tag_data.IsValid("attach_type"))
		{
			ikattachType = (IKCtrlData.IKAttachType)Enum.Parse(typeof(IKCtrlData.IKAttachType), tag_data.GetTagProperty("attach_type").AsString());
		}
		if (ikattachType == IKCtrlData.IKAttachType.NewPoint)
		{
			ikdata.OffsetWorld = tag_data.IsValid("offset_world");
			ikdata.OffsetBone = tag_data.IsValid("offset_bone");
		}
		float blend_time = 0f;
		if (tag_data.IsValid("blendtime"))
		{
			blend_time = GameUty.MillisecondToSecond(tag_data.GetTagProperty("blendtime").AsInteger());
		}
		bool do_animation = false;
		if (tag_data.IsValid("do_animation"))
		{
			do_animation = true;
		}
		maidAndMan.IKTargetToOdogu(text, odogu_name, tgt_name, zero, ikattachType, blend_time, do_animation, true);
		return false;
	}

	public bool TagIKAttachIKBoneNext(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "ikattachbonenext", new string[]
		{
			"src",
			"srcbone",
			"target",
			"targetbone"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data.GetTagProperty("src").AsString());
		Maid maidAndMan2 = this.GetMaidAndMan(tag_data.GetTagProperty("target").AsString());
		if (maidAndMan == null || maidAndMan2 == null)
		{
			return false;
		}
		string text = tag_data.GetTagProperty("srcbone").AsString();
		string bone_name = tag_data.GetTagProperty("targetbone").AsString();
		IKCtrlData ikdata = maidAndMan.IKCtrl.GetIKData(text);
		if (!ikdata)
		{
			return false;
		}
		Vector3 zero = Vector3.zero;
		if (tag_data.IsValid("offsetx"))
		{
			zero.x = tag_data.GetTagProperty("offsetx").AsReal();
		}
		if (tag_data.IsValid("offsety"))
		{
			zero.y = tag_data.GetTagProperty("offsety").AsReal();
		}
		if (tag_data.IsValid("offsetz"))
		{
			zero.z = tag_data.GetTagProperty("offsetz").AsReal();
		}
		IKCtrlData.IKAttachType ikattachType = IKCtrlData.IKAttachType.Point;
		if (tag_data.IsValid("attach_type"))
		{
			ikattachType = (IKCtrlData.IKAttachType)Enum.Parse(typeof(IKCtrlData.IKAttachType), tag_data.GetTagProperty("attach_type").AsString());
		}
		if (ikattachType == IKCtrlData.IKAttachType.NewPoint)
		{
			ikdata.OffsetWorld = tag_data.IsValid("offset_world");
			ikdata.OffsetBone = tag_data.IsValid("offset_bone");
		}
		float blend_time = 0f;
		if (tag_data.IsValid("blendtime"))
		{
			blend_time = GameUty.MillisecondToSecond(tag_data.GetTagProperty("blendtime").AsInteger());
		}
		bool do_animation = tag_data.IsValid("do_animation");
		maidAndMan.IKTargetToIKBone(text, maidAndMan2, bone_name, zero, ikattachType, blend_time, do_animation, true);
		return false;
	}

	public bool TagAllPos(KagTagSupport tag_data)
	{
		bool flag = false;
		bool flag2 = false;
		Vector3 zero = Vector3.zero;
		Vector3 zero2 = Vector3.zero;
		if (tag_data.IsValid("x"))
		{
			flag = true;
			zero.x = tag_data.GetTagProperty("x").AsReal();
		}
		if (tag_data.IsValid("y"))
		{
			flag = true;
			zero.y = tag_data.GetTagProperty("y").AsReal();
		}
		if (tag_data.IsValid("z"))
		{
			flag = true;
			zero.z = tag_data.GetTagProperty("z").AsReal();
		}
		if (tag_data.IsValid("rx"))
		{
			flag2 = true;
			zero2.x = tag_data.GetTagProperty("rx").AsReal();
		}
		if (tag_data.IsValid("ry"))
		{
			flag2 = true;
			zero2.y = tag_data.GetTagProperty("ry").AsReal();
		}
		if (tag_data.IsValid("rz"))
		{
			flag2 = true;
			zero2.z = tag_data.GetTagProperty("rz").AsReal();
		}
		if (flag)
		{
			GameMain.Instance.CharacterMgr.SetCharaAllPos(zero);
			if (!this.script_mgr_.compatibilityMode)
			{
				for (int i = 0; i < GameMain.Instance.CharacterMgr.GetMaidCount(); i++)
				{
					Maid maid = GameMain.Instance.CharacterMgr.GetMaid(i);
					if (maid != null && maid.body0 != null)
					{
						maid.body0.SetBoneHitHeightY(zero.y);
					}
				}
			}
		}
		if (flag2)
		{
			GameMain.Instance.CharacterMgr.SetCharaAllRot(zero2);
		}
		return false;
	}

	public bool TagAllOffSet(KagTagSupport tag_data)
	{
		bool flag = false;
		bool flag2 = false;
		Vector3 zero = Vector3.zero;
		Vector3 zero2 = Vector3.zero;
		if (tag_data.IsValid("x"))
		{
			flag = true;
			zero.x = tag_data.GetTagProperty("x").AsReal();
		}
		if (tag_data.IsValid("y"))
		{
			flag = true;
			zero.y = tag_data.GetTagProperty("y").AsReal();
		}
		if (tag_data.IsValid("z"))
		{
			flag = true;
			zero.z = tag_data.GetTagProperty("z").AsReal();
		}
		if (tag_data.IsValid("rx"))
		{
			flag2 = true;
			zero2.x = tag_data.GetTagProperty("rx").AsReal();
		}
		if (tag_data.IsValid("ry"))
		{
			flag2 = true;
			zero2.y = tag_data.GetTagProperty("ry").AsReal();
		}
		if (tag_data.IsValid("rz"))
		{
			flag2 = true;
			zero2.z = tag_data.GetTagProperty("rz").AsReal();
		}
		if (flag)
		{
			GameMain.Instance.CharacterMgr.CharaAllOfsetPos(zero);
		}
		if (flag2)
		{
			GameMain.Instance.CharacterMgr.CharaAllOfsetRot(zero2);
		}
		return false;
	}

	public bool TagAddAllOffset(KagTagSupport tag_data)
	{
		bool flag = false;
		bool flag2 = false;
		Vector3 zero = Vector3.zero;
		Vector3 zero2 = Vector3.zero;
		if (tag_data.IsValid("x"))
		{
			flag = true;
			zero.x = tag_data.GetTagProperty("x").AsReal();
		}
		if (tag_data.IsValid("y"))
		{
			flag = true;
			zero.y = tag_data.GetTagProperty("y").AsReal();
		}
		if (tag_data.IsValid("z"))
		{
			flag = true;
			zero.z = tag_data.GetTagProperty("z").AsReal();
		}
		if (tag_data.IsValid("rx"))
		{
			flag2 = true;
			zero2.x = tag_data.GetTagProperty("rx").AsReal();
		}
		if (tag_data.IsValid("ry"))
		{
			flag2 = true;
			zero2.y = tag_data.GetTagProperty("ry").AsReal();
		}
		if (tag_data.IsValid("rz"))
		{
			flag2 = true;
			zero2.z = tag_data.GetTagProperty("rz").AsReal();
		}
		if (flag)
		{
			Vector3 charaAllOfsetPos = GameMain.Instance.CharacterMgr.GetCharaAllOfsetPos();
			GameMain.Instance.CharacterMgr.CharaAllOfsetPos(charaAllOfsetPos + zero);
		}
		if (flag2)
		{
			Vector3 charaAllOfsetRot = GameMain.Instance.CharacterMgr.GetCharaAllOfsetRot();
			GameMain.Instance.CharacterMgr.CharaAllOfsetRot(charaAllOfsetRot + zero2);
		}
		return false;
	}

	public bool TagOffSet(KagTagSupport tag_data)
	{
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		bool flag = false;
		bool flag2 = false;
		Vector3 zero = Vector3.zero;
		Vector3 zero2 = Vector3.zero;
		if (tag_data.IsValid("x"))
		{
			flag = true;
			zero.x = tag_data.GetTagProperty("x").AsReal();
		}
		if (tag_data.IsValid("y"))
		{
			flag = true;
			zero.y = tag_data.GetTagProperty("y").AsReal();
		}
		if (tag_data.IsValid("z"))
		{
			flag = true;
			zero.z = tag_data.GetTagProperty("z").AsReal();
		}
		if (tag_data.IsValid("rx"))
		{
			flag2 = true;
			zero2.x = tag_data.GetTagProperty("rx").AsReal();
		}
		if (tag_data.IsValid("ry"))
		{
			flag2 = true;
			zero2.y = tag_data.GetTagProperty("ry").AsReal();
		}
		if (tag_data.IsValid("rz"))
		{
			flag2 = true;
			zero2.z = tag_data.GetTagProperty("rz").AsReal();
		}
		if (flag)
		{
			maidAndMan.SetPos(zero);
		}
		if (flag2)
		{
			maidAndMan.SetRot(zero2);
		}
		return false;
	}

	public bool TagAllResetPos(KagTagSupport tag_data)
	{
		GameMain.Instance.CharacterMgr.ResetCharaPosAll();
		return false;
	}

	public bool TagTransform(KagTagSupport tag_data)
	{
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		return maidAndMan == null && false;
	}

	public bool TagPosition(KagTagSupport tag_data)
	{
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		return maidAndMan == null && false;
	}

	public bool TagRotation(KagTagSupport tag_data)
	{
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		return maidAndMan == null && false;
	}

	public bool TagCamera(KagTagSupport tag_data)
	{
		Vector3 zero = Vector3.zero;
		Vector2 zero2 = Vector2.zero;
		float f_fRadius = 0f;
		if (tag_data.IsValid("reset"))
		{
			GameMain.Instance.MainCamera.ResetFromScriptOnTarget();
			return false;
		}
		if (tag_data.IsValid("radius"))
		{
			f_fRadius = tag_data.GetTagProperty("radius").AsReal();
		}
		if (tag_data.IsValid("cx"))
		{
			zero.x = tag_data.GetTagProperty("cx").AsReal();
		}
		if (tag_data.IsValid("cy"))
		{
			zero.y = tag_data.GetTagProperty("cy").AsReal();
		}
		if (tag_data.IsValid("cz"))
		{
			zero.z = tag_data.GetTagProperty("cz").AsReal();
		}
		if (tag_data.IsValid("rx"))
		{
			zero2.x = tag_data.GetTagProperty("rx").AsReal();
		}
		if (tag_data.IsValid("ry"))
		{
			zero2.y = tag_data.GetTagProperty("ry").AsReal();
		}
		GameMain.Instance.MainCamera.SetFromScriptOnTarget(zero, f_fRadius, zero2);
		return false;
	}

	public bool TagCameraChase(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "camerachase", new string[]
		{
			"chase"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		string f_strAttachBone = tag_data.GetTagProperty("chase").AsString();
		Vector3 zero = Vector3.zero;
		if (tag_data.IsValid("offsx"))
		{
			zero.x = tag_data.GetTagProperty("offsx").AsReal();
		}
		if (tag_data.IsValid("offsy"))
		{
			zero.y = tag_data.GetTagProperty("offsy").AsReal();
		}
		if (tag_data.IsValid("offsz"))
		{
			zero.z = tag_data.GetTagProperty("offsz").AsReal();
		}
		bool f_fOnece = true;
		if (tag_data.IsValid("continue"))
		{
			f_fOnece = false;
		}
		int millisecond = 0;
		if (tag_data.IsValid("time"))
		{
			millisecond = tag_data.GetTagProperty("time").AsInteger();
		}
		GameMain.Instance.MainCamera.SetChaseCamera(maidAndMan, f_strAttachBone, zero, f_fOnece, GameUty.MillisecondToSecond(millisecond));
		return false;
	}

	public bool TagCameraChaseStop(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "camerachasestop", new string[0]);
		GameMain.Instance.MainCamera.RemoveChaseCameraAll();
		return false;
	}

	public bool TagCameraAnimationStart(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "cameraanimationstart", new string[]
		{
			"time"
		});
		bool f_bStart = false;
		Vector3 zero = Vector3.zero;
		Vector3 zero2 = Vector3.zero;
		Vector2 zero3 = Vector2.zero;
		Vector2 zero4 = Vector2.zero;
		float f_fRadius = 0f;
		float f_fSRadius = 0f;
		float f_fTime = GameUty.MillisecondToSecond(tag_data.GetTagProperty("time").AsInteger());
		string f_strEaseType = string.Empty;
		bool f_bSkip = tag_data.IsValid("skip");
		if (tag_data.IsValid("radius"))
		{
			f_fRadius = tag_data.GetTagProperty("radius").AsReal();
		}
		if (tag_data.IsValid("cx"))
		{
			zero.x = tag_data.GetTagProperty("cx").AsReal();
		}
		if (tag_data.IsValid("cy"))
		{
			zero.y = tag_data.GetTagProperty("cy").AsReal();
		}
		if (tag_data.IsValid("cz"))
		{
			zero.z = tag_data.GetTagProperty("cz").AsReal();
		}
		if (tag_data.IsValid("rx"))
		{
			zero3.x = tag_data.GetTagProperty("rx").AsReal();
		}
		if (tag_data.IsValid("ry"))
		{
			zero3.y = tag_data.GetTagProperty("ry").AsReal();
		}
		if (tag_data.IsValid("sradius"))
		{
			f_fSRadius = tag_data.GetTagProperty("sradius").AsReal();
			f_bStart = true;
		}
		if (tag_data.IsValid("scx"))
		{
			zero2.x = tag_data.GetTagProperty("scx").AsReal();
			f_bStart = true;
		}
		if (tag_data.IsValid("scy"))
		{
			zero2.y = tag_data.GetTagProperty("scy").AsReal();
			f_bStart = true;
		}
		if (tag_data.IsValid("scz"))
		{
			zero2.z = tag_data.GetTagProperty("scz").AsReal();
			f_bStart = true;
		}
		if (tag_data.IsValid("srx"))
		{
			zero4.x = tag_data.GetTagProperty("srx").AsReal();
			f_bStart = true;
		}
		if (tag_data.IsValid("sry"))
		{
			zero4.y = tag_data.GetTagProperty("sry").AsReal();
			f_bStart = true;
		}
		if (tag_data.IsValid("easetype"))
		{
			f_strEaseType = tag_data.GetTagProperty("easetype").AsString();
		}
		float f_fDelay = 0f;
		if (tag_data.IsValid("delay"))
		{
			f_fDelay = GameUty.MillisecondToSecond(tag_data.GetTagProperty("delay").AsInteger());
		}
		GameMain.Instance.MainCamera.StartAnimationTo(f_bStart, zero2, f_fSRadius, zero4, zero, f_fRadius, zero3, f_fTime, f_strEaseType, f_bSkip, f_fDelay);
		return false;
	}

	public bool TagCameraControl(KagTagSupport tag_data)
	{
		GameMain.Instance.MainCamera.SetControl(tag_data.IsValid("true"));
		return false;
	}

	public bool TagLightMain(KagTagSupport tag_data)
	{
		Vector3 zero = Vector3.zero;
		float intensity = 0f;
		bool flag = false;
		bool flag2 = false;
		if (tag_data.IsValid("rx"))
		{
			zero.x = tag_data.GetTagProperty("rx").AsReal();
			flag = true;
		}
		if (tag_data.IsValid("ry"))
		{
			zero.y = tag_data.GetTagProperty("ry").AsReal();
			flag = true;
		}
		if (tag_data.IsValid("rz"))
		{
			zero.z = tag_data.GetTagProperty("rz").AsReal();
			flag = true;
		}
		if (tag_data.IsValid("intensity"))
		{
			intensity = tag_data.GetTagProperty("intensity").AsReal();
			flag2 = true;
		}
		if (flag)
		{
			GameMain.Instance.MainLight.SetRotation(zero);
		}
		if (flag2)
		{
			GameMain.Instance.MainLight.SetIntensity(intensity);
		}
		return false;
	}

	public bool TagPlayBgm(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "playbgm", new string[]
		{
			"file"
		});
		string text = tag_data.GetTagProperty("file").AsString();
		text = Path.ChangeExtension(text, ".ogg");
		int millisecond = 0;
		if (tag_data.IsValid("fade"))
		{
			millisecond = tag_data.GetTagProperty("fade").AsInteger();
		}
		if (tag_data.IsValid("old"))
		{
			string f_strFileName = Path.GetFileNameWithoutExtension(text) + "_OLD.ogg";
			if (GameUty.FileSystem.IsExistentFile(f_strFileName))
			{
				GameMain.Instance.SoundMgr.PlayBGM(f_strFileName, GameUty.MillisecondToSecond(millisecond), true);
			}
			else
			{
				GameMain.Instance.SoundMgr.PlayBGMLegacy(text, GameUty.MillisecondToSecond(millisecond), true);
			}
		}
		else
		{
			GameMain.Instance.SoundMgr.PlayBGM(text, GameUty.MillisecondToSecond(millisecond), true);
		}
		return false;
	}

	public bool TagStopBgm(KagTagSupport tag_data)
	{
		int millisecond = 0;
		if (tag_data.IsValid("fade"))
		{
			millisecond = tag_data.GetTagProperty("fade").AsInteger();
		}
		GameMain.Instance.SoundMgr.StopBGM(GameUty.MillisecondToSecond(millisecond));
		return false;
	}

	public bool TagPlayEnv(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "playenv", new string[]
		{
			"file"
		});
		string text = tag_data.GetTagProperty("file").AsString();
		text = Path.ChangeExtension(text, ".ogg");
		int millisecond = 0;
		if (tag_data.IsValid("fade"))
		{
			millisecond = tag_data.GetTagProperty("fade").AsInteger();
		}
		GameMain.Instance.SoundMgr.PlayEnv(text, GameUty.MillisecondToSecond(millisecond));
		return false;
	}

	public bool TagStopEnv(KagTagSupport tag_data)
	{
		int millisecond = 0;
		if (tag_data.IsValid("fade"))
		{
			millisecond = tag_data.GetTagProperty("fade").AsInteger();
		}
		GameMain.Instance.SoundMgr.StopEnv(GameUty.MillisecondToSecond(millisecond));
		return false;
	}

	public bool TagPlaySe(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "playse", new string[]
		{
			"file"
		});
		string bgm_file_name = tag_data.GetTagProperty("file").AsString();
		bgm_file_name = Path.ChangeExtension(bgm_file_name, ".ogg");
		if (bgm_file_name == "SE016.ogg" && !GameMain.Instance.CMSystem.EjaculationSeEnabled)
		{
			return false;
		}
		bool loop = tag_data.IsValid("loop");
		int num = 0;
		if (tag_data.IsValid("wait"))
		{
			num = tag_data.GetTagProperty("wait").AsInteger();
		}
		WaitEventList waitEventList = this.GetWaitEventList("se");
		if (num <= 0)
		{
			GameMain.Instance.SoundMgr.PlaySe(bgm_file_name, loop);
			waitEventList.Clear();
		}
		else
		{
			waitEventList.Add(delegate
			{
				GameMain.Instance.SoundMgr.PlaySe(bgm_file_name, loop);
			}, num);
		}
		return false;
	}

	public bool TagStopSe(KagTagSupport tag_data)
	{
		string text = string.Empty;
		if (tag_data.IsValid("file"))
		{
			text = tag_data.GetTagProperty("file").AsString();
			text = Path.ChangeExtension(text, ".ogg");
		}
		if (!string.IsNullOrEmpty(text))
		{
			GameMain.Instance.SoundMgr.StopSe(text);
		}
		else
		{
			GameMain.Instance.SoundMgr.StopSe();
		}
		return false;
	}

	public bool TagPlayVoice(KagTagSupport tag_data)
	{
		bool result = false;
		this.CheckAbsolutelyNecessaryTag(tag_data, "playvoice", new string[]
		{
			"voice"
		});
		string text = tag_data.GetTagProperty("voice").AsString();
		text = Path.ChangeExtension(text, ".ogg");
		bool f_bLoop = tag_data.IsValid("loop");
		int millisecond = 0;
		if (tag_data.IsValid("fade"))
		{
			millisecond = tag_data.GetTagProperty("fade").AsInteger();
		}
		int num = -1;
		if (!tag_data.IsValid("dummy"))
		{
			Maid maidAndMan = this.GetMaidAndMan(tag_data);
			if (maidAndMan != null && maidAndMan.Visible)
			{
				maidAndMan.AudioMan.LoadPlay(text, GameUty.MillisecondToSecond(millisecond), true, f_bLoop);
				if (maidAndMan.AudioMan.isPlay() && maidAndMan.AudioMan.audiosource.clip != null)
				{
					num = (int)(maidAndMan.AudioMan.audiosource.clip.length * 1000f);
				}
				if (tag_data.IsValid("wait"))
				{
					result = this.SetMaidVoiceWait(maidAndMan);
				}
			}
			else
			{
				GameMain.Instance.SoundMgr.PlayDummyVoice(text, GameUty.MillisecondToSecond(millisecond), true, f_bLoop, 50);
			}
		}
		else
		{
			GameMain.Instance.SoundMgr.PlayDummyVoice(text, GameUty.MillisecondToSecond(millisecond), true, f_bLoop, 50);
			if (GameMain.Instance.SoundMgr.m_AudioDummyVoice.isPlay() && GameMain.Instance.SoundMgr.m_AudioDummyVoice.audiosource.clip != null)
			{
				num = (int)(GameMain.Instance.SoundMgr.m_AudioDummyVoice.audiosource.clip.length * 1000f);
			}
			if (tag_data.IsValid("wait"))
			{
				result = this.SetDummyVoiceWait();
			}
		}
		if (!string.IsNullOrEmpty(this.subtitle_data.text) && (0 <= this.subtitle_data.displayTime || 0 < num))
		{
			SubtitleMovieManager globalInstance = SubtitleMovieManager.GetGlobalInstance(this.subtitle_data.casinoType);
			globalInstance.autoDestroy = true;
			int num2 = (0 > this.subtitle_data.displayTime) ? num : this.subtitle_data.displayTime;
			num2 += this.subtitle_data.addDisplayTime;
			globalInstance.Play(this.subtitle_data.text, num2);
			this.subtitle_data.Clear();
		}
		return result;
	}

	public bool TagStopVoice(KagTagSupport tag_data)
	{
		if (!tag_data.IsValid("dummy"))
		{
			Maid maidAndMan = this.GetMaidAndMan(tag_data);
			if (maidAndMan == null)
			{
				return false;
			}
			maidAndMan.AudioMan.Stop();
		}
		else
		{
			GameMain.Instance.SoundMgr.StopDummyVoide();
		}
		return false;
	}

	public bool TagStopSound(KagTagSupport tag_data)
	{
		GameMain.Instance.SoundMgr.StopAll();
		return false;
	}

	public bool TagFade3D(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "fade3D", new string[]
		{
			"time"
		});
		int millisecond = tag_data.GetTagProperty("time").AsInteger();
		float f_fTime = GameUty.MillisecondToSecond(millisecond);
		bool flag = tag_data.IsValid("sync");
		if (tag_data.IsValid("in"))
		{
			GameMain.Instance.MainCamera.FadeInNoUI(f_fTime, true);
		}
		else
		{
			GameMain.Instance.MainCamera.FadeOutNoUI(f_fTime, true);
		}
		if (flag)
		{
			this.SetFadeWait(true);
		}
		return flag;
	}

	public bool TagSetBg(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "setbg", new string[]
		{
			"file"
		});
		string text = tag_data.GetTagProperty("file").AsString();
		Maid maid = GameMain.Instance.CharacterMgr.GetMaid(0);
		if (0 <= text.IndexOf("?"))
		{
			if (maid != null)
			{
				text = ScriptManager.ReplacePersonal(GameMain.Instance.CharacterMgr.GetMaid(0), text);
			}
			else
			{
				Debug.LogError("@SetBgで指定されたファイルに?がありましたが、スロット0にメイドがいないので性格置換できませんでした");
			}
		}
		GameMain.Instance.BgMgr.ChangeBg(text);
		return false;
	}

	public bool TagDraw2DTex(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "draw2dtex", new string[]
		{
			"file",
			"x",
			"y"
		});
		GameObject gameObject = GameObject.Find("__GameMain__/SystemUI Root/MessageWindowPanel/tex2dplate");
		bool flag = false;
		if (gameObject == null)
		{
			gameObject = Utility.CreatePrefab(GameObject.Find("__GameMain__/SystemUI Root"), "System/Prefab/tex2dplate", true);
			gameObject.name = "tex2dplate";
			flag = true;
		}
		UITexture component = gameObject.GetComponent<UITexture>();
		component.mainTexture = Resources.Load<Texture2D>(tag_data.GetTagProperty("file").AsString());
		component.SetDimensions(component.mainTexture.width, component.mainTexture.height);
		Vector3 localPosition = new Vector3((float)(-960 + tag_data.GetTagProperty("x").AsInteger()), (float)(540 - tag_data.GetTagProperty("y").AsInteger()), 0f);
		gameObject.transform.localPosition = localPosition;
		if (flag)
		{
			gameObject.transform.parent = GameObject.Find("__GameMain__/SystemUI Root/MessageWindowPanel").transform;
		}
		return false;
	}

	public bool TagClear2DTex(KagTagSupport tag_data)
	{
		GameObject gameObject = GameObject.Find("__GameMain__/SystemUI Root/MessageWindowPanel/tex2dplate");
		if (gameObject != null)
		{
			UnityEngine.Object.DestroyImmediate(gameObject);
		}
		return false;
	}

	public bool TagItemChange(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "itemchange", new string[]
		{
			"category",
			"name"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		maidAndMan.ItemChangeTemp(tag_data.GetTagProperty("category").AsString().ToLower(), tag_data.GetTagProperty("name").AsString());
		return false;
	}

	public bool TagItemSet(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "itemset", new string[]
		{
			"category",
			"item"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		maidAndMan.SetProp(tag_data.GetTagProperty("category").AsString().ToLower(), tag_data.GetTagProperty("item").AsString(), 0, tag_data.IsValid("temp"), tag_data.IsValid("noscale"));
		return false;
	}

	public bool TagItemReset(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "itemreset", new string[0]);
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		if (tag_data.IsValid("allwear"))
		{
			for (int i = 53; i <= 82; i++)
			{
				maidAndMan.ResetProp((MPN)i, true);
			}
		}
		else if (tag_data.IsValid("multi"))
		{
			string text = tag_data.GetTagProperty("multi").AsString();
			string[] array = text.Split(new char[]
			{
				':'
			});
			foreach (string mpn in array)
			{
				maidAndMan.ResetProp(mpn, true);
			}
		}
		else
		{
			maidAndMan.ResetProp(tag_data.GetTagProperty("category").AsString().ToLower(), true);
		}
		return false;
	}

	public bool TagItemPos(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "itempos", new string[]
		{
			"slot",
			"target"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		string f_strSlotName = tag_data.GetTagProperty("slot").AsString();
		string f_strObjTarget = tag_data.GetTagProperty("target").AsString();
		Vector3 f_vPos = default(Vector3);
		bool flag = false;
		Vector3 f_vRot = default(Vector3);
		bool flag2 = false;
		if (tag_data.IsValid("x"))
		{
			f_vPos.x = tag_data.GetTagProperty("x").AsReal();
			flag = true;
		}
		if (tag_data.IsValid("y"))
		{
			f_vPos.y = tag_data.GetTagProperty("y").AsReal();
			flag = true;
		}
		if (tag_data.IsValid("z"))
		{
			f_vPos.z = tag_data.GetTagProperty("z").AsReal();
			flag = true;
		}
		if (tag_data.IsValid("rx"))
		{
			f_vRot.x = tag_data.GetTagProperty("rx").AsReal();
			flag2 = true;
		}
		if (tag_data.IsValid("ry"))
		{
			f_vRot.y = tag_data.GetTagProperty("ry").AsReal();
			flag2 = true;
		}
		if (tag_data.IsValid("rz"))
		{
			f_vRot.z = tag_data.GetTagProperty("rz").AsReal();
			flag2 = true;
		}
		if (flag)
		{
			maidAndMan.body0.SetSlotOffsetPos(f_strSlotName, f_strObjTarget, f_vPos);
		}
		if (flag2)
		{
			maidAndMan.body0.SetSlotOffsetRot(f_strSlotName, f_strObjTarget, f_vRot);
		}
		return false;
	}

	public bool TagAllProcPropSeqStart(KagTagSupport tag_data)
	{
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		if (tag_data.IsValid("fix"))
		{
			maidAndMan.AllProcProp();
		}
		else
		{
			maidAndMan.AllProcPropSeqStart();
			if (tag_data.IsValid("sync") && maidAndMan.Visible)
			{
				this.SetMaidAllPropSeqWait(maidAndMan);
				return true;
			}
		}
		return false;
	}

	public bool TagItemMask(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "itemmask", new string[]
		{
			"slot",
			"hide"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		string text = tag_data.GetTagProperty("slot").AsString();
		bool f_bVisible = tag_data.GetTagProperty("hide").AsBool();
		TBody.SlotID f_eSlot = TBody.SlotID.accAnl;
		try
		{
			f_eSlot = (TBody.SlotID)Enum.Parse(typeof(TBody.SlotID), text);
		}
		catch
		{
			NDebug.Assert("@itemmask TBody.SlotID enum convert error.\\n" + text, false);
		}
		maidAndMan.body0.SetMask(f_eSlot, f_bVisible);
		return false;
	}

	public bool TagItemMaskMode(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "itemmaskmode", new string[]
		{
			"type"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		string text = tag_data.GetTagProperty("type").AsString();
		TBody.MaskMode maskMode = TBody.MaskMode.None;
		try
		{
			maskMode = (TBody.MaskMode)Enum.Parse(typeof(TBody.MaskMode), text);
		}
		catch
		{
			NDebug.Assert("@itemmaskmode TBody.MaskMode enum convert error.\\n" + text, false);
		}
		maidAndMan.body0.SetMaskMode(maskMode);
		return false;
	}

	public bool TagMaidReset(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "maidreset", new string[]
		{
			"maid"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		maidAndMan.ResetAll();
		return this.SetMaidAllPropSeqWait(maidAndMan);
	}

	public bool TagPropSet(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "propset", new string[]
		{
			"category"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		bool f_bTemp = tag_data.IsValid("temp");
		string text = tag_data.GetTagProperty("category").AsString();
		if (tag_data.IsValid("autofix"))
		{
			string slotname = tag_data.GetTagProperty("slot").AsString();
			TBodySkin slot = maidAndMan.body0.GetSlot(slotname);
			string param = slot.GetParam2("autofix_" + text);
			if (!string.IsNullOrEmpty(param))
			{
				int val = 0;
				if (int.TryParse(param, out val))
				{
					maidAndMan.SetProp(text, val, f_bTemp);
				}
			}
		}
		else if (tag_data.IsValid("val"))
		{
			int val2 = tag_data.GetTagProperty("val").AsInteger();
			maidAndMan.SetProp(text, val2, f_bTemp);
		}
		else
		{
			Debug.LogError("@PropSet には val か autofix のどちらかの指定が必要です。");
		}
		return false;
	}

	public bool TagPropReset(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "propreset", new string[]
		{
			"category"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		string mpn = tag_data.GetTagProperty("category").AsString();
		maidAndMan.ResetProp(mpn, false);
		return false;
	}

	public bool TagAddPrefabBg(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "addprefabbg", new string[]
		{
			"name"
		});
		string text = string.Empty;
		string f_strSrc = string.Empty;
		if (tag_data.IsValid("src"))
		{
			text = tag_data.GetTagProperty("src").AsString();
		}
		else if (tag_data.IsValid("ab"))
		{
			f_strSrc = tag_data.GetTagProperty("ab").AsString();
		}
		string f_strName = tag_data.GetTagProperty("name").AsString();
		string f_strDest = string.Empty;
		if (tag_data.IsValid("dest"))
		{
			f_strDest = tag_data.GetTagProperty("dest").AsString();
		}
		Vector3 zero = Vector3.zero;
		Vector3 zero2 = Vector3.zero;
		if (tag_data.IsValid("x"))
		{
			zero.x = tag_data.GetTagProperty("x").AsReal();
		}
		if (tag_data.IsValid("y"))
		{
			zero.y = tag_data.GetTagProperty("y").AsReal();
		}
		if (tag_data.IsValid("z"))
		{
			zero.z = tag_data.GetTagProperty("z").AsReal();
		}
		if (tag_data.IsValid("rx"))
		{
			zero2.x = tag_data.GetTagProperty("rx").AsReal();
		}
		if (tag_data.IsValid("ry"))
		{
			zero2.y = tag_data.GetTagProperty("ry").AsReal();
		}
		if (tag_data.IsValid("rz"))
		{
			zero2.z = tag_data.GetTagProperty("rz").AsReal();
		}
		if (this.script_mgr_.compatibilityMode && text.ToLower() == "odogu_manaita")
		{
			zero = new Vector3(2.2485f, 0.772f, -0.953f);
		}
		if (!string.IsNullOrEmpty(text))
		{
			GameMain.Instance.BgMgr.AddPrefabToBg(text, f_strName, f_strDest, zero, zero2);
		}
		else
		{
			GameMain.Instance.BgMgr.AddAssetsBundleToBg(f_strSrc, f_strName, f_strDest, zero, zero2);
		}
		return false;
	}

	public bool TagSetPrefabBgTransformData(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "SetPrefabBgTransformData", new string[]
		{
			"name"
		});
		GameObject prefabFromBg = GameMain.Instance.BgMgr.GetPrefabFromBg(tag_data.GetTagProperty("name").AsString());
		if (prefabFromBg != null)
		{
			Transform transform = prefabFromBg.transform;
			Vector3 localPosition = transform.localPosition;
			Vector3 eulerAngles = transform.localRotation.eulerAngles;
			Vector3 localScale = transform.localScale;
			if (tag_data.IsValid("x"))
			{
				localPosition.x = tag_data.GetTagProperty("x").AsReal();
			}
			if (tag_data.IsValid("y"))
			{
				localPosition.y = tag_data.GetTagProperty("y").AsReal();
			}
			if (tag_data.IsValid("z"))
			{
				localPosition.z = tag_data.GetTagProperty("z").AsReal();
			}
			if (tag_data.IsValid("rx"))
			{
				eulerAngles.x = tag_data.GetTagProperty("rx").AsReal();
			}
			if (tag_data.IsValid("ry"))
			{
				eulerAngles.y = tag_data.GetTagProperty("ry").AsReal();
			}
			if (tag_data.IsValid("rz"))
			{
				eulerAngles.z = tag_data.GetTagProperty("rz").AsReal();
			}
			if (tag_data.IsValid("sx"))
			{
				localScale.x = tag_data.GetTagProperty("sx").AsReal();
			}
			if (tag_data.IsValid("sy"))
			{
				localScale.y = tag_data.GetTagProperty("sy").AsReal();
			}
			if (tag_data.IsValid("sz"))
			{
				localScale.z = tag_data.GetTagProperty("sz").AsReal();
			}
			transform.localPosition = localPosition;
			transform.localRotation = Quaternion.Euler(eulerAngles);
			transform.localScale = localScale;
		}
		return false;
	}

	public bool TagDelPrefabBg(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "delprefabBg", new string[]
		{
			"name"
		});
		GameMain.Instance.BgMgr.DelPrefabFromBg(tag_data.GetTagProperty("name").AsString());
		return false;
	}

	public bool TagDelPrefabBgAll(KagTagSupport tag_data)
	{
		GameMain.Instance.BgMgr.DelPrefabFromBgAll();
		return false;
	}

	public bool TagMovePrefabToChara(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "moveprefabtochara", new string[]
		{
			"bone",
			"name"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		string f_strDestBone = tag_data.GetTagProperty("bone").AsString();
		string f_strPrefabName = tag_data.GetTagProperty("name").AsString();
		Vector3 zero = Vector3.zero;
		if (tag_data.IsValid("offsx"))
		{
			zero.x = tag_data.GetTagProperty("offsx").AsReal();
		}
		if (tag_data.IsValid("offsy"))
		{
			zero.y = tag_data.GetTagProperty("offsy").AsReal();
		}
		if (tag_data.IsValid("offsz"))
		{
			zero.z = tag_data.GetTagProperty("offsz").AsReal();
		}
		int millisecond = 0;
		if (tag_data.IsValid("time"))
		{
			millisecond = tag_data.GetTagProperty("time").AsInteger();
		}
		GameMain.Instance.BgMgr.MovePrefabToChara(f_strPrefabName, maidAndMan, f_strDestBone, zero, Vector3.zero, GameUty.MillisecondToSecond(millisecond));
		return false;
	}

	public bool TagAddPrefabWorld(KagTagSupport tag_data)
	{
		return false;
	}

	public bool TagReleasePrefab(KagTagSupport tag_data)
	{
		return false;
	}

	public bool TagPrefabAnimatorSetParam(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "name", new string[]
		{
			"param"
		});
		string f_strName = tag_data.GetTagProperty("name").AsString();
		string f_strParam = tag_data.GetTagProperty("param").AsString();
		if (tag_data.IsValid("bool"))
		{
			GameMain.Instance.BgMgr.PrefabAnimatorSetParam<bool>(f_strName, f_strParam, tag_data.GetTagProperty("bool").AsBool());
		}
		else if (tag_data.IsValid("int"))
		{
			GameMain.Instance.BgMgr.PrefabAnimatorSetParam<int>(f_strName, f_strParam, tag_data.GetTagProperty("int").AsInteger());
		}
		else if (tag_data.IsValid("float"))
		{
			GameMain.Instance.BgMgr.PrefabAnimatorSetParam<float>(f_strName, f_strParam, tag_data.GetTagProperty("float").AsReal());
		}
		else if (tag_data.IsValid("trigger"))
		{
			GameMain.Instance.BgMgr.PrefabAnimatorTrigger(f_strName, f_strParam, tag_data.IsValid("reset"));
		}
		return false;
	}

	public bool TagChinko(KagTagSupport tag_data)
	{
		bool chinkoVisible = tag_data.IsValid("on");
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null || !maidAndMan.boMAN)
		{
			return false;
		}
		maidAndMan.body0.SetChinkoVisible(chinkoVisible);
		return false;
	}

	public bool TagSetLoacalPosition(KagTagSupport tag_data)
	{
		return false;
	}

	public bool TagAddLocalPosition(KagTagSupport tag_data)
	{
		return false;
	}

	public bool TagOpenMouth(KagTagSupport tag_data)
	{
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		if (tag_data.IsValid("open"))
		{
			maidAndMan.OpenMouth(true);
		}
		if (tag_data.IsValid("close"))
		{
			maidAndMan.OpenMouth(false);
		}
		return false;
	}

	public bool TagEyeToPosition(KagTagSupport tag_data)
	{
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		Vector3 f_vecTargetPos = default(Vector3);
		if (tag_data.IsValid("x"))
		{
			f_vecTargetPos.x = tag_data.GetTagProperty("x").AsReal();
		}
		if (tag_data.IsValid("y"))
		{
			f_vecTargetPos.y = tag_data.GetTagProperty("y").AsReal();
		}
		if (tag_data.IsValid("z"))
		{
			f_vecTargetPos.z = tag_data.GetTagProperty("z").AsReal();
		}
		int millisecond = 500;
		if (tag_data.IsValid("blend"))
		{
			millisecond = tag_data.GetTagProperty("blend").AsInteger();
		}
		maidAndMan.EyeToPosition(f_vecTargetPos, GameUty.MillisecondToSecond(millisecond));
		return false;
	}

	public bool TagEyeToTarget(KagTagSupport tag_data)
	{
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		this.CheckAbsolutelyNecessaryTag(tag_data, "eyetotarget", new string[]
		{
			"target"
		});
		Maid maidAndMan2 = this.GetMaidAndMan(tag_data.GetTagProperty("target").AsString());
		int millisecond = 500;
		if (tag_data.IsValid("blend"))
		{
			millisecond = tag_data.GetTagProperty("blend").AsInteger();
		}
		string text = string.Empty;
		if (tag_data.IsValid("bone"))
		{
			text = tag_data.GetTagProperty("bone").AsString();
		}
		if (text == string.Empty)
		{
			maidAndMan.EyeToTarget(maidAndMan2, GameUty.MillisecondToSecond(millisecond), "Bip01 Head");
		}
		else
		{
			maidAndMan.EyeToTarget(maidAndMan2, GameUty.MillisecondToSecond(millisecond), text);
		}
		return false;
	}

	public bool TagEyeToCamera(KagTagSupport tag_data)
	{
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		this.CheckAbsolutelyNecessaryTag(tag_data, "eyetocamera", new string[]
		{
			"move"
		});
		string text = tag_data.GetTagProperty("move").AsString();
		Maid.EyeMoveType f_eType = Maid.EyeMoveType.無し;
		try
		{
			f_eType = (Maid.EyeMoveType)Enum.Parse(typeof(Maid.EyeMoveType), text);
		}
		catch (ArgumentException)
		{
			NDebug.Assert("Maid.EyeMoveType\nenum parse error.[" + text + "]", false);
		}
		int millisecond = 500;
		if (tag_data.IsValid("blend"))
		{
			millisecond = tag_data.GetTagProperty("blend").AsInteger();
		}
		maidAndMan.EyeToCamera(f_eType, GameUty.MillisecondToSecond(millisecond));
		return false;
	}

	public bool TagEyeToReset(KagTagSupport tag_data)
	{
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		int millisecond = 500;
		if (tag_data.IsValid("blend"))
		{
			millisecond = tag_data.GetTagProperty("blend").AsInteger();
		}
		maidAndMan.EyeToReset(GameUty.MillisecondToSecond(millisecond));
		return false;
	}

	public bool TagSetMaidOffsetPos(KagTagSupport tag_data)
	{
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		this.CheckAbsolutelyNecessaryTag(tag_data, "setmaidoffsetpos", new string[]
		{
			"splitnum"
		});
		int f_nCSTSplitNum = tag_data.GetTagProperty("splitnum").AsInteger();
		CharacterMgr.CharaPer f_cIn = BaseKagManager.PerthOffsetPosTagData.CreateCharaPer(this.tjs_, tag_data);
		GameMain.Instance.CharacterMgr.SetMaidOffsetPos(maidAndMan, f_nCSTSplitNum, f_cIn);
		return false;
	}

	public bool TagSetMaidOffsetMultiPos(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "setmaidoffsetpos", new string[]
		{
			"splitnum"
		});
		int f_nCSTSplitNum = tag_data.GetTagProperty("splitnum").AsInteger();
		List<KeyValuePair<Maid, CharacterMgr.CharaPer>> list = BaseKagManager.PerthOffsetPosTagData.CreateMultiCharaPer(this.tjs_, tag_data, this);
		GameMain.Instance.CharacterMgr.SetMaidOffsetOther(list, f_nCSTSplitNum);
		if (!this.script_mgr_.compatibilityMode)
		{
			for (int i = 0; i < list.Count; i++)
			{
				Maid targetMaid = list[i].Key;
				if (this.maidOffsetSetList.Find((Maid maid) => maid == targetMaid) == null)
				{
					this.maidOffsetSetList.Add(targetMaid);
				}
			}
		}
		return false;
	}

	public bool TagSetManOffsetPos(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "TagSetManOffsetPos", new string[]
		{
			"man",
			"splitnum",
			"target",
			"penisdetail"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		string tag_str = tag_data.GetTagProperty("target").AsString();
		Maid maidAndMan2 = this.GetMaidAndMan(tag_str);
		int f_nCSTSplitNum = tag_data.GetTagProperty("splitnum").AsInteger();
		bool f_bPenisDetailMode = tag_data.GetTagProperty("penisdetail").AsBool();
		KeyValuePair<CharacterMgr.CharaPer, CharacterMgr.PenisPer> keyValuePair = BaseKagManager.PerthOffsetPosTagData.CreateCharaPerAndPenisPer(this.tjs_, tag_data);
		GameMain.Instance.CharacterMgr.SetManOffsetPos(maidAndMan, maidAndMan2, f_nCSTSplitNum, f_bPenisDetailMode, keyValuePair.Key, keyValuePair.Value);
		if (!this.script_mgr_.compatibilityMode)
		{
			Maid targetMan = maidAndMan;
			if (this.maidOffsetSetList.Find((Maid maid) => maid == targetMan) == null)
			{
				this.maidOffsetSetList.Add(targetMan);
			}
		}
		return false;
	}

	public bool TagSetMaidOffsetPosCategory(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "setmaidoffsetposcategory", new string[]
		{
			"category"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		string category = tag_data.GetTagProperty("category").AsString();
		if (tag_data.IsValid("x"))
		{
			maidAndMan.SetPosOffsetFromUdeSclX(category, tag_data.GetTagProperty("x").AsReal());
		}
		if (tag_data.IsValid("y"))
		{
			maidAndMan.SetPosOffsetFromUdeSclY(category, tag_data.GetTagProperty("y").AsReal());
		}
		if (tag_data.IsValid("z"))
		{
			maidAndMan.SetPosOffsetFromUdeSclZ(category, tag_data.GetTagProperty("z").AsReal());
		}
		return false;
	}

	public bool TagAddPrefabChara(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "addprefabchara", new string[]
		{
			"src",
			"bone"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		string text = tag_data.GetTagProperty("src").AsString();
		string f_strDestBone = tag_data.GetTagProperty("bone").AsString();
		string f_strName = text;
		if (tag_data.IsValid("name"))
		{
			f_strName = tag_data.GetTagProperty("name").AsString();
		}
		Vector3 zero = Vector3.zero;
		Vector3 zero2 = Vector3.zero;
		if (tag_data.IsValid("x"))
		{
			zero.x = tag_data.GetTagProperty("x").AsReal();
		}
		if (tag_data.IsValid("y"))
		{
			zero.y = tag_data.GetTagProperty("y").AsReal();
		}
		if (tag_data.IsValid("z"))
		{
			zero.z = tag_data.GetTagProperty("z").AsReal();
		}
		if (tag_data.IsValid("rx"))
		{
			zero2.x = tag_data.GetTagProperty("rx").AsReal();
		}
		if (tag_data.IsValid("ry"))
		{
			zero2.y = tag_data.GetTagProperty("ry").AsReal();
		}
		if (tag_data.IsValid("rz"))
		{
			zero2.z = tag_data.GetTagProperty("rz").AsReal();
		}
		maidAndMan.AddPrefab(text, f_strName, f_strDestBone, zero, zero2);
		return false;
	}

	public bool TagDelPrefabChara(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "delprefabchara", new string[]
		{
			"name"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		maidAndMan.DelPrefab(tag_data.GetTagProperty("name").AsString());
		return false;
	}

	public bool TagDelPrefabCharaAll(KagTagSupport tag_data)
	{
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		maidAndMan.DelPrefabAll();
		return false;
	}

	public bool TagAnimObjChara(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "animobjchara", new string[]
		{
			"name",
			"mot",
			"play",
			"loop"
		});
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		string f_strName = tag_data.GetTagProperty("name").AsString();
		string f_strAnimName = tag_data.GetTagProperty("mot").AsString();
		bool f_bNowPlay = tag_data.GetTagProperty("play").AsBool();
		bool f_bLoop = tag_data.GetTagProperty("loop").AsBool();
		maidAndMan.AnimationObject(f_strName, f_strAnimName, f_bNowPlay, f_bLoop);
		return false;
	}

	public bool TagCharaActivate(KagTagSupport tag_data)
	{
		if (this.script_mgr_.compatibilityMode)
		{
			return this.TagCompatibilityCharaActivate(tag_data);
		}
		GameMain.Instance.ScriptMgr.StopMotionScript();
		int num = 0;
		bool flag = false;
		if (tag_data.IsValid("maid"))
		{
			num = tag_data.GetTagProperty("maid").AsInteger();
		}
		else if (tag_data.IsValid("man"))
		{
			flag = true;
			num = tag_data.GetTagProperty("man").AsInteger();
		}
		else
		{
			NDebug.Assert("@charaactivate error.", false);
		}
		CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
		Maid maid = null;
		if (tag_data.IsValid("leader"))
		{
			NDebug.Assert(!flag, "@charaactivateのleaderタグはメイド専用です。man指定がされています。");
			for (int i = 0; i < characterMgr.GetStockMaidCount(); i++)
			{
				Maid stockMaid = characterMgr.GetStockMaid(i);
				if (stockMaid != null && stockMaid.status.leader)
				{
					characterMgr.SetActiveMaid(stockMaid, num);
					maid = stockMaid;
					break;
				}
			}
			NDebug.Assert(maid != null, "メイド長を探せませんでした");
		}
		else if (tag_data.IsValid("rank1"))
		{
			NDebug.Assert(!flag, "@charaactivateのrank1タグはメイド専用です。man指定がされています。");
			List<Maid> list = new List<Maid>();
			for (int j = 0; j < characterMgr.GetStockMaidCount(); j++)
			{
				Maid stockMaid2 = characterMgr.GetStockMaid(j);
				if (stockMaid2 != null)
				{
					list.Add(stockMaid2);
				}
			}
			List<Maid> list2 = list;
			if (BaseKagManager.<>f__mg$cache0 == null)
			{
				BaseKagManager.<>f__mg$cache0 = new Comparison<Maid>(CharacterSelectManager.SortMaidRanking);
			}
			list2.Sort(BaseKagManager.<>f__mg$cache0);
			for (int k = 0; k < list.Count; k++)
			{
				if (list[k].status.popularRank == 1)
				{
					characterMgr.SetActiveMaid(list[k], num);
					maid = list[k];
					break;
				}
			}
		}
		else if (tag_data.IsValid("main"))
		{
			Personal.Data data = Personal.GetData(tag_data.GetTagProperty("main").AsString());
			NDebug.Assert(!flag, "@charaactivateのmainタグはメイド専用です。man指定がされています。");
			for (int l = 0; l < characterMgr.GetStockMaidCount(); l++)
			{
				Maid stockMaid3 = characterMgr.GetStockMaid(l);
				if (stockMaid3 != null && stockMaid3.status.mainChara && stockMaid3.status.personal.id == data.id)
				{
					characterMgr.SetActiveMaid(stockMaid3, num);
					maid = stockMaid3;
					break;
				}
			}
			NDebug.Assert(maid != null, data.drawName + "性格のメインキャラを探せませんでした");
		}
		else if (tag_data.IsValid("npc"))
		{
			string text = tag_data.GetTagProperty("npc").AsString();
			if (SubMaid.Contains(text))
			{
				NDebug.Assert(!flag, "npc指定の男は日対応です[" + text + "]");
				maid = characterMgr.ActivateNpc(num);
				NDebug.Assert(maid.boNPC, "NPCメイドではないメイドにNPCプリセットを適用しようとしました");
				SubMaid.Data.CharacterStatus characterStatus = (!GameMain.Instance.CharacterMgr.status.lockUserDraftMaid) ? SubMaid.GetData(text).status : SubMaid.GetData(text).secondStatus;
				if (characterStatus == null)
				{
					characterStatus = SubMaid.GetData(text).status;
				}
				CharacterMgr.npcDatas[characterStatus.presetName].Apply(maid, false);
			}
			else
			{
				NDebug.Assert(CharacterMgr.npcDatas.ContainsKey(text), "キャラクタープリセット設定[" + text + "]の情報が見つかりませんでした");
				if (!flag)
				{
					maid = characterMgr.ActivateNpc(num);
				}
				else
				{
					maid = characterMgr.GetMan(num);
					NDebug.Assert(maid != null, "男スロット指定が限界数を超えています。指定可能範囲は0~" + 5.ToString() + "までです");
				}
				if (!flag)
				{
					NDebug.Assert(maid.boNPC, "NPCメイドではないメイドにNPCプリセットを適用しようとしました");
				}
				CharacterMgr.npcDatas[text].Apply(maid, false);
			}
			maid.gameObject.name = ((!flag) ? "Maid[" : "Man[") + num.ToString() + "]";
			if (!flag)
			{
				GameObject gameObject = maid.gameObject;
				string name = gameObject.name;
				gameObject.name = string.Concat(new string[]
				{
					name,
					" ",
					maid.status.firstName,
					" ",
					maid.status.lastName
				});
			}
		}
		else if (tag_data.IsValid("sub"))
		{
			string b = tag_data.GetTagProperty("sub").AsString();
			NDebug.Assert(!flag, "@charaactivateのsubタグはメイド専用です。man指定がされています。");
			for (int m = 0; m < characterMgr.GetStockMaidCount(); m++)
			{
				Maid stockMaid4 = characterMgr.GetStockMaid(m);
				if (stockMaid4 != null && stockMaid4.status.heroineType == HeroineType.Sub && stockMaid4.status.subCharaData != null && stockMaid4.status.subCharaData.uniqueName == b)
				{
					characterMgr.SetActiveMaid(stockMaid4, num);
					maid = stockMaid4;
					break;
				}
			}
		}
		else if (tag_data.IsValid("slot"))
		{
			NDebug.Assert(!flag, "@charaactivateのslotタグはメイド専用です。man指定がされています。");
			int f_nStockSlot = tag_data.GetTagProperty("slot").AsInteger();
			maid = GameMain.Instance.CharacterMgr.Activate(num, f_nStockSlot, flag, false);
		}
		else if (tag_data.IsValid("swap"))
		{
			int slotNoB = tag_data.GetTagProperty("swap").AsInteger();
			GameMain.Instance.CharacterMgr.SwapActiveSlot(num, slotNoB, flag);
		}
		else
		{
			NDebug.Assert("@charaactivate error.", false);
		}
		bool result = false;
		if (maid != null && !tag_data.IsValid("noload"))
		{
			maid.Visible = true;
			result = this.SetMaidAllPropSeqWait(maid);
		}
		return result;
	}

	public bool TagCompatibilityCharaActivate(KagTagSupport tag_data)
	{
		int num = 0;
		bool flag = false;
		if (tag_data.IsValid("maid"))
		{
			num = tag_data.GetTagProperty("maid").AsInteger();
		}
		else if (tag_data.IsValid("man"))
		{
			flag = true;
			num = tag_data.GetTagProperty("man").AsInteger();
			if (this.script_mgr_.compatibilityMode && 6 <= num)
			{
				num = 5;
			}
		}
		else if (tag_data.IsValid("file"))
		{
			num = 16;
		}
		else
		{
			NDebug.Assert("@charaactivate error.", false);
		}
		Maid maid = null;
		if (tag_data.IsValid("npc") || tag_data.IsValid("file"))
		{
			string text = string.Empty;
			if (tag_data.IsValid("npc"))
			{
				text = tag_data.GetTagProperty("npc").AsString();
			}
			else
			{
				text = tag_data.GetTagProperty("file").AsString();
			}
			if (this.script_mgr_.compatibilityMode)
			{
				if (text == "叔父メイド" || text == "メイド秘書" || text == "エステメイド")
				{
					text = "旧" + text;
				}
				else if (text == "pre_尾高千夏")
				{
					text = "旧千夏";
				}
				else if (text == "その他1")
				{
					text = "客2";
				}
			}
			NDebug.Assert(CharacterMgr.npcDatas.ContainsKey(text), "サブキャラクター[" + text + "]の情報が見つかりませんでした");
			if (!flag)
			{
				maid = GameMain.Instance.CharacterMgr.ActivateNpc(num);
			}
			else
			{
				maid = GameMain.Instance.CharacterMgr.GetMan(num);
				NDebug.Assert(maid != null, "男スロット指定が限界数を超えています。指定可能範囲は0~" + 5.ToString() + "までです");
			}
			if (!flag)
			{
				NDebug.Assert(maid.boNPC, "NPCメイドではないメイドにNPCプリセットを適用しようとしました");
			}
			CharacterMgr.npcDatas[text].Apply(maid, false);
		}
		else if (tag_data.IsValid("pc"))
		{
			int f_nStockSlot = tag_data.GetTagProperty("pc").AsInteger();
			maid = GameMain.Instance.CharacterMgr.Activate(num, f_nStockSlot, false, false);
		}
		else
		{
			NDebug.Assert("@charaactivate error.", false);
		}
		bool result = false;
		if (maid != null)
		{
			result = this.SetMaidAllPropSeqWait(maid);
		}
		return result;
	}

	public bool TagConCharaActivateFreeNPC(KagTagSupport tag_data)
	{
		return this.TagCompatibilityCharaActivate(tag_data);
	}

	public bool TagConCharaActivate1stRanking(KagTagSupport tag_data)
	{
		GameMain.Instance.ScriptMgr.StopMotionScript();
		int f_nActiveSlotNo = 0;
		if (tag_data.IsValid("maid"))
		{
			f_nActiveSlotNo = tag_data.GetTagProperty("maid").AsInteger();
		}
		List<Maid> list = new List<Maid>();
		CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
		for (int i = 0; i < characterMgr.GetStockMaidCount(); i++)
		{
			Maid stockMaid = characterMgr.GetStockMaid(i);
			if (stockMaid != null)
			{
				list.Add(stockMaid);
			}
		}
		List<Maid> list2 = list;
		if (BaseKagManager.<>f__mg$cache1 == null)
		{
			BaseKagManager.<>f__mg$cache1 = new Comparison<Maid>(CharacterSelectManager.SortMaidRanking);
		}
		list2.Sort(BaseKagManager.<>f__mg$cache1);
		bool result = false;
		for (int j = 0; j < list.Count; j++)
		{
			if (list[j].status.popularRank == 1)
			{
				characterMgr.SetActiveMaid(list[j], f_nActiveSlotNo);
				list[j].Visible = true;
				result = this.SetMaidAllPropSeqWait(list[j]);
				break;
			}
		}
		return result;
	}

	public bool TagConCharaActivateLeader(KagTagSupport tag_data)
	{
		GameMain.Instance.ScriptMgr.StopMotionScript();
		int f_nActiveSlotNo = 0;
		if (tag_data.IsValid("maid"))
		{
			f_nActiveSlotNo = tag_data.GetTagProperty("maid").AsInteger();
		}
		bool result = false;
		CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
		for (int i = 0; i < characterMgr.GetStockMaidCount(); i++)
		{
			Maid stockMaid = characterMgr.GetStockMaid(i);
			if (stockMaid != null && stockMaid.status.leader)
			{
				characterMgr.SetActiveMaid(stockMaid, f_nActiveSlotNo);
				stockMaid.Visible = true;
				result = this.SetMaidAllPropSeqWait(stockMaid);
				break;
			}
		}
		return result;
	}

	public bool TagManPresetMenuLoad(KagTagSupport tag_data)
	{
		int nManNo = 0;
		if (tag_data.IsValid("man"))
		{
			nManNo = tag_data.GetTagProperty("man").AsInteger();
		}
		CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
		Maid man = characterMgr.GetMan(nManNo);
		if (man != null)
		{
			man.SetUpModel(tag_data.GetTagProperty("file").AsString());
		}
		return false;
	}

	public bool TagCharaDeactivate(KagTagSupport tag_data)
	{
		int num = 0;
		bool flag = false;
		if (tag_data.IsValid("maid"))
		{
			num = tag_data.GetTagProperty("maid").AsInteger();
		}
		else if (tag_data.IsValid("man"))
		{
			flag = true;
			num = tag_data.GetTagProperty("man").AsInteger();
			if (this.script_mgr_.compatibilityMode && 6 <= num)
			{
				num = 5;
			}
		}
		else
		{
			NDebug.Assert("@CharaDeactivate error.", false);
		}
		ScriptManager scriptMgr = GameMain.Instance.ScriptMgr;
		scriptMgr.ClearForcExecWaitEvent();
		foreach (KeyValuePair<int, MotionKagManager> keyValuePair in scriptMgr.kag_mot_dic)
		{
			if (!flag)
			{
				if (keyValuePair.Value.main_maid != null && keyValuePair.Value.main_maid == GameMain.Instance.CharacterMgr.GetMaid(num))
				{
					keyValuePair.Value.ClearMotion();
					keyValuePair.Value.enabled = false;
				}
			}
			else if (!scriptMgr.compatibilityMode)
			{
				Maid man = GameMain.Instance.CharacterMgr.GetMan(num);
				if (man != null && man.body0 != null)
				{
					man.body0.SetChinkoVisible(true);
				}
				if (keyValuePair.Value.main_man != null && keyValuePair.Value.main_man == man)
				{
					keyValuePair.Value.ClearMotion();
					keyValuePair.Value.enabled = false;
				}
			}
		}
		if (!flag)
		{
			GameMain.Instance.CharacterMgr.Deactivate(num, flag);
		}
		else
		{
			GameMain.Instance.CharacterMgr.CharaVisible(num, false, flag);
		}
		return false;
	}

	public bool TagCharaVisible(KagTagSupport tag_data)
	{
		int num = 0;
		bool flag = false;
		if (tag_data.IsValid("maid"))
		{
			num = tag_data.GetTagProperty("maid").AsInteger();
		}
		else if (tag_data.IsValid("man"))
		{
			flag = true;
			num = tag_data.GetTagProperty("man").AsInteger();
			if (this.script_mgr_.compatibilityMode && 6 <= num)
			{
				num = 5;
			}
		}
		else
		{
			NDebug.Assert("@charavisible error.", false);
		}
		bool flag2 = tag_data.IsValid("true");
		Maid maid = GameMain.Instance.CharacterMgr.CharaVisible(num, flag2, flag);
		if (maid == null && this.script_mgr_.compatibilityMode)
		{
			return false;
		}
		NDebug.Assert(maid != null, string.Concat(new object[]
		{
			"@charavisibleエラー。指定の",
			(!flag) ? "メイド" : "男",
			"はいません。スロット番号",
			num
		}));
		if (!this.script_mgr_.compatibilityMode && maid != null && maid.body0 != null && flag && !flag2)
		{
			maid.body0.SetChinkoVisible(true);
		}
		bool result = false;
		if (flag2 && maid != null)
		{
			result = this.SetMaidAllPropSeqWait(maid);
		}
		return result;
	}

	public bool TagCharaVisibleAllOff(KagTagSupport tag_data)
	{
		bool flag = tag_data.IsValid("man");
		bool flag2 = false;
		CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
		if (!flag)
		{
			for (int i = 0; i < characterMgr.GetMaidCount(); i++)
			{
				if (characterMgr.GetMaid(i) != null)
				{
					characterMgr.CharaVisible(i, flag2, flag);
				}
			}
		}
		else
		{
			for (int j = 0; j < characterMgr.GetManCount(); j++)
			{
				Maid man = characterMgr.GetMan(j);
				if (man != null)
				{
					if (!flag2 && man.body0 != null)
					{
						man.body0.SetChinkoVisible(true);
					}
					characterMgr.CharaVisible(j, flag2, flag);
				}
			}
		}
		return false;
	}

	public bool TagTexMulAdd(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "layer", new string[]
		{
			"x",
			"y",
			"r",
			"s"
		});
		Maid maid = this.GetMaidAndMan(tag_data);
		if (maid == null)
		{
			return false;
		}
		Func<string, string> func = delegate(string ran_str)
		{
			string[] array5 = ran_str.Split(new char[]
			{
				':'
			});
			return array5[UnityEngine.Random.Range(0, array5.Length)];
		};
		string slot = "body";
		if (tag_data.IsValid("slot"))
		{
			slot = tag_data.GetTagProperty("slot").AsString();
		}
		int matno = 0;
		if (tag_data.IsValid("matno"))
		{
			matno = tag_data.GetTagProperty("matno").AsInteger();
		}
		string propname = "_MainTex";
		if (tag_data.IsValid("propname"))
		{
			propname = tag_data.GetTagProperty("propname").AsString();
		}
		int layer = tag_data.GetTagProperty("layer").AsInteger();
		string file = string.Empty;
		if (tag_data.IsValid("file"))
		{
			file = tag_data.GetTagProperty("file").AsString();
		}
		else if (tag_data.IsValid("res"))
		{
			file = tag_data.GetTagProperty("res").AsString();
		}
		NDebug.Assert(!string.IsNullOrEmpty(file), "@texmuladd [file] or [res] error.");
		file = func(file);
		if (tag_data.IsValid("res"))
		{
			file = "res:" + file;
		}
		string text = tag_data.GetTagProperty("x").AsString();
		string[] array = text.Split(new char[]
		{
			':'
		});
		NDebug.Assert(array.Length == 2, "@texmuladd [x] error.");
		int x = UnityEngine.Random.Range(int.Parse(array[0]), int.Parse(array[1]) + 1);
		string text2 = tag_data.GetTagProperty("y").AsString();
		string[] array2 = text2.Split(new char[]
		{
			':'
		});
		NDebug.Assert(array2.Length == 2, "@texmuladd [y] error.");
		int y = UnityEngine.Random.Range(int.Parse(array2[0]), int.Parse(array2[1]) + 1);
		string text3 = tag_data.GetTagProperty("r").AsString();
		string[] array3 = text3.Split(new char[]
		{
			':'
		});
		NDebug.Assert(array3.Length == 2, "@texmuladd [r] error.");
		float r = (float)UnityEngine.Random.Range((int)(float.Parse(array3[0]) * 100f), (int)(float.Parse(array3[1]) * 100f + 1f)) / 100f;
		string text4 = tag_data.GetTagProperty("s").AsString();
		string[] array4 = text4.Split(new char[]
		{
			':'
		});
		NDebug.Assert(array4.Length == 2, "@texmuladd [s] error.");
		float s = (float)UnityEngine.Random.Range((int)(float.Parse(array4[0]) * 100f), (int)(float.Parse(array4[1]) * 100f + 1f)) / 100f;
		int num = 0;
		if (tag_data.IsValid("delay"))
		{
			num = tag_data.GetTagProperty("delay").AsInteger();
		}
		WaitEventList waitEventList = this.GetWaitEventList("tex_mul_add");
		if (num <= 0)
		{
			this.ExecForcWaitEvent();
			if (maid != null && maid.body0 != null && maid.body0.isLoadedBody)
			{
				maid.body0.MulTexSet(slot, matno, propname, layer, file, GameUty.SystemMaterial.Alpha, true, x, y, r, s, false, null, 1f, 1024);
				if (propname == "_MainTex")
				{
					maid.body0.MulTexSet(slot, matno, "_ShadowTex", layer, file, GameUty.SystemMaterial.Alpha, true, x, y, r, s, false, null, 1f, 1024);
				}
				maid.body0.MulTexProc(slot);
			}
		}
		else
		{
			waitEventList.Add(delegate
			{
				if (maid != null && maid.body0 != null && maid.body0.isLoadedBody)
				{
					maid.body0.MulTexSet(slot, matno, propname, layer, file, GameUty.SystemMaterial.Alpha, true, x, y, r, s, false, null, 1f, 1024);
					if (propname == "_MainTex")
					{
						maid.body0.MulTexSet(slot, matno, "_ShadowTex", layer, file, GameUty.SystemMaterial.Alpha, true, x, y, r, s, false, null, 1f, 1024);
					}
					maid.body0.MulTexProc(slot);
				}
			}, num);
		}
		return false;
	}

	public bool TagTexMulDel(KagTagSupport tag_data)
	{
		Maid maidAndMan = this.GetMaidAndMan(tag_data);
		if (maidAndMan == null)
		{
			return false;
		}
		int f_nMatNo = 0;
		if (tag_data.IsValid("matno"))
		{
			f_nMatNo = tag_data.GetTagProperty("matno").AsInteger();
		}
		string text = "_MainTex";
		if (tag_data.IsValid("propname"))
		{
			text = tag_data.GetTagProperty("propname").AsString();
		}
		string text2 = "body";
		if (tag_data.IsValid("slot"))
		{
			text2 = tag_data.GetTagProperty("slot").AsString();
		}
		this.script_mgr_.ClearForcExecWaitEvent();
		string text3 = "10:20";
		if (tag_data.IsValid("layer"))
		{
			text3 = tag_data.GetTagProperty("layer").AsString();
		}
		int num = 10;
		int num2 = 20;
		string[] array = text3.Split(new char[]
		{
			':'
		});
		if (array.Length == 2)
		{
			num = int.Parse(array[0].Trim());
			num2 = int.Parse(array[1].Trim());
		}
		else if (array.Length == 1)
		{
			num2 = (num = int.Parse(array[0].Trim()));
		}
		for (int i = num; i <= num2; i++)
		{
			maidAndMan.body0.MulTexRemove(text2, f_nMatNo, text, i);
			if (text == "_MainTex")
			{
				maidAndMan.body0.MulTexRemove(text2, f_nMatNo, "_ShadowTex", i);
			}
		}
		maidAndMan.Visible = true;
		maidAndMan.body0.MulTexProc(text2);
		return false;
	}

	public bool TagStartDay(KagTagSupport tag_data)
	{
		GameMain.Instance.OnStartDay();
		return false;
	}

	public bool TagEndDay(KagTagSupport tag_data)
	{
		GameMain.Instance.OnEndDay();
		return false;
	}

	public bool TagScheduleStartManage(KagTagSupport tag_data)
	{
		ScheduleAPI.DayStartManage();
		return false;
	}

	public bool TagConUpdateMaidPoint(KagTagSupport tag_data)
	{
		return false;
	}

	public bool TagVRBGChangeInit(KagTagSupport tag_data)
	{
		SceneVRCommunication.Instance.KagBGChangeInit(tag_data.GetTagList());
		return false;
	}

	public bool TagVREventObj(KagTagSupport tag_data)
	{
		string f_strName = tag_data.GetTagProperty("name").AsString();
		int f_nVisible = 0;
		if (tag_data.IsValid("visible"))
		{
			f_nVisible = ((!tag_data.GetTagProperty("visible").AsBool()) ? 2 : 1);
		}
		int f_nTrigger = 0;
		if (tag_data.IsValid("trigger"))
		{
			f_nTrigger = ((!tag_data.GetTagProperty("trigger").AsBool()) ? 2 : 1);
		}
		int f_nGrab = 0;
		if (tag_data.IsValid("grab"))
		{
			f_nGrab = ((!tag_data.GetTagProperty("grab").AsBool()) ? 2 : 1);
		}
		string f_strAnimation = string.Empty;
		if (tag_data.IsValid("animation"))
		{
			f_strAnimation = tag_data.GetTagProperty("animation").AsString();
		}
		SceneVRCommunication.Instance.KagEventObj(f_strName, f_nVisible, f_nTrigger, f_nGrab, f_strAnimation);
		return false;
	}

	public bool TagVREventGroup(KagTagSupport tag_data)
	{
		string f_strName = tag_data.GetTagProperty("name").AsString();
		int f_nVisible = 0;
		if (tag_data.IsValid("visible"))
		{
			f_nVisible = ((!tag_data.GetTagProperty("visible").AsBool()) ? 2 : 1);
		}
		int f_nTrigger = 0;
		if (tag_data.IsValid("trigger"))
		{
			f_nTrigger = ((!tag_data.GetTagProperty("trigger").AsBool()) ? 2 : 1);
		}
		int f_nGrab = 0;
		if (tag_data.IsValid("grab"))
		{
			f_nGrab = ((!tag_data.GetTagProperty("grab").AsBool()) ? 2 : 1);
		}
		SceneVRCommunication.Instance.KagEventObjGroup(f_strName, f_nVisible, f_nTrigger, f_nGrab);
		return false;
	}

	public bool TagVRFreeScene(KagTagSupport tag_data)
	{
		if (tag_data.IsValid("start"))
		{
			SceneVRCommunication.Instance.kagFreeSceneSwitch(true, true, false);
		}
		else if (tag_data.IsValid("end"))
		{
			bool f_bEnableSkip = !tag_data.IsValid("noskip");
			SceneVRCommunication.Instance.kagFreeSceneSwitch(false, f_bEnableSkip, false);
		}
		return false;
	}

	public bool TagVRCamera(KagTagSupport tag_data)
	{
		float num = 0f;
		bool flag = false;
		float x = tag_data.GetTagProperty("x").AsReal();
		float z = tag_data.GetTagProperty("z").AsReal();
		if (tag_data.IsValid("height"))
		{
			num = tag_data.GetTagProperty("height").AsReal();
		}
		else if (tag_data.IsValid("stand"))
		{
			num = GameMain.Instance.CMSystem.VRCameraHeightStandOffs;
		}
		else if (tag_data.IsValid("sit"))
		{
			num = GameMain.Instance.CMSystem.VRCameraHeightSitOffs;
			flag = true;
		}
		bool f_bYFromFloor = true;
		if (tag_data.IsValid("nofloor"))
		{
			f_bYFromFloor = false;
			if (flag)
			{
				num += 0.4f;
			}
		}
		GameMain.Instance.MainCamera.SetRealHeadPos(new Vector3(x, num, z), f_bYFromFloor);
		if (tag_data.IsValid("angle"))
		{
			float y = tag_data.GetTagProperty("angle").AsReal();
			GameMain.Instance.MainCamera.SetRealHeadRot(new Vector3(0f, y, 0f), true);
		}
		return false;
	}

	public bool TagVRTablet(KagTagSupport tag_data)
	{
		if (tag_data.IsValid("show"))
		{
			GameMain.Instance.OvrMgr.OvrCamera.ShowUI(true);
		}
		else if (tag_data.IsValid("hide"))
		{
			GameMain.Instance.OvrMgr.OvrCamera.ShowUI(false);
		}
		if (tag_data.IsValid("reset"))
		{
			float f_fOffsetRotY = 0f;
			if (tag_data.IsValid("rot"))
			{
				f_fOffsetRotY = tag_data.GetTagProperty("rot").AsReal();
			}
			GameMain.Instance.OvrMgr.OvrCamera.UIPosReset(f_fOffsetRotY);
		}
		if (tag_data.IsValid("nomove"))
		{
			bool uiNoMoveMode = tag_data.GetTagProperty("nomove").AsBool();
			SceneVRCommunication.Instance.UiNoMoveMode = uiNoMoveMode;
		}
		if (tag_data.IsValid("nohome"))
		{
			bool uiNoHomeMode = tag_data.GetTagProperty("nohome").AsBool();
			SceneVRCommunication.Instance.UiNoHomeMode = uiNoHomeMode;
		}
		if (tag_data.IsValid("notime"))
		{
			bool uiNoTimeMode = tag_data.GetTagProperty("notime").AsBool();
			SceneVRCommunication.Instance.UiNoTimeMode = uiNoTimeMode;
		}
		return false;
	}

	public bool TagVRChoicesSet(KagTagSupport tag_data)
	{
		int f_nMaidNo = -1;
		VRChoices.SelectPair.Type f_type = VRChoices.SelectPair.Type.Text;
		string f_strRegionSplitOfColon = string.Empty;
		this.CheckAbsolutelyNecessaryTag(tag_data, "text", new string[]
		{
			"label"
		});
		string text = tag_data.GetTagProperty("text").AsString();
		text = ScriptManager.ReplaceCharaName(text);
		string f_strLabel = tag_data.GetTagProperty("label").AsString();
		if (tag_data.IsValid("maid"))
		{
			f_nMaidNo = tag_data.GetTagProperty("maid").AsInteger();
		}
		if (tag_data.IsValid("type"))
		{
			string text2 = tag_data.GetTagProperty("type").AsString();
			if (text2 == "touch")
			{
				f_type = VRChoices.SelectPair.Type.Touch;
			}
			else if (text2 == "look")
			{
				f_type = VRChoices.SelectPair.Type.Look;
			}
			else
			{
				NDebug.Assert("typeに不正な文字列 " + text2, false);
			}
		}
		float f_fTimeOut = -1f;
		if (tag_data.IsValid("time"))
		{
			f_fTimeOut = tag_data.GetTagProperty("time").AsReal();
		}
		if (tag_data.IsValid("region"))
		{
			f_strRegionSplitOfColon = tag_data.GetTagProperty("region").AsString();
		}
		SceneVRCommunication.Instance.Choices.Add(text, f_strLabel, f_nMaidNo, f_type, f_strRegionSplitOfColon, f_fTimeOut);
		return false;
	}

	public bool TagVRChoicesShow(KagTagSupport tag_data)
	{
		if (tag_data.IsValid("end"))
		{
			SceneVRCommunication.Instance.Choices.Finalize(null);
			return false;
		}
		int f_nTimeOutMS = 0;
		string f_strTimeOutLabel = string.Empty;
		int f_nRandom = 0;
		if (tag_data.IsValid("timeout"))
		{
			f_nTimeOutMS = tag_data.GetTagProperty("timeout").AsInteger();
		}
		if (tag_data.IsValid("timeoutlabel"))
		{
			f_strTimeOutLabel = tag_data.GetTagProperty("timeoutlabel").AsString();
		}
		if (tag_data.IsValid("random"))
		{
			f_nRandom = tag_data.GetTagProperty("random").AsInteger();
		}
		SceneVRCommunication.Instance.Choices.Show(f_nTimeOutMS, f_strTimeOutLabel, f_nRandom);
		return true;
	}

	public bool TagVRChoicesShowNonStop(KagTagSupport tag_data)
	{
		if (tag_data.IsValid("end"))
		{
			SceneVRCommunication.Instance.Choices.Finalize(null);
			return false;
		}
		int f_nTimeOutMS = 0;
		string f_strTimeOutLabel = string.Empty;
		int f_nRandom = 0;
		if (tag_data.IsValid("timeout"))
		{
			f_nTimeOutMS = tag_data.GetTagProperty("timeout").AsInteger();
		}
		if (tag_data.IsValid("timeoutlabel"))
		{
			f_strTimeOutLabel = tag_data.GetTagProperty("timeoutlabel").AsString();
		}
		if (tag_data.IsValid("random"))
		{
			f_nRandom = tag_data.GetTagProperty("random").AsInteger();
		}
		SceneVRCommunication.Instance.Choices.Show(f_nTimeOutMS, f_strTimeOutLabel, f_nRandom);
		return false;
	}

	public bool TagVRDoNextTime(KagTagSupport tag_data)
	{
		SceneVRCommunication.Instance.KagDoNextTime();
		return false;
	}

	public bool TagVRResetHeadPos(KagTagSupport tag_data)
	{
		GameMain.Instance.OvrMgr.OvrCamera.ReCallcOffset();
		return false;
	}

	public bool TagVRTouchScript(KagTagSupport tag_data)
	{
		SceneVRCommunication.Instance.TouchComm.Touch_Operator(tag_data);
		return false;
	}

	public bool TagVRDayTimeShow(KagTagSupport tag_data)
	{
		string f_strReturnFile = string.Empty;
		string f_strReturnLabel = string.Empty;
		if (tag_data.IsValid("file"))
		{
			f_strReturnFile = tag_data.GetTagProperty("file").AsString();
		}
		if (tag_data.IsValid("label"))
		{
			f_strReturnLabel = tag_data.GetTagProperty("label").AsString();
		}
		SceneVRCommunication.Instance.KagStartDayTimeShow(f_strReturnFile, f_strReturnLabel);
		return false;
	}

	public bool TagVRDialog(KagTagSupport tag_data)
	{
		string text = string.Empty;
		string f_strLabelOk = string.Empty;
		string f_strLabelCancel = string.Empty;
		string f_strLabelYes = string.Empty;
		string strLabelNo = string.Empty;
		if (tag_data.IsValid("text"))
		{
			text = tag_data.GetTagProperty("text").AsString();
			text = ScriptManager.ReplaceCharaName(text);
		}
		if (tag_data.IsValid("ok"))
		{
			f_strLabelOk = tag_data.GetTagProperty("ok").AsString();
		}
		if (tag_data.IsValid("cancel"))
		{
			f_strLabelCancel = tag_data.GetTagProperty("cancel").AsString();
		}
		if (tag_data.IsValid("yes"))
		{
			f_strLabelYes = tag_data.GetTagProperty("yes").AsString();
		}
		if (tag_data.IsValid("no"))
		{
			strLabelNo = tag_data.GetTagProperty("no").AsString();
		}
		SceneVRCommunication.Instance.KagDialog(text, f_strLabelOk, f_strLabelCancel, f_strLabelYes, strLabelNo);
		return true;
	}

	public bool TagVRStartMovieMusicPlayerTV(KagTagSupport tag_data)
	{
		SceneVRCommunication.Instance.KagStartMovieMusicPlayerTV();
		return false;
	}

	public bool TagVRMovieTV(KagTagSupport tag_data)
	{
		string f_strFileName = string.Empty;
		bool f_bLoop = false;
		bool f_bStart = tag_data.IsValid("start");
		if (tag_data.IsValid("file"))
		{
			f_strFileName = tag_data.GetTagProperty("file").AsString();
		}
		if (tag_data.IsValid("loop"))
		{
			f_bLoop = tag_data.IsValid("loop");
		}
		SceneVRCommunication.Instance.KagVRMovieTV(f_bStart, f_strFileName, f_bLoop);
		return false;
	}

	public bool TagVRPlantWindowShow(KagTagSupport tag_data)
	{
		string strFileName = string.Empty;
		string strLabelOK = string.Empty;
		string strLabelCancel = string.Empty;
		if (tag_data.IsValid("file"))
		{
			strFileName = tag_data.GetTagProperty("file").AsString();
		}
		if (tag_data.IsValid("ok"))
		{
			strLabelOK = tag_data.GetTagProperty("ok").AsString();
		}
		if (tag_data.IsValid("cancel"))
		{
			strLabelCancel = tag_data.GetTagProperty("cancel").AsString();
		}
		SceneVRCommunication.Instance.KagPlantWindowShow(strFileName, strLabelOK, strLabelCancel);
		return false;
	}

	public bool TagVRPlantUpdate(KagTagSupport tag_data)
	{
		SceneVRCommunication.Instance.KagPlantUpdate();
		return false;
	}

	public bool TagVRTutorialStart(KagTagSupport tag_data)
	{
		string f_strReturnLabel = string.Empty;
		if (tag_data.IsValid("end"))
		{
			f_strReturnLabel = tag_data.GetTagProperty("end").AsString();
		}
		SceneVRCommunication.Instance.KagTutorialStart(f_strReturnLabel);
		return true;
	}

	public bool TagVRPhotoModeStart(KagTagSupport tag_data)
	{
		bool f_bStart = true;
		if (tag_data.IsValid("start"))
		{
			f_bStart = true;
		}
		else if (tag_data.IsValid("end"))
		{
			f_bStart = false;
		}
		GameMain.Instance.OvrMgr.OvrCamera.ChangeToCameraMode(f_bStart);
		return false;
	}

	public bool TagVRNoChangeBG(KagTagSupport tag_data)
	{
		bool f_bStart = true;
		if (tag_data.IsValid("start"))
		{
			f_bStart = true;
		}
		else if (tag_data.IsValid("end"))
		{
			f_bStart = false;
		}
		SceneVRCommunication.Instance.KagVRNoChangeBG(f_bStart);
		return false;
	}

	public bool TagVRCamToManHead(KagTagSupport tag_data)
	{
		float f_fTime = 1f;
		if (tag_data.IsValid("time"))
		{
			f_fTime = (float)tag_data.GetTagProperty("time").AsInteger() / 1000f;
		}
		GameMain.Instance.OvrMgr.OvrCamera.PosToManHead(f_fTime);
		return false;
	}

	public bool TagVRTrophyText(KagTagSupport tag_data)
	{
		string f_strText = string.Empty;
		if (tag_data.IsValid("text"))
		{
			f_strText = tag_data.GetTagProperty("text").AsString();
		}
		SceneVRCommunication.Instance.KagVRTrophyGet(f_strText);
		return false;
	}

	public bool TagVRRentalMaidSelectStart(KagTagSupport tag_data)
	{
		SceneVRCommunication.Instance.KagRentalMaidSelectStart();
		return true;
	}

	public bool TagVRTouchUseSelect(KagTagSupport tag_data)
	{
		string f_strReturnLabel = string.Empty;
		if (tag_data.IsValid("end"))
		{
			f_strReturnLabel = tag_data.GetTagProperty("end").AsString();
		}
		SceneVRCommunication.Instance.KagTouchUseSelect(f_strReturnLabel);
		return true;
	}

	public bool TagVRHintShow(KagTagSupport tag_data)
	{
		string f_strHintMsg = string.Empty;
		if (tag_data.IsValid("text"))
		{
			f_strHintMsg = tag_data.GetTagProperty("text").AsString();
		}
		SceneVRCommunication.Instance.KagHintShow(f_strHintMsg);
		return false;
	}

	public bool TagVRKaraokeWindowShow(KagTagSupport tag_data)
	{
		string f_strReturnFile = string.Empty;
		string f_strReturnLabel = string.Empty;
		if (tag_data.IsValid("cancel_file"))
		{
			f_strReturnFile = tag_data.GetTagProperty("cancel_file").AsString();
		}
		if (tag_data.IsValid("cancel_label"))
		{
			f_strReturnLabel = tag_data.GetTagProperty("cancel_label").AsString();
		}
		SceneVRCommunication.Instance.KagKaraokeWindowShow(f_strReturnFile, f_strReturnLabel);
		return false;
	}

	public bool TagDanceResultStart(KagTagSupport tag_data)
	{
		Result_Display.StartDisplay(tag_data.GetTagProperty("label").AsString());
		return false;
	}

	public bool TagSetDanceType(KagTagSupport tag_data)
	{
		if (!tag_data.IsValid("dancetype"))
		{
			return false;
		}
		string value = tag_data.GetTagProperty("dancetype").AsString();
		RhythmAction_Mgr.SetDanceType((RhythmAction_Mgr.DanceType)Enum.Parse(typeof(RhythmAction_Mgr.DanceType), value));
		return false;
	}

	public bool TagCutinTexShoot(KagTagSupport tag_data)
	{
		string cut_name = string.Empty;
		string label = string.Empty;
		if (tag_data.IsValid("cut"))
		{
			cut_name = tag_data.GetTagProperty("cut").AsString();
		}
		if (tag_data.IsValid("label"))
		{
			label = tag_data.GetTagProperty("label").AsString();
		}
		ShootCutInTex.CutInTexShoot(cut_name, label);
		return false;
	}

	public bool TagBattleCutInStart(KagTagSupport tag_data)
	{
		string end_label = string.Empty;
		if (tag_data.IsValid("label"))
		{
			end_label = tag_data.GetTagProperty("label").AsString();
		}
		ConfrontCutIn.CutInStart(end_label);
		return false;
	}

	public bool TagMotionCheckStart(KagTagSupport tag_data)
	{
		MotionAction_Mgr.ResponceStart(tag_data);
		return false;
	}

	public bool TagSetMcSkip(KagTagSupport tag_data)
	{
		if (tag_data.IsValid("end"))
		{
			McSkip.SkipRelease();
		}
		else if (tag_data.IsValid("label"))
		{
			McSkip.SkipWait(tag_data.GetTagProperty("label").AsString());
		}
		return false;
	}

	public bool TagAddedEventDisplay(KagTagSupport tag_data)
	{
		string label = string.Empty;
		if (tag_data.IsValid("label"))
		{
			label = tag_data.GetTagProperty("label").AsString();
		}
		else
		{
			Debug.LogError("タグ関数.eventrelease:Labelが指定されてません");
		}
		GameMain.Instance.ScenarioSelectMgr.AddedDisplay(label);
		return false;
	}

	public bool TagTutorialStart(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "name", new string[0]);
		string sceneName = tag_data.GetTagProperty("name").AsString();
		string returnLabelName = string.Empty;
		if (tag_data.IsValid("end"))
		{
			returnLabelName = tag_data.GetTagProperty("end").AsString();
		}
		bool absoluteCall = tag_data.IsValid("absolute");
		if (uGUITutorialPanel.IsOpened())
		{
			uGUITutorialPanel.CloseTutorial(true, false);
		}
		uGUITutorialPanel.OpenTutorial(sceneName, delegate
		{
			if (!string.IsNullOrEmpty(returnLabelName))
			{
				GameMain.Instance.ScriptMgr.adv_kag.JumpLabel(returnLabelName);
			}
			GameMain.Instance.ScriptMgr.adv_kag.Exec();
		}, absoluteCall);
		return true;
	}

	public bool TagLoadSubtitleFile(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "loadsubtitlefile", new string[]
		{
			"file"
		});
		string fileName = Path.ChangeExtension(tag_data.GetTagProperty("file").AsString(), ".ks");
		SubtitleMovieManager globalInstance = SubtitleMovieManager.GetGlobalInstance(false);
		globalInstance.autoDestroy = true;
		globalInstance.LoadSubtitleScriptFile(fileName);
		globalInstance.Play();
		return false;
	}

	public bool TagEndSubtitleDisplay(KagTagSupport tag_data)
	{
		SubtitleMovieManager.DestroyGlobalInstance();
		return false;
	}

	public bool TagSubtitleDisplayForPlayVoice(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "subtitledisplayforplayvoice", new string[]
		{
			"text"
		});
		this.subtitle_data.text = tag_data.GetTagProperty("text").AsString();
		this.subtitle_data.displayTime = -1;
		if (tag_data.IsValid("addtime"))
		{
			this.subtitle_data.addDisplayTime = tag_data.GetTagProperty("addtime").AsInteger();
		}
		else if (tag_data.IsValid("wait"))
		{
			this.subtitle_data.displayTime = tag_data.GetTagProperty("wait").AsInteger();
		}
		this.subtitle_data.casinoType = tag_data.IsValid("mode_c");
		return false;
	}

	public bool TagSubtitleDisplay(KagTagSupport tag_data)
	{
		this.CheckAbsolutelyNecessaryTag(tag_data, "subtitledisplay", new string[]
		{
			"text",
			"time"
		});
		string text = tag_data.GetTagProperty("text").AsString();
		int displayTime = int.Parse(tag_data.GetTagProperty("time").AsString());
		SubtitleMovieManager globalInstance = SubtitleMovieManager.GetGlobalInstance(false);
		globalInstance.autoDestroy = true;
		globalInstance.Play(text, displayTime);
		return false;
	}

	protected virtual void PlayMaidMotion(Maid maid, string fn, bool additive = false, bool loop = false, bool boAddQue = false, float val = 0.5f)
	{
		if (!GameMain.Instance.ScriptMgr.is_motion_blend)
		{
			val = 0f;
		}
		maid.CrossFade(fn, this.script_mgr_.file_system, additive, loop, boAddQue, val, 1f);
	}

	protected virtual void PlayMaidMotionAbs(Maid maid, string fn, bool additive = false, bool loop = false, bool boAddQue = false, float val = 0.5f)
	{
		if (!GameMain.Instance.ScriptMgr.is_motion_blend)
		{
			val = 0f;
		}
		maid.CrossFadeAbsolute(fn, this.script_mgr_.file_system, additive, loop, boAddQue, val, 1f);
	}

	public static Maid GetVoiceTargetMaid(KagTagSupport tag_data)
	{
		Maid maid = null;
		CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
		if (tag_data.IsValid("maid"))
		{
			maid = characterMgr.GetMaid(int.Parse(tag_data.GetTagProperty("maid").AsString()));
		}
		else if (tag_data.IsValid("name") || tag_data.IsValid("real"))
		{
			string text = string.Empty;
			if (tag_data.IsValid("real"))
			{
				text = tag_data.GetTagProperty("real").AsString().Trim();
			}
			else
			{
				text = tag_data.GetTagProperty("name").AsString().Trim();
			}
			if (tag_data.IsValid("real") && text == "フリー" && GameMain.Instance.ScriptMgr.compatibilityMode)
			{
				text = "[HF16]";
			}
			if (text.IndexOf("[HF") == 0)
			{
				string text2 = text.Replace("[HF", string.Empty).Replace("]", string.Empty);
				if (string.IsNullOrEmpty(text2))
				{
					text2 = "0";
				}
				int nMaidNo = int.Parse(text2);
				maid = characterMgr.GetMaid(nMaidNo);
			}
			else
			{
				for (int i = 0; i < characterMgr.GetMaidCount(); i++)
				{
					Maid maid2 = characterMgr.GetMaid(i);
					if (maid2 != null && maid2.boNPC && maid2.status.firstName == text)
					{
						maid = maid2;
						break;
					}
				}
			}
			if (maid == null)
			{
				Debug.LogWarning("ボイス再生対象のメイドを特定できませんでした");
			}
		}
		return maid;
	}

	public Maid GetMaidAndMan(string tag_str)
	{
		int num = 0;
		tag_str = tag_str.ToLower();
		int num2 = tag_str.IndexOf(':');
		if (num2 != -1)
		{
			string[] array = tag_str.Split(new char[]
			{
				':'
			});
			NDebug.Assert(array.Length == 2, tag_str + "\nメイド,もしくは男の指定が不正です");
			num = int.Parse(array[1]);
			tag_str = array[0];
		}
		if (tag_str == "maid")
		{
			return this.GetMaid(num);
		}
		if (tag_str == "man")
		{
			return this.GetMan(num);
		}
		NDebug.Assert(tag_str + "\nメイド,もしくは男の指定が不正です", false);
		return null;
	}

	public Maid GetMaidAndMan(KagTagSupport tag_data)
	{
		int num = 0;
		bool flag = false;
		if (tag_data.IsValid("maid"))
		{
			num = tag_data.GetTagProperty("maid").AsInteger();
		}
		else if (tag_data.IsValid("man"))
		{
			flag = true;
			num = tag_data.GetTagProperty("man").AsInteger();
			if (this.script_mgr_.compatibilityMode && 6 <= num)
			{
				num = 5;
			}
		}
		else
		{
			NDebug.Assert("スクリプトのman/maid指定が不正です。", false);
		}
		return flag ? this.GetMan(num) : this.GetMaid(num);
	}

	public virtual Maid GetMaid(int maid_no)
	{
		return GameMain.Instance.CharacterMgr.GetMaid(maid_no);
	}

	public virtual Maid GetMan(int man_no)
	{
		return GameMain.Instance.CharacterMgr.GetMan(man_no);
	}

	protected WaitEventList GetWaitEventList(string list_name)
	{
		if (!this.wait_event_list_.ContainsKey(list_name))
		{
			this.wait_event_list_.Add(list_name, new WaitEventList());
		}
		return this.wait_event_list_[list_name];
	}

	public void CheckAbsolutelyNecessaryTag(KagTagSupport tag_data, string tag_name, params string[] check_tag)
	{
		for (int i = 0; i < check_tag.Length; i++)
		{
			NDebug.Assert(tag_data.IsValid(check_tag[i]), string.Concat(new string[]
			{
				"@",
				tag_name,
				"\n必須タグ[",
				check_tag[i],
				"]が指定されていません"
			}));
		}
	}

	protected bool SetWait(int time, bool skip_possible)
	{
		this.SetExecWait(time, skip_possible);
		return true;
	}

	public void ExecForcWaitEvent()
	{
		WaitEventList waitEventList = this.GetWaitEventList("tex_mul_add");
		if (waitEventList.list == null || waitEventList.list.Count == 0)
		{
			return;
		}
		for (int i = 0; i < waitEventList.list.Count; i++)
		{
			waitEventList.list[i].call_back_delegate();
		}
		waitEventList.Clear();
	}

	public void ClearForcExecWaitEvent()
	{
		WaitEventList waitEventList = this.GetWaitEventList("tex_mul_add");
		if (waitEventList.list == null || waitEventList.list.Count == 0)
		{
			return;
		}
		waitEventList.Clear();
	}

	public void Dispose()
	{
		this.Dispose(true);
		GC.SuppressFinalize(this);
	}

	protected void Dispose(bool is_release_managed_code)
	{
		if (this.is_disposed_)
		{
			return;
		}
		this.wait_event_list_.Clear();
		this.kag_.Dispose();
		this.kag_ = null;
		this.script_mgr_ = null;
		this.is_disposed_ = true;
	}

	public KagScript kag
	{
		get
		{
			return this.kag_;
		}
	}

	protected bool exec_wait_enabled
	{
		get
		{
			return this.exec_wait_data_.use;
		}
	}

	protected bool IsFadeProc()
	{
		return GameMain.Instance.MainCamera.IsFadeProc() || GameMain.Instance.MainCamera.IsFadeProcNoUI();
	}

	private void OnScenarioLoadEvent(string file_name, string label_name)
	{
		this.subtitle_data.Clear();
	}

	public virtual string GetKagClassName()
	{
		return "ベースkag";
	}

	private string ReplaceFileNameCallBack(string file_name)
	{
		Maid maid = this.GetMaid(0);
		if (maid == null)
		{
			return file_name;
		}
		int maidCount = GameMain.Instance.CharacterMgr.GetMaidCount();
		Maid[] array = new Maid[maidCount];
		for (int i = 0; i < maidCount; i++)
		{
			array[i] = this.GetMaid(i);
		}
		return ScriptManager.ReplacePersonal(array, file_name);
	}

	public void Serialize(BinaryWriter binary)
	{
		binary.Write("CM3D2_KAG");
		binary.Write(1170);
		byte[] array = this.kag_.Serialize();
		int value = array.Length;
		binary.Write(value);
		binary.Write(array);
		binary.Write(this.fade_wait_);
		binary.Write(this.enabled);
	}

	public void Deserialize(BinaryReader binary)
	{
		string a = binary.ReadString();
		NDebug.Assert(a == "CM3D2_KAG", "KAGのヘッダーが不正です。");
		int num = binary.ReadInt32();
		int count = binary.ReadInt32();
		byte[] serialize_data = binary.ReadBytes(count);
		this.kag_.Deserialize(serialize_data);
		this.fade_wait_ = binary.ReadBoolean();
		this.enabled = binary.ReadBoolean();
		this.exec_wait_data_.Clear();
		this.wait_event_list_.Clear();
		this.subtitle_data.Clear();
	}

	public bool enabled { get; set; }

	public List<Maid> maidOffsetSetList { get; protected set; }

	protected readonly TJSScript tjs_;

	protected ScriptManager script_mgr_;

	protected KagScript kag_;

	protected bool fade_wait_;

	protected BaseKagManager.ExecWaitData exec_wait_data_ = new BaseKagManager.ExecWaitData();

	protected Dictionary<string, WaitEventList> wait_event_list_ = new Dictionary<string, WaitEventList>();

	protected BaseKagManager.SubtitleData subtitle_data = new BaseKagManager.SubtitleData();

	private bool is_disposed_;

	[CompilerGenerated]
	private static Comparison<Maid> <>f__mg$cache0;

	[CompilerGenerated]
	private static Comparison<Maid> <>f__mg$cache1;

	private class PerthOffsetPosTagData
	{
		public static CharacterMgr.CharaPer CreateCharaPer(TJSScript tjs, KagTagSupport tag_data)
		{
			CharacterMgr.CharaPer charaPer = BaseKagManager.PerthOffsetPosTagData.GetCharaPer(tjs, tag_data, string.Empty);
			NDebug.AssertNull(charaPer != null);
			return charaPer;
		}

		public static List<KeyValuePair<Maid, CharacterMgr.CharaPer>> CreateMultiCharaPer(TJSScript tjs, KagTagSupport tag_data, BaseKagManager kag_mgr)
		{
			List<KeyValuePair<Maid, CharacterMgr.CharaPer>> list = new List<KeyValuePair<Maid, CharacterMgr.CharaPer>>();
			for (int i = 0; i < GameMain.Instance.CharacterMgr.GetMaidCount(); i++)
			{
				CharacterMgr.CharaPer charaPer = BaseKagManager.PerthOffsetPosTagData.GetCharaPer(tjs, tag_data, "-Maid:" + i);
				if (charaPer != null)
				{
					KeyValuePair<Maid, CharacterMgr.CharaPer> item = new KeyValuePair<Maid, CharacterMgr.CharaPer>(kag_mgr.GetMaid(i), charaPer);
					list.Add(item);
				}
			}
			return list;
		}

		public static KeyValuePair<CharacterMgr.CharaPer, CharacterMgr.PenisPer> CreateCharaPerAndPenisPer(TJSScript tjs, KagTagSupport tag_data)
		{
			CharacterMgr.CharaPer charaPer = BaseKagManager.PerthOffsetPosTagData.GetCharaPer(tjs, tag_data, string.Empty);
			if (charaPer == null)
			{
				charaPer = new CharacterMgr.CharaPer();
			}
			CharacterMgr.PenisPer penisPer = BaseKagManager.PerthOffsetPosTagData.GetPenisPer(tjs, tag_data);
			if (penisPer == null)
			{
				penisPer = new CharacterMgr.PenisPer();
			}
			return new KeyValuePair<CharacterMgr.CharaPer, CharacterMgr.PenisPer>(charaPer, penisPer);
		}

		private static CharacterMgr.CharaPer GetCharaPer(TJSScript tjs, KagTagSupport tag_data, string add_tag_string)
		{
			CharacterMgr.CharaPer charaPer = null;
			BaseKagManager.PerthOffsetPosTagData.TagArrayData tagArrayData = BaseKagManager.PerthOffsetPosTagData.TagArrayData.Create(tjs, tag_data, "OffsDouPar" + add_tag_string);
			if (tagArrayData.valid)
			{
				if (charaPer == null)
				{
					charaPer = new CharacterMgr.CharaPer();
				}
				tagArrayData.GetVector3(ref charaPer.vecOffsDouParGreater, ref charaPer.vecOffsDouParLess);
			}
			BaseKagManager.PerthOffsetPosTagData.TagArrayData.Rlease();
			tagArrayData = BaseKagManager.PerthOffsetPosTagData.TagArrayData.Create(tjs, tag_data, "OffsShinCho" + add_tag_string);
			if (tagArrayData.valid)
			{
				if (charaPer == null)
				{
					charaPer = new CharacterMgr.CharaPer();
				}
				tagArrayData.GetVector3(ref charaPer.vecOffsShinChoGreater, ref charaPer.vecOffsShinChoLess);
			}
			BaseKagManager.PerthOffsetPosTagData.TagArrayData.Rlease();
			tagArrayData = BaseKagManager.PerthOffsetPosTagData.TagArrayData.Create(tjs, tag_data, "OffsMuneL" + add_tag_string);
			if (tagArrayData.valid)
			{
				if (charaPer == null)
				{
					charaPer = new CharacterMgr.CharaPer();
				}
				tagArrayData.GetVector3(ref charaPer.vecOffsMuneLGreater, ref charaPer.vecOffsMuneLLess);
			}
			BaseKagManager.PerthOffsetPosTagData.TagArrayData.Rlease();
			tagArrayData = BaseKagManager.PerthOffsetPosTagData.TagArrayData.Create(tjs, tag_data, "HaremDouPer" + add_tag_string);
			if (tagArrayData.valid)
			{
				if (charaPer == null)
				{
					charaPer = new CharacterMgr.CharaPer();
				}
				tagArrayData.GetVector3(ref charaPer.vecHaremDouPerGreater, ref charaPer.vecHaremDouPerLess);
			}
			BaseKagManager.PerthOffsetPosTagData.TagArrayData.Rlease();
			tagArrayData = BaseKagManager.PerthOffsetPosTagData.TagArrayData.Create(tjs, tag_data, "HaremShinCho" + add_tag_string);
			if (tagArrayData.valid)
			{
				if (charaPer == null)
				{
					charaPer = new CharacterMgr.CharaPer();
				}
				tagArrayData.GetVector3(ref charaPer.vecHaremShinChoGreater, ref charaPer.vecHaremShinChoLess);
			}
			BaseKagManager.PerthOffsetPosTagData.TagArrayData.Rlease();
			tagArrayData = BaseKagManager.PerthOffsetPosTagData.TagArrayData.Create(tjs, tag_data, "HaremMuneL" + add_tag_string);
			if (tagArrayData.valid)
			{
				if (charaPer == null)
				{
					charaPer = new CharacterMgr.CharaPer();
				}
				tagArrayData.GetVector3(ref charaPer.vecHaremMuneLGreater, ref charaPer.vecHaremMuneLLess);
			}
			BaseKagManager.PerthOffsetPosTagData.TagArrayData.Rlease();
			return charaPer;
		}

		private static CharacterMgr.PenisPer GetPenisPer(TJSScript tjs, KagTagSupport tag_data)
		{
			CharacterMgr.PenisPer penisPer = null;
			BaseKagManager.PerthOffsetPosTagData.TagArrayData tagArrayData = BaseKagManager.PerthOffsetPosTagData.TagArrayData.Create(tjs, tag_data, "PenisCommonBase");
			if (tagArrayData.valid)
			{
				if (penisPer == null)
				{
					penisPer = new CharacterMgr.PenisPer();
				}
				tagArrayData.GetVector3(ref penisPer.vecPenisCommonBase);
			}
			BaseKagManager.PerthOffsetPosTagData.TagArrayData.Rlease();
			tagArrayData = BaseKagManager.PerthOffsetPosTagData.TagArrayData.Create(tjs, tag_data, "PenisAmend");
			if (tagArrayData.valid)
			{
				if (penisPer == null)
				{
					penisPer = new CharacterMgr.PenisPer();
				}
				tagArrayData.GetVector3(ref penisPer.vecPenisAmend);
			}
			BaseKagManager.PerthOffsetPosTagData.TagArrayData.Rlease();
			tagArrayData = BaseKagManager.PerthOffsetPosTagData.TagArrayData.Create(tjs, tag_data, "PenisDouPer");
			if (tagArrayData.valid)
			{
				if (penisPer == null)
				{
					penisPer = new CharacterMgr.PenisPer();
				}
				tagArrayData.GetVector3(ref penisPer.vecPenisDouPerGreater, ref penisPer.vecPenisDouPerLess);
			}
			BaseKagManager.PerthOffsetPosTagData.TagArrayData.Rlease();
			tagArrayData = BaseKagManager.PerthOffsetPosTagData.TagArrayData.Create(tjs, tag_data, "PenisShincho");
			if (tagArrayData.valid)
			{
				if (penisPer == null)
				{
					penisPer = new CharacterMgr.PenisPer();
				}
				tagArrayData.GetVector3(ref penisPer.vecPenisShinchoGreater, ref penisPer.vecPenisShinchoLess);
			}
			BaseKagManager.PerthOffsetPosTagData.TagArrayData.Rlease();
			return penisPer;
		}

		private class TagArrayData
		{
			private TagArrayData(TJSScript tjs, KagTagSupport tag_data, string tag_name)
			{
				this.tjs_ = tjs;
				this.is_valid_ = tag_data.IsValid(tag_name);
				if (this.is_valid_)
				{
					string eval_str = this.kTjsGlobalVarName + "=" + tag_data.GetTagProperty(tag_name).AsString();
					this.tjs_.EvalScript(eval_str);
					TJSVariant tjsvariant = new TJSVariant();
					this.tjs_.EvalScript(this.kTjsGlobalVarName + ".count", tjsvariant);
					this.array_count_ = tjsvariant.AsInteger();
					tjsvariant.Dispose();
					NDebug.Assert(this.array_count_ == 3 || this.array_count_ == 6, tag_name + "の指定数が不正です(6 or 7 only)");
				}
			}

			public static BaseKagManager.PerthOffsetPosTagData.TagArrayData Create(TJSScript tjs, KagTagSupport tag_data, string tag_name)
			{
				NDebug.Assert(BaseKagManager.PerthOffsetPosTagData.TagArrayData.instans_data_ == null, "TagArrayDataインスタンスの重複");
				tag_name = tag_name.ToLower();
				BaseKagManager.PerthOffsetPosTagData.TagArrayData.instans_data_ = new BaseKagManager.PerthOffsetPosTagData.TagArrayData(tjs, tag_data, tag_name);
				return BaseKagManager.PerthOffsetPosTagData.TagArrayData.instans_data_;
			}

			public static void Rlease()
			{
				if (BaseKagManager.PerthOffsetPosTagData.TagArrayData.instans_data_ == null)
				{
					return;
				}
				BaseKagManager.PerthOffsetPosTagData.TagArrayData.instans_data_.tjs_.EvalScript(BaseKagManager.PerthOffsetPosTagData.TagArrayData.instans_data_.kTjsGlobalVarName + " = void");
				BaseKagManager.PerthOffsetPosTagData.TagArrayData.instans_data_ = null;
			}

			public void GetVector3(ref Vector3 dest)
			{
				if (!this.is_valid_)
				{
					return;
				}
				NDebug.Assert(this.array_count_ == 3, "Vector3*2の要素に対してVector3を1つのみ作成しようとしています");
				using (TJSVariant tjsvariant = new TJSVariant())
				{
					this.tjs_.EvalScript(this.kTjsGlobalVarName + "[0]", tjsvariant);
					dest.x = tjsvariant.AsReal();
					this.tjs_.EvalScript(this.kTjsGlobalVarName + "[1]", tjsvariant);
					dest.y = tjsvariant.AsReal();
					this.tjs_.EvalScript(this.kTjsGlobalVarName + "[2]", tjsvariant);
					dest.z = tjsvariant.AsReal();
				}
			}

			public void GetVector3(ref Vector3 first_dest, ref Vector3 second_dest)
			{
				if (!this.is_valid_)
				{
					return;
				}
				NDebug.Assert(this.array_count_ == 6, "要素xyzのみに対してVector3を2つ作成しようとしています");
				using (TJSVariant tjsvariant = new TJSVariant())
				{
					this.tjs_.EvalScript(this.kTjsGlobalVarName + "[0]", tjsvariant);
					first_dest.x = tjsvariant.AsReal();
					this.tjs_.EvalScript(this.kTjsGlobalVarName + "[1]", tjsvariant);
					first_dest.y = tjsvariant.AsReal();
					this.tjs_.EvalScript(this.kTjsGlobalVarName + "[2]", tjsvariant);
					first_dest.z = tjsvariant.AsReal();
					this.tjs_.EvalScript(this.kTjsGlobalVarName + "[3]", tjsvariant);
					second_dest.x = tjsvariant.AsReal();
					this.tjs_.EvalScript(this.kTjsGlobalVarName + "[4]", tjsvariant);
					second_dest.y = tjsvariant.AsReal();
					this.tjs_.EvalScript(this.kTjsGlobalVarName + "[5]", tjsvariant);
					second_dest.z = tjsvariant.AsReal();
				}
			}

			public int vecotr_element_count
			{
				get
				{
					return (this.array_count_ != 3) ? 2 : 1;
				}
			}

			public int count
			{
				get
				{
					return this.array_count_;
				}
			}

			public bool valid
			{
				get
				{
					return this.is_valid_;
				}
			}

			private string kTjsGlobalVarName = "global.__tmp_array";

			private static BaseKagManager.PerthOffsetPosTagData.TagArrayData instans_data_;

			private TJSScript tjs_;

			private bool is_valid_;

			private int array_count_;
		}
	}

	protected class ExecWaitData
	{
		public virtual bool Check()
		{
			return !this.use || this.wait_time <= GameMain.tick_count - this.start_tick_count;
		}

		public virtual void Clear()
		{
			this.start_tick_count = (this.wait_time = 0);
			this.use = false;
			this.skip_possible = true;
		}

		public int start_tick_count;

		public int wait_time;

		public bool skip_possible;

		public bool use;
	}

	protected class MaidPropSeqWaitData : BaseKagManager.ExecWaitData
	{
		public override bool Check()
		{
			return !this.use || this.maid == null || !this.maid.IsBusy;
		}

		public override void Clear()
		{
			base.Clear();
			this.maid = null;
		}

		public Maid maid;
	}

	protected class MaidVoiceWaitData : BaseKagManager.ExecWaitData
	{
		public override bool Check()
		{
			if (!this.use || this.maid == null)
			{
				return true;
			}
			AudioSourceMgr audioMan = this.maid.AudioMan;
			return audioMan == null || !audioMan.isPlay();
		}

		public override void Clear()
		{
			base.Clear();
			this.maid = null;
		}

		public Maid maid;
	}

	protected class DummyVoiceWaitData : BaseKagManager.ExecWaitData
	{
		public override bool Check()
		{
			return !this.use || !GameMain.Instance.SoundMgr.IsPlayDummyVoice();
		}

		public override void Clear()
		{
			base.Clear();
		}
	}

	protected class SubtitleData
	{
		public SubtitleData()
		{
			this.Clear();
		}

		public void Clear()
		{
			this.text = string.Empty;
			this.displayTime = -1;
			this.addDisplayTime = 0;
			this.casinoType = false;
		}

		public string text;

		public int displayTime;

		public int addDisplayTime;

		public bool casinoType;
	}
}
