Пример #1
0
        public void OnYotogiPlayManagerOnClickCommand(Yotogi.SkillData.Command.Data command_data)
        {
            YotogiPlay.PlayerState OldPlayerState = bInsertFuck;

            //実際の動作をする
            orgOnClickCommand(command_data);

            //メイドの性格を取得
            Personal = this.maid.Param.status.personal.ToString();

            //夜伽グループ名
            yotogi_group_name = command_data.basic.group_name;
            //夜伽コマンド名
            yotogi_name = command_data.basic.name;
            //興奮値
            iLastExcite = maid.Param.status.cur_excite;
            //興奮状態のステータス
            yExciteStatus = YotogiPlay.GetExcitementStatus(iLastExcite);
            //挿入状態かどうか
            bInsertFuck = getFieldValue <YotogiPlayManager, YotogiPlay.PlayerState>(this.yotogiPlayManager, "player_state_");

            //PlayerStateがNormalからInsertになる場合
            bool InsertFlg = (OldPlayerState == YotogiPlay.PlayerState.Normal && bInsertFuck == YotogiPlay.PlayerState.Insert);

            //Pistonを実行する
            A10PistonEvents(yotogi_group_name, yotogi_name, iLastExcite, InsertFlg, Personal);
        }
Пример #2
0
        public void A10PistonInit()
        {
            //Stopする
            devices.ForEach(device => device.SetPatternAndLevel(0, 0));

            //変数群初期化
            yotogi_group_name = "";
            yotogi_name       = "";
            iLastExcite       = 0;
            yExciteStatus     = 0;
            bInsertFuck       = YotogiPlay.PlayerState.Normal;
            Personal          = "";

            NowPattern = 0;
            NowLevel   = 0;
        }
Пример #3
0
        private int GetLevel(Yotogi.ExcitementStatus Status, A10PistonConfig.LevelItem LevelItem)
        {
            try
            {
                switch (Status)
                {
                case Yotogi.ExcitementStatus.Minus:
                {
                    return(LevelItem.Lv0);
                }

                case Yotogi.ExcitementStatus.Small:
                {
                    return(LevelItem.Lv1);
                }

                case Yotogi.ExcitementStatus.Medium:
                {
                    return(LevelItem.Lv2);
                }

                case Yotogi.ExcitementStatus.Large:
                {
                    return(LevelItem.Lv3);
                }

                default:
                {
                    return(-1);
                }
                }
            }
            catch
            {
                Debug.Log("Error:GetLevel");
                return(-1);
            }
        }
Пример #4
0
        private IEnumerator PistonCoroutine(int iLastExcite, A10PistonConfig.YotogiItem YotogiItem, Dictionary <string, A10PistonConfig.LevelItem> A10PistonPattanDict, bool InsertFlg, string Personal, A10PistonClass a10Piston)
        {
            // 興奮状態のステータス
            yExciteStatus = YotogiPlay.GetExcitementStatus(iLastExcite);
            int iExciteStatus = (int)yExciteStatus;

            // 指定コマンドの制御状態をループする.
            while (true)
            {
                foreach (A10PistonConfig.Control Item in YotogiItem.ControlData)
                {
                    // 性格を指定しているが不一致の場合は無視
                    if (Item.Personal != "" && Item.Personal != Personal)
                    {
                        continue;
                    }

                    // 挿入時指定をしているが挿入フラグがない場合は無視
                    if (Item.Insert && !InsertFlg)
                    {
                        continue;
                    }

                    // 接続機器を指定しているが不一致の場合は無視
                    if (Item.Device != "" && Item.Device != a10Piston.ConnectedModel.ToString())
                    {
                        continue;
                    }

                    // 興奮状態を指定しているが不一致の場合は無視
                    if (0 <= Item.Excite && Item.Excite != iExciteStatus)
                    {
                        continue;
                    }

                    //現在のPatternとLevel
                    A10PistonClass.Pattern SetPattan = a10Piston.pattern;
                    int SetLevel    = a10Piston.level;
                    int SetPosition = a10Piston.position;

                    //Patternの定義があれば更新
                    if (0 == Item.Pattern)
                    {
                        SetPattan = A10PistonClass.Pattern.ClockWise;
                    }
                    else if (1 == Item.Pattern)
                    {
                        SetPattan = A10PistonClass.Pattern.CounterClockWise;
                    }

                    //Positionの定義があれば更新
                    if (-1 < Item.Position)
                    {
                        SetPosition = Clamp(Item.Position, A10PistonClass.Position_Min, A10PistonClass.Position_Max);
                    }

                    //Levelの定義があれば更新
                    if (-1 < Item.Level)
                    {
                        SetLevel = Clamp(Item.Level, A10PistonClass.Level_Min, A10PistonClass.Level_Max);
                    }

                    //LevelNameの定義がある場合
                    if (Item.LvName != "")
                    {
                        if (A10PistonPattanDict.ContainsKey(Item.LvName))
                        {
                            //興奮値を元にLevelを更新
                            SetLevel = Clamp(GetLevel(yExciteStatus, A10PistonPattanDict[Item.LvName]), A10PistonClass.Level_Min, A10PistonClass.Level_Max);
                        }
                        else
                        {
                            DebugManager.Log("LevelNameの定義が見つかりません");
                        }
                    }

                    //ディレイ
                    if (0.0f < Item.Delay)
                    {
                        yield return(new WaitForSeconds(Item.Delay));
                    }

                    //振動を開始する
                    if (SetLevel != a10Piston.level || SetPattan != a10Piston.pattern || SetPosition != a10Piston.position)
                    {
                        //Pistonの振動処理
                        //a10Piston.SetPatternAndLevel(SetPattan, SetLevel);
                        a10Piston.SetPositionAndLevel(SetPosition, SetLevel);
                        //GUI用に更新をする。
                        NowPattern = (Int32)a10Piston.pattern;
                        NowLevel   = a10Piston.level;
                    }

                    //ログを追加
                    DebugManager.Log(a10Piston.ConnectedModel.ToString() + ": [Pattern:" + a10Piston.pattern + "][Level:" + a10Piston.level + "][Delay:" + Item.Delay + "][Time:" + Item.Time + "]");

                    //継続タイム
                    if (0.0f < Item.Time)
                    {
                        yield return(new WaitForSeconds(Item.Time));
                    }
                    else
                    {
                        // 継続時間の指定が無い場合、0.1秒毎に次の処理へ移行する
                        yield return(new WaitForSeconds(0.1f));
                    }

                    /*
                     * //性格の指定があるかどうか(未指定の場合はそのまま実行)
                     * if (Item.Personal == "" || Item.Personal == Personal)
                     * {
                     *      //挿入時に挿入フラグがあった場合もしくはそれ以外
                     *      if ((Item.Insert && InsertFlg) || Item.Insert == false)
                     *      {
                     *              // 接続機器の指定があるかどうか(未指定の場合はそのまま実行)
                     *              if ((Item.Device == "" || Item.Device == a10Piston.ConnectedModel.ToString()))
                     *              {
                     *                      // 興奮状態が指定と異なる場合は実行しない(未指定の場合はそのまま実行)
                     *                      if (0 <= Item.Excite && Item.Excite != iExciteStatus)
                     *                      {
                     *                              continue;
                     *                      }
                     *              }
                     *      }
                     * }
                     */
                }

                // 2ループ目以降の挿入フラグはオフにする
                InsertFlg = false;
            }
        }