Exemple #1
0
        public override object Clone()
        {
            BodyPlan clone = new BodyPlan();

            this.Copy(this, clone);
            return(clone);
        }
Exemple #2
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);
        }
Exemple #3
0
        static BodyPlan()
        {
            List <BodyPlan> bodyPlans = new List <BodyPlan>();

            for (int i = 0; i < 7; ++i)
            {
                BodyPlan plan = new BodyPlan()
                {
                    Bonus       = 1,
                    TagType     = TagType.Other,
                    BonusTarget = "MoveMultiplier",
                    Difficulty  = 0,
                    Limbs       = i * 2,
                    LimbLength  = (int)Math.Floor(App.rng.Next(2, 6) / 2f),
                };
                string description = "";
                switch (i)
                {
                case 0:
                    description = "with no legs, this creature seems to be one long mass of muscle... or stomach.";
                    break;

                case 1:
                    description =
                        "something is maddeningly familiar about this one... or perhaps it is simply that with two legs, it moves in a twisted mockery of your own motion.";
                    break;

                case 2:
                    description =
                        "this beast feels right, somehow.  Perhaps it is your imagination, but something seems to resonate, as though 4 is the proper number of limbs a creature should have.";
                    plan.Bonus = 2;

                    break;

                case 3:
                    description =
                        "six limbs leave you unsettled, or would have, once, had you not seen so many like it.  You can almost remember what it was like to be horrified by the very existence of a beast like this...";
                    plan.Bonus = 2;
                    break;

                case 4:
                    description =
                        "eight limbs call to mind things that scuttle and scurry on the periphery of your vision.  They strike in the night, from concealment.  At least this beast will not do you that discourtesy.";
                    plan.Bonus = 2;
                    break;

                case 5:
                    description =
                        "10 limbs is... too many.  Even motionless, they evoke images of squeezing crowding squirming wriggling dripping in the dark...  Somehow they are always moving closer, even when you think you've finished them off...";
                    plan.Bonus = 2;
                    break;

                case 6:
                    description =
                        "cut off a limb and 2 grow to replace it- an endless forest of limbs, seeking twisting ripping... they won't stop.  They'll never stop. They'll rip you open and drink deeply of you, and immediately forget you, nothing more than an hors d'oeuvre.  Even if you kill them those filthy legs will be scratching around in your mind for years to come.";
                    plan.Bonus = 3;
                    break;
                }

                plan.Description = description;
                bodyPlans.Add(plan);
            }

            for (int i = 3; i < 14; ++i)
            {
                BodyPlan plan = new BodyPlan()
                {
                    Bonus             = (int)(Math.Ceiling(i / 4.0f) - 1),
                    TagType           = TagType.Other,
                    BonusTarget       = "BonusHP",
                    Difficulty        = (int)(Math.Ceiling(i / 4.0f) - 1),
                    HasRadialSymmetry = true,
                    Limbs             = i,
                    LimbLength        = App.rng.Next(1, 4),
                };
                string description = "";
                switch (i)
                {
                case 3:
                case 4:
                case 5:
                case 6:
                    description =
                        $"with {i} limbs arrayed evenly around its body, everything about this creature's movement seems preternatural.  The limbs move chaotically, with no pattern you can deduce save for one: it knows where you are, and it's coming.";
                    break;

                case 7:
                case 8:
                case 9:
                case 10:
                    description =
                        $" {i} limbs around this creature evenly spaced makes it seem at first like a monstrous spider, but would that such a comforting lie could be true.  This beast is always watching you, even in retreat, and quick to punish those who seek to take advantage of an opening.";
                    break;

                case 11:
                case 12:
                case 13:
                case 14:
                    description =
                        $"Flexible limbs seem to jut out everywhere... {i - 2}... {i}.  The writhing mass of them makes your skin squirm, as though they are already caressing your neck, tearing your flesh away in implausibly neat strips.";
                    break;
                }

                plan.Description = description;
                bodyPlans.Add(plan);
            }

            BeastFactory.BodyPlans = bodyPlans.ToArray();
        }