private void パレマス形式ToolStripMenuItem_Click(object sender, EventArgs e) { chpLoad m_d; m_d = JSONLoad(); if (m_d.f) { PalletMaster.Searcher = new Searcher(); PalletMaster.Searcher.SetSearcher(m_d.d); PalletMaster.AbilityDataSet(); sanControl.SetSanText(PalletMaster.Searcher.characterInfos.SAN.ToString()); //SAN情報の入力 fightControl.SetFightText(PalletMaster.Searcher.characterInfos.HP.ToString()); //HP情報の入力 fightControl.SetFightDamageBonusText(PalletMaster.Searcher.characterInfos.damageBonus); //HP情報の入力 PalletMaster.Searcher.CheckUnique(); PalletMaster.RefreshListView(); } var defaultSkillList = Proccess.GetSkillSet(); PalletMaster.Searcher.SetDefaultSkills(defaultSkillList); if (PalletMaster.Setting.charaNameToUserNameFlg) { PalletMaster.Setting.userName = PalletMaster.Searcher.characterInfos.characterName; } }
//キャラクターアーカイブスからキャラクターデータを読込 public Searcher charaArchiveHTMLRead(string m_URL) { var searcher = new Searcher(); var wc = new WebClient(); var defaultSkillList = Proccess.GetSkillSet(); searcher.SetDefaultSkills(defaultSkillList); try { wc.Encoding = System.Text.Encoding.UTF8; string html = wc.DownloadString(m_URL); //指定URLのHTMLデータを取得 // HtmlParserクラスをインスタンス化 searcher = ImportCharacterByAngleSharp(html, searcher); } catch (WebException exc) { Console.WriteLine(exc.Message); } catch (NullReferenceException exc) { Console.WriteLine(exc.Message); } searcher.CheckUnique(); //技能値が初期値かそうでないか判定をする return(searcher); }
public NewCharacter() { Searcher = new Searcher(); Searcher.SetDefaultSkills(Proccess.GetSkillSet()); Searcher.skills = Proccess.GetSkillSet(); Searcher.skills.ForEach(_ => _.defaultValue = _.value); }
public Searcher ConversionToSearcher() { if (this == null) { return(new Searcher()); } Searcher searcher = new Searcher(); searcher.SetDefaultSkills(Proccess.GetSkillSet()); searcher = ReplacementSkills(uniqueSkills, searcher, ""); searcher = ReplacementSkills(fightSkills, searcher, "戦闘"); searcher.abilityValues.setCHP(abilityValues); searcher.characterInfos.setCHP(searcherInfos); searcher.backgroundString = backgroundString; searcher.CheckUnique(); return(searcher); }
public MainForm(Searcher d) { InitializeComponent(); //フォームの初期化 PalletMaster = new PalletMaster { //設定の読込と初期設定 Setting = IOHelper.toLoadSetting() }; var templeteTextSelected = PalletMaster.Setting.useBCDiceAPIFlg || PalletMaster.Setting.offlineMode; skillControl.SetButtonTempleteUserCopyName ( templeteTextSelected ? "ダイス" : "コピー" ); if (PalletMaster.Setting.useDiceBotFlg == 0) { toChangeBCDice(); } else { toChageSidekick(); } var defaultSkills = Proccess.GetSkillSet(); PalletMaster.Searcher.SetDefaultSkills(defaultSkills); historyAbilityControl.SelectedIndexListBoxAbility(0); historyAbilityControl.SelectedIndexListBoxValue(4); //フォームを最前面に表示するか否かをセット TopMost = PalletMaster.Setting.checkTopMostFlg; //PalletMasterのコンストラクタにMainFormを割り当てる //PalletMasterからMainFormの関数を叩けるようにする PalletMaster.SetMainForm(this); //skillControlを技能タブに割り当てる skillControl.SetPalletMaster(PalletMaster); setTab(skillControl, tabPageSkill); //SANControlを技能タブに割り当てる sanControl.SetPalletMaster(PalletMaster); setTab(sanControl, tabPageSAN); //FightControlを技能タブに割り当てる fightControl.SetPalletMaster(PalletMaster); setTab(fightControl, tabPageFight); //HistoryAbibilityControlを技能タブに割り当てる historyAbilityControl.SetPalletMaster(PalletMaster); setTab(historyAbilityControl, tabHistoryAblityRole); //MemoControlを技能タブに割り当てる memoControl.SetMainForm(PalletMaster); setTab(memoControl, tabPageMemo); formFontChange(PalletMaster.Setting.font, PalletMaster.Setting.fontSize); }
//キャラクター保管所のtxtデータをキャラクターデータに成形 public Searcher toChangeTxtToData(List <string> al) { var searcher = new Searcher(); searcher.SetDefaultSkills(Proccess.GetSkillSet()); char[] del = { '-', '-', '《', '》', ':', '/', ' ', '%', ' ', '●' }; string importFlg = "base"; foreach (string charaLine in al) { string[] arr = charaLine.Split(del, StringSplitOptions.RemoveEmptyEntries); if (arr.Length == 0) { continue; } switch (arr[0]) { //戦闘系技能のインポート case "■技能■": importFlg = "fightSkill"; break; case "探索系技能": importFlg = "sarchSkill"; break; case "行動系技能": importFlg = "actSkill"; break; case "交渉系技能": importFlg = "negotiationSkill"; break; case "知識系技能": importFlg = "wisdomSkill"; break; case "■戦闘■": importFlg = "fight"; break; } try { if (arr[0].IsAny("職業", "年齢", "出身", "髪の色", "身長", "体重", "STR", "作成時", "成長等", "他修正", "習得", "名称")) { continue; } } catch (Exception e) { Console.WriteLine(e.Message); continue; } switch (importFlg) { case "base": //能力値のインポート if (arr[0] == "=合計=") { int num; searcher.abilityValues.STR = int.TryParse(arr[1], out num) ? num : 0; searcher.abilityValues.CON = int.TryParse(arr[2], out num) ? num : 0; searcher.abilityValues.POW = int.TryParse(arr[3], out num) ? num : 0; searcher.abilityValues.DEX = int.TryParse(arr[4], out num) ? num : 0; searcher.abilityValues.APP = int.TryParse(arr[5], out num) ? num : 0; searcher.abilityValues.SIZ = int.TryParse(arr[6], out num) ? num : 0; searcher.abilityValues.INT = int.TryParse(arr[7], out num) ? num : 0; searcher.abilityValues.EDU = int.TryParse(arr[8], out num) ? num : 0; searcher.characterInfos.HP = int.TryParse(arr[9], out num) ? num : 0; searcher.characterInfos.MP = int.TryParse(arr[10], out num) ? num : 0; } else { //探索者情報のインポート try { searcher.characterInfos.setParameter(arr[0], arr[1]); } catch (Exception exc) { Console.WriteLine(exc.Message); } } break; case "fightSkill": //探索者情報のインポート try { for (int i = 0; i <= arr.Length; i += 2) { var value = int.TryParse(arr[i + 1], out var x) ? x : -1; if (value != -1) { AddSkillSearcher(arr[i], value, "戦闘", searcher); } } } catch (Exception exc) { Console.WriteLine(exc.Message); } break; case "actSkill": if (arr.Length % 2 != 0) { break; } for (int i = 0; i < arr.Length; i += 2) { var value = int.TryParse(arr[i + 1], out var x) ? x : -1; if (value != -1) { AddSkillSearcher(arr[i], value, "行動", searcher); } } break; case "sarchSkill": if (arr.Length % 2 != 0) { break; } //探索者情報のインポート for (int i = 0; i < arr.Length; i += 2) { var value = int.TryParse(arr[i + 1], out var x) ? x : -1; if (value != -1) { AddSkillSearcher(arr[i], value, "探索", searcher); } } break; case "negotiationSkill": if (arr.Length % 2 != 0) { break; } //探索者情報のインポート for (int i = 0; i < arr.Length; i += 2) { var value = int.TryParse(arr[i + 1], out var x) ? x : -1; if (value != -1) { AddSkillSearcher(arr[i], value, "交渉", searcher); } } break; case "wisdomSkill": if (arr.Length % 2 != 0) { break; } //探索者情報のインポート for (int i = 0; i < arr.Length; i += 2) { var value = int.TryParse(arr[i + 1], out var x) ? x : -1; if (value != -1) { AddSkillSearcher(arr[i], value, "知識", searcher); } } break; case "fight": if (arr[0] == "ダメージボーナス") { searcher.characterInfos.setParameter(arr[0], arr[1]); } break; } } return(searcher); }