protected static void OnAmbitionConsign() { if (ConsignmentRegister.sSkillVsSaleChanceCurve == null) { ConsignmentRegister.InitializeData(); } Dictionary <ulong, List <ConsignedObjectProxy> > objects = ConsignedObjectProxy.ConvertToList(ConsignmentRegister.sConsignedObjects); Consign(objects, ConsignmentRegister.sConsignAttempts, ConsignmentRegister.kConsignmentPrices, ConsignmentRegister.kMadeGoodSaleThreshold, ConsignmentRegister.kReputationBonusForPositiveFeedback, ConsignmentRegister.sQualityVsReputationCurve, ConsignmentRegister.kSellXItemsOpportunityReputationGainMultiplier, ConsignmentRegister.kConsignmentLifespan, ConsignmentRegister.kDailyNumberOfAttemptsDecrement, ConsignmentRegister.sReputationVsStoreFeeCurve, ConsignmentRegister.kNumberOfTopSellingItems, ConsignmentRegister.kMakeXSimoleonsOpportunityConsignmentFeeMultiplier); ConsignmentRegister.sConsignedObjects = ConsignedObjectProxy.ConvertToList <ConsignmentRegister.ConsignedObject>(objects); }
private static List <ISellableUIItem> CreateConsignmentObjectsList(Sim customer) { List <ISellableUIItem> consignableObjectsList = new List <ISellableUIItem>(); foreach (GameObject obj in Inventories.QuickFind <GameObject>(customer.Inventory, true, IsObjectConsignable)) { ConsignmentRegister.AddObjectToSellableObjectsList(obj, consignableObjectsList); } foreach (GameObject obj in Inventories.QuickFind <GameObject>(customer.Household.SharedFamilyInventory.Inventory, true, IsObjectConsignable)) { ConsignmentRegister.AddObjectToSellableObjectsList(obj, consignableObjectsList); } return(consignableObjectsList); }
protected static bool IsConsignable(GameObject obj) { if (!obj.CanBeSold()) { return(false); } if ((!GameUtils.IsInstalled(ProductVersion.EP2)) && (!GameUtils.IsInstalled(ProductVersion.EP7))) { return(false); } if (GameUtils.IsInstalled(ProductVersion.EP2)) { if (ConsignmentRegister.IsObjectConsignable(obj, null)) { return(true); } } if (GameUtils.IsInstalled(ProductVersion.EP7)) { if (PotionShopConsignmentRegister.IsObjectConsignable(obj, null)) { return(true); } } if (obj is ICraftedArt) { return(true); } if (obj is MinorPet) { return(true); } return(Consignments.IsCollectable(obj)); }
public int Sell(SimDescription sim, GameObject obj) { if ((mAllowConsignment) && (sim.CreatedSim != null) && (IsConsignable(obj))) { Inventory inventory = Inventories.ParentInventory(obj); if ((inventory == null) || (inventory.TryToRemove(obj))) { try { if (GameUtils.IsInstalled(ProductVersion.EP2)) { ConsignmentRegister.OnConsignedItem(sim.CreatedSim, obj); } else if (GameUtils.IsInstalled(ProductVersion.EP7)) { PotionShopConsignmentRegister.OnConsignedItem(sim.CreatedSim, obj); } return(0); } catch (Exception e) { Common.DebugException(obj, e); } } } int value = obj.Value; Consignments.NotifySell(sim, obj); AdjustFunds(sim, "SellItem", value); obj.Destroy(); return(value); }
public override int GetValueOfSale(SimDescription sim) { return(ConsignmentRegister.GetValueOfSale(mData, sim)); }
public override float GetChanceOfSale(Sim createdSim) { return(ConsignmentRegister.GetChanceOfSale(createdSim, mData)); }