public override bool Test(Sim a, ICatPrey target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { if (SimTypes.IsSelectable(a)) { if (a.SkillManager.GetSkillLevel(SkillNames.CatHunting) < 1) { return(false); } } return(base.Test(a, target, isAutonomous, ref greyedOutTooltipCallback)); }
public override bool Test(Sim a, ICatPrey target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { if (SimTypes.IsSelectable(a)) { if (a.SkillManager.GetSkillLevel(SkillNames.CatHunting) < 1) { return false; } } return base.Test(a, target, isAutonomous, ref greyedOutTooltipCallback); }
public override string GetInteractionName(Sim actor, ICatPrey target, InteractionObjectPair iop) { return base.GetInteractionName(actor, target, new InteractionObjectPair(sOldSingleton, target)); }
private void DoExitWithPreyOutcomeEx() { ICatPrey target = Target; IInsectJig jig = Target as IInsectJig; if (jig != null) { DestroyPrey = true; target = CatHuntingComponent.CreateTerrarium(jig.InsectType); if (target != null) { target.SetPosition(Target.Position); target.SetForward(Target.ForwardVector); target.AddToWorld(); target.UpdateVisualState(CatHuntingComponent.CatHuntingModelState.Carried); SetActor("prey", target); } } else { DestroyPrey = false; } if (target != null) { target.SetOpacity(1f, 0f); AnimateSim("Exit With Prey"); if (target.CatHuntingComponent != null) { target.CatHuntingComponent.SetCatcher(Actor); } Sim inventoryActor = Actor; if (!SimTypes.IsSelectable(Actor)) { SimDescription head = SimTypes.HeadOfFamily(Actor.Household); if ((head != null) && (head.CreatedSim != null)) { inventoryActor = head.CreatedSim; } } // Custom if (inventoryActor.Inventory.TryToAdd(target, false)) { target.UpdateVisualState(CatHuntingComponent.CatHuntingModelState.InInventory); // Custom StoryProgression.Main.Skills.Notify("CatchPrey", Actor, CatHuntingComponent.LocalizeString(Actor.IsFemale, "CatchPreySuccess", new object[] { Actor, Target.GetLocalizedName() })); foreach (Sim sim in Actor.Household.Sims) { EventTracker.SendEvent(new Event(EventTypeId.kArkBuilder, sim, Target)); } if (SimTypes.IsSelectable(Actor)) { TryPushPresentTo(target); } } else { if (jig != null) { target.Destroy(); } DestroyPrey = true; } } else { DoPreyGoneOutcome(); } }
public override string GetInteractionName(Sim actor, ICatPrey target, InteractionObjectPair iop) { return(base.GetInteractionName(actor, target, new InteractionObjectPair(sOldSingleton, target))); }