Ejemplo n.º 1
0
Archivo: SE.cs Proyecto: Jkank/sister
        /* ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ */
        /* ■ 関数名:s_ScriptEngine                ■ */
        /* ■ 入力:sentence_ct 文章の番号を示すカウンタ     ■ */
        /* ■    o_bgpic   背景画像のオブジェクト      ■ */
        /* ■    o_charbox1  左側キャラ画像のオブジェクト   ■ */
        /* ■    o_charbox2  右側キャラ画像のオブジェクト   ■ */
        /* ■ 出力:sentence_ct 次回読み込み用のカウンタの値   ■ */
        /* ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ */
        public static int ScriptEngine(Defines.fileID file_no, int sentence_ct, int log_ct, int log_ct_use, int Slct_No)
        {
            int i;
            const int D_CHAR_LAST = 1000000;              /* 1ファイルの最大文字数のDefine( ENDコードが無かった時の Fail Safe ) */
            const int D_WORKVAL_MAX = 100000;
            const int VAL_REG_A = 1;
            const int VAL_REG_B = 2;
            const int VAL_REG_C = 3;

            if (fileID_next != file_no)
            {
                ChangeFile(file_no);
                fileID_next = file_no;

                Program.Doujin_game_sharp.PlaySoundEffect(0, false);
                Program.Doujin_game_sharp.PlaySoundEffect(1, true);

                //PlayBGM("音楽");
                //PlayBGM("音楽");
            }

            /* 乱数取得用クラスインスタンス生成 */
            Random rnd = new Random();
            int rand = rnd.Next(100);           /* 乱数の生成 */

            //フォントオブジェクトの作成
            Font fnt = new Font(Defines.FontName, Defines.MainTextFontSize);

            Brush Color = Brushes.White;

            //SisterData取得
            Sister Sis = GameData.SisterData;

            string textrowbuf;                            /* 文章バッファ */

            count = nowSentHead(sentence_ct);   /* テキスト内の初期値を取得 */
            countold = count;

            for (i = log_ct_use + 1; i <= 100; i++)
            {
                log[i] = " ";
                name[i] = " ";
            }

            while (count < D_CHAR_LAST)
            {

                rand = rnd.Next(100);           /* 乱数の更新 */

                if (text[count] == '/' && text[count + 1] == '/')
                {

                    /*====================*/
                    /*   コメントアウト   */
                    /*====================*/
                    while (checkRowLast(count) == 0)
                    {
                        count++;
                    }
                    count += 2;
                    countold = count;
                    inrowcount = 0;
                }
                else if (text[count] == ':')
                {
                    textrowbuf = text.Substring(countold, inrowcount);

                    /*======================*/
                    /*    選択肢コマンド    */
                    /*======================*/
                    if (textrowbuf.Length >= 4 && textrowbuf.Substring(0, 4) == "選択肢終")
                    {
                        count++;
                        count += 2;
                        countold = count;
                        sentence_ct++;
                        inrowcount = 0;
                        /* 選択肢の表示終了 */
                        break;
                    }
                    else if (textrowbuf.Length >= 3 && textrowbuf.Substring(0, 3) == "選択肢")
                    {
                        int work_count;

                        Slct_ct = 0;

                        for (work_count = 0; work_count <= 1000; work_count++)
                        {
                            if (text[count + work_count] == '選'
                             && text[count + work_count + 1] == '択'
                             && text[count + work_count + 2] == '肢'
                             && text[count + work_count + 3] == '終')
                            {
                                int ct;
                                for (ct = 0; ct <= work_count; ct++)
                                {
                                    if (text[count + ct] == ';')
                                    {
                                        Slct_ct++;
                                    }
                                }
                                Slct_ct_max = Slct_ct;
                                break;
                            }
                        }

                        Program.Doujin_game_sharp.dispSlctBox(Slct_ct_max);
                        count++;
                        countold = count;
                        sentence_ct++;
                        inrowcount = 0;
                    }

                    /*====================*/
                    /*    文法コマンド    */
                    /*====================*/
            //					else if (textrowbuf.Length >= 9 && textrowbuf.Substring(0, 9) == "ENDRETURN")
            //					{
            //						sentence_ct = 0;
            //						count = 0;
            //						countold = 0;
            //
            //						/*** 文章表示終了処理 ***/
            //						textrowbuf = "";
            //
            //						/* 立ち絵の消去 */
            //						Program.Doujin_game_sharp.delCharacterImageLeft();
            //						Program.Doujin_game_sharp.delCharacterImageRight();
            //
            //
            //						if (true == EndEventCheck())
            //						{
            //							/* 戻り先ファイル名 */
            //							//break;
            //						}
            //						else
            //						{
            //							count = 0;
            //							countold = 0;
            //							/* ファイルを戻す */
            //							ChangeFile(fileID_forReturn);
            //						}
            //
            //						return sentence_ct;
            //					}
                    else if (textrowbuf.Length >= 3 && textrowbuf.Substring(0, 3) == "END")
                    {
                        sentence_ct = 0;
                        count = 0;
                        countold = 0;

                        /*** 文章表示終了処理 ***/
                        textrowbuf = "";

                        /* 戻り先ファイル名 */
                        fileID_forReturn = file_no;

                        if (true == EndEventCheck())
                        {
                            //break;
                        }
                        else
                        {
                            /* 立ち絵の消去 */
                            Program.Doujin_game_sharp.delCharacterImageLeft();
                            Program.Doujin_game_sharp.delCharacterImageRight();

                            /* 立ち絵の消去に対応してウィンドウ透過のリセット */
                            Program.Doujin_game_sharp.BackgroundDraw2(0);

                            return sentence_ct;
                        }
                    }
                    else if (textrowbuf.Substring(0, 1) == "[")
                    {
                        /*** ラベル ***/
                        /* ラベルはすっ飛ばして次へ */

                        count++;

                        ////ここにcount += 2 を入れるべきかどうか////
                        count += 2;     /* 改行(ラベルの行には、何もコメントを書かないこと) */

                        countold = count;
                        sentence_ct++;
                        inrowcount = 0;
                    }
                    else if (textrowbuf.Length >= 3 && textrowbuf.Substring(0, 3) == "JMP")
                    {
                        /*** ジャンプ ***/
                        count = text.IndexOf("\r\n" + textrowbuf.Remove(0, 4)) + 2;
                        countold = count;
                        sentence_ct = getNowSent(count);
                        inrowcount = 0;
                    }
                    else if (textrowbuf.Length >= 7 && textrowbuf.Substring(0, 7) == "FILEJMP")
                    {
                        int work_ct = 0;
                        /*** ファイルをまたいだジャンプ ***/
                        inrowcount = 8;
                        while (textrowbuf.Substring(inrowcount + work_ct, 1) != " ")
                        {
                            work_ct++;
                        }
                        file_no = GetFileNo(textrowbuf.Substring(inrowcount, work_ct));
                        ChangeFile(file_no);
                        inrowcount += work_ct;
                        count = text.IndexOf("\r\n" + textrowbuf.Remove(0, ++inrowcount)) + 2;
                        countold = count;
                        sentence_ct = getNowSent(count);
                        inrowcount = 0;
                    }
                    else if (textrowbuf.Length >= 2 && textrowbuf.Substring(0, 2) == "移動")
                    {
                        string place = textrowbuf.Substring(3, (textrowbuf.Length - 3));
                        switch (place)
                        {
                            case "礼拝堂":
                                GameData.ScenarioData.NowPlace = Defines.LOC_CHAPEL;
                                break;
                            case "サラの部屋":
                                GameData.ScenarioData.NowPlace = Defines.LOC_SARAROOM;
                                break;
                            case "マリーの部屋":
                                GameData.ScenarioData.NowPlace = Defines.LOC_MARYROOM;
                                break;
                            case "リディの部屋":
                                GameData.ScenarioData.NowPlace = Defines.LOC_LIDYROOM;
                                break;
                            case "書庫":
                                GameData.ScenarioData.NowPlace = Defines.LOC_LIBRARY;
                                break;
                            case "商店":
                                GameData.ScenarioData.NowPlace = Defines.LOC_STORE;
                                break;
                            case "酒場":
                                GameData.ScenarioData.NowPlace = Defines.LOC_BAR;
                                break;
                            case "広場":
                                GameData.ScenarioData.NowPlace = Defines.LOC_SQUARE;
                                break;
                            case "路地裏":
                                GameData.ScenarioData.NowPlace = Defines.LOC_BACKSTREET;
                                break;
                            default:
                                GameData.ScenarioData.NowPlace = Defines.LOC_CHAPEL;
                                break;
                        }
                        count += 3;
                        countold = count;
                        sentence_ct = getNowSent(count);
                        inrowcount = 0;
                    }
                    else if (textrowbuf.Length >= 2 && textrowbuf.Substring(0, 2) == "計算")
                    {
                        /*** 計算 ***/

                        inrowcount = 3;
                        int inrowcountold = inrowcount;
                        int work_ct = 0;
                        Parameter work_1 = new Parameter();
                        int work_1_v = 0;
                        int work_2 = 0;
                        Parameter right_1 = new Parameter();
                        Parameter right_2 = new Parameter();
                        int work_value_1 = 0;
                        int work_value_2 = 0;
                        bool var_flag_L = false;            /*即値フラグ*/
                        bool int_flag_R_1 = false;            /*即値フラグ*/
                        bool int_flag_R_2 = false;            /*即値フラグ*/

                        /** 計算式左辺取得 **/
                        while (textrowbuf.Substring(inrowcount, 1) != " ")
                        {
                            inrowcount++;
                            work_ct++;
                        }
                        if (work_ct >= 2 && "体力" == textrowbuf.Substring(inrowcountold, work_ct))
                        {
                            work_1 = Sis.HitPoint;
                        }
                        else if (work_ct >= 2 && "気力" == textrowbuf.Substring(inrowcountold, work_ct))
                        {
                            work_1 = Sis.MentalPoint;
                        }
                        else if (work_ct >= 3 && "性欲値" == textrowbuf.Substring(inrowcountold, work_ct))
                        {
                            work_1 = Sis.PassionPoint;
                        }
                        else if (work_ct >= 3 && "道徳心" == textrowbuf.Substring(inrowcountold, work_ct))
                        {
                            work_1 = Sis.MoralPoint;
                        }
                        else if (work_ct >= 5 && "触手成長度" == textrowbuf.Substring(inrowcountold, work_ct))
                        {
                            work_1 = Sis.MoralPoint;
                        }
                        else if (work_ct >= 5 && "姉様パンツ" == textrowbuf.Substring(inrowcountold, work_ct))
                        {
                            //work_1 = Sis.Panty;
                            work_1 = Sis.MoralPoint;
                        }
                        else if (work_ct >= 3 && "お香数" == textrowbuf.Substring(inrowcountold, work_ct))
                        {
                            work_1 = Sis.MoralPoint;
                        }
                        else if (work_ct >= 2 && "酒数" == textrowbuf.Substring(inrowcountold, work_ct))
                        {
                            work_1 = Sis.MoralPoint;
                        }
                        else if (work_ct >= 2 && "時刻" == textrowbuf.Substring(inrowcountold, work_ct))
                        {
                            work_1 = Sis.MoralPoint;
                        }
                        else if (work_ct >= 2 && "日数" == textrowbuf.Substring(inrowcountold, work_ct))
                        {
                            work_1_v = GameData.ScenarioData.DayCt;
                            val_reg = VAL_REG_A;
                            var_flag_L = true;
                        }
                        else if (work_ct >= 3 && "汎用A" == textrowbuf.Substring(inrowcountold, work_ct))
                        {
                            work_1_v = A_REG;
                            val_reg = VAL_REG_A;
                            var_flag_L = true;
                        }
                        else if (work_ct >= 3 && "汎用B" == textrowbuf.Substring(inrowcountold, work_ct))
                        {
                            work_1_v = B_REG;
                            val_reg = VAL_REG_B;
                            var_flag_L = true;
                        }
                        else if (work_ct >= 3 && "汎用C" == textrowbuf.Substring(inrowcountold, work_ct))
                        {
                            work_1_v = C_REG;
                            val_reg = VAL_REG_C;
                            var_flag_L = true;
                        }
                        else
                        {
                            Console.WriteLine("work_1 該当するパラメーターが存在しないようです");
                        }

                        inrowcount++;
                        inrowcountold = inrowcount;

                        /** 計算式等号取得 **/
                        while (textrowbuf.Substring(inrowcount, 1) != " ")
                        {
                            inrowcount++;
                            work_2++;
                        }

                        inrowcount++;
                        /* inrowcountoldは、演算子付き等号を後で拾うために動かさない */

                        if (2 >= work_2)
                        {
                            /* += -= *= /= <-(代入) */
                            /* 右辺の項は一つ */

                            /** 右辺取得 **/
                            if ("性欲値" == textrowbuf.Substring(inrowcount))
                            {
                                right_1 = Sis.PassionPoint;
                            }
                            else if ("堕落度" == textrowbuf.Substring(inrowcount))
                            {
                                right_1 = Sis.MoralPoint;
                            }
                            else if ("お香数" == textrowbuf.Substring(inrowcount))
                            {
                                right_1 = Sis.MoralPoint;
                            }
                            else if ("酒数" == textrowbuf.Substring(inrowcount))
                            {
                                right_1 = Sis.MoralPoint;
                            }
                            else if ("日数" == textrowbuf.Substring(inrowcount))
                            {
                                work_value_1 = GameData.ScenarioData.DayCt;
                                int_flag_R_1 = true;
                            }
                            else if ("乱数" == textrowbuf.Substring(inrowcount))
                            {
                                work_value_1 = rand;
                                int_flag_R_1 = true;
                            }
                            else
                            {
                                /* 整数値 */
                                while (work_value_1 < D_WORKVAL_MAX)
                                {
                                    string aaaa = textrowbuf.Substring(inrowcount);
                                    //if (textrowbuf.Substring(inrowcount) == work_value_1.ToString())
                                    if (aaaa == work_value_1.ToString())
                                    {
                                        break;
                                    }
                                    work_value_1++;
                                    int_flag_R_1 = true;
                                }
                            }

                            if (var_flag_L == true)
                            {
                                /* 左辺、汎用パラメーター */
                                if (int_flag_R_1 == true)
                                {
                                    /* 右辺は即値 */
                                    if ("+=" == textrowbuf.Substring(inrowcountold, work_2))
                                    {
                                        work_1_v += work_value_1;
                                    }
                                    else if ("-=" == textrowbuf.Substring(inrowcountold, work_2))
                                    {
                                        work_1_v -= work_value_1;
                                    }
                                    else if ("*=" == textrowbuf.Substring(inrowcountold, work_2))
                                    {
                                        work_1_v *= work_value_1;
                                    }
                                    else if ("/=" == textrowbuf.Substring(inrowcountold, work_2))
                                    {
                                        work_1_v /= work_value_1;
                                    }
                                    else if ("<-" == textrowbuf.Substring(inrowcountold, work_2))
                                    {
                                        work_1_v = work_value_1;
                                    }
                                }
                                else
                                {
                                    /* 右辺は変数 */
                                    if ("+=" == textrowbuf.Substring(inrowcountold, work_2))
                                    {
                                        work_1_v += right_1.CurrentValue;
                                    }
                                    else if ("-=" == textrowbuf.Substring(inrowcountold, work_2))
                                    {
                                        work_1_v -= right_1.CurrentValue;
                                    }
                                    else if ("*=" == textrowbuf.Substring(inrowcountold, work_2))
                                    {
                                        work_1_v *= right_1.CurrentValue;
                                    }
                                    else if ("/=" == textrowbuf.Substring(inrowcountold, work_2))
                                    {
                                        work_1_v /= right_1.CurrentValue;
                                    }
                                    else if ("<-" == textrowbuf.Substring(inrowcountold, work_2))
                                    {
                                        work_1_v = right_1.CurrentValue;
                                    }
                                }
                                switch (val_reg)        //汎用RAMに値を入れる
                                {
                                    case VAL_REG_A:
                                        A_REG = work_1_v;
                                        break;
                                    case VAL_REG_B:
                                        B_REG = work_1_v;
                                        break;
                                    case VAL_REG_C:
                                        C_REG = work_1_v;
                                        break;
                                    default:
                                        Console.WriteLine("error val_reg");
                                        break;
                                }
                            }
                            else
                            {
                                if (int_flag_R_1 == true)
                                {
                                    /* 右辺は即値 */
                                    if ("+=" == textrowbuf.Substring(inrowcountold, work_2))
                                    {
                                        work_1.CurrentValue += work_value_1;
                                    }
                                    else if ("-=" == textrowbuf.Substring(inrowcountold, work_2))
                                    {
                                        work_1.CurrentValue -= work_value_1;
                                    }
                                    else if ("*=" == textrowbuf.Substring(inrowcountold, work_2))
                                    {
                                        work_1.CurrentValue *= work_value_1;
                                    }
                                    else if ("/=" == textrowbuf.Substring(inrowcountold, work_2))
                                    {
                                        work_1.CurrentValue /= work_value_1;
                                    }
                                    else if ("<-" == textrowbuf.Substring(inrowcountold, work_2))
                                    {
                                        work_1.CurrentValue = work_value_1;
                                    }
                                }
                                else
                                {
                                    /* 右辺は変数 */
                                    if ("+=" == textrowbuf.Substring(inrowcountold, work_2))
                                    {
                                        work_1.CurrentValue += right_1.CurrentValue;
                                    }
                                    else if ("-=" == textrowbuf.Substring(inrowcountold, work_2))
                                    {
                                        work_1.CurrentValue -= right_1.CurrentValue;
                                    }
                                    else if ("*=" == textrowbuf.Substring(inrowcountold, work_2))
                                    {
                                        work_1.CurrentValue *= right_1.CurrentValue;
                                    }
                                    else if ("/=" == textrowbuf.Substring(inrowcountold, work_2))
                                    {
                                        work_1.CurrentValue /= right_1.CurrentValue;
                                    }
                                    else if ("<-" == textrowbuf.Substring(inrowcountold, work_2))
                                    {
                                        work_1.CurrentValue = right_1.CurrentValue;
                                    }
                                }
                            }
                        }
                        else
                        {
                            /* = */
                            /* 右辺の項は二つ */

                            inrowcountold = inrowcount;
                            /* こちらの分岐では演算子付き等号は出てこないので、inrowcountoldは更新してしまって良い */

                            /** 右辺第一項取得 **/
                            while (textrowbuf.Substring(inrowcount, 1) != ":")
                            {
                                inrowcount++;
                                work_ct++;
                            }
                            if (work_ct >= 2 && "体力" == textrowbuf.Substring(inrowcount, work_ct))
                            {
                                work_1 = Sis.HitPoint;
                            }
                            else if (work_ct >= 2 && "気力" == textrowbuf.Substring(inrowcount, work_ct))
                            {
                                work_1 = Sis.MentalPoint;
                            }
                            else if (work_ct >= 3 && "性欲値" == textrowbuf.Substring(inrowcount, work_ct))
                            {
                                work_1 = Sis.PassionPoint;
                            }
                            else if (work_ct >= 3 && "道徳心" == textrowbuf.Substring(inrowcount, work_ct))
                            {
                                work_1 = Sis.MoralPoint;
                            }
                            else if (work_ct >= 3 && "お香数" == textrowbuf.Substring(inrowcountold, work_ct))
                            {
                                work_1 = Sis.MoralPoint;
                            }
                            else if (work_ct >= 2 && "酒数" == textrowbuf.Substring(inrowcountold, work_ct))
                            {
                                work_1 = Sis.MoralPoint;
                            }
                            else if (work_ct >= 5 && "露出癖LV" == textrowbuf.Substring(inrowcountold, work_ct))
                            {
                                work_value_1 = Sis.Skills[0].Level;
                                int_flag_R_1 = true;
                            }
                            else if (work_ct >= 6 && "レズっ気LV" == textrowbuf.Substring(inrowcountold, work_ct))
                            {
                                work_value_1 = Sis.Skills[0].Level;
                                int_flag_R_1 = true;
                            }
                            else if (work_ct >= 6 && "マゾっ気LV" == textrowbuf.Substring(inrowcountold, work_ct))
                            {
                                work_value_1 = Sis.Skills[0].Level;
                                int_flag_R_1 = true;
                            }
                            else if (work_ct >= 6 && "サドっ気LV" == textrowbuf.Substring(inrowcountold, work_ct))
                            {
                                work_value_1 = Sis.Skills[0].Level;
                                int_flag_R_1 = true;
                            }
                            else if (work_ct >= 2 && "汎用A" == textrowbuf.Substring(inrowcountold, work_ct))
                            {
                                work_value_1 = A_REG;
                                int_flag_R_1 = true;
                            }
                            else if (work_ct >= 2 && "汎用B" == textrowbuf.Substring(inrowcountold, work_ct))
                            {
                                work_value_1 = B_REG;
                                int_flag_R_1 = true;
                            }
                            else if (work_ct >= 2 && "汎用C" == textrowbuf.Substring(inrowcountold, work_ct))
                            {
                                work_value_1 = C_REG;
                                int_flag_R_1 = true;
                            }
                            else if (work_ct >= 2 && "乱数" == textrowbuf.Substring(inrowcountold, work_ct))
                            {
                                work_value_1 = rand;
                                int_flag_R_1 = true;
                            }
                            else
                            {
                                /* 整数値 */
                                while (work_value_1 < D_WORKVAL_MAX)
                                {
                                    if (textrowbuf.Substring(inrowcountold, work_ct) == work_value_1.ToString())
                                    {
                                        break;
                                    }
                                    work_value_1++;
                                    int_flag_R_1 = true;
                                }
                            }

                            inrowcount++;
                            inrowcountold = inrowcount;
                            /* こちらの分岐では演算子付き等号は出てこないので、inrowcountoldは更新してしまって良い */

                            /* 演算子の分カウンタを進める */
                            inrowcount++;
                            inrowcount++;
                            /* inrowcountoldは、演算子を後で拾うために動かさない */

                            /** 右辺第二項取得 **/
                            if ("性欲値" == textrowbuf.Substring(inrowcount))
                            {
                                right_2 = Sis.PassionPoint;
                            }
                            else if ("堕落度" == textrowbuf.Substring(inrowcount))
                            {
                                right_2 = Sis.MoralPoint;
                            }
                            else if ("汎用A" == textrowbuf.Substring(inrowcount - work_ct))
                            {
                                work_value_2 = A_REG;
                                int_flag_R_2 = true;
                            }
                            else if ("汎用B" == textrowbuf.Substring(inrowcount - work_ct))
                            {
                                work_value_2 = B_REG;
                                int_flag_R_2 = true;
                            }
                            else if ("汎用C" == textrowbuf.Substring(inrowcount - work_ct))
                            {
                                work_value_2 = C_REG;
                                int_flag_R_2 = true;
                            }
                            else if ("乱数" == textrowbuf.Substring(inrowcount - work_ct))
                            {
                                work_value_2 = rand;
                                int_flag_R_2 = true;
                            }
                            else
                            {
                                /* 整数値 */
                                while (work_value_2 < D_WORKVAL_MAX)
                                {
                                    if (textrowbuf.Substring(inrowcount) == work_value_2.ToString())
                                    {
                                        break;
                                    }
                                    work_value_2++;
                                    int_flag_R_2 = true;
                                }
                            }

                            /** 計算 **/
                            if (var_flag_L == true)
                            {
                                if (int_flag_R_1 == true && int_flag_R_2 == true)
                                {
                                    /* 右辺の両項とも即値 */
                                    if ("+" == textrowbuf.Substring(inrowcountold, 1))
                                    {
                                        work_1_v = work_value_1 + work_value_2;
                                    }
                                    else if ("-" == textrowbuf.Substring(inrowcountold, 1))
                                    {
                                        work_1_v = work_value_1 - work_value_2;
                                    }
                                    else if ("*" == textrowbuf.Substring(inrowcountold, 1))
                                    {
                                        work_1_v = work_value_1 * work_value_2;
                                    }
                                    else if ("/" == textrowbuf.Substring(inrowcountold, 1))
                                    {
                                        work_1_v = work_value_1 / work_value_2;
                                    }
                                }
                                else if (int_flag_R_1 == true && int_flag_R_2 == false)
                                {
                                    /* 右辺の第一項:即値 第二項:変数 */
                                    if ("+" == textrowbuf.Substring(inrowcountold, 1))
                                    {
                                        work_1_v = work_value_1 + right_2.CurrentValue;
                                    }
                                    else if ("-" == textrowbuf.Substring(inrowcountold, 1))
                                    {
                                        work_1_v = work_value_1 - right_2.CurrentValue;
                                    }
                                    else if ("*" == textrowbuf.Substring(inrowcountold, 1))
                                    {
                                        work_1_v = work_value_1 * right_2.CurrentValue;
                                    }
                                    else if ("/" == textrowbuf.Substring(inrowcountold, 1))
                                    {
                                        work_1_v = work_value_1 / right_2.CurrentValue;
                                    }
                                }
                                else if (int_flag_R_1 == false && int_flag_R_2 == true)
                                {
                                    /* 右辺の第一項:即値 第二項:変数 */
                                    if ("+" == textrowbuf.Substring(inrowcountold, 1))
                                    {
                                        work_1_v = right_1.CurrentValue + work_value_2;
                                    }
                                    else if ("-" == textrowbuf.Substring(inrowcountold, 1))
                                    {
                                        work_1_v = right_1.CurrentValue - work_value_2;
                                    }
                                    else if ("*" == textrowbuf.Substring(inrowcountold, 1))
                                    {
                                        work_1_v = right_1.CurrentValue * work_value_2;
                                    }
                                    else if ("/" == textrowbuf.Substring(inrowcountold, 1))
                                    {
                                        work_1_v = right_1.CurrentValue / work_value_2;
                                    }
                                }
                                else
                                {
                                    /* 右辺の両項とも変数 */
                                    if ("+" == textrowbuf.Substring(inrowcountold, 1))
                                    {
                                        work_1_v = right_1.CurrentValue + right_2.CurrentValue;
                                    }
                                    else if ("-" == textrowbuf.Substring(inrowcountold, 1))
                                    {
                                        work_1_v = right_1.CurrentValue - right_2.CurrentValue;
                                    }
                                    else if ("*" == textrowbuf.Substring(inrowcountold, 1))
                                    {
                                        work_1_v = right_1.CurrentValue * right_2.CurrentValue;
                                    }
                                    else if ("/" == textrowbuf.Substring(inrowcountold, 1))
                                    {
                                        work_1_v = right_1.CurrentValue / right_2.CurrentValue;
                                    }
                                }

                                switch (val_reg)        //汎用RAMに値を入れる
                                {
                                    case VAL_REG_A:
                                        A_REG = work_1_v;
                                        break;
                                    case VAL_REG_B:
                                        B_REG = work_1_v;
                                        break;
                                    case VAL_REG_C:
                                        C_REG = work_1_v;
                                        break;
                                    default:
                                        Console.WriteLine("error val_reg");
                                        break;
                                }
                            }
                            else
                            {
                                if (int_flag_R_1 == true && int_flag_R_2 == true)
                                {
                                    /* 右辺の両項とも即値 */
                                    if ("+" == textrowbuf.Substring(inrowcountold, 1))
                                    {
                                        work_1.CurrentValue = work_value_1 + work_value_2;
                                    }
                                    else if ("-" == textrowbuf.Substring(inrowcountold, 1))
                                    {
                                        work_1.CurrentValue = work_value_1 - work_value_2;
                                    }
                                    else if ("*" == textrowbuf.Substring(inrowcountold, 1))
                                    {
                                        work_1.CurrentValue = work_value_1 * work_value_2;
                                    }
                                    else if ("/" == textrowbuf.Substring(inrowcountold, 1))
                                    {
                                        work_1.CurrentValue = work_value_1 / work_value_2;
                                    }
                                }
                                else if (int_flag_R_1 == true && int_flag_R_2 == false)
                                {
                                    /* 右辺の第一項:即値 第二項:変数 */
                                    if ("+" == textrowbuf.Substring(inrowcountold, 1))
                                    {
                                        work_1.CurrentValue = work_value_1 + right_2.CurrentValue;
                                    }
                                    else if ("-" == textrowbuf.Substring(inrowcountold, 1))
                                    {
                                        work_1.CurrentValue = work_value_1 - right_2.CurrentValue;
                                    }
                                    else if ("*" == textrowbuf.Substring(inrowcountold, 1))
                                    {
                                        work_1.CurrentValue = work_value_1 * right_2.CurrentValue;
                                    }
                                    else if ("/" == textrowbuf.Substring(inrowcountold, 1))
                                    {
                                        work_1.CurrentValue = work_value_1 / right_2.CurrentValue;
                                    }
                                }
                                else if (int_flag_R_1 == false && int_flag_R_2 == true)
                                {
                                    /* 右辺の第一項:即値 第二項:変数 */
                                    if ("+" == textrowbuf.Substring(inrowcountold, 1))
                                    {
                                        work_1.CurrentValue = right_1.CurrentValue + work_value_2;
                                    }
                                    else if ("-" == textrowbuf.Substring(inrowcountold, 1))
                                    {
                                        work_1.CurrentValue = right_1.CurrentValue - work_value_2;
                                    }
                                    else if ("*" == textrowbuf.Substring(inrowcountold, 1))
                                    {
                                        work_1.CurrentValue = right_1.CurrentValue * work_value_2;
                                    }
                                    else if ("/" == textrowbuf.Substring(inrowcountold, 1))
                                    {
                                        work_1.CurrentValue = right_1.CurrentValue / work_value_2;
                                    }
                                }
                                else
                                {
                                    /* 右辺の両項とも変数 */
                                    if ("+" == textrowbuf.Substring(inrowcountold, 1))
                                    {
                                        work_1.CurrentValue = right_1.CurrentValue + right_2.CurrentValue;
                                    }
                                    else if ("-" == textrowbuf.Substring(inrowcountold, 1))
                                    {
                                        work_1.CurrentValue = right_1.CurrentValue - right_2.CurrentValue;
                                    }
                                    else if ("*" == textrowbuf.Substring(inrowcountold, 1))
                                    {
                                        work_1.CurrentValue = right_1.CurrentValue * right_2.CurrentValue;
                                    }
                                    else if ("/" == textrowbuf.Substring(inrowcountold, 1))
                                    {
                                        work_1.CurrentValue = right_1.CurrentValue / right_2.CurrentValue;
                                    }
                                }
                            }
                        }

                        /* 改行 */
                        count++;
                        count++;

                        count++;
                        countold = count;
                        sentence_ct++;
                        inrowcount = 0;
                        inrowcountold = 0;

                    }
                    else if (textrowbuf.Length >= 3 && textrowbuf.Substring(0, 3) == "If(")
                    {
                        /*** 条件分岐 If文 ***/

                        inrowcount = 4;
                        int inrowcountold = inrowcount;
                        int work_ct_1 = 0;
                        int work_ct_2 = 0;
                        Parameter work_1 = new Parameter();
                        int work_1_v = 0;
                        int work_2 = 0;
                        int work_3 = 0;
                        int work_4 = 0;
                        Parameter work_5 = new Parameter();
                        int work_value = 0;
                        bool int_flag_L = false;              /* 左辺即値 */
                        bool int_flag_R = false;              /* 右辺即値 */

                        bool work_value_b_L = false;
                        bool work_value_b_R = false;
                        bool bool_flag_L = false;			  /* 右辺Bool値 */
                        bool bool_flag_R = false;			  /* 右辺Bool値 */

                        /** 条件左辺取得 **/
                        while (textrowbuf.Substring(inrowcount, 1) != " ")
                        {
                            inrowcount++;
                            work_ct_1++;
                        }
                        if (work_ct_1 >= 2 && "体力" == textrowbuf.Substring(inrowcountold, work_ct_1))
                        {
                            work_1 = Sis.HitPoint;
                            int_flag_L = false;
                        }
                        else if (work_ct_1 >= 2 && "気力" == textrowbuf.Substring(inrowcountold, work_ct_1))
                        {
                            work_1 = Sis.MentalPoint;
                            int_flag_L = false;
                        }
                        else if (work_ct_1 >= 3 && "性欲値" == textrowbuf.Substring(inrowcountold, work_ct_1))
                        {
                            work_1 = Sis.PassionPoint;
                            int_flag_L = false;
                        }
                        else if (work_ct_1 >= 3 && "道徳心" == textrowbuf.Substring(inrowcountold, work_ct_1))
                        {
                            work_1 = Sis.MoralPoint;
                            int_flag_L = false;
                        }
                        else if (work_ct_1 >= 4 && "レズっ気" == textrowbuf.Substring(inrowcountold, work_ct_1))
                        {
                            work_3 = Sis.Skills[Sister.SKL_SMLFETI].Level;
                            int_flag_L = false;
                        }
                        else if (work_ct_1 >= 5 && "匂いフェチ" == textrowbuf.Substring(inrowcountold, work_ct_1))
                        {
                            work_3 = Sis.Skills[Sister.SKL_SMLFETI].Level;
                            int_flag_L = false;
                        }
                        else if (work_ct_1 >= 4 && "ふたなり" == textrowbuf.Substring(inrowcountold, work_ct_1))
                        {
                            //////////未作成//////////
                            work_3 = Sis.Skills[Sister.SKL_FUTA].Level;
                            int_flag_L = true;
                        }
                        else if (work_ct_1 >= 6 && "サキュバス化" == textrowbuf.Substring(inrowcountold, work_ct_1))
                        {
                            //////////未作成//////////
                            work_3 = Sis.Skills[Sister.SKL_SUCCUBUS].Level;
                            int_flag_L = true;
                        }
                        else if (work_ct_1 >= 5 && "触手成長度" == textrowbuf.Substring(inrowcountold, work_ct_1))
                        {
                            work_1 = Sis.MoralPoint;
                            int_flag_L = false;
                        }
                        else if (work_ct_1 >= 5 && "姉様パンツ" == textrowbuf.Substring(inrowcountold, work_ct_1))
                        {
                            //work_1 = Sis.MaryPanty;
                            work_1 = Sis.MoralPoint;
                            int_flag_L = true;
                        }
                        else if (work_ct_1 >= 3 && "お香数" == textrowbuf.Substring(inrowcountold, work_ct_1))
                        {
                            work_1 = Sis.MoralPoint;
                            int_flag_L = false;
                        }
                        else if (work_ct_1 >= 2 && "酒数" == textrowbuf.Substring(inrowcountold, work_ct_1))
                        {
                            work_1 = Sis.MoralPoint;
                            int_flag_L = false;
                        }
                        else if (work_ct_1 >= 4 && "お香経験" == textrowbuf.Substring(inrowcountold, work_ct_1))
                        {
                            work_3 = Sis.ExpNums[Sister.EXP_INCENSE];
                            int_flag_L = false;
                        }
                        else if (work_ct_1 >= 4 && "触手経験" == textrowbuf.Substring(inrowcountold, work_ct_1))
                        {
                            work_3 = Sis.ExpNums[Sister.EXP_LOPER];
                            int_flag_L = false;
                        }
                        else if (work_ct_1 >= 5 && "治療会経験" == textrowbuf.Substring(inrowcountold, work_ct_1))
                        {
                            work_3 = Sis.ExpNums[Sister.EXP_HEAL];
                            int_flag_L = false;
                        }
                        else if (work_ct_1 >= 6 && "姉様レズ経験" == textrowbuf.Substring(inrowcountold, work_ct_1))
                        {
                            work_3 = Sis.ExpNums[Sister.EXP_MARYLSB];
                            int_flag_L = false;
                        }
                        else if (work_ct_1 >= 2 && "日数" == textrowbuf.Substring(inrowcountold, work_ct_1))
                        {
                            work_3 = GameData.ScenarioData.DayCt;
                            int_flag_L = true;
                        }
                        else if (work_ct_1 >= 2 && "時刻" == textrowbuf.Substring(inrowcountold, work_ct_1))
                        {
                            work_3 = GameData.ScenarioData.NowTime;
                            int_flag_L = true;
                        }
                        else if (work_ct_1 >= 4 && "現在位置" == textrowbuf.Substring(inrowcountold, work_ct_1))
                        {
                            work_3 = GameData.ScenarioData.NowPlace;
                            int_flag_L = true;
                        }
                        else if (work_ct_1 >= 3 && "信頼度" == textrowbuf.Substring(inrowcountold, work_ct_1))
                        {
                            work_3 = GameData.ScenarioData.NowPlace;
                            int_flag_L = true;
                        }
                        else if (work_ct_1 >= 3 && "汎用A" == textrowbuf.Substring(inrowcountold, work_ct_1))
                        {
                            work_3 = A_REG;
                            int_flag_L = true;
                        }
                        else if (work_ct_1 >= 3 && "汎用B" == textrowbuf.Substring(inrowcountold, work_ct_1))
                        {
                            work_3 = B_REG;
                            int_flag_L = true;
                        }
                        else if (work_ct_1 >= 3 && "汎用C" == textrowbuf.Substring(inrowcountold, work_ct_1))
                        {
                            work_3 = C_REG;
                            int_flag_L = true;
                        }
                        else if (work_ct_1 >= 4 && "選択番号" == textrowbuf.Substring(inrowcountold, work_ct_1))
                        {
                            work_3 = Slct_No;
                            int_flag_L = true;
                        }
                        else if (work_ct_1 >= 2 && "乱数" == textrowbuf.Substring(inrowcountold, work_ct_1))
                        {
                            work_3 = rand;
                            int_flag_L = true;
                        }
                        else
                        {
                            Console.WriteLine("if文左辺に想定外の値が入っている");
                        }

                        inrowcount++;
                        inrowcountold = inrowcount;

                        /** 比較演算子取得 **/
                        while (textrowbuf.Substring(inrowcount, 1) != " ")
                        {
                            inrowcount++;
                            work_2++;
                        }

                        inrowcount++;
                        inrowcountold = inrowcount;

                        /** 条件右辺取得 **/
                        /* 文字数取得 */
                        while (textrowbuf.Substring(inrowcountold + work_ct_2, 1) != " ")
                        {
                            inrowcount++;
                            work_ct_2++;
                        }
                        if (work_ct_2 >= 2 && "お香数" == textrowbuf.Substring(inrowcountold, work_ct_2))
                        {
                            work_5 = Sis.HitPoint;
                            int_flag_R = false;
                            bool_flag_R = false;
                        }
                        if (work_ct_2 >= 2 && "体力" == textrowbuf.Substring(inrowcountold, work_ct_2))
                        {
                            work_5 = Sis.HitPoint;
                            int_flag_R = false;
                            bool_flag_R = false;
                        }
                        else if (work_ct_2 >= 2 && "気力" == textrowbuf.Substring(inrowcountold, work_ct_2))
                        {
                            work_5 = Sis.MentalPoint;
                            int_flag_R = false;
                            bool_flag_R = false;
                        }
                        else if (work_ct_2 >= 3 && "性欲値" == textrowbuf.Substring(inrowcountold, work_ct_2))
                        {
                            work_5 = Sis.PassionPoint;
                            int_flag_R = false;
                            bool_flag_R = false;
                        }
                        else if (work_ct_2 >= 3 && "道徳心" == textrowbuf.Substring(inrowcountold, work_ct_2))
                        {
                            work_5 = Sis.MoralPoint;
                            int_flag_R = false;
                            bool_flag_R = false;
                        }
                        else if (work_ct_2 >= 5 && "触手成長度" == textrowbuf.Substring(inrowcountold, work_ct_2))
                        {
                            work_5 = Sis.MoralPoint;
                            int_flag_R = false;
                            bool_flag_R = false;
                        }
                        else if (work_ct_2 >= 5 && "日数" == textrowbuf.Substring(inrowcountold, work_ct_2))
                        {
                            work_5.CurrentValue = GameData.ScenarioData.DayCt;
                            int_flag_R = true;
                            bool_flag_R = false;
                        }
                        else if (work_ct_2 >= 3 && "礼拝堂" == textrowbuf.Substring(inrowcountold, work_ct_2))
                        {
                            work_5.CurrentValue = Defines.LOC_CHAPEL;
                            int_flag_R = true;
                            bool_flag_R = false;
                        }
                        else if (work_ct_2 >= 5 && "サラの部屋" == textrowbuf.Substring(inrowcountold, work_ct_2))
                        {
                            work_5.CurrentValue = Defines.LOC_SARAROOM;
                            int_flag_R = true;
                            bool_flag_R = false;
                        }
                        else if (work_ct_2 >= 6 && "マリーの部屋" == textrowbuf.Substring(inrowcountold, work_ct_2))
                        {
                            work_5.CurrentValue = Defines.LOC_MARYROOM;
                            int_flag_R = true;
                            bool_flag_R = false;
                        }
                        else if (work_ct_2 >= 6 && "リディの部屋" == textrowbuf.Substring(inrowcountold, work_ct_2))
                        {
                            work_5.CurrentValue = Defines.LOC_LIDYROOM;
                            int_flag_R = true;
                            bool_flag_R = false;
                        }
                        else if (work_ct_2 >= 2 && "書庫" == textrowbuf.Substring(inrowcountold, work_ct_2))
                        {
                            work_5.CurrentValue = Defines.LOC_LIBRARY;
                            int_flag_R = true;
                            bool_flag_R = false;
                        }
                        else if (work_ct_2 >= 2 && "商店" == textrowbuf.Substring(inrowcountold, work_ct_2))
                        {
                            work_5.CurrentValue = Defines.LOC_STORE;
                            int_flag_R = true;
                            bool_flag_R = false;
                        }
                        else if (work_ct_2 >= 2 && "酒場" == textrowbuf.Substring(inrowcountold, work_ct_2))
                        {
                            work_5.CurrentValue = Defines.LOC_BAR;
                            int_flag_R = true;
                            bool_flag_R = false;
                        }
                        else if (work_ct_2 >= 2 && "広場" == textrowbuf.Substring(inrowcountold, work_ct_2))
                        {
                            work_5.CurrentValue = Defines.LOC_SQUARE;
                            int_flag_R = true;
                            bool_flag_R = false;
                        }
                        else if (work_ct_2 >= 3 && "路地裏" == textrowbuf.Substring(inrowcountold, work_ct_2))
                        {
                            work_5.CurrentValue = Defines.LOC_BACKSTREET;
                            int_flag_R = true;
                            bool_flag_R = false;
                        }
                        else if (work_ct_2 >= 3 && "汎用A" == textrowbuf.Substring(inrowcountold, work_ct_2))
                        {
                            work_5.CurrentValue = A_REG;
                            int_flag_R = true;
                            bool_flag_R = false;
                        }
                        else if (work_ct_2 >= 3 && "汎用B" == textrowbuf.Substring(inrowcountold, work_ct_2))
                        {
                            work_5.CurrentValue = B_REG;
                            int_flag_R = true;
                            bool_flag_R = false;
                        }
                        else if (work_ct_2 >= 3 && "汎用C" == textrowbuf.Substring(inrowcountold, work_ct_2))
                        {
                            work_5.CurrentValue = C_REG;
                            int_flag_R = true;
                            bool_flag_R = false;
                        }
                        else if (work_ct_2 >= 4 && "選択番号" == textrowbuf.Substring(inrowcountold, work_ct_2))
                        {
                            work_5.CurrentValue = Slct_No;
                            int_flag_R = true;
                            bool_flag_R = false;
                        }
                        else if (work_ct_2 >= 2 && "乱数" == textrowbuf.Substring(inrowcountold, work_ct_2))
                        {
                            work_5.CurrentValue = rand;
                            int_flag_R = true;
                            bool_flag_R = false;
                        }
                        else if (textrowbuf.Length >= inrowcountold + 4 && textrowbuf.Substring(inrowcountold, work_ct_2) == "true")
                        {
                            /* true (bool) */

                            work_value_b_R = true;
                            int_flag_R = true;
                            bool_flag_R = true;
                        }
                        else if (textrowbuf.Length >= inrowcountold + 5 && textrowbuf.Substring(inrowcountold, work_ct_2) == "false")
                        {
                            /* false (bool) */

                            work_value_b_R = false;
                            int_flag_R = true;
                            bool_flag_R = true;
                        }
                        else
                        {
                            /* 整数値 */
                            while (work_value < D_WORKVAL_MAX)
                            {
                                if (textrowbuf.Substring(inrowcountold, work_ct_2) == work_value.ToString())
                                {
                                    break;
                                }
                                work_value++;
                            }
                            int_flag_R = true;
                        }

                        inrowcount += 3;

                        /** ジャンプ先ラベル文字数取得 **/
                        while (textrowbuf.Substring(inrowcount + work_4, 1) != "]")
                        {
                            work_4++;
                        }
                        work_4++;

                        /** 条件式に従ってジャンプ **/

                        if (bool_flag_L == true && bool_flag_R == true)
                        {
                            //bool値
                            if ("==" == textrowbuf.Substring(5 + work_ct_1, work_2))
                            {
                                if (work_value_b_L == work_value_b_R)
                                {
                                    string aiueo = "\r\n" + textrowbuf.Substring(inrowcount, work_4);
                                    count = text.IndexOf(aiueo) + 2;
                                }
                                else
                                {
                                    /* 改行 */
                                    count++;
                                    count++;

                                    count++;
                                }
                            }
                        }
                        else if (int_flag_L == false && int_flag_R == false)
                        {
                            //左辺:変数 右辺:変数

                            if ("<" == textrowbuf.Substring(5 + work_ct_1, work_2))
                            {
                                if (work_1.CurrentValue < work_5.CurrentValue)
                                {
                                    string aiueo = "\r\n" + textrowbuf.Substring(inrowcount, work_4);
                                    count = text.IndexOf(aiueo) + 2;
                                }
                                else
                                {
                                    /* 改行 */
                                    count++;
                                    count++;

                                    count++;
                                }
                            }
                            else if ("<=" == textrowbuf.Substring(5 + work_ct_1, work_2))
                            {

                                if (work_1.CurrentValue <= work_5.CurrentValue)
                                {
                                    string aiueo = "\r\n" + textrowbuf.Substring(inrowcount, work_4);
                                    count = text.IndexOf(aiueo) + 2;
                                }
                                else
                                {
                                    /* 改行 */
                                    count++;
                                    count++;

                                    count++;
                                }
                            }
                            else if (">" == textrowbuf.Substring(5 + work_ct_1, work_2))
                            {

                                if (work_1.CurrentValue > work_5.CurrentValue)
                                {
                                    string aiueo = "\r\n" + textrowbuf.Substring(inrowcount, work_4);
                                    count = text.IndexOf(aiueo) + 2;
                                }
                                else
                                {
                                    /* 改行 */
                                    count++;
                                    count++;

                                    count++;
                                }
                            }
                            else if (">=" == textrowbuf.Substring(5 + work_ct_1, work_2))
                            {

                                if (work_1.CurrentValue >= work_5.CurrentValue)
                                {
                                    string aiueo = "\r\n" + textrowbuf.Substring(inrowcount, work_4);
                                    count = text.IndexOf(aiueo) + 2;
                                }
                                else
                                {
                                    /* 改行 */
                                    count++;
                                    count++;

                                    count++;
                                }
                            }
                            else if ("==" == textrowbuf.Substring(5 + work_ct_1, work_2))
                            {
                                if (work_1.CurrentValue == work_5.CurrentValue)
                                {
                                    string aiueo = "\r\n" + textrowbuf.Substring(inrowcount, work_4);
                                    count = text.IndexOf(aiueo) + 2;
                                }
                                else
                                {
                                    /* 改行 */
                                    count++;
                                    count++;

                                    count++;
                                }
                            }
                            else if ("!=" == textrowbuf.Substring(5 + work_ct_1, work_2))
                            {

                                if (work_1.CurrentValue != work_5.CurrentValue)
                                {
                                    string aiueo = "\r\n" + textrowbuf.Substring(inrowcount, work_4);
                                    count = text.IndexOf(aiueo) + 2;
                                }
                                else
                                {
                                    /* 改行 */
                                    count++;
                                    count++;

                                    count++;
                                }
                            }

                        }
                        else if (int_flag_L == false && int_flag_R == true)
                        {
                            // 左辺変数
                            int_flag_R = false;

                            if ("<" == textrowbuf.Substring(5 + work_ct_1, work_2))
                            {
                                if (work_1.CurrentValue < work_value)
                                {
                                    string aiueo = "\r\n" + textrowbuf.Substring(inrowcount, work_4);
                                    count = text.IndexOf(aiueo) + 2;
                                }
                                else
                                {
                                    /* 改行 */
                                    count++;
                                    count++;

                                    count++;
                                }
                            }
                            else if ("<=" == textrowbuf.Substring(5 + work_ct_1, work_2))
                            {

                                if (work_1.CurrentValue <= work_value)
                                {
                                    string aiueo = "\r\n" + textrowbuf.Substring(inrowcount, work_4);
                                    count = text.IndexOf(aiueo) + 2;
                                }
                                else
                                {
                                    /* 改行 */
                                    count++;
                                    count++;

                                    count++;
                                }
                            }
                            else if (">" == textrowbuf.Substring(5 + work_ct_1, work_2))
                            {

                                if (work_1.CurrentValue > work_value)
                                {
                                    string aiueo = "\r\n" + textrowbuf.Substring(inrowcount, work_4);
                                    count = text.IndexOf(aiueo) + 2;
                                }
                                else
                                {
                                    /* 改行 */
                                    count++;
                                    count++;

                                    count++;
                                }
                            }
                            else if (">=" == textrowbuf.Substring(5 + work_ct_1, work_2))
                            {

                                if (work_1.CurrentValue >= work_value)
                                {
                                    string aiueo = "\r\n" + textrowbuf.Substring(inrowcount, work_4);
                                    count = text.IndexOf(aiueo) + 2;
                                }
                                else
                                {
                                    /* 改行 */
                                    count++;
                                    count++;

                                    count++;
                                }
                            }
                            else if ("==" == textrowbuf.Substring(5 + work_ct_1, work_2))
                            {

                                if (work_1.CurrentValue == work_value)
                                {
                                    string aiueo = "\r\n" + textrowbuf.Substring(inrowcount, work_4);
                                    count = text.IndexOf(aiueo) + 2;
                                }
                                else
                                {
                                    /* 改行 */
                                    count++;
                                    count++;

                                    count++;
                                }
                            }
                            else if ("!=" == textrowbuf.Substring(5 + work_ct_1, work_2))
                            {

                                if (work_1.CurrentValue != work_value)
                                {
                                    string aiueo = "\r\n" + textrowbuf.Substring(inrowcount, work_4);
                                    count = text.IndexOf(aiueo) + 2;
                                }
                                else
                                {
                                    /* 改行 */
                                    count++;
                                    count++;

                                    count++;
                                }
                            }

                        }
                        else if (int_flag_L == true && int_flag_R == false)
                        {
                            //右辺変数

                            if ("<" == textrowbuf.Substring(5 + work_ct_1, work_2))
                            {
                                if (work_3 < work_5.CurrentValue)
                                {
                                    string aiueo = "\r\n" + textrowbuf.Substring(inrowcount, work_4);
                                    count = text.IndexOf(aiueo) + 2;
                                }
                                else
                                {
                                    /* 改行 */
                                    count++;
                                    count++;

                                    count++;
                                }
                            }
                            else if ("<=" == textrowbuf.Substring(5 + work_ct_1, work_2))
                            {

                                if (work_3 <= work_5.CurrentValue)
                                {
                                    string aiueo = "\r\n" + textrowbuf.Substring(inrowcount, work_4);
                                    count = text.IndexOf(aiueo) + 2;
                                }
                                else
                                {
                                    /* 改行 */
                                    count++;
                                    count++;

                                    count++;
                                }
                            }
                            else if (">" == textrowbuf.Substring(5 + work_ct_1, work_2))
                            {

                                if (work_3 > work_5.CurrentValue)
                                {
                                    string aiueo = "\r\n" + textrowbuf.Substring(inrowcount, work_4);
                                    count = text.IndexOf(aiueo) + 2;
                                }
                                else
                                {
                                    /* 改行 */
                                    count++;
                                    count++;

                                    count++;
                                }
                            }
                            else if (">=" == textrowbuf.Substring(5 + work_ct_1, work_2))
                            {

                                if (work_3 >= work_5.CurrentValue)
                                {
                                    string aiueo = "\r\n" + textrowbuf.Substring(inrowcount, work_4);
                                    count = text.IndexOf(aiueo) + 2;
                                }
                                else
                                {
                                    /* 改行 */
                                    count++;
                                    count++;

                                    count++;
                                }
                            }
                            else if ("==" == textrowbuf.Substring(5 + work_ct_1, work_2))
                            {

                                if (work_3 == work_5.CurrentValue)
                                {
                                    string aiueo = "\r\n" + textrowbuf.Substring(inrowcount, work_4);
                                    count = text.IndexOf(aiueo) + 2;
                                }
                                else
                                {
                                    /* 改行 */
                                    count++;
                                    count++;

                                    count++;
                                }
                            }
                            else if ("!=" == textrowbuf.Substring(5 + work_ct_1, work_2))
                            {

                                if (work_3 != work_5.CurrentValue)
                                {
                                    string aiueo = "\r\n" + textrowbuf.Substring(inrowcount, work_4);
                                    count = text.IndexOf(aiueo) + 2;
                                }
                                else
                                {
                                    /* 改行 */
                                    count++;
                                    count++;

                                    count++;
                                }
                            }

                        }
                        else if (int_flag_L == true && int_flag_R == true)
                        {
                            // 左辺:整数値 右辺:整数値
                            int_flag_R = false;

                            if ("<" == textrowbuf.Substring(5 + work_ct_1, work_2))
                            {
                                if (work_3 < work_value)
                                {
                                    string aiueo = "\r\n" + textrowbuf.Substring(inrowcount, work_4);
                                    count = text.IndexOf(aiueo) + 2;
                                }
                                else
                                {
                                    /* 改行 */
                                    count++;
                                    count++;

                                    count++;
                                }
                            }
                            else if ("<=" == textrowbuf.Substring(5 + work_ct_1, work_2))
                            {

                                if (work_3 <= work_value)
                                {
                                    string aiueo = "\r\n" + textrowbuf.Substring(inrowcount, work_4);
                                    count = text.IndexOf(aiueo) + 2;
                                }
                                else
                                {
                                    /* 改行 */
                                    count++;
                                    count++;

                                    count++;
                                }
                            }
                            else if (">" == textrowbuf.Substring(5 + work_ct_1, work_2))
                            {

                                if (work_3 > work_value)
                                {
                                    string aiueo = "\r\n" + textrowbuf.Substring(inrowcount, work_4);
                                    count = text.IndexOf(aiueo) + 2;
                                }
                                else
                                {
                                    /* 改行 */
                                    count++;
                                    count++;

                                    count++;
                                }
                            }
                            else if (">=" == textrowbuf.Substring(5 + work_ct_1, work_2))
                            {

                                if (work_3 >= work_value)
                                {
                                    string aiueo = "\r\n" + textrowbuf.Substring(inrowcount, work_4);
                                    count = text.IndexOf(aiueo) + 2;
                                }
                                else
                                {
                                    /* 改行 */
                                    count++;
                                    count++;

                                    count++;
                                }
                            }
                            else if ("==" == textrowbuf.Substring(5 + work_ct_1, work_2))
                            {

                                if (work_3 == work_value)
                                {
                                    string aiueo = "\r\n" + textrowbuf.Substring(inrowcount, work_4);
                                    count = text.IndexOf(aiueo) + 2;
                                }
                                else
                                {
                                    /* 改行 */
                                    count++;
                                    count++;

                                    count++;
                                }
                            }
                            else if ("!=" == textrowbuf.Substring(5 + work_ct_1, work_2))
                            {

                                if (work_3 != work_value)
                                {
                                    string aiueo = "\r\n" + textrowbuf.Substring(inrowcount, work_4);
                                    count = text.IndexOf(aiueo) + 2;
                                }
                                else
                                {
                                    /* 改行 */
                                    count++;
                                    count++;

                                    count++;
                                }
                            }

                        }

                        countold = count;
                        sentence_ct = getNowSent(count);
                        inrowcount = 0;
                        inrowcountold = 0;
                    }
                    /*======================*/
                    /*    発言者コマンド    */
                    /*======================*/
                    else if (textrowbuf == "Text")
                    {
                        Color = Brushes.White;

                        name[0] = "Text";

                        /* キャラ名の消去 */
                        Program.Doujin_game_sharp.ClearCharacterName();

                        count++;
                        countold = count;
                        sentence_ct++;
                        inrowcount = 0;
                    }
                    else if (textrowbuf.Length >= 2 && textrowbuf.Substring(0, 2) == "サラ")
                    {
                        Color = Brushes.Pink;
                        Program.Doujin_game_sharp.setCharacterImageLeft(textrowbuf);

                        name[0] = "サラ";

                        /* キャラ名の表示 */
                        Program.Doujin_game_sharp.DrawCharacterName(name[0]);

                        count++;
                        countold = count;
                        sentence_ct++;
                        inrowcount = 0;
                    }
                    else if (textrowbuf.Length >= 3 && textrowbuf.Substring(0, 3) == "マリー")
                    {
                        Color = Brushes.Yellow;

                        Program.Doujin_game_sharp.setCharacterImageLeft(textrowbuf);

                        name[0] = "マリー";

                        /* キャラ名の表示 */
                        Program.Doujin_game_sharp.DrawCharacterName(name[0]);

                        count++;
                        countold = count;
                        sentence_ct++;
                        inrowcount = 0;
                    }
                    else if (textrowbuf.Length >= 3 && textrowbuf.Substring(0, 3) == "リディ")
                    {
                        Color = Brushes.Orange;
                        Program.Doujin_game_sharp.setCharacterImageRight(textrowbuf);

                        name[0] = "リディ";

                        /* キャラ名の表示 */
                        Program.Doujin_game_sharp.DrawCharacterName(name[0]);

                        count++;
                        countold = count;
                        sentence_ct++;
                        inrowcount = 0;
                    }
                    else if (textrowbuf.Length >= 3 && textrowbuf.Substring(0, 3) == "触手娘")
                    {
                        Color = Brushes.Green;
                        Program.Doujin_game_sharp.setCharacterImageRight(textrowbuf);

                        name[0] = "触手娘";

                        /* キャラ名の表示 */
                        Program.Doujin_game_sharp.DrawCharacterName(name[0]);

                        count++;
                        countold = count;
                        sentence_ct++;
                        inrowcount = 0;
                    }
                    else if (textrowbuf.Length >= 2 && textrowbuf.Substring(0, 2) == "魔物")
                    {
                        Color = Brushes.Magenta;
                        Program.Doujin_game_sharp.setCharacterImageRight(textrowbuf);

                        name[0] = "魔物";

                        /* キャラ名の表示 */
                        Program.Doujin_game_sharp.DrawCharacterName(name[0]);

                        count++;
                        countold = count;
                        sentence_ct++;
                        inrowcount = 0;
                    }
                    else if (textrowbuf.Length >= 3 && textrowbuf.Substring(0, 3) == "???")
                    {
                        Color = Brushes.Gray;
                        //Program.Doujin_game_sharp.setCharacterImageRight(textrowbuf);

                        name[0] = "???";

                        /* キャラ名の表示 */
                        Program.Doujin_game_sharp.DrawCharacterName(name[0]);

                        count++;
                        countold = count;
                        sentence_ct++;
                        inrowcount = 0;
                    }
                    else if (textrowbuf.Length >= 2 && textrowbuf.Substring(0, 2) == "商人")
                    {
                        Color = Brushes.Gray;
                        //Program.Doujin_game_sharp.setCharacterImageRight(textrowbuf);

                        name[0] = "商人";

                        /* キャラ名の表示 */
                        Program.Doujin_game_sharp.DrawCharacterName(name[0]);

                        count++;
                        countold = count;
                        sentence_ct++;
                        inrowcount = 0;
                    }
                    else if (textrowbuf.Length >= 2 && textrowbuf.Substring(0, 2) == "店員")
                    {
                        Color = Brushes.Gray;
                        //Program.Doujin_game_sharp.setCharacterImageRight(textrowbuf);

                        name[0] = "店員";

                        /* キャラ名の表示 */
                        Program.Doujin_game_sharp.DrawCharacterName(name[0]);

                        count++;
                        countold = count;
                        sentence_ct++;
                        inrowcount = 0;
                    }
                    else if (textrowbuf.Length >= 2 && textrowbuf.Substring(0, 2) == "男1")
                    {
                        Color = Brushes.Gray;
                        //Program.Doujin_game_sharp.setCharacterImageRight(textrowbuf);

                        name[0] = "男";

                        /* キャラ名の表示 */
                        Program.Doujin_game_sharp.DrawCharacterName(name[0]);

                        count++;
                        countold = count;
                        sentence_ct++;
                        inrowcount = 0;
                    }
                    else if (textrowbuf.Length >= 2 && textrowbuf.Substring(0, 2) == "男2")
                    {
                        Color = Brushes.Gray;
                        //Program.Doujin_game_sharp.setCharacterImageRight(textrowbuf);

                        name[0] = "男";

                        /* キャラ名の表示 */
                        Program.Doujin_game_sharp.DrawCharacterName(name[0]);

                        count++;
                        countold = count;
                        sentence_ct++;
                        inrowcount = 0;
                    }
                    else if (textrowbuf.Length >= 2 && textrowbuf.Substring(0, 2) == "男3")
                    {
                        Color = Brushes.Gray;
                        //Program.Doujin_game_sharp.setCharacterImageRight(textrowbuf);

                        name[0] = "男";

                        /* キャラ名の表示 */
                        Program.Doujin_game_sharp.DrawCharacterName(name[0]);

                        count++;
                        countold = count;
                        sentence_ct++;
                        inrowcount = 0;
                    }
                    else if (textrowbuf == "Plus")
                    {
                        Color = Brushes.Blue;

                        name[0] = "Plus";

                        /* キャラ名の消去 */
                        Program.Doujin_game_sharp.ClearCharacterName();

                        count++;
                        countold = count;
                        sentence_ct++;
                        inrowcount = 0;
                    }
                    else if (textrowbuf == "Minus")
                    {
                        Color = Brushes.Red;

                        name[0] = "Minus";

                        /* キャラ名の消去 */
                        Program.Doujin_game_sharp.ClearCharacterName();

                        count++;
                        countold = count;
                        sentence_ct++;
                        inrowcount = 0;
                    }
                    /*======================*/
                    /*     効果コマンド     */
                    /*======================*/
                    else if (textrowbuf.Length >= 2 && textrowbuf.Substring(0, 2) == "IN")
                    {
                        /* 立ち絵の表示 */
                        string char_name = textrowbuf.Substring(3, textrowbuf.Length - 3);

                        if (char_name.Length >= 2 && char_name.Substring(0, 2) == "サラ")
                        {
                            Program.Doujin_game_sharp.setCharacterImageLeft(char_name);
                        }
                        else
                        {
                            Program.Doujin_game_sharp.setCharacterImageRight(char_name);
                        }
                        count += 2;
                        countold = count;
                        sentence_ct = getNowSent(count);
                        inrowcount = 0;
                    }
                    else if (textrowbuf.Length >= 3 && textrowbuf.Substring(0, 3) == "OUT")
                    {
                        /* 立ち絵の消去 */
                        string char_name = textrowbuf.Substring(4, textrowbuf.Length - 4);

                        if (char_name.Length >= 2 && char_name.Substring(0, 2) == "サラ")
                        {
                            Program.Doujin_game_sharp.delCharacterImageLeft();
                        }
                        else
                        {
                            Program.Doujin_game_sharp.delCharacterImageRight();
                        }
                        Program.Doujin_game_sharp.BackgroundDraw2(0);
                        count += 2;
                        countold = count;
                        sentence_ct = getNowSent(count);
                        inrowcount = 0;

                    }
                    else if (textrowbuf.Length >= 3 && textrowbuf.Substring(0, 3) == "BGM")
                    {
                        /* BGMの鳴動 */

                    }
                    else if (textrowbuf.Length >= 2 && textrowbuf.Substring(0, 2) == "SE")
                    {
                        /* 効果音の鳴動 */

                    }
                    else if (textrowbuf.Length >= 2 && textrowbuf.Substring(0, 2) == "背景")
                    {
                        string str_BGPic = textrowbuf.Substring(3, textrowbuf.Length - 3);
                        /* 背景の変更 */
                        Program.Doujin_game_sharp.DispStatus = 0;
                        Program.Doujin_game_sharp.BGPicname = str_BGPic;
                        Program.Doujin_game_sharp.setBGPic();
                        count += 3;
                        countold = count;
                        sentence_ct = getNowSent(count);
                        inrowcount = 0;
                    }
                }
                else if (text[count] == ';')
                {

                    if (Slct_ct != 0)
                    {
                        /* 選択肢の表示 */
                        //Bitmap canvas;
                        int no = 0;

                        textrowbuf = text.Substring(countold + 2, inrowcount - 2);

                        //描画先とするImageオブジェクトを作成する
                        Bitmap canvas1 = new Bitmap(Defines.SelectBoxWidth, Defines.SelectBoxHeight);
                        Graphics g1 = Graphics.FromImage(canvas1);
                        g1.DrawString(textrowbuf, fnt, Color, 10, 17);

                        //表示する
                        switch (Slct_ct)
                        {
                            case 4:
                                    no = 1;
                                break;
                            case 3:
                                if (Slct_ct_max == 4)      { no = 2; }
                                else                       { no = 1; }
                                break;
                            case 2:
                                if      (Slct_ct_max == 4) { no = 3; }
                                else if (Slct_ct_max == 3) { no = 2; }
                                else                       { no = 1; }
                                break;
                            case 1:
                                if      (Slct_ct_max == 4) { no = 4; }
                                else if (Slct_ct_max == 3) { no = 3; }
                                else                       { no = 2; }
                                break;
                            default:
                                break;
                        }
                        Program.Doujin_game_sharp.setSelectBoxImage(no, canvas1);
                        g1.Dispose();
                        //ImageオブジェクトのGraphicsオブジェクトを作成する

                        count++;                /* ';'分 */
                        countold = count;
                        sentence_ct++;
                        inrowcount = 0;
                        Slct_ct--;
                        if (Slct_ct == 0)
                        {
                            count += 2;         /* 改行記号分 */
                            countold = count;
                            sentence_ct = getNowSent(count);
                            //リソースを解放する
                            fnt.Dispose();
                        }
                    }
                    else
                    {
                        /* ナレーション・セリフの表示 */
                        //描画先とするImageオブジェクトを作成する
                        Bitmap canvas1 = new Bitmap(Defines.TextAreaWidth, Defines.TextAreaHeight);
                        //ImageオブジェクトのGraphicsオブジェクトを作成する
                        Graphics g1 = Graphics.FromImage(canvas1);

                        textrowbuf = text.Substring(countold, inrowcount);

                        //計算結果部分を文字列に置き換える
                        textrowbuf = textrowbuf.Replace("<汎用A>", A_REG.ToString("D"));
                        textrowbuf = textrowbuf.Replace("<汎用B>", B_REG.ToString("D"));
                        textrowbuf = textrowbuf.Replace("<汎用C>", C_REG.ToString("D"));

                        g1.DrawString(textrowbuf, fnt, Color, 30, 0);
                        //PictureBox1に表示する
                        Program.Doujin_game_sharp.setTextAreaImage(canvas1);

                        //リソースを解放する
                        fnt.Dispose();
                        g1.Dispose();

                        count++;
                        countold = count;
                        sentence_ct++;
                        inrowcount = 0;
                        log[0] = textrowbuf;
                        backlogRenew(log_ct_use);
                        break;
                    }
                }
                else if (count >= 2 && checkRowLast(count) == 1 && checkRowLast(count - 2) == 1)
                {
                    /* 空白行 */
                    count += 2;
                    countold = count;
                    inrowcount = 0;
                }
                else
                {
                    count++;
                    inrowcount++;
                }
            }
            return sentence_ct;
        }
Ejemplo n.º 2
0
Archivo: SE.cs Proyecto: Jkank/sister
 /* ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ */
 /* ■ 関数名:ChangeFile                    ■ */
 /* ■ 内容:読み取るファイルを変更                       ■ */
 /* ■       file_noに対応したファイルをtext(文字列)に展開 ■ */
 /* ■ 入力:file_no                                     ■ */
 /* ■ 出力:                                            ■ */
 /* ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ */
 private static void ChangeFile(Defines.fileID file_no)
 {
     switch (file_no)
     {
         case Defines.fileID.TXT_OPENING:
             text = Properties.Resources.オープニング;
             break;
         case Defines.fileID.TXT_CHURCH:
             text = Properties.Resources.教会;
             break;
         case Defines.fileID.TXT_MARY:
             text = Properties.Resources.マリーの部屋;
             break;
         case Defines.fileID.TXT_LIDY:
             text = Properties.Resources.リディの部屋;
             break;
         case Defines.fileID.TXT_LEST:
             text = Properties.Resources.休息;
             break;
         case Defines.fileID.TXT_SHOP:
             //text = Properties.Resources.商店;
             break;
         case Defines.fileID.TXT_READ:
             text = Properties.Resources.読書;
             break;
         case Defines.fileID.TXT_ROSYUTSU:
             //text = Properties.Resources.露出;
             break;
         case Defines.fileID.TXT_NEWSKILL:
             text = Properties.Resources.スキル取得;
             break;
         case Defines.fileID.TXT_PUSSION_LIMIT:
             text = Properties.Resources.性欲限界;
             break;
         case Defines.fileID.TXT_HP_RUNOUT:
             text = Properties.Resources.体力切れ;
             break;
         case Defines.fileID.TXT_MENTAL_RUNOUT:
             text = Properties.Resources.気力切れ;
             break;
         case Defines.fileID.TXT_DEVIL_PART:
             text = Properties.Resources.魔物パート;
             break;
         case Defines.fileID.TXT_ENDING:
             text = Properties.Resources.エンディング;
             break;
         default:
             Console.WriteLine("エラー 該当するテキストファイルがありません");
             break;
     }
     doujin_game_sharp.ChangeNowFile(file_no);
 }
Ejemplo n.º 3
0
 /* == 以下サブルーチン的メソッド == */
 /* ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ */
 /* ■ 関数名:ChangeNowFile		            ■ */
 /* ■ 内容:参照ファイル変更処理						   ■ */
 /* ■ 入力:file_id                                     ■ */
 /* ■ 出力:なし                                        ■ */
 /* ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ */
 public static void ChangeNowFile(Defines.fileID file_id)
 {
     nowfile = file_id;
 }