Ejemplo n.º 1
0
        public override void Delete()
        {
            if (ParentHouse == null)
            {
                base.Delete();
                return;
            }

            if (!Owned && !ParentHouse.IsFriend(c_RentalClient))
            {
                if (c_RentalClient != null && RentalMaster != null)
                {
                    RentalMaster.SendMessage("{0} has ended your rental agreement.  Because you revoked their access, their last payment will be refunded.", RentalMaster.Name);
                    c_RentalClient.SendMessage("You have ended your rental agreement with {0}.  Because your access was revoked, your last payment is refunded.", c_RentalClient.Name);
                }

                DepositTo(c_RentalClient);
            }
            else if (Owned)
            {
                if (c_RentalClient != null && RentalMaster != null)
                {
                    c_RentalClient.SendMessage("{0} has ended your rental agreement.  Since they broke the contract, your are refunded the last payment.", RentalMaster.Name);
                    RentalMaster.SendMessage("You have ended your rental agreement with {0}.  They will be refunded their last payment.", c_RentalClient.Name);
                }

                DepositTo(c_RentalClient);

                PackUpHouse();
            }
            else
            {
                if (c_RentalClient != null && RentalMaster != null)
                {
                    RentalMaster.SendMessage("{0} has ended your rental agreement.", c_RentalClient.Name);
                    c_RentalClient.SendMessage("You have ended your rental agreement with {0}.", RentalMaster.Name);
                }

                DepositTo(RentalMaster);
            }

            ClearRentTimer();
            base.Delete();
        }
Ejemplo n.º 2
0
        protected override void ConvertItems(bool keep)
        {
            if (House == null || ParentHouse == null || RentalMaster == null)
            {
                return;
            }

            foreach (BaseDoor door in new ArrayList(ParentHouse.Doors).Cast <BaseDoor>().Where(door => door.Map == House.Map && House.Region.Contains(door.Location)))
            {
                ConvertDoor(door);
            }

            foreach (SecureInfo info in new ArrayList(ParentHouse.Secures).Cast <SecureInfo>().Where(info => info.Item.Map == House.Map && House.Region.Contains(info.Item.Location)))
            {
                ParentHouse.Release(RentalMaster, info.Item);
            }

            foreach (Item item in new ArrayList(ParentHouse.LockDowns).Cast <Item>().Where(item => item.Map == House.Map && House.Region.Contains(item.Location)))
            {
                ParentHouse.Release(RentalMaster, item);
            }
        }