예제 #1
0
 public override bool RunFromInventory()
 {
     // We'll assume that if the cat can stand in the location, it's valid to drop their prey?
     Target.UpdateVisualState(CatHuntingModelState.Carried);
     PetCarrySystem.PickUpFromSimInventory(Actor, Target, removeFromInventory: true);
     PetCarrySystem.PutDownOnFloor(Actor);
     Target.UpdateVisualState(CatHuntingModelState.InWorld);
     return(true);
 }
예제 #2
0
		public override bool RunFromInventory()
		{
			mSimToPresent = (GetSelectedObject() as Sim);
			if (mSimToPresent == null)
			{
				return false;
			}
			Target.UpdateVisualState(CatHuntingModelState.Carried);
			if (!PetCarrySystem.PickUpFromSimInventory(Actor, Target, removeFromInventory: true))
			{
				Target.UpdateVisualState(CatHuntingModelState.InInventory);
				return false;
			}
			return Run();
		}
예제 #3
0
		public override bool Run()
		{
			if (mSimToPresent == null)
			{
				mSimToPresent = (GetSelectedObject() as Sim);
				if (mSimToPresent == null)
				{
					return false;
				}
				if (!PetCarrySystem.PickUp(Actor, Target))
				{
					return false;
				}
				Target.UpdateVisualState(CatHuntingModelState.Carried);
			}

			if (mSimToPresent != null && !mSimToPresent.HasBeenDestroyed)
			{
				mSimToPresent.InteractionQueue.CancelAllInteractions();
				EWWait.Definition waitDefinition = new EWWait.Definition();
				EWWait waitInstance = waitDefinition.CreateInstance(mSimToPresent, mSimToPresent,
					new InteractionPriority(InteractionPriorityLevel.UserDirected), false,
					CancellableByPlayer) as EWWait;
				waitInstance.SetInteractionName("Wait for Medicine");
				mSimToPresent.InteractionQueue.AddNext(waitInstance);

				Route val = Actor.CreateRoute();
				val.DoRouteFail = true;
				val.SetOption(RouteOption.MakeDynamicObjectAdjustments, true);
				val.PlanToPointRadialRange(mSimToPresent, mSimToPresent.Position, kDistanceFromSimToPresent,
					kDistanceFromSimToPresent, Vector3.UnitZ, 360f, RouteDistancePreference.PreferNearestToRouteDestination,
					RouteOrientationPreference.TowardsObject, mSimToPresent.LotCurrent.LotId,
					new int[1]
					{
						mSimToPresent.RoomId
					});
				if (Actor.DoRoute(val))
				{
					val.SetOption(RouteOption.MakeDynamicObjectAdjustments, false);
					val.PlanToPointRadialRange(mSimToPresent, mSimToPresent.Position,
						kDistanceFromSimToPresent, kDistanceFromSimToPresent, Vector3.UnitZ, 360f,
						RouteDistancePreference.PreferNearestToRouteDestination, RouteOrientationPreference.TowardsObject,
						mSimToPresent.LotCurrent.LotId, new int[1]
						{
							mSimToPresent.RoomId
						});
					Actor.DoRoute(val);
				}
				waitInstance.waitComplete = true;
			}
			PetCarrySystem.PutDownOnFloor(Actor);
			Target.UpdateVisualState(CatHuntingModelState.InWorld);
			Target.CatHuntingComponent.mHasBeenPresented = true;
			if (Actor.HasExitReason())
			{
				return false;
			}
			BeginCommodityUpdates();

			EWPetBeTreated.Definition treatDefinition = new EWPetBeTreated.Definition();
			EWPetBeTreated treatInstance = treatDefinition.CreateInstance(Target, mSimToPresent,
				new InteractionPriority(InteractionPriorityLevel.UserDirected), false,
				CancellableByPlayer) as EWPetBeTreated;
			treatInstance.SetParams(isSuccessfulTreatment(mSimToPresent), BuffNames.GotFleasPet,
				Actor, true);
			mSimToPresent.InteractionQueue.AddNext(treatInstance);

			EndCommodityUpdates(succeeded: true);

			return true;
		}