コード例 #1
0
        public void DropUnconscious(long duration = -1, bool toFront = true)
        {
            var          cat = AniCatalog.Unconscious;
            ScriptAniJob job = toFront ? cat.DropFront : cat.DropBack;

            if (job != null)
            {
                ModelInst.StartAniJob(job);
            }

            _Uncon = toFront ? Unconsciousness.Front : Unconsciousness.Back;

            var strm = BaseInst.GetScriptVobStream();

            strm.Write((byte)ScriptVobMessageIDs.Uncon);
            strm.Write((byte)_Uncon);
            BaseInst.SendScriptVobStream(strm);

            if (duration >= 0)
            {
                if (unconTimer == null)
                {
                    unconTimer = new GUCTimer(LiftUnconsciousness);
                }

                unconTimer.SetInterval(duration);
                unconTimer.Start();
            }

            OnUnconChange?.Invoke(this);
        }
コード例 #2
0
        private void DoLiftUncon()
        {
            _Uncon = Unconsciousness.None;
            var strm = BaseInst.GetScriptVobStream();

            strm.Write((byte)ScriptVobMessageIDs.Uncon);
            strm.Write((byte)_Uncon);
            BaseInst.SendScriptVobStream(strm);

            int hp = HP + 25;

            SetHealth(hp > HPMax ? HPMax : hp);
            OnUnconChange?.Invoke(this);
        }
コード例 #3
0
 public void SetUnconsciousness(Unconsciousness unconsciousness)
 {
     if (this.uncon != Unconsciousness.None && unconsciousness == Unconsciousness.None)
     {
         int voice = (int)this.CustomVoice;
         if (voice > 0 && voice < 20)
         {
             string str = string.Format("SVM_{0}_OHMYHEAD.WAV", voice);
             if (!cachedVoices.TryGetValue(str, out SoundDefinition scream))
             {
                 scream = new SoundDefinition(str);
                 cachedVoices.Add(str, scream);
             }
             SoundHandler.PlaySound3D(scream, this.BaseInst, 3000, 0.7f);
         }
     }
     this.uncon = unconsciousness;
     if (this == Hero)
     {
         oCNpcFocus.SetFocusMode(IsUnconscious ? 0 : 1);
     }
 }