Ejemplo n.º 1
0
        public Player(int id, string textureSheetFileName, Vector2 pos, Class pClass, int time)
            : base(id, textureSheetFileName, pos, time)
        {
            currKeyState = Keyboard.GetState();
            currMouseState = Mouse.GetState();

            maxHealth = 100;

            playerClass = pClass;

            weaponTextureFilePath = "Textures/basicAxe";
            weaponSFXFilePath = "SoundEffects/Magic";

            head = new Hat(0);
            body = new Shirt(0);
            weapon = new Axe(0);
            feet = new Boots(0);

            isClassSet = false;

            if (playerClass == Class.Soldier)
            {
                damage = 3;
                speed = 1;
                attackSpeed = 2;
                range = 30;

                EquipWeapon(new Axe(0));
            }
            else if (playerClass == Class.Thief)
            {
                damage = 1;
                speed = 3;
                attackSpeed = 4;
                range = 40;

                EquipWeapon(new Dagger(0));
            }
            else if (playerClass == Class.Wizard)
            {
                damage = 2;
                speed = 2.5f;
                attackSpeed = 3;
                range = 50;

                EquipWeapon(new Staff(0));
            }

            sprites.Add(new Rectangle(0, 0, 16, 16));
            sprites.Add(new Rectangle(17, 0, 14, 16));
            sprites.Add(new Rectangle(33, 0, 14, 16));
        }
Ejemplo n.º 2
0
        public void EquipWeapon(Equipment wpn)
        {
            damage -= (int)weapon.GetMagnitude();

            weapon = wpn;

            damage += (int)weapon.GetMagnitude();
        }
Ejemplo n.º 3
0
        public void EquipFootwear(Equipment footwear)
        {
            speed -= feet.GetMagnitude();

            feet = footwear;

            speed += feet.GetMagnitude();
        }
Ejemplo n.º 4
0
        public void EquipHeadGear(Equipment helmet)
        {
            range -= (int)head.GetMagnitude();

            head = helmet;

            range += (int)head.GetMagnitude();
        }
Ejemplo n.º 5
0
        public void EquipArmour(Equipment armour)
        {
            maxHealth -= (int)body.GetMagnitude();

            body = armour;

            maxHealth += (int)body.GetMagnitude();

            currentHealth = maxHealth;
        }