예제 #1
0
파일: ManagerLot.cs 프로젝트: yakoder/NRaas
        public bool Allow(Common.IStatGenerator stats, Lot lot, ICollection <SimDescription> sims, FindLotFlags flags, bool allowRentable)
        {
            LotOptions lotData = Options.GetLotOptions(lot);

            if (UnchartedIslandMarker.IsUnchartedIsland(lot))
            {
                stats.IncStat("Find Lot: Uncharted");
                return(false);
            }
            else if (!lotData.GetValue <AllowLotUseOption, bool>())
            {
                stats.IncStat("Find Lot: Lot Allow Denied");
                return(false);
            }
            else if (!PassesHomeInspection(stats, lot, sims, flags))
            {
                stats.IncStat("Find Lot: Home Inspection");
                return(false);
            }

            if (!allowRentable)
            {
                if (Money.GetDeedOwner(lot) != null)
                {
                    return(false);
                }
            }

            return(lotData.AllowCastes(stats, sims));
        }
예제 #2
0
파일: ManagerLot.cs 프로젝트: yakoder/NRaas
        public bool AllowSim(Common.IStatGenerator stats, Sim sim, Lot lot)
        {
            if (sim == null)
            {
                return(false);
            }

            if (!lot.IsOpenVenue())
            {
                stats.IncStat("Not Open Venue");
                return(false);
            }
            else if (UnchartedIslandMarker.IsUnchartedIsland(lot))
            {
                stats.IncStat("Uncharted");
                return(false);
            }

            LotOptions lotOptions = GetLotOptions(lot);

            if (!lotOptions.GetValue <AllowLotPushOption, bool>())
            {
                stats.IncStat("Lot Push Denied");
                return(false);
            }

            if (!lotOptions.AllowCastes(stats, sim.SimDescription))
            {
                return(false);
            }

            switch (lot.CommercialLotSubType)
            {
            case CommercialLotSubType.kEP2_JunkyardNoVisitors:
            case CommercialLotSubType.kMisc_NoVisitors:
                stats.IncStat("No Visitors");
                return(false);

            case CommercialLotSubType.kArtGallery:
            case CommercialLotSubType.kTheatre:
                if (sim.TraitManager.HasElement(TraitNames.CantStandArt))
                {
                    stats.IncStat("CantStandArt");
                    return(false);
                }
                break;

            case CommercialLotSubType.kBeach:
            case CommercialLotSubType.kEP3_DanceClubPool:
            case CommercialLotSubType.kPool:
            case CommercialLotSubType.kFishingSpot:
                if (sim.TraitManager.HasElement(TraitNames.CantStandArt))
                {
                    stats.IncStat("CantStandArt");
                    return(false);
                }
                break;

            case CommercialLotSubType.kGym:
                if (sim.TraitManager.HasElement(TraitNames.CouchPotato))
                {
                    stats.IncStat("CouchPotato");
                    return(false);
                }
                break;

            case CommercialLotSubType.kGraveyard:
                if (sim.TraitManager.HasElement(TraitNames.Coward))
                {
                    stats.IncStat("Coward");
                    return(false);
                }
                break;
            }

            CarryingChildPosture posture = sim.CarryingChildPosture;

            if (posture != null)
            {
                if (!AllowSim(stats, posture.Child, lot))
                {
                    stats.IncStat("Child Fail");
                    return(false);
                }
            }

            return(true);
        }