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; * * } * }*/ }
public override void Update(GameTime gameTime) { zoneSelected = Zone.GetSelectedZone(); if (zoneSelected == null) { this.Visible = false; 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(); 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)) { Upgrade(Zone.GetSelectedZone()); } pastMouseState = currentMouseState; } base.Update(gameTime); }
public override void Update(GameTime gameTime) { zoneSelected = Zone.GetSelectedZone(); if (zoneSelected == null) { this.Visible = false; 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(); 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)) { Upgrade(Zone.GetSelectedZone()); } pastMouseState = currentMouseState; } base.Update(gameTime); }
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; } }*/ }