Ejemplo n.º 1
0
        public static bool CreateAndCarryshoppingBag(Sim sim)
        {
            bool     flag     = false;
            Suitcase suitcase = (GlobalFunctions.CreateObjectOutOfWorld("suitcaseVintage", ProductVersion.EP9) as Suitcase);

            //if (suitcase != null)
            //{
            //    if (sim.ParentToRightHand(suitcase))
            //    {
            //        CarrySystem.EnterWhileHolding(sim, suitcase);
            //    }
            //}

            if (suitcase != null)
            {
                flag = sim.TryAddObjectToInventory(suitcase);
                if (flag)
                {
                    flag = CarrySystem.PickUpFromSimInventory(sim, suitcase, true);
                }
            }
            return(flag);
        }
Ejemplo n.º 2
0
            protected override bool Run()
            {
                if (base.Actor.Inventory.Contains(base.Target))
                {
                    if (!CarrySystem.PickUpFromSimInventory(base.Actor, this.Target))
                    {
                        return(false);
                    }
                }
                else if (!base.Actor.RouteToObjectRadius(base.Target, 0.3f))
                {
                    if (!CarrySystem.PickUp(base.Actor, base.Target))
                    {
                        return(false);
                    } //pick up object and then bring it to a surface.

                    return(false);
                } //move in close to the object and if not possible quit the interaction.
                  //alternate path depending on whether the checkbook is already in the inventory.

                //place on surface and then enter the chair

                placeOnSurface();

                /*
                 * if (this.mCheckBookSurface != null) {
                 *  SurfaceSlot surfaceSlotFramContainedObject = this.mCheckBookSurface.Surface.GetSurfaceSlotFromContainedObject(this.Target);
                 *  this.mChecBookSlot = surfaceSlotFramContainedObject.ContainmentSlot;
                 *  Slot chairslot = surfaceSlotFramContainedObject.ChairSlots[0];
                 *  ISittable Chair = (ISittable) mCheckBookSurface.GetContainedObject(chairslot);
                 *  InteractionInstance sitOnChair = Chair.RouteToForSitting(base.Actor, chairslot, true,;
                 *  //base.Actor.RouteToSlot(this.Target, mChecBookSlot);
                 *  ChildUtils.SetPosturePrecondition(this, CommodityKind.Sitting, new CommodityKind[]
                 *  {
                 *      CommodityKind.InFrontOfSurfaceForTarget,
                 *      CommodityKind.ChairScootedIntoSurface
                 *  });
                 *
                 * }
                 *
                 */

                CAS.SimDescription receiver = getSimSelection();

                if (receiver != null)
                {
                    String samount = StringInputDialog.Show("Amount:", "(Must be round number) §", "100");
                    //must parse the string into an integer
                    int amount = 0;
                    if (int.TryParse(samount, out amount) && receiver != null)
                    {
                        transferFunds(base.Actor.SimDescription, receiver, amount);
                    }

                    else
                    {
                        base.Actor.ShowTNSIfSelectable("Woops! Messed up the check...I can't send this one!", StyledNotification.NotificationStyle.kSimTalking);
                        return(false);  //exit interaction when user enters invalid value
                    }
                }
                else
                {
                    return(false);
                }
                checkAnimation(); //end with animation
                base.Actor.ShowTNSIfSelectable("Ended animation.", StyledNotification.NotificationStyle.kSimTalking);
                //CarrySystem.AnimateIntoSimInventory(base.Actor);  animation errors out in null. Probably because of table
                base.Actor.ShowTNSIfSelectable("Ended animate into.", StyledNotification.NotificationStyle.kSimTalking);
                base.Actor.Inventory.TryToAdd(this.Target);
                base.Actor.ShowTNSIfSelectable("Ended method", StyledNotification.NotificationStyle.kSimTalking);
                return(true);
                //CarrySystem.PutDown(base.Actor, SurfaceType.Normal, true);
            }