public override bool Test(Sim a, GameObject target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { if (!a.SkillManager.HasElement(EWHerbLoreSkill.SkillNameID)) { return(false); } PlantableComponent plantable = target.Plantable; if (plantable == null) { return(false); } if (plantable.PlantDef == null) { return(false); } if (plantable.PlantDef.LimitedAvailability) { return(false); } ITreasureSpawnableObject treasureSpawnableObject = target as ITreasureSpawnableObject; if (treasureSpawnableObject != null && treasureSpawnableObject.IsOnSpawner) { return(false); } return(!target.InUse && CarrySystem.CouldPickUp(target as ICarryable)); }
public override bool Test(Sim a, MoneyBag target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { ITreasureSpawnableObject obj2 = target; if ((obj2 != null) && obj2.IsOnSpawner) { return(false); } return(true); }
private static void GiveTreasuresToSimInternal(List <IGameObject> treasures, Sim actor) { foreach (IGameObject obj2 in treasures) { IControlHowSimsAcquireMe me = obj2 as IControlHowSimsAcquireMe; if (me != null) { me.GetAcquiredBySim(actor); } else { if (Inventories.TryToMove(obj2, actor)) { ITreasureSpawnableObject obj3 = obj2 as ITreasureSpawnableObject; if ((obj3 != null) && !obj3.HasBeenCollected) { obj3.OnTreasureCollected(actor, false); } continue; } obj2.Destroy(); } } }