예제 #1
0
        public bool Test()
        {
            XmlDocument doc = new XmlDocument();

            doc.AppendChild(doc.CreateElement("root"));
            Tag t = new Tag()
            {
                Bonus       = 1.4f,
                BonusTarget = "BonusMove",
                Operation   = SupportedOperations.Multiply,
                TagType     = TagType.StatEnhancing,
                Description = "Testy stuff",
            };

            t.SaveXmlRoot(doc);
            foreach (Armor armor in BeastFactory.BoneArmor)
            {
                armor.SaveXmlRoot(doc);
            }

            RangedAttackTag tag = new RangedAttackTag
            {
                AbsoluteLevel = 12, Accuracy = 13, Ammo = 1, AttackName = "Pewpewpew", BaseStat = BaseStat.DX,
                Difficulty    = 13
            };
            var clonetest = tag.Clone() as RangedAttackTag;

            if (!(tag.AbsoluteLevel == clonetest?.AbsoluteLevel &&
                  tag.Accuracy == clonetest.Accuracy &&
                  tag.Ammo == clonetest.Ammo &&
                  tag.AttackName == clonetest.AttackName &&
                  tag.BaseStat == clonetest.BaseStat &&
                  tag.Difficulty == clonetest.Difficulty))
            {
                return(false);
            }

            clonetest.AttackName = "KEYKEYKEY";
            if (tag.AttackName == clonetest.AttackName)
            {
                return(false);
            }



            BodyPlan b = new BodyPlan();

            b = BeastFactory.BodyPlans[12];
            b.SaveXmlRoot(doc);

            Milieu m = new Milieu();

            m = BeastFactory.Milieux[3];
            m.SaveXmlRoot(doc);
            doc.Save("tagTest.xml");
            t.LoadXml(doc.DocumentElement.LastChild as XmlElement);

            return(true);
        }
예제 #2
0
        static Milieu()
        {
            List <Milieu> milieux = new List <Milieu>(5);

            for (int i = 0; i < 5; ++i)
            {
                Milieu m = new Milieu()
                {
                    BonusTarget = "BonusMove",
                    TagType     = TagType.MovementType,
                    Operation   = SupportedOperations.Multiply,
                    Bonus       = 1f,
                };
                string description = "";
                switch (i)
                {
                case 0:                         //Underground
                    description =
                        " the creature is covered in debris, it looks like it can burrow as easily as it can walk";
                    m.CanTrample = true;
                    break;

                case 1:                         //Terrestrial
                    description =
                        " this beast seems to have a good physique... it's probably a fast runner";
                    m.Bonus      = 2f;
                    m.CanTrample = true;

                    break;

                case 2:                         //Liquid
                    description =
                        " this monster is probably in its element in water.";
                    m.Bonus = 2f;

                    break;

                case 3:                         //Flier- Hover
                    description =
                        " this creature is hovering in place high above";
                    m.Bonus      = 2f;
                    m.Difficulty = 10;
                    break;

                case 4:                         //Flier-Fighter Jet
                    description =
                        " this beast arcs and wheels, never staying in place for a moment";
                    m.Difficulty = 15;
                    m.Bonus      = 3f;
                    break;
                }

                m.Description = description;
                milieux.Add(m);
            }

            BeastFactory.Milieux = milieux.ToArray();
        }