示例#1
0
        public static void returnSoul(Zone zone)
        {
            int numSouls    = Convert.ToInt32(zone.getNumberOfSouls());
            int soulsOnHand = PointAndCurency.GetSouls();

            if (zone.GetZoneType() >= 2)
            {
                zone.setNumberOfSouls(numSouls + 1);
                PointAndCurency.SetSouls(soulsOnHand - 1);
            }



            /*foreach (var soul in souls)
             * {
             *  if (soul.soulName == "currency")
             *  {
             *      soul.soulName = "alive";
             *      soul.age = 0;
             *      soul.maxAge = random.Next(30, 140);
             *      soul.goodLevel = soul.goodLevel - 2;
             *
             *  }
             * }*/
        }
示例#2
0
        public override void Update(GameTime gameTime)
        {
            zoneSelected = Zone.GetSelectedZone();
            if (zoneSelected == null)
            {
                this.Visible = true;
                this.Enabled = true;
            }
            else
            {
                //Getting Zone Information
                idString            = zoneSelected.getZoneIDString();
                typeString          = zoneSelected.getZoneName(zoneSelected.GetZoneType()); //get zone type int.. give it to the GetZoneName and receive string with name of zone type
                upgradeCostString   = zoneSelected.getUpgradeCost();
                numberOfSoulsString = zoneSelected.getNumberOfSouls();

                this.Visible = true;
                this.Enabled = true;

                currentMouseState = Mouse.GetState();
                if (currentMouseState.LeftButton == ButtonState.Released && pastMouseState.LeftButton == ButtonState.Pressed && cashSoulsRectanglePosition.Contains(currentMouseState.X, currentMouseState.Y))
                {
                    CashSouls();
                }
                if (currentMouseState.LeftButton == ButtonState.Released && pastMouseState.LeftButton == ButtonState.Pressed && upgradeRectanglePosition.Contains(currentMouseState.X, currentMouseState.Y))
                {
                    if (Zone.GetSelectedZone().GetZoneType() != 5)
                    {
                        splash.Play();
                    }
                    Upgrade(Zone.GetSelectedZone());
                }
                if (currentMouseState.LeftButton == ButtonState.Released && pastMouseState.LeftButton == ButtonState.Pressed && returnSoulsRectanglePosition.Contains(currentMouseState.X, currentMouseState.Y))
                {
                    returnSouls();
                }

                /*  if (currentMouseState.LeftButton == ButtonState.Released && pastMouseState.LeftButton == ButtonState.Pressed && cashSoulsRectanglePosition.Contains(currentMouseState.X, currentMouseState.Y))
                 * {
                 *    CashSouls();
                 * }*/
                pastMouseState = currentMouseState;
            }
            base.Update(gameTime);
        }
示例#3
0
        public static void returnSoul(Zone zone)
        {
            int numSouls = Convert.ToInt32(zone.getNumberOfSouls());
            int soulsOnHand = PointAndCurency.GetSouls();

            if (zone.GetZoneType() >= 2)
            {
                zone.setNumberOfSouls(numSouls + 1);
                PointAndCurency.SetSouls(soulsOnHand - 1);
            }

            /*foreach (var soul in souls)
            {
                if (soul.soulName == "currency")
                {
                    soul.soulName = "alive";
                    soul.age = 0;
                    soul.maxAge = random.Next(30, 140);
                    soul.goodLevel = soul.goodLevel - 2;

                }
            }*/
        }
示例#4
0
        public override void Update(GameTime gameTime)
        {
            zoneSelected = Zone.GetSelectedZone();
            if (zoneSelected == null)
            {
                this.Visible = true;
                this.Enabled = true;
            }
            else
            {
                //Getting Zone Information
                idString = zoneSelected.getZoneIDString();
                typeString = zoneSelected.getZoneName(zoneSelected.GetZoneType()); //get zone type int.. give it to the GetZoneName and receive string with name of zone type
                upgradeCostString = zoneSelected.getUpgradeCost();
                numberOfSoulsString = zoneSelected.getNumberOfSouls();

                this.Visible = true;
                this.Enabled = true;

                currentMouseState = Mouse.GetState();
                if (currentMouseState.LeftButton == ButtonState.Released && pastMouseState.LeftButton == ButtonState.Pressed && cashSoulsRectanglePosition.Contains(currentMouseState.X, currentMouseState.Y))
                {
                    CashSouls();
                }
                if (currentMouseState.LeftButton == ButtonState.Released && pastMouseState.LeftButton == ButtonState.Pressed && upgradeRectanglePosition.Contains(currentMouseState.X, currentMouseState.Y))
                {
                    if (Zone.GetSelectedZone().GetZoneType() != 5)
                    {
                        splash.Play();
                    }
                    Upgrade(Zone.GetSelectedZone());
                }
                if (currentMouseState.LeftButton == ButtonState.Released && pastMouseState.LeftButton == ButtonState.Pressed && returnSoulsRectanglePosition.Contains(currentMouseState.X, currentMouseState.Y))
                {
                    returnSouls();
                }

              /*  if (currentMouseState.LeftButton == ButtonState.Released && pastMouseState.LeftButton == ButtonState.Pressed && cashSoulsRectanglePosition.Contains(currentMouseState.X, currentMouseState.Y))
                {
                    CashSouls();
                }*/
                pastMouseState = currentMouseState;
            }
            base.Update(gameTime);
        }