Esempio n. 1
0
 public Buff(Texture2D texture, Controller controller, int maxTurns)
 {
     this.texture = texture;
     this.maxTurns = maxTurns;
     this.controller = controller;
     turns = this.maxTurns;
 }
Esempio n. 2
0
 public Ray(Controller controller, Point origin, Vector2 direction, int viewDistance)
 {
     this.origin = origin;
     this.direction = direction;
     this.direction.Normalize();
     this.controller = controller;
     this.viewDistance = viewDistance;
 }
Esempio n. 3
0
 public Room(Controller controller, Map map, Point cornerLeftUp, Point cornerRightDown)
 {
     this.controller = controller;
     this.map = map;
     cornerNW = cornerLeftUp;
     cornerSE = cornerRightDown;
     width = cornerSE.X - cornerNW.X;
     height = cornerSE.Y - cornerNW.Y;
 }
Esempio n. 4
0
        public Player(Controller controller)
        {
            this.controller = controller;
            state = Keyboard.GetState();
            position = new Point(0, 0);
            health = maxHealth;
            delay = maxDelay;

            map = controller.map;
        }
Esempio n. 5
0
        public Map(Controller controller, int floorSize)
        {
            this.controller = controller;
            this.floorSize = floorSize;

            GenerateEmptyFloor();
            mapString = ArrayToString(mapArray);

            mouse = Mouse.GetState();
        }
Esempio n. 6
0
 public Camera(Controller controller, Point position, int tileSize)
 {
     this.controller = controller;
     this.tileSize = tileSize;
     this.position = position;
     this.graphics = controller.graphics;
     map = controller.map;
     scale = map.scale;
     maxTilesX = (int)Math.Ceiling(((float)graphics.PreferredBackBufferWidth / ((float)tileSize * scale)));
     maxTilesY = (int)Math.Ceiling(((float)graphics.PreferredBackBufferHeight / ((float)tileSize * scale)));
 }
Esempio n. 7
0
        public Enemy(Controller controller, Point position, EnemyType enemyType)
        {
            this.position = position;
            this.controller = controller;

            switch (enemyType) //ADDENEMY
            {
                case EnemyType.Skeleton:
                    {
                        texture = ContentManager.tSkeleton;
                        damage = 2;
                        maxHealth = 10;
                        viewDistance = 4;
                        expValue = 5;
                        dropRate = 8;
                        break;
                    }
                case EnemyType.Bat:
                    {
                        texture = ContentManager.tBat;
                        damage = 1;
                        maxHealth = 8;
                        viewDistance = 6;
                        dropRate = 6;
                        expValue = 3;
                        break;
                    }
            }
            //DIFFICULTY SCALING
            int scale = (int)(controller.level / 3);
            maxHealth += scale;
            damage += scale;
            expValue += scale;

            health = maxHealth;
            if (CanSeePlayer())
            {
                asleep = false;
            }
        }
Esempio n. 8
0
 public Inventory(Controller controller)
 {
     this.controller = controller;
     player = controller.player;
 }
Esempio n. 9
0
 public Gameplay(GraphicsDeviceManager graphics)
 {
     this.graphics = graphics;
     controller = new Controller(graphics);
 }
Esempio n. 10
0
        public Item(Controller controller, Point position, Map.Element baseElem)
        {
            this.controller = controller;
            this.position = position;
            this.baseElem = baseElem;

            Rarity rarity = RollRarity();

            int random;
            switch (rarity)
            {
                case Rarity.Common:
                    random = controller.random.Next(commonArray.Length);
                    itemType = commonArray[random];
                    break;

                case Rarity.Uncommon:
                    random = controller.random.Next(uncommonArray.Length);
                    itemType = uncommonArray[random];
                    break;

                case Rarity.Rare:
                    random = controller.random.Next(rareArray.Length);
                    itemType = rareArray[random];
                    break;
            }

            switch (itemType)//ADDITEM
            {
                case ItemType.Potion:
                    {
                        texture = ContentManager.tPotion;
                        itemCat = ItemCat.Consumable;
                        break;
                    }
                case ItemType.HealingPotion:
                    {
                        texture = ContentManager.tHealingPotion;
                        itemCat = ItemCat.Consumable;
                        break;
                    }
                case ItemType.PotionRed:
                    {
                        texture = ContentManager.tPotionRed;
                        itemCat = ItemCat.Consumable;
                        break;
                    }
                case ItemType.BigSword:
                    {
                        texture = ContentManager.tBigSword;
                        itemCat = ItemCat.Weapon;

                        damageStat = 5;
                        break;
                    }
                case ItemType.Shield:
                    {
                        texture = ContentManager.tShield;
                        itemCat = ItemCat.Armor;

                        defenseStat = 1;
                        break;
                    }
                case ItemType.PlateArmor:
                    {
                        texture = ContentManager.tPlateArmor;
                        itemCat = ItemCat.Armor;

                        defenseStat = 4;
                        break;
                    }
                case ItemType.BrokenSword:
                    {
                        texture = ContentManager.tBrokenSword;
                        itemCat = ItemCat.Weapon;

                        damageStat = 2;
                        break;
                    }
            }

            if (itemCat == ItemCat.Armor || itemCat == ItemCat.Weapon)
            {
                if (controller.random.Next(BONUSCHANCE) == BONUSCHANCE - 1)
                {
                    if (damageStat > 0)
                    {
                        bonusStat = controller.random.Next(damageStat) + 1;
                        damageStat += bonusStat;
                    }
                    if (defenseStat > 0)
                    {
                        bonusStat = controller.random.Next(defenseStat) + 1;
                        defenseStat += bonusStat;
                    }
                }
            }
        }