Пример #1
0
        public Creature(byte speed, DNotation attack, int creatureImage,
            string name, Color color, List<BodyPart> anatomy, int mass, int rngSeed)
        {
            xpBorder = 10;
            level = 1;
            xpWorth = 1;
            hp = 10;
            hpMax = 10;
            mp = 10;
            mpMax = 10;
            gp = 0;
            xp = 0;
            xpLevel = 1;
            rng = new Random(rngSeed);
            this.gold = 0;
            this.attack = new DNotation(attack);
            this.killCount = 0;
            this.food = 15000; //Start with 15000 food units
            this.isPlayer = false;
            this.anatomy = new List<BodyPart>(anatomy);
            this.isAlive = true;
            this.creatureImage = creatureImage;
            this.speed = speed;
            this.turnsToWait = speed;
            this.mind = new Sentience();
            this.name = name;
            this.smelliness = 32;
            this.senseOfSmell = 10;
            this.color = color;
            this.mass = mass;
            this.minDLevel = 1;
            this.rng = new Random(rngSeed);

            foreach (BodyPart b in this.anatomy)
            {
                if (b.flags.HasFlag(BodyPartFlags.CanPickUpItem))
                {
                    this.isDextrous = true;
                    b.flags |= BodyPartFlags.CanUseWeapon;
                }
            }
        }
Пример #2
0
        public Creature(Creature c)
        {
            this.gold = c.gold;
            this.attack = new DNotation(c.attack); //Deep copy
            this.turn_energy = c.turn_energy;
            this.level = c.level;
            this.xpWorth = c.xpWorth;
            this.attack = c.attack;
            this.xp = c.xp;
            this.xpLevel = c.xpLevel;
            this.xpBorder = c.xpBorder;
            this.hp = c.hp;
            this.hpMax = c.hpMax;
            this.mp = c.mp;
            this.mpMax = c.mpMax;
            this.gp = c.gp;
            this.killCount = c.killCount;
            this.seed = c.seed;
            this.food = c.food;
            this.isPlayer = c.isPlayer;
            this.rng = c.rng;
            this.isAlive = true;
            this.creatureImage = c.creatureImage;
            this.speed = c.speed;
            this.turnsToWait = c.speed;
            this.mind = c.mind;
            this.name = c.name;
            this.smelliness = c.smelliness;
            this.senseOfSmell = c.senseOfSmell;
            this.mass = c.mass;
            this.color = c.color;
            this.pos = c.pos;
            this.minDLevel = c.minDLevel;
            this.armorType = c.armorType;
            this.weapon = c.weapon;
            this.strength = c.strength;
            this.dexterity = c.dexterity;
            this.constitution = c.constitution;
            this.intelligence = c.intelligence;
            this.wisdom = c.wisdom;
            this.charisma = c.charisma;

            this.anatomy = new List<BodyPart>();
            foreach (BodyPart b in c.anatomy)
                this.anatomy.Add(new BodyPart(b));

            this.inventory = new List<Item>();
            foreach (Item i in c.inventory)
                this.inventory.Add(i);

            this.wornArmor = new List<Armor>();
            foreach (Armor a in c.wornArmor)
                this.wornArmor.Add(a);

            this.isDextrous = c.isDextrous;
        }