Example #1
0
 public CharWord(DTO.ArknightData.CharWordJson word)
 {
     OperatorId = ArknightUtil.GetId(word.CharId);
     Title      = word.VoiceTitle;
     Text       = word.VoiceText;
     Index      = word.VoiceIndex;
 }
Example #2
0
 public Talent(DTO.ArknightData.Candidate c)
 {
     Phase            = c.UnlockCondition.Phase;
     RequirePotential = c.RequiredPotentialRank;
     Name             = c.Name;
     Description      = ArknightUtil.RemoveBrackets(c.Description);
 }
Example #3
0
 public Skills(Skill skill)
 {
     SkillName        = skill.SkillName;
     SkillCode        = skill.SkillCode;
     SkillDescription = skill.SkillDescription;
     SkillType        = ArknightUtil.GetSkillType(skill.SkillType);
     SpType           = ArknightUtil.GetSPType(skill.SpType);
     ChargeTime       = skill.ChargeTime;
     MaxChargeTime    = skill.MaxChargeTime;
     SpCost           = skill.SpCost;
     MaxSpCost        = skill.MaxSpCost;
     InitSp           = skill.InitSp;
     MaxInitSp        = skill.MaxInitSp;
     Increment        = skill.Increment;
     Duration         = skill.Duration;
     MaxDuration      = skill.MaxDuration;
     RangeId          = skill.RangeId;
     MasteryLevels    = new List <MasteryLevel>();
     if (skill.MasteryUpCosts != null)
     {
         var level = skill.MasteryUpCosts.GroupBy(m => m.Level).OrderBy(group => group.Key);
         foreach (var l in level)
         {
             MasteryLevels.Add(new MasteryLevel(l));
         }
     }
 }
Example #4
0
        public async Task <Dictionary <string, List <string> > > GetOperatorByTag(List <string> tags)
        {
            try
            {
                List <List <string> > recruit = new List <List <string> >();
                List <string>         tagName = new List <string>();
                foreach (string s in tags)
                {
                    Tag res = await applicationDbContext.Tags
                              .Where(t => t.TagName.ToLower().Contains(s.ToLower()))
                              .Include(t => t.OperatorTags.OrderBy(o => o.Operator.Name))
                              .ThenInclude(o => o.Operator)
                              .SingleOrDefaultAsync();

                    List <string> name = new List <string>();
                    if (res != null && res.OperatorTags != null)
                    {
                        foreach (OperatorTag t in res.OperatorTags)
                        {
                            name.Add(t.Operator.Name);
                        }
                        recruit.Add(name);
                        tagName.Add(res.TagName);
                    }
                }
                return(ArknightUtil.CreateRecruit(recruit, tagName));
            }
            catch (Exception e)
            {
                throw e;
            }
        }
        public async Task  AddInfo(Dictionary <string, Data.DTO.ArknightData.CharInfo> dic)
        {
            try
            {
                var info = new List <Data.Model.CharInfo>();
                foreach (var item in dic)
                {
                    if (item.Key.Contains("char"))
                    {
                        int      id = ArknightUtil.GetId(item.Value.CharID);
                        Operator op = await applicationDb.Operators
                                      .Where(o => o.OperatorId == id)
                                      .SingleAsync();

                        op.Artist = item.Value.DrawName;
                        op.CV     = item.Value.InfoName;
                        applicationDb.Update(op);
                        if (item.Value.StoryTextAudio.Any())
                        {
                            foreach (StoryTextAudio ci in item.Value.StoryTextAudio)
                            {
                                info.Add(new Data.Model.CharInfo(id, ci));
                            }
                        }
                    }
                }
                await applicationDb.AddRangeAsync(info);

                await applicationDb.SaveChangesAsync();
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Example #6
0
 public Buff(BaseBuff b)
 {
     BuffName     = b.BuffName;
     BuffIcon     = b.BuffIcon;
     SkillIcon    = b.SkillIcon;
     BuffCategory = b.BuffCategory;
     Description  = b.Description;
     RoomType     = ArknightUtil.GetRoom(b.BuffIcon);
     Phase        = b.Phase;
     Lvl          = b.Lvl;
 }
Example #7
0
 public Item(DTO.ArknightData.ItemDetail item)
 {
     ItemId       = int.Parse(item.ItemId);
     Name         = item.Name;
     Desc         = item.Description;
     IconId       = item.IconId;
     Rarity       = ArknightUtil.CalculateRarity(item.Rarity);
     Usage        = item.Usage;
     ClassifyType = item.ClassifyType;
     ItemType     = item.ItemType;
 }
Example #8
0
 public BaseBuff(DTO.ArknightData.BaseBuff baseBuff, DTO.ArknightData.CharBuff charBuff, Cond cond, int i)
 {
     OperatorId   = ArknightUtil.GetId(charBuff.CharId);
     BuffCode     = baseBuff.BuffId;
     BuffName     = baseBuff.BuffName;
     BuffIcon     = baseBuff.BuffIcon;
     SkillIcon    = baseBuff.SkillIcon;
     BuffCategory = baseBuff.BuffCategory;
     Description  = ArknightUtil.RemoveBrackets(baseBuff.Description);
     Phase        = cond.Phase;
     Lvl          = cond.Lvl;
     Order        = i;
 }
        public BasicFile(CharInfo charInfo)
        {
            string[] text    = charInfo.StoryText.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None);
            string   pattern = "\\[(.*?)\\]";
            Regex    regex   = new Regex(pattern, RegexOptions.IgnoreCase);

            foreach (string t in text)
            {
                Match m = regex.Match(t);
                Console.WriteLine("Basic" + "  " + m.Value);
                if (m.Success)
                {
                    if (m.Value.Contains("Code Name"))
                    {
                        CodeName = ArknightUtil.GetInfoText(t);
                    }
                    else if (m.Value.Contains("Gender"))
                    {
                        Gender = ArknightUtil.GetInfoText(t);
                    }
                    else if (m.Value.Contains("Combat Experience"))
                    {
                        CombatExperience = ArknightUtil.GetInfoText(t);
                    }
                    else if (m.Value.Contains("Place of Birth"))
                    {
                        PlaceOfBirth = ArknightUtil.GetInfoText(t);
                    }
                    else if (m.Value.Contains("Date of Birth"))
                    {
                        DateOfBirth = ArknightUtil.GetInfoText(t);
                    }
                    else if (m.Value.Contains("Race"))
                    {
                        Race = ArknightUtil.GetInfoText(t);
                    }
                    else if (m.Value.Contains("Height"))
                    {
                        Height = ArknightUtil.GetInfoText(t);
                    }
                    else if (m.Value.Contains("Infection Status"))
                    {
                        InfectionStatus = text.Last().Trim();
                    }
                }
            }
        }
Example #10
0
 public Skin(DTO.ArknightData.SkinJson sk)
 {
     SkinCode       = sk.SkinId;
     OperatorId     = ArknightUtil.GetId(sk.CharId);
     IllustId       = sk.IllustId;
     AvatarId       = sk.AvatarId;
     PortraitId     = sk.PortraitId;
     Artist         = sk.DisplaySkin.DrawerName;
     SkinGroupName  = sk.DisplaySkin.SkinGroupName;
     Content        = ArknightUtil.RemoveSkinTag(sk.DisplaySkin.Content);
     Usage          = sk.DisplaySkin.Usage;
     Desc           = sk.DisplaySkin.Description;
     Dialog         = sk.DisplaySkin.Dialog;
     DisplayName    = sk.DisplaySkin.SkinName;
     ObtainApproach = sk.DisplaySkin.ObtainApproach;
     Console.WriteLine("content: " + Content);
 }
Example #11
0
        public void UpdateSkill(SkillJson skill)
        {
            Level first = skill.Levels.First();
            Level last  = skill.Levels.Last();

            SkillName        = first.Name;
            SkillDescription = ArknightUtil.ReplaceSkillDesc(skill.Levels.First().Description, first.Blackboard, last.Blackboard);
            SkillType        = first.SkillType;
            SpType           = first.SpData.SpType;
            ChargeTime       = first.SpData.MaxChargeTime;
            MaxChargeTime    = last.SpData.MaxChargeTime;
            SpCost           = first.SpData.SpCost;
            MaxSpCost        = last.SpData.SpCost;
            Increment        = first.SpData.Increment;
            Duration         = first.Duration;
            MaxDuration      = last.Duration;
            RangeId          = first.RangeId;
        }
Example #12
0
        public PhysicalExam(CharInfo info)
        {
            string[] text    = info.StoryText.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None);
            string   pattern = "\\[(.*?)\\]";
            Regex    regex   = new Regex(pattern, RegexOptions.IgnoreCase);

            foreach (string t in text)
            {
                Match m = regex.Match(t);
                if (m.Success)
                {
                    if (m.Value.Contains("Physical Strength"))
                    {
                        PhysicalStrength = ArknightUtil.GetInfoText(t);
                    }
                    else if (m.Value.Contains("Mobility"))
                    {
                        Mobility = ArknightUtil.GetInfoText(t);
                    }
                    else if (m.Value.Contains("Physical Resilience"))
                    {
                        PhysicalResilience = ArknightUtil.GetInfoText(t);
                    }
                    else if (m.Value.Contains("Tactical Acumen"))
                    {
                        TacticalAcumen = ArknightUtil.GetInfoText(t);
                    }
                    else if (m.Value.Contains("Combat Skill"))
                    {
                        CombatSkill = ArknightUtil.GetInfoText(t);
                    }
                    else if (m.Value.Contains("Originium Arts Assimilation"))
                    {
                        OriginiumAdaptability = ArknightUtil.GetInfoText(t);
                    }
                }
            }
        }
        public async Task AddOpTag(List <RecruitJson> recruits)
        {
            try
            {
                List <OperatorTag> ot = new List <OperatorTag>();
                foreach (RecruitJson r in recruits)
                {
                    Operator op = await applicationDb.Operators
                                  .Where(o => o.Name.ToLower().Equals(r.Name.ToLower()))
                                  .Select(o => new Operator()
                    {
                        OperatorId = o.OperatorId
                    })
                                  .SingleOrDefaultAsync();

                    if (op != null)
                    {
                        foreach (string e in r.TagList)
                        {
                            int tagId = ArknightUtil.GetTagId(e);
                            if (tagId != 0)
                            {
                                ot.Add(new OperatorTag(op.OperatorId, tagId));
                            }
                        }
                    }
                }
                await applicationDb.AddRangeAsync(ot);

                await applicationDb.SaveChangesAsync();
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Example #14
0
 public Operator(string key, Character character)
 {
     OperatorId         = ArknightUtil.GetId(key);
     OperatorCode       = key;
     Name               = character.Name;
     Description        = ArknightUtil.RemoveBrackets(character.Description);
     Team               = ArknightUtil.GetTeam(character.Team);
     DisplayNumber      = character.DisplayNumber;
     Position           = character.Position;
     DisplayLogo        = character.DisplayLogo;
     ItemUsage          = character.ItemUsage;
     ItemDesc           = character.ItemDesc;
     ItemObtainApproach = character.ItemObtainApproach;
     IsNotObtainable    = character.IsNotObtainable;
     Rarity             = ArknightUtil.CalculateRarity(character.Rarity);
     Profession         = ArknightUtil.GetClass(character.Profession);
     TagList            = ArknightUtil.JoinListTag(character.TagList);
     if (character.Trait != null)
     {
         Trait = ArknightUtil.RemoveBrackets(character.Trait.OverrideDescription);
     }
     Elites = new List <Elite>();
     foreach (Phase p in character.Phases)
     {
         Elite e = new Elite(p);
         Elites.Add(e);
     }
     Skills = new List <Skill>();
     foreach (DTO.ArknightData.Skill s in character.Skills)
     {
         var skill = new Skill(s);
         Skills.Add(skill);
     }
     Talents = new List <Talent>();
     if (character.Talents != null)
     {
         foreach (DTO.ArknightData.Talent t in character.Talents)
         {
             if (t.Candidates != null)
             {
                 foreach (Candidate c in t.Candidates)
                 {
                     var talent = new Talent(c);
                     Talents.Add(talent);
                 }
             }
         }
     }
     AllSkillUps = new List <AllSkillUp>();
     if (character.AllSkillLvlup != null)
     {
         int index = 1;
         foreach (AllSkillLvlup all in character.AllSkillLvlup)
         {
             var allSkill = new AllSkillUp(all, index);
             AllSkillUps.Add(allSkill);
             index++;
         }
     }
     Potentials = new List <Potential>();
     if (character.PotentialRanks != null)
     {
         int index = 1;
         foreach (var p in character.PotentialRanks)
         {
             Potentials.Add(new Potential(p, index));
             index++;
         }
     }
 }