Beispiel #1
0
        public static async Task <HtmlDocument> GetSheetDataAsync(string targetUrl, TrpgSystem trpgSystem)
        {
            var result = new HtmlDocument();

            try
            {
                var str = await _httpClient.GetStringAsync(targetUrl);

#if MAKE_DELAY_SERVER
                await Task.Delay(2000);
#endif

                //キャラクター保管所の対象システムシートであることの確認
                if (!Regex.Match(str, trpgSystem.CheckUrl()).Success)
                {
                    return(null);
                }

                result.LoadHtml(str);
            }
            catch
            {
                return(null);
            }

            return(result);
        }
Beispiel #2
0
 public static bool IsSelectingByNameOnDiceRollResult(this TrpgSystem system)
 {
     //ダイスロール結果を受信する際に名前でソートするか
     bool[] values =
     {
         false,
         false,
         false,
         true,
         false
     };
     return(values[(int)system]);
 }
Beispiel #3
0
 public static string CheckUrl(this TrpgSystem system)
 {
     //キャラシー保管所で、それぞれのシステムのシートか確認するための文字列
     //この文字列が含まれていれば各システムのキャラシート。
     string[] values =
     {
         "",
         "https://charasheet.vampire-blood.net/ara2_pc_making.html",
         "https://charasheet.vampire-blood.net/coc_pc_making.html",
         "https://charasheet.vampire-blood.net/dx3_pc_making.html",
         ""
     };
     return(values[(int)system]);
 }
Beispiel #4
0
        public static RollDice MakeNormalRollDice(this TrpgSystem system)
        {
            var result = new RollDice(system);

            switch (system)
            {
            case TrpgSystem.DiceBot:
            default:
                break;

            case TrpgSystem.Arianrhod:
            {
                result.DiceNumber = 2;
                result.DiceBase   = 6;
                result.Inequality = ">=";
                break;
            }

            case TrpgSystem.Cthulhu:
            {
                result.DiceNumber = 1;
                result.DiceBase   = 100;
                result.Inequality = "<=";
                break;
            }

            case TrpgSystem.DoubleCross:
            {
                result.DiceNumber = 1;
                result.DiceBase   = 10;
                result.Inequality = ">=";
                break;
            }

            case TrpgSystem.Insane:
            {
                result.DiceNumber = 2;
                result.DiceBase   = 6;
                result.Inequality = ">=";
                break;
            }
            }

            return(result);
        }
Beispiel #5
0
        public static string SendingTextFormat(this TrpgSystem system, bool isVissibleTargetVaule)
        {
            //      {0}    D    {1}   +    {2}        {3}         {4}       [    {5}    ]   {6}
            // (DiceNumber)D(DiceBase)+(DiceConst)(Inequality)(TargetValue) [(RollGroup)](RollName)
            // AR :  3     D     6    +     8          >=       (目標値)    [    攻撃  ]  回避
            // CoC:  1     D    100     (未使用)       <=          80       [    探索  ]  目星
            // XX :  13    DX    7    +     4          >=       (目標値)    [  コンボ ] 獣爪撃
            // IS :  2     D     6      (未使用)       >=           5       [   暴力  ]  焼却

            string[,] values =
            {
                {   //DiceBot
                    "{0}D{1}{2:+0;-0;#}{3}{4} [ {5} ] {6}",
                    "{0}D{1}{2:+0;-0;#} [ {5} ] {6}"
                },

                {   //Arianrhod
                    "{0}D{1}{2:+0;-0;#}{3}{4} [ {5} ] {6}",
                    "{0}D{1}{2:+0;-0;#} [ {5} ] {6}"
                },

                {   //Cthulhu
                    //normal(1D100)
                    //"{0}D{1}{3}{4} [ {5} ] {6}",
                    //"{0}D{1} [ {5} ] {6}"
                    //ccb使用
                    "ccb{3}{4} [ {5} ] {6}",
                    "ccb [ {5} ] {6}"
                },

                {   //DoubleCross
                    //DiceBaseをクリティカル値入力欄として使用
                    "{0}DX{1}{2:+0;-0;#}{3}{4} [ {5} ] {6}",
                    "{0}DX{1}{2:+0;-0;#} [ {5} ] {6}"
                },

                {   //InSANe
                    "{0}D{1}{3}{4} [ {5} ] {6}",
                    "{0}D{1} [ {5} ] {6}"
                }
            };
            return(values[(int)system, isVissibleTargetVaule ? 0 : 1]);
        }
Beispiel #6
0
        public DodontoFPCData(TrpgSystem trpgSystem)
        {
            InitializeDelegateCommand();

            this.UsingSystem = trpgSystem;
            var rn = this.UsingSystem.ResourceNames();

            this._resources = new BindableValueList <int>();
            //Enumerable.Repeat(0, rn.Count()).Select(i => this._resources.AddItem(new BindableValue<int>(i)));
            for (var i = 0; i < rn.Count(); i++)
            {
                this._resources.AddItem(new BindableValue <int>(0));
            }

            this.IgnoreSyncVar = new List <string> {
                nameof(this.Images.SelectedItem),
                nameof(this.AbImages)
            };
        }
Beispiel #7
0
        public static string[] ResourceNames(this TrpgSystem system)
        {
            var Names = new string[][]
            {
                //DiceBot
                new [] { "HP", "/HP", "MP", "/MP" },

                //Arianrhod
                new [] { "HP", "/HP", "MP", "/MP", "Fate" },

                //Cthulhu
                new [] { "HP", "/HP", "MP", "/MP", "SAN" },

                //DoubleCross
                new [] { "HP", "/HP", "侵蝕率", "ロイス" },

                //InSANe
                new [] { "HP", "/HP", "正気度", "/正気度", "狂気" }
            };

            return(Names[(int)system].ToArray());
        }
Beispiel #8
0
        public static Func <string, Task <TrpgPC> > MakePCFromWebAsync(this TrpgSystem system)
        {
            Func <string, Task <TrpgPC> >[] funcs =
            {
                //DiceBot
                TrpgPC.MakePCFromWebAsync,

                //Arianrhod
                ArPC.MakePCFromWebAsync,

                //Cthulhu
                CoCPC.MakePCFromWebAsync,

                //DoubleCross
                XXPC.MakePCFromWebAsync,

                //InSANe
                ISPC.MakePCFromWebAsync
            };

            return(funcs[(int)system]);
        }
Beispiel #9
0
 public RollDice(TrpgSystem sytem)
 {
     this.UsingSystem = sytem;
 }