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); }
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(); }
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; }