private static void Morguage(GamePlayer Player, int propID, bool undo = false) { HouseCardData thishouse = (from h in Player.MyState.LocalCardData where h.ID == propID select h).FirstOrDefault(); OwnedProperty local = (from h in Player.PlayerProperty where h.ID == propID select h).FirstOrDefault(); if (!undo) { if (!local.Morguage) { int updatedcash = 0; local.Morguage = true; updatedcash += local.HouseLevel * thishouse.HouseCost / 2; local.HouseLevel = 0; updatedcash += thishouse.BuyCost / 2; Player.Cash += updatedcash; } } else { Player.Cash -= thishouse.BuyCost / 2; Player.Cash -= thishouse.BuyCost / 20; local.Morguage = false; } }
private static void PayRent(HouseCardData house, GamePlayer payingPlayer, GamePlayer landLord) { int cashToPay = 0; int diceout = 0; foreach (var item in payingPlayer.MyState.lastDieRoll) { diceout += item; } OwnedProperty prop = (from h in landLord.PlayerProperty where h.ID == house.ID select h).FirstOrDefault(); if (!prop.Morguage) { switch (house.Type) { case "Standard": switch (prop.HouseLevel) { case 0: if (prop.SetLevel == 1) { cashToPay = house.Rent0 * 2; } else { cashToPay = house.Rent0; } break; case 1: cashToPay = house.Rent1; break; case 2: cashToPay = house.Rent2; break; case 3: cashToPay = house.Rent3; break; case 4: cashToPay = house.Rent4; break; case 5: cashToPay = house.Rent5; break; default: break; } break; case "Station": switch (prop.SetLevel) { case 0: cashToPay = house.Rent0; break; case 1: cashToPay = house.Rent1; break; case 2: cashToPay = house.Rent2; break; case 3: cashToPay = house.Rent3; break; default: break; } break; case "NutsVoorziening": if (prop.SetLevel == 1) { cashToPay = house.Rent1 * diceout; } else { cashToPay = house.Rent0 * diceout; } break; default: break; } } payingPlayer.Cash -= cashToPay; }