public void OnButtonClick()
    {
        Character myChar = new Character();

        Feat           temp      = null;
        CharacterClass tempClass = null;

        if (AppLibary.featDictionary.TryGetValue(AppLibary.AlignmentChannel, out temp))
        {
            Debug.Log(temp.featName);
            Debug.Log(temp.features);
            Debug.Log(temp.description);
            Debug.Log(temp.special);
        }

        if (AppLibary.characterClassDictionary.TryGetValue(AppLibary.Fighter, out tempClass))
        {
            Debug.Log(tempClass.className);
            Debug.Log(tempClass.description);
            Debug.Log(tempClass.role);
            Debug.Log(tempClass.alignment);
            Debug.Log(tempClass.hitDie);
            Debug.Log(tempClass.classSkills);
            Debug.Log(tempClass.skillRanksLevel);

            ClassAbility tempClassAbility = null;
            if (tempClass.characterClassAbilities.TryGetValue(AppLibary.Bravery, out tempClassAbility))
            {
                Debug.Log(tempClassAbility.abilityName);
                Debug.Log(tempClassAbility.description);
                Debug.Log(tempClassAbility.feature);
            }
        }
    }
示例#2
0
        public static List <ClassAbility> GetListOfClassAbility()
        {
            List <ClassAbility> listofClassAbilities = new List <ClassAbility>();
            ClassAbility        SecondWind           = GetClassAbility();

            listofClassAbilities.Add(SecondWind);

            ClassAbility SpellMastery = new ClassAbility
            {
                ClassAbility_id = Guid.Parse("19e51104-8590-4199-b7e2-079993bb8ccb"),
                Class_id        = Guid.Parse("4e82620a-0496-4ecc-b6d4-05faa064310b"),
                Name            = "Spell Master",
                Description     = "Choose a 1st level spell and a 2nd level spell in your spellbook. As long as you have them prepared, you can cast them without consuming a spell slot.",
                LevelLearned    = 18
            };

            listofClassAbilities.Add(SpellMastery);

            ClassAbility Vanish = new ClassAbility
            {
                ClassAbility_id = Guid.Parse("97bd8231-a001-4228-824f-7606202913b0"),
                Class_id        = Guid.Parse("969c08ca-f983-4ddd-b351-31962f2429cd"),
                Name            = "Vanish",
                Description     = "You can Hide as a bonus action.",
                LevelLearned    = 14
            };

            listofClassAbilities.Add(Vanish);
            return(listofClassAbilities);
        }
示例#3
0
 public ClassCardInfo(string className, int defensePoint, int classAbilityTokensCount, ClassAbility classAbility)
 {
     this.className               = className;
     this.defensePoint            = defensePoint;
     this.classAbilityTokensCount = classAbilityTokensCount;
     this.classAbility            = classAbility;
 }
示例#4
0
文件: Ability.cs 项目: mxgmn/GENW
 public bool Has(ClassAbility ability)
 {
     if (ability == null) return true;
     else
     {
         bool isLearned = t.xp == null ? true : t.xp.learned.Contains(ability);
         return list.Contains(ability) && isLearned;
     }
 }
示例#5
0
文件: Item.cs 项目: mxgmn/GENW
    public override void Load(XmlNode xnode)
    {
        name = MyXml.GetString(xnode, "name");
        weight = MyXml.GetFloat(xnode, "weight");
        value = MyXml.GetFloat(xnode, "value");
        isRenewable = MyXml.GetBool(xnode, "renewable");
        craftingComplexity = MyXml.GetInt(xnode, "crafting");

        string s = MyXml.GetString(xnode, "requires");
        if (s != "") requirement = ClassAbility.Get(s);
    }
示例#6
0
        public static ClassAbility GetClassAbility()
        {
            ClassAbility SecondWind = new ClassAbility
            {
                ClassAbility_id = Guid.Parse("500f04e7-d080-4ba8-9a22-57a64d5f6a25"),
                Class_id        = Guid.Parse("15478d70-f96e-4c14-aeaf-4a1e35605874"),
                Name            = "Second Wind",
                Description     = "You have a limited well of stamina you can draw upon to protect yourself from harm.",
                LevelLearned    = 1
            };

            return(SecondWind);
        }
        public void ClassAbilitiesRepo_GetAbilitiesOfClassAtOrBelowLevel_ValidCall()
        {
            //Arrange
            List <ClassAbility> listofClassAbility = CreateTestData.GetListOfClassAbility();

            var mockSet = new Mock <DbSet <ClassAbility> >()
                          .SetupData(listofClassAbility, o =>
            {
                return(listofClassAbility.Single(x => x.ClassAbility_id.CompareTo(o.First()) == 0));
            });
            ClassAbility expected = new ClassAbility
            {
                ClassAbility_id = Guid.Parse("97bd8231-a001-4228-824f-7606202913b0"),
                Class_id        = Guid.Parse("969c08ca-f983-4ddd-b351-31962f2429cd"),
                Name            = "Vanish",
                Description     = "You can Hide as a bonus action.",
                LevelLearned    = 14
            };
            var notExpected1 = CreateTestData.GetClassAbility();
            var notExpected2 = new ClassAbility
            {
                ClassAbility_id = Guid.Parse("19e51104-8590-4199-b7e2-079993bb8ccb"),
                Class_id        = Guid.Parse("4e82620a-0496-4ecc-b6d4-05faa064310b"),
                Name            = "Spell Master",
                Description     = "Choose a 1st level spell and a 2nd level spell in your spellbook. As long as you have them prepared, you can cast them without consuming a spell slot.",
                LevelLearned    = 18
            };

            using (var mockContext = AutoMock.GetLoose())
            {
                mockContext.Mock <PlayableClassContext>()
                .Setup(x => x.ClassAbilities).Returns(mockSet.Object);

                //Act
                var toTest = mockContext.Create <ClassAbilityRepository>();
                var actual = toTest.GetAbilitiesOfClassAtOrBelowLevel(expected.Class_id, 14);

                //Assert
                actual.Should().ContainEquivalentOf(expected);
                actual.Should().NotContain(notExpected1);
                actual.Should().NotContain(notExpected2);
                actual.Should().NotContainNulls();
                actual.Should().NotBeEmpty();
            }
        }
示例#8
0
文件: Skill.cs 项目: mxgmn/GENW
 public override void Load(XmlNode xnode)
 {
     name = MyXml.GetString(xnode, "name");
     description = MyXml.GetString(xnode, "description");
     bonus = new Bonus(xnode);
     ability = BigBase.Instance.abilities.Get(MyXml.GetString(xnode, "ability"));
 }
示例#9
0
 public bool HasAbility(ClassAbility a)
 {
     return party.Where(c => c.abilities.Has(a)).Count() > 0;
 }
示例#10
0
 public void RemoveClassAbility(ClassAbility toBeRemoved)
 {
     _worker.ClassAbilities.Remove(toBeRemoved);
 }
示例#11
0
 public void AddAbility(ClassAbility ability)
 {
     _worker.ClassAbilities.Add(ability);
 }