123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- using System;
- using System.Collections.Generic;
- public class PrivateMaidTouchKagManager : BaseKagManager
- {
- public PrivateMaidTouchKagManager(TJSScript tjs, ScriptManager scriptMgr) : base(tjs, scriptMgr)
- {
- }
- public override void Initialize()
- {
- base.Initialize();
- this.kag_.AddTagCallBack("talk", new KagScript.KagTagCallBack(this.TagTalk));
- this.kag_.AddTagCallBack("rc_talk", new KagScript.KagTagCallBack(this.TagRcTalk));
- this.kag_.AddTagCallBack("talkrepeat", new KagScript.KagTagCallBack(this.TagTalkRepeat));
- this.kag_.AddTagCallBack("hitret", new KagScript.KagTagCallBack(this.TagHitRet));
- }
- public void LoadScript(Maid maid, string fileName, string labelName = "")
- {
- base.enabled = true;
- if (maid != null)
- {
- fileName = ScriptManager.ReplacePersonal(maid, fileName);
- }
- this.LoadScriptFile(fileName, labelName);
- this.Exec();
- }
- public bool TagTalk(KagTagSupport tag_data)
- {
- this.talkDataDictionary.Clear();
- base.CheckAbsolutelyNecessaryTag(tag_data, "voice", new string[0]);
- if (PrivateMaidTouchManager.instance == null)
- {
- return false;
- }
- this.talkDataDictionary.Add("tag", "talk");
- this.talkDataDictionary.Add("voice", tag_data.GetTagProperty("voice").AsString() + ".ogg");
- Maid voiceTargetMaid = BaseKagManager.GetVoiceTargetMaid(tag_data);
- this.talkDataDictionary.Add("maidguid", (!(voiceTargetMaid != null)) ? string.Empty : voiceTargetMaid.status.guid);
- return false;
- }
- private bool TagRcTalk(KagTagSupport tag_data)
- {
- this.talkDataDictionary.Clear();
- base.CheckAbsolutelyNecessaryTag(tag_data, "voice", new string[0]);
- if (PrivateMaidTouchManager.instance == null)
- {
- return false;
- }
- this.talkDataDictionary.Add("tag", "rc_talk");
- this.talkDataDictionary.Add("voice", tag_data.GetTagProperty("voice").AsString() + ".ogg");
- Maid voiceTargetMaid = BaseKagManager.GetVoiceTargetMaid(tag_data);
- this.talkDataDictionary.Add("maidguid", (!(voiceTargetMaid != null)) ? string.Empty : voiceTargetMaid.status.guid);
- return false;
- }
- private bool TagTalkRepeat(KagTagSupport tag_data)
- {
- this.talkDataDictionary.Clear();
- base.CheckAbsolutelyNecessaryTag(tag_data, "voice", new string[0]);
- if (PrivateMaidTouchManager.instance == null)
- {
- return false;
- }
- this.talkDataDictionary.Add("tag", "talkrepeat");
- this.talkDataDictionary.Add("voice", tag_data.GetTagProperty("voice").AsString() + ".ogg");
- Maid voiceTargetMaid = BaseKagManager.GetVoiceTargetMaid(tag_data);
- this.talkDataDictionary.Add("maidguid", (!(voiceTargetMaid != null)) ? string.Empty : voiceTargetMaid.status.guid);
- return false;
- }
- public bool TagHitRet(KagTagSupport tag_data)
- {
- string text = this.kag_.GetText();
- this.kag_.TextClear();
- string text2;
- this.talkDataDictionary.TryGetValue("tag", out text2);
- string maidGuid;
- this.talkDataDictionary.TryGetValue("maidguid", out maidGuid);
- string voiceFileName;
- this.talkDataDictionary.TryGetValue("voice", out voiceFileName);
- this.talkDataDictionary.Clear();
- PrivateMaidTouchManager.VoiceData voiceData = new PrivateMaidTouchManager.VoiceData
- {
- maidGuid = maidGuid,
- voiceFileName = voiceFileName,
- text = text
- };
- if (text2 != null)
- {
- if (!(text2 == "talk"))
- {
- if (!(text2 == "rc_talk"))
- {
- if (text2 == "talkrepeat")
- {
- PrivateMaidTouchManager.instance.SetRepeatVoice(voiceData);
- }
- }
- else
- {
- PrivateMaidTouchManager.instance.AddRcVoiceData(voiceData);
- }
- }
- else
- {
- PrivateMaidTouchManager.instance.SetSingleVoice(voiceData);
- }
- }
- return false;
- }
- public override string GetKagClassName()
- {
- return "プライベートお触りモードkag";
- }
- private Dictionary<string, string> talkDataDictionary = new Dictionary<string, string>();
- }
|