123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241 |
- using System;
- public class MotionKagManager : BaseKagManager
- {
- public MotionKagManager(TJSScript tjs, ScriptManager script_mgr) : base(tjs, script_mgr)
- {
- for (int i = 0; i < this.last_maid_motion_set_log_.Length; i++)
- {
- this.last_maid_motion_set_log_[i] = string.Empty;
- }
- for (int j = 0; j < this.last_man_motion_set_log_.Length; j++)
- {
- this.last_man_motion_set_log_[j] = string.Empty;
- }
- }
- public override void Initialize()
- {
- base.Initialize();
- this.kag_.RemoveTagCallBack("motionscript");
- this.kag_.RemoveTagCallBack("allprocpropseqstart");
- this.kag_.AddTagCallBack("allprocpropseqstart", new KagScript.KagTagCallBack(this.TagMotAllProcPropSeqStart));
- this.kag_.RemoveTagCallBack("setmaidoffsetmultipos");
- this.kag_.AddTagCallBack("setmaidoffsetmultipos", new KagScript.KagTagCallBack(this.TagSetMaidOffsetMultiPos2));
- this.kag_.RemoveTagCallBack("face");
- this.kag_.AddTagCallBack("face", new KagScript.KagTagCallBack(this.TagMotFace));
- this.kag_.RemoveTagCallBack("faceblend");
- this.kag_.AddTagCallBack("faceblend", new KagScript.KagTagCallBack(this.TagMotFaceBlend));
- }
- public Maid SetMainMaid(Maid maid)
- {
- this.main_maid_ = maid;
- return this.main_maid_;
- }
- public Maid SetMainMaid(string maid_guid)
- {
- if (string.IsNullOrEmpty(maid_guid))
- {
- this.main_maid_ = null;
- return null;
- }
- for (int i = 0; i < GameMain.Instance.CharacterMgr.GetMaidCount(); i++)
- {
- Maid maid = GameMain.Instance.CharacterMgr.GetMaid(i);
- if (maid != null && maid.status.guid == maid_guid)
- {
- this.main_maid_ = maid;
- break;
- }
- }
- return this.main_maid_;
- }
- public Maid SetMainMan(Maid man)
- {
- this.main_man_ = man;
- return this.main_man_;
- }
- public Maid SetMainMan(string man_guid)
- {
- if (string.IsNullOrEmpty(man_guid))
- {
- this.main_man_ = null;
- return null;
- }
- for (int i = 0; i < GameMain.Instance.CharacterMgr.GetManCount(); i++)
- {
- Maid man = GameMain.Instance.CharacterMgr.GetMan(i);
- if (man != null && man.status.guid == man_guid)
- {
- this.main_man_ = man;
- break;
- }
- }
- return this.main_man_;
- }
- private bool TagSetMaidOffsetMultiPos2(KagTagSupport tag_data)
- {
- if (this.valid_pos)
- {
- base.TagSetMaidOffsetMultiPos(tag_data);
- }
- return false;
- }
- private bool TagMotAllProcPropSeqStart(KagTagSupport tag_data)
- {
- Maid maidAndMan = base.GetMaidAndMan(tag_data);
- if (maidAndMan == null)
- {
- return false;
- }
- if (tag_data.IsValid("fix"))
- {
- maidAndMan.AllProcProp();
- }
- else
- {
- NDebug.Assert(!this.script_mgr_.is_motion_all_prop_seq, "MotionKagManager AllProcPropSeqStart error.");
- this.script_mgr_.is_motion_all_prop_seq = true;
- this.script_mgr_.motion_all_prop_seq_maid = maidAndMan;
- }
- return false;
- }
- private bool TagMotFace(KagTagSupport tag_data)
- {
- return !this.face_fix_ && base.TagFace(tag_data);
- }
- private bool TagMotFaceBlend(KagTagSupport tag_data)
- {
- return !this.face_fix_ && base.TagFaceBlend(tag_data);
- }
- public void SetNextMotion(bool is_next)
- {
- this.next_flag_ = is_next;
- }
- public void SetFaceFix(bool is_fix)
- {
- this.face_fix_ = is_fix;
- }
- protected override void PlayMaidMotion(Maid maid, string fn, bool additive = false, bool loop = false, bool boAddQue = false, float val = 0.5f)
- {
- if (this.next_flag_)
- {
- boAddQue = true;
- this.next_flag_ = false;
- }
- base.PlayMaidMotion(maid, fn, additive, loop, boAddQue, val);
- if (!maid.boMAN && !boAddQue && 0 <= maid.ActiveSlotNo && maid.ActiveSlotNo < this.last_maid_motion_set_log_.Length)
- {
- this.last_maid_motion_set_log_[maid.ActiveSlotNo] = fn.ToLower();
- }
- else if (maid.boMAN && !boAddQue && 0 <= maid.ActiveSlotNo && maid.ActiveSlotNo < this.last_man_motion_set_log_.Length)
- {
- this.last_man_motion_set_log_[maid.ActiveSlotNo] = fn.ToLower();
- }
- }
- public void ClearMotion()
- {
- this.exec_wait_data_.Clear();
- this.wait_event_list_.Clear();
- }
- public void SetSloatNo(int no)
- {
- this.sloat_no_ = no;
- }
- public override string GetKagClassName()
- {
- return "モーションkag : " + this.sloat_no_.ToString();
- }
- public override Maid GetMaid(int no)
- {
- if (no == 0 && this.main_maid_ != null)
- {
- return this.main_maid_;
- }
- return base.GetMaid(no);
- }
- public override Maid GetMan(int man_no)
- {
- if (man_no == 0 && this.main_man_ != null)
- {
- return this.main_man_;
- }
- return base.GetMan(man_no);
- }
- public bool valid_pos
- {
- get
- {
- return this.valid_pos_;
- }
- set
- {
- this.valid_pos_ = value;
- }
- }
- public Maid main_maid
- {
- get
- {
- return this.main_maid_;
- }
- }
- public Maid main_man
- {
- get
- {
- return this.main_man_;
- }
- }
- public string[] last_maid_motion_set_log
- {
- get
- {
- return this.last_maid_motion_set_log_;
- }
- }
- public string[] last_man_motion_set_log
- {
- get
- {
- return this.last_man_motion_set_log_;
- }
- }
- private int sloat_no_;
- private bool next_flag_;
- private bool face_fix_;
- private Maid main_maid_;
- private Maid main_man_;
- private bool valid_pos_ = true;
- protected string[] last_maid_motion_set_log_ = new string[6];
- protected string[] last_man_motion_set_log_ = new string[6];
- }
|