Author Topic: Share Your Nectar Making Recipes  (Read 408776 times)

gnowor

  • Guest
Re: Share Your Nectar Making Recipes
« Reply #45 on: December 21, 2009, 05:58:11 PM »
The randomly generated value is used in two ways.

First off, it is the ONLY factor affecting flavor.  Amazing/Great/Terrible/etc. is all dependent on this flavor value.  It takes the string "Apple Apple Grape Grape etc." (I'm not sure exactly on the names/formating).  It hashes this value.  It then converts the hashed value to an integer and uses this as the seed for the Randomizer.  It then pulls out 3 floats from the Randomizer, and averages them.  If the number is less than .5, it multiplies it by two.  If the number is above .5, it subtracts .5 and then multiplies by 2.  It then adds the median combo multiplier (fixed value set internally but modifiable) to the product of (the Max combo multipler minus the median combo multiplier) and the value computed above.  It then compares this to it's internal threshold levels of .5, 1.2, 2.5 and 4 (these are individually modifiable as well).  Anything below .5 is terrible, .5-1.1999 is poor, 1.2-2.4999 is well, etc.

Now this value is also used as a multiplier (along with several other multipliers including whether you have flavorful feet, upgrades to nectar maker, your skill level, etc.) to determine the value of the bottle.  This does explain why there's variance within the Terrible, Great, Amazing, etc. ranges.  It's not using Amazing as a multiplier.  It's using the value determined above as a multiplier. Further explanation in P.P.S.

Hope this helps.

P.S.  I'm a little burnt out, so I'm not going to put a how-to guide on how to access all this information.  Do a google search on reflector (the app I'm using to look at files), and "sims 3" and that should get you started.  You'll also have to unpack some of the game files which you can do with s3pe.  When you get all that done, the info above is in "Sims3.Gameplay.Objects.HobbiesSkills.NectarMaker.NectarFinishTask".

P.P.S. Code for determining value:
float baseValue = ((((((num * num2) * num4) * this.mFlavorMultiplier) * num7) * kQualityLevelMultiplier[((int) num5) - 1]) * this.mMultiplierFromFeet) * makeStyleValueModifier;

num = sum of the internal nectar values associated with all ingredients (for example, apple is 5, life fruit is 22 - this is regardless of quality)
num2 = Random Multiplier (although it's constrained to a range that's set by other constants)
num4 = skill multiplier
FlavorMultiplier = Whether the nectar maker is flavor upgraded (1 if not, more if it is)
num7 = the long "taste" multiplier i talked about at beginning of post
QualityLevelMultiplier & num5 = Multiplier based on quality of produce
MultiplierFromFeet = Flavorful feet multiplier (1 if regular feet, more if sim is challenged [pun intended])
MakeStyleModifier = Multiplier based on the kind of nectar you made (extended, concentrated, mass produce, etc.)


bshag

  • Guest
Re: Share Your Nectar Making Recipes
« Reply #46 on: December 22, 2009, 12:39:18 PM »
Wow gnowor...that's some post there. :D  I'm way not that scientific...glad someone is.  :D

I have a receipe that came out of an improved pressing nectar-maker by a sim with L10 in nectar-making.  I'm stumped as how the game calls a nectar "pretty good" and it comes out of the maker as perfect.  ::)  Also, how do you guys get nectar to come out being $300 a bottle and her perfect nectar came out only $178?  I'm depressed... :D

Anywho, the receipe is 3 cranulet/3 cherry/4 flame fruit.

A little off the subject but EA isn't fooling anybody.  :D  My sim will pour herself the "nectar" sit and swirl the glass and sniff it...just like you would do wine.  Nice try EA!  :D



Registered members do not see ads on this Forum. Register here.

gnowor

  • Guest
Re: Share Your Nectar Making Recipes
« Reply #47 on: December 22, 2009, 04:41:34 PM »
The quality (Perfect, Outstanding, Excellent, Great, Very Nice, Nice, Normal, etc.) is determined by your skill level and the quality of ingredients.

The "Pretty good" that you get when the nectar is made and comes out of the nectar maker is produced by the randomizer I explained above.  It refers to the taste of the nectar.  Short version: The game has random values assigned to each different recipe.  You cannot predict these values (other than by predict combo effectiveness).  The game will use this "pretty good" rating of the TASTE (which is different that the quality listed above).  This pretty good factors into the value along with the quality of the nectar.

The highest priced bottle of nectar will need to have many things, including high cost ingredients (life fruit, flame fruit, etc.), Perfect quality, Amazing Taste (as opposed to the pretty good that you got), L10 sim with flavored feet, upgraded nectar maker, and I bet I'm forgetting other factors as well.  For each one of these qualities that you're missing, or is reduced in value (maybe Excellent Quality and pretty good taste and level 7 nectar maker), the value of the bottle will suffer.  Hope this helps!

bshag

  • Guest
Re: Share Your Nectar Making Recipes
« Reply #48 on: December 23, 2009, 12:36:59 AM »
Thanks for the explanation and it does clear some things up.  I guess she just needs to keep making nectar and combining the flame and life fruits along with the more rare of the grapes to get a really high priced bottle of wine, er, um nectar.  :D

PrairieGhost

  • Guest
Re: Share Your Nectar Making Recipes
« Reply #49 on: December 25, 2009, 06:53:02 AM »
I didn't see this listed, so I thought I'd share... I created a sort of cherry limeade with 5 cherries and 5 limes, and it turned out Great. :3

bshag

  • Guest
Re: Share Your Nectar Making Recipes
« Reply #50 on: December 26, 2009, 11:24:31 AM »
Hi Prairie, welcome to the forum and thanks for the recipe.  I seem to be having a little difficulty having good tasting nectar.  ::)

Always did like cherry limeade.  :)

shanadowa

  • Guest
Re: Share Your Nectar Making Recipes
« Reply #51 on: December 28, 2009, 02:37:16 PM »
Here are 2 Amazing that I have found and didn't see posted yet:
6 Meloire Grapes and 4 Cherries
6 Cherries and 4 Pomeganate.

Working my way through 60-40% mixes atm and that is what I have found so far, along with a ton of great tasting batches.




Registered members do not see ads on this Forum. Register here.

Fatmice

  • Guest
Re: Share Your Nectar Making Recipes
« Reply #52 on: December 30, 2009, 06:47:41 PM »
The randomly generated value is used in two ways.

First off, it is the ONLY factor affecting flavor.  Amazing/Great/Terrible/etc. is all dependent on this flavor value.  It takes the string "Apple Apple Grape Grape etc." (I'm not sure exactly on the names/formating).  It hashes this value.  It then converts the hashed value to an integer and uses this as the seed for the Randomizer.  It then pulls out 3 floats from the Randomizer, and averages them.  If the number is less than .5, it multiplies it by two.  If the number is above .5, it subtracts .5 and then multiplies by 2.  It then adds the median combo multiplier (fixed value set internally but modifiable) to the product of (the Max combo multipler minus the median combo multiplier) and the value computed above.  It then compares this to it's internal threshold levels of .5, 1.2, 2.5 and 4 (these are individually modifiable as well).  Anything below .5 is terrible, .5-1.1999 is poor, 1.2-2.4999 is well, etc.

Now this value is also used as a multiplier (along with several other multipliers including whether you have flavorful feet, upgrades to nectar maker, your skill level, etc.) to determine the value of the bottle.  This does explain why there's variance within the Terrible, Great, Amazing, etc. ranges.  It's not using Amazing as a multiplier.  It's using the value determined above as a multiplier. Further explanation in P.P.S.

Hope this helps.

P.S.  I'm a little burnt out, so I'm not going to put a how-to guide on how to access all this information.  Do a google search on reflector (the app I'm using to look at files), and "sims 3" and that should get you started.  You'll also have to unpack some of the game files which you can do with s3pe.  When you get all that done, the info above is in "Sims3.Gameplay.Objects.HobbiesSkills.NectarMaker.NectarFinishTask".

P.P.S. Code for determining value:
float baseValue = ((((((num * num2) * num4) * this.mFlavorMultiplier) * num7) * kQualityLevelMultiplier[((int) num5) - 1]) * this.mMultiplierFromFeet) * makeStyleValueModifier;

num = sum of the internal nectar values associated with all ingredients (for example, apple is 5, life fruit is 22 - this is regardless of quality)
num2 = Random Multiplier (although it's constrained to a range that's set by other constants)
num4 = skill multiplier
FlavorMultiplier = Whether the nectar maker is flavor upgraded (1 if not, more if it is)
num7 = the long "taste" multiplier i talked about at beginning of post
QualityLevelMultiplier & num5 = Multiplier based on quality of produce
MultiplierFromFeet = Flavorful feet multiplier (1 if regular feet, more if sim is challenged [pun intended])
MakeStyleModifier = Multiplier based on the kind of nectar you made (extended, concentrated, mass produce, etc.)



Which game file/package are you dumping?  I'd like to take a look at the code myself to see if it is replicable.  From the sound of it, this "random" generator can probably be replicated with +/- % since each computer will have small deviation.

Currently, I looked under GameplayData.package with s3pe and there are several xml entries related to nectar that were interesting.  I do not see any of the codes that you have presented.


Fatmice

  • Guest
Re: Share Your Nectar Making Recipes
« Reply #53 on: January 01, 2010, 12:20:18 AM »
Found the codes.  I will be disecting these over the next several days.  Hopefully, I can replicate this outside of the game.  It might be possible to create an object in game that calls the private class to find effective combination ingame.

Class member that generate the nectar quality.  This is found under Sims3GameplayObjects.dll
Code: [Select]
private void NectarFinishTask()
{
    List<Ingredient> fruitsUsed = base.Inventory.FindAll<Ingredient>(false);
    foreach (GameObject obj2 in fruitsUsed)
    {
        base.Inventory.SetNotInUse(obj2);
    }
    if (((fruitsUsed != null) && (fruitsUsed.Count > 0)) && (this.mLastSimToMake != null))
    {
        float num = 0f;
        float num2 = (((float) RandomGen.NextDouble()) * (kMaxGlobalValueVariance - kMinGlobalValueVariance)) + kMinGlobalValueVariance;
        int skillLevel = this.mLastSimToMake.SkillManager.GetSkillLevel(SkillNames.Nectar);
        float num4 = ((kLevel10Multiplier - kLevel0Multiplier) * (((float) skillLevel) / 10f)) + kLevel0Multiplier;
        fruitsUsed.Sort();
        string str = "";
        bool flag = true;
        Ingredient ingredient = fruitsUsed[0];
        string key = "";
        Dictionary<string, int> ingredients = new Dictionary<string, int>();
        if (ingredient != null)
        {
            key = ingredient.Data.Key;
        }
        float num5 = 0f;
        foreach (Ingredient ingredient2 in fruitsUsed)
        {
            if (flag && !key.Equals(ingredient2.Data.Key))
            {
                flag = false;
            }
            str = str + ingredient2.Data.Key;
            if (!ingredients.ContainsKey(ingredient2.Data.Key))
            {
                ingredients.Add(ingredient2.Data.Key, 1);
            }
            else
            {
                Dictionary<string, int> dictionary2;
                string str9;
                (dictionary2 = ingredients)[str9 = ingredient2.Data.Key] = dictionary2[str9] + 1;
            }
            num += ingredient2.Data.NectarValue;
            num5 += (float) ingredient2.GetQuality();
            base.Inventory.TryToRemove(ingredient2);
        }
        num5 /= (float) fruitsUsed.Count;
        uint hash = ResourceUtils.HashString32(str);
        float num7 = 1f;
        if (!flag)
        {
            num7 = CalculateHashMultiplier(hash);
        }
        float makeStyleValueModifier = this.GetMakeStyleValueModifier(this.mLastUsedMakeStyle);
        int makeStyleBottleModifier = this.GetMakeStyleBottleModifier(this.mLastUsedMakeStyle);
        float baseValue = ((((((num * num2) * num4) * this.mFlavorMultiplier) * num7) * kQualityLevelMultiplier[((int) num5) - 1]) * this.mMultiplierFromFeet) * makeStyleValueModifier;
        int numBottles = (kNumBottlesPerBatch + this.mBottleDifference) + makeStyleBottleModifier;
        NectarSkill skill = this.mLastSimToMake.SkillManager.GetSkill<NectarSkill>(SkillNames.Nectar);
        if ((skill != null) && skill.IsNectarMaster())
        {
            numBottles += NectarSkill.kExtraBottlesNectarMaster;
        }
        List<IngredientNameCount> list2 = new List<IngredientNameCount>();
        foreach (string str3 in ingredients.Keys)
        {
            list2.Add(new IngredientNameCount(str3, ((float) ingredients[str3]) / ((float) fruitsUsed.Count)));
        }
        list2.Sort();
        string str4 = "";
        string str5 = "";
        if (list2.Count > 0)
        {
            str4 = IngredientData.NameToDataMap[list2[0].IngredientName].Name;
        }
        if (list2.Count > 1)
        {
            str5 = IngredientData.NameToDataMap[list2[1].IngredientName].Name;
        }
        List<NectarSkill.NectarBottleInfo> mTopNectarsMade = new List<NectarSkill.NectarBottleInfo>();
        if (skill != null)
        {
            mTopNectarsMade = skill.mTopNectarsMade;
        }
        string mBottleName = "";
        if (string.IsNullOrEmpty(str5))
        {
            mBottleName = Localization.LocalizeString("Gameplay/Objects/CookingObjects/NectarBottle:NectarNameOneFruit", new object[] { str4 });
        }
        else
        {
            mBottleName = Localization.LocalizeString("Gameplay/Objects/CookingObjects/NectarBottle:NectarName", new object[] { str4, str5 });
            if (mBottleName.Length > 40)
            {
                mBottleName = Localization.LocalizeString("Gameplay/Objects/CookingObjects/NectarBottle:NectarNameOneFruit", new object[] { str4 });
            }
        }
        foreach (NectarSkill.NectarBottleInfo info in mTopNectarsMade)
        {
            if (info.mFruitHash == hash)
            {
                mBottleName = info.mBottleName;
            }
        }
        string entryKey = "Gameplay/Objects/HobbiesSkills/NectarMaker:";
        if (flag)
        {
            entryKey = entryKey + "NameBottleDialogJustOneFruit";
        }
        else if (num7 < kPoorComboThreshold)
        {
            entryKey = entryKey + "NameBottleDialogTerribly";
        }
        else if (num7 < kWellComboThreshold)
        {
            entryKey = entryKey + "NameBottleDialogPoor";
        }
        else if (num7 < kGreatComboThreshold)
        {
            entryKey = entryKey + "NameBottleDialogWell";
        }
        else if (num7 < kAmazingComboThreshold)
        {
            entryKey = entryKey + "NameBottleDialogGreat";
        }
        else
        {
            entryKey = entryKey + "NameBottleDialogAmazing";
        }
        string name = StringInputDialog.Show(Localization.LocalizeString("Gameplay/Objects/HobbiesSkills/NectarMaker:NameBottleDialog", new object[0]), Localization.LocalizeString(entryKey, new object[0]), mBottleName, 40, 5);
        bool flag2 = false;
        if (skill != null)
        {
            skill.MadeXBottles(numBottles);
            skill.UsedFruits(fruitsUsed);
            skill.NectarTypeMade(new NectarSkill.NectarBottleInfo(hash, name, ingredients, (int) baseValue));
            flag2 = skill.ReachedMaxLevel();
        }
        int dateNum = ((int) SimClock.ConvertFromTicks(GameStates.TimeInHomeworld.Ticks, TimeUnit.Weeks)) + 1;
        for (int i = 0; i < numBottles; i++)
        {
            NectarBottle item = GlobalFunctions.CreateObjectOutOfWorld("NectarBottle", null, new NectarBottleObjectInitParams(hash, name, list2, "Gameplay/Objects/HobbiesSkills/NectarMaker:Weeks", dateNum, baseValue, baseValue, this.mLastSimToMake, flag2)) as NectarBottle;
            this.mBottles.Add(item);
            EventTracker.SendEvent(EventTypeId.kMadeNectar, this.mLastSimToMake.CreatedSim, item);
        }
        if (this.mBottles.Count > 0)
        {
            this.mCurrentStateMachine.SetActor("nectarBottle", this.mBottles[0]);
        }
        this.mCurrentStateMachine.RequestState("nectarMaker", "Exit");
        this.mCurrentStateMachine.Dispose();
        this.mCurrentStateMachine = null;
        this.mMultiplierFromFeet = 1f;
        this.mLastUsedMakeStyle = MakeNectarStyle.Basic;
        this.mLastSimToMake = null;
        this.CurrentState = NectarMakerState.FruitAddable;
    }
}

The code above calls RandomGen.  This is found under SimIFace.dll


Code: [Select]
public sealed class RandomGen
{
    // Fields
    private static IRandom gRandomGen;

    // Methods
    private RandomGen()
    {
    }

    public static double NextDouble()
    {
        if (gRandomGen == null)
        {
            gRandomGen = (IRandom) AppDomain.CurrentDomain.GetData("RandomGen");
            if (gRandomGen == null)
            {
                return 0.0;
            }
        }
        return gRandomGen.NextDouble();
    }
}

So RandomGen is a child of IRandom which is derived from Random.  This IRandom is also found under SimIFace.dll while Random is found under ScriptCore.dll.  Now Random is a derived from System.Objects which is found under mscorlib.dll.  Under mscorlib.dll, there is another "Random", System.Random...  I can only guess that the SciptCore.dll Random is some how a child of System.Random.

code for SimIFace.IRandom
Code: [Select]
public interface IRandom
{
    // Methods
    double NextDouble();
}

cod for ScriptCore.Random
Code: [Select]
public sealed class Random : IRandom
{
    // Methods
    public Random()
    {
        AppDomain.CurrentDomain.SetData("RandomGen", this);
    }

    public double NextDouble()
    {
        return Random_NextDoubleImpl();
    }

    [DllImport("Sims3Common.dll")]
    private static extern double Random_NextDoubleImpl();
}

code for System.Random
Code: [Select]
[Serializable]
public class Random
{
    // Fields
    private int inext;
    private int inextp;
    private const int MBIG = 0x7fffffff;
    private const int MSEED = 0x9a4ec86;
    private const int MZ = 0;
    private int[] SeedArray;

    // Methods
    public Random() : this(Environment.TickCount)
    {
    }

    public Random(int Seed)
    {
        this.SeedArray = new int[0x38];
        int num2 = 0x9a4ec86 - Math.Abs(Seed);
        this.SeedArray[0x37] = num2;
        int num3 = 1;
        for (int i = 1; i < 0x37; i++)
        {
            int index = (0x15 * i) % 0x37;
            this.SeedArray[index] = num3;
            num3 = num2 - num3;
            if (num3 < 0)
            {
                num3 += 0x7fffffff;
            }
            num2 = this.SeedArray[index];
        }
        for (int j = 1; j < 5; j++)
        {
            for (int k = 1; k < 0x38; k++)
            {
                this.SeedArray[k] -= this.SeedArray[1 + ((k + 30) % 0x37)];
                if (this.SeedArray[k] < 0)
                {
                    this.SeedArray[k] += 0x7fffffff;
                }
            }
        }
        this.inext = 0;
        this.inextp = 0x1f;
    }

    public virtual int Next()
    {
        return (int) (this.Sample() * 2147483647.0);
    }

    public virtual int Next(int maxValue)
    {
        if (maxValue < 0)
        {
            throw new ArgumentOutOfRangeException(Locale.GetText("Max value is less then min value."));
        }
        return (int) (this.Sample() * maxValue);
    }

    public virtual int Next(int minValue, int maxValue)
    {
        if (minValue > maxValue)
        {
            throw new ArgumentOutOfRangeException(Locale.GetText("Min value is greater then max value."));
        }
        uint num = (uint) (maxValue - minValue);
        if (num == 0)
        {
            return minValue;
        }
        int num2 = ((int) (this.Sample() * num)) + minValue;
        if (num2 == maxValue)
        {
            return (num2 - 1);
        }
        return num2;
    }

    public virtual void NextBytes(byte[] buffer)
    {
        if (buffer == null)
        {
            throw new ArgumentNullException("buffer");
        }
        for (int i = 0; i < buffer.Length; i++)
        {
            buffer[i] = (byte) (this.Sample() * 256.0);
        }
    }

    public virtual double NextDouble()
    {
        return this.Sample();
    }

    protected virtual double Sample()
    {
        if (++this.inext >= 0x38)
        {
            this.inext = 1;
        }
        if (++this.inextp >= 0x38)
        {
            this.inextp = 1;
        }
        int num = this.SeedArray[this.inext] - this.SeedArray[this.inextp];
        if (num < 0)
        {
            num += 0x7fffffff;
        }
        this.SeedArray[this.inext] = num;
        return (num * 4.6566128752457969E-10);
    }
}

Fatmice

  • Guest
Re: Share Your Nectar Making Recipes
« Reply #54 on: January 01, 2010, 12:46:00 AM »
Math class

Code: [Select]
public static class Math
{
    // Fields
    private static double doubleRoundLimit = 1E+16;
    public const double E = 2.7182818284590451;
    private const int maxRoundingDigits = 15;
    public const double PI = 3.1415926535897931;
    private static double[] roundPower10Double = new double[] { 1.0, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, 10000000.0, 100000000.0, 1000000000.0, 10000000000, 100000000000, 1000000000000, 10000000000000, 100000000000000, 1E+15 };

    // Methods
    public static decimal Abs(decimal value)
    {
        return decimal.Abs(value);
    }

    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern double Abs(double value);
    public static short Abs(short value)
    {
        if (value >= 0)
        {
            return value;
        }
        return AbsHelper(value);
    }

    public static int Abs(int value)
    {
        if (value >= 0)
        {
            return value;
        }
        return AbsHelper(value);
    }

    public static long Abs(long value)
    {
        if (value >= 0L)
        {
            return value;
        }
        return AbsHelper(value);
    }

    [CLSCompliant(false)]
    public static sbyte Abs(sbyte value)
    {
        if (value >= 0)
        {
            return value;
        }
        return AbsHelper(value);
    }

    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern float Abs(float value);
    private static short AbsHelper(short value)
    {
        if (value == -32768)
        {
            throw new OverflowException(Environment.GetResourceString("Overflow_NegateTwosCompNum"));
        }
        return -value;
    }

    private static int AbsHelper(int value)
    {
        if (value == -2147483648)
        {
            throw new OverflowException(Environment.GetResourceString("Overflow_NegateTwosCompNum"));
        }
        return -value;
    }

    private static long AbsHelper(long value)
    {
        if (value == -9223372036854775808L)
        {
            throw new OverflowException(Environment.GetResourceString("Overflow_NegateTwosCompNum"));
        }
        return -value;
    }

    private static sbyte AbsHelper(sbyte value)
    {
        if (value == -128)
        {
            throw new OverflowException(Environment.GetResourceString("Overflow_NegateTwosCompNum"));
        }
        return -value;
    }

    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern double Acos(double d);
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern double Asin(double d);
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern double Atan(double d);
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern double Atan2(double y, double x);
    public static long BigMul(int a, int b)
    {
        return (a * b);
    }

    public static decimal Ceiling(decimal d)
    {
        return decimal.Ceiling(d);
    }

    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern double Ceiling(double a);
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern double Cos(double d);
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern double Cosh(double value);
    public static int DivRem(int a, int b, out int result)
    {
        result = a % b;
        return (a / b);
    }

    public static long DivRem(long a, long b, out long result)
    {
        result = a % b;
        return (a / b);
    }

    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern double Exp(double d);
    public static decimal Floor(decimal d)
    {
        return decimal.Floor(d);
    }

    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern double Floor(double d);
    public static double IEEERemainder(double x, double y)
    {
        double d = x % y;
        if (double.IsNaN(d))
        {
            return double.NaN;
        }
        if ((d == 0.0) && double.IsNegative(x))
        {
            return double.NegativeZero;
        }
        double num2 = d - (Abs(y) * Sign(x));
        if (Abs(num2) == Abs(d))
        {
            double a = x / y;
            if (Abs(Round(a)) > Abs(a))
            {
                return num2;
            }
            return d;
        }
        if (Abs(num2) < Abs(d))
        {
            return num2;
        }
        return d;
    }

    private static unsafe double InternalRound(double value, int digits, MidpointRounding mode)
    {
        if (Abs(value) < doubleRoundLimit)
        {
            double num = roundPower10Double[digits];
            value *= num;
            if (mode == MidpointRounding.AwayFromZero)
            {
                double num2 = SplitFractionDouble(&value);
                if (Abs(num2) >= 0.5)
                {
                    value += Sign(num2);
                }
            }
            else
            {
                value = Round(value);
            }
            value /= num;
        }
        return value;
    }

    private static unsafe double InternalTruncate(double d)
    {
        SplitFractionDouble(&d);
        return d;
    }

    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern double Log(double d);
    public static double Log(double a, double newBase)
    {
        if ((newBase != 1.0) && ((a == 1.0) || ((newBase != 0.0) && !double.IsPositiveInfinity(newBase))))
        {
            return (Log(a) / Log(newBase));
        }
        return double.NaN;
    }

    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern double Log10(double d);
    [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
    public static byte Max(byte val1, byte val2)
    {
        if (val1 < val2)
        {
            return val2;
        }
        return val1;
    }

    [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
    public static decimal Max(decimal val1, decimal val2)
    {
        return decimal.Max(val1, val2);
    }

    [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
    public static double Max(double val1, double val2)
    {
        if (val1 > val2)
        {
            return val1;
        }
        if (double.IsNaN(val1))
        {
            return val1;
        }
        return val2;
    }

    [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
    public static short Max(short val1, short val2)
    {
        if (val1 < val2)
        {
            return val2;
        }
        return val1;
    }

    [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
    public static int Max(int val1, int val2)
    {
        if (val1 < val2)
        {
            return val2;
        }
        return val1;
    }

    [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
    public static long Max(long val1, long val2)
    {
        if (val1 < val2)
        {
            return val2;
        }
        return val1;
    }

    [CLSCompliant(false), ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
    public static sbyte Max(sbyte val1, sbyte val2)
    {
        if (val1 < val2)
        {
            return val2;
        }
        return val1;
    }

    [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
    public static float Max(float val1, float val2)
    {
        if (val1 > val2)
        {
            return val1;
        }
        if (float.IsNaN(val1))
        {
            return val1;
        }
        return val2;
    }

    [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success), CLSCompliant(false)]
    public static ushort Max(ushort val1, ushort val2)
    {
        if (val1 < val2)
        {
            return val2;
        }
        return val1;
    }

    [CLSCompliant(false), ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
    public static uint Max(uint val1, uint val2)
    {
        if (val1 < val2)
        {
            return val2;
        }
        return val1;
    }

    [CLSCompliant(false), ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
    public static ulong Max(ulong val1, ulong val2)
    {
        if (val1 < val2)
        {
            return val2;
        }
        return val1;
    }

    [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
    public static byte Min(byte val1, byte val2)
    {
        if (val1 > val2)
        {
            return val2;
        }
        return val1;
    }

    [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
    public static decimal Min(decimal val1, decimal val2)
    {
        return decimal.Min(val1, val2);
    }

    [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
    public static double Min(double val1, double val2)
    {
        if (val1 < val2)
        {
            return val1;
        }
        if (double.IsNaN(val1))
        {
            return val1;
        }
        return val2;
    }

    [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
    public static short Min(short val1, short val2)
    {
        if (val1 > val2)
        {
            return val2;
        }
        return val1;
    }

    [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
    public static int Min(int val1, int val2)
    {
        if (val1 > val2)
        {
            return val2;
        }
        return val1;
    }

    [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
    public static long Min(long val1, long val2)
    {
        if (val1 > val2)
        {
            return val2;
        }
        return val1;
    }

    [CLSCompliant(false), ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
    public static sbyte Min(sbyte val1, sbyte val2)
    {
        if (val1 > val2)
        {
            return val2;
        }
        return val1;
    }

    [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
    public static float Min(float val1, float val2)
    {
        if (val1 < val2)
        {
            return val1;
        }
        if (float.IsNaN(val1))
        {
            return val1;
        }
        return val2;
    }

    [CLSCompliant(false), ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
    public static ushort Min(ushort val1, ushort val2)
    {
        if (val1 > val2)
        {
            return val2;
        }
        return val1;
    }

    [CLSCompliant(false), ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
    public static uint Min(uint val1, uint val2)
    {
        if (val1 > val2)
        {
            return val2;
        }
        return val1;
    }

    [CLSCompliant(false), ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
    public static ulong Min(ulong val1, ulong val2)
    {
        if (val1 > val2)
        {
            return val2;
        }
        return val1;
    }

    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern double Pow(double x, double y);
    public static decimal Round(decimal d)
    {
        return decimal.Round(d, 0);
    }

    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern double Round(double a);
    public static decimal Round(decimal d, int decimals)
    {
        return decimal.Round(d, decimals);
    }

    public static decimal Round(decimal d, MidpointRounding mode)
    {
        return decimal.Round(d, 0, mode);
    }

    public static double Round(double value, int digits)
    {
        if ((digits < 0) || (digits > 15))
        {
            throw new ArgumentOutOfRangeException("digits", Environment.GetResourceString("ArgumentOutOfRange_RoundingDigits"));
        }
        return InternalRound(value, digits, MidpointRounding.ToEven);
    }

    public static double Round(double value, MidpointRounding mode)
    {
        return Round(value, 0, mode);
    }

    public static decimal Round(decimal d, int decimals, MidpointRounding mode)
    {
        return decimal.Round(d, decimals, mode);
    }

    public static double Round(double value, int digits, MidpointRounding mode)
    {
        if ((digits < 0) || (digits > 15))
        {
            throw new ArgumentOutOfRangeException("digits", Environment.GetResourceString("ArgumentOutOfRange_RoundingDigits"));
        }
        if ((mode < MidpointRounding.ToEven) || (mode > MidpointRounding.AwayFromZero))
        {
            throw new ArgumentException(Environment.GetResourceString("Argument_InvalidEnumValue", new object[] { mode, "MidpointRounding" }), "mode");
        }
        return InternalRound(value, digits, mode);
    }

    public static int Sign(decimal value)
    {
        if (value < 0M)
        {
            return -1;
        }
        if (value > 0M)
        {
            return 1;
        }
        return 0;
    }

    public static int Sign(double value)
    {
        if (value < 0.0)
        {
            return -1;
        }
        if (value > 0.0)
        {
            return 1;
        }
        if (value != 0.0)
        {
            throw new ArithmeticException(Environment.GetResourceString("Arithmetic_NaN"));
        }
        return 0;
    }

    public static int Sign(short value)
    {
        if (value < 0)
        {
            return -1;
        }
        if (value > 0)
        {
            return 1;
        }
        return 0;
    }

    public static int Sign(int value)
    {
        if (value < 0)
        {
            return -1;
        }
        if (value > 0)
        {
            return 1;
        }
        return 0;
    }

    public static int Sign(long value)
    {
        if (value < 0L)
        {
            return -1;
        }
        if (value > 0L)
        {
            return 1;
        }
        return 0;
    }

    [CLSCompliant(false)]
    public static int Sign(sbyte value)
    {
        if (value < 0)
        {
            return -1;
        }
        if (value > 0)
        {
            return 1;
        }
        return 0;
    }

    public static int Sign(float value)
    {
        if (value < 0f)
        {
            return -1;
        }
        if (value > 0f)
        {
            return 1;
        }
        if (value != 0f)
        {
            throw new ArithmeticException(Environment.GetResourceString("Arithmetic_NaN"));
        }
        return 0;
    }

    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern double Sin(double a);
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern double Sinh(double value);
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern unsafe double SplitFractionDouble(double* value);
    [MethodImpl(MethodImplOptions.InternalCall), ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
    public static extern double Sqrt(double d);
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern double Tan(double a);
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern double Tanh(double value);
    public static decimal Truncate(decimal d)
    {
        return decimal.Truncate(d);
    }

    public static double Truncate(double d)
    {
        return InternalTruncate(d);
    }
}

 
Collapse Methods
 

scobra1w

  • Guest
Re: Share Your Nectar Making Recipes
« Reply #55 on: January 19, 2010, 09:22:53 AM »
Here's one that I found worked really well.

8 Renoit + 2 Grapes

Offline Metropolis Man

  • Tournament/Dynasty Coordinator
  • Administrator
  • Watcher
  • ******
  • Posts: 11529
Re: Share Your Nectar Making Recipes
« Reply #56 on: January 19, 2010, 10:33:17 PM »
Has anyone come up with a Flame Fruit recipe that does not include Life Fruit or the Rare Grapes? I'm trying to come up with a backup recipe in the upcoming nectar tourney and the best I found was 9FF/1Pomegranate on Extended Nectaration — $1600 for 5 bottles.

brunocbreis

  • Guest
Re: Share Your Nectar Making Recipes
« Reply #57 on: January 23, 2010, 09:00:41 AM »
Yesterday I came up with an amazing recipe!
I don't think it's anywhere, but if it is, well, it's here too:
4 Plum
5 Gralladina Fran Grapes
1 Cranerlet Nuala Grape

Also, while trying some combinations out, I got a great one too:
5 Cranerlet Nuala Grapes
3 Cherries
2 Pomelos

Offline AriaGirl77

  • Watcher
  • ******
  • Posts: 1330
Re: Share Your Nectar Making Recipes
« Reply #58 on: January 24, 2010, 06:35:12 PM »
Anyone know any good recipes for Avornalino or Meloire grapes?  Seems like the only thing good to use them for is fertilizer.  :-\

Offline Eftyen

  • Townie
  • ***
  • Posts: 117
Re: Share Your Nectar Making Recipes
« Reply #59 on: January 25, 2010, 03:53:24 PM »
A question about the flavor code...

....  It then adds the median combo multiplier (fixed value set internally but modifiable) to the product of (the Max combo multipler minus the median combo multiplier) and the value computed above.

...

P.P.S. Code for determining value:
float baseValue = ((((((num * num2) * num4) * this.mFlavorMultiplier) * num7) * kQualityLevelMultiplier[((int) num5) - 1]) * this.mMultiplierFromFeet) * makeStyleValueModifier;

num = sum of the internal nectar values associated with all ingredients (for example, apple is 5, life fruit is 22 - this is regardless of quality)
num2 = Random Multiplier (although it's constrained to a range that's set by other constants)
num4 = skill multiplier
FlavorMultiplier = Whether the nectar maker is flavor upgraded (1 if not, more if it is)
num7 = the long "taste" multiplier i talked about at beginning of post
QualityLevelMultiplier & num5 = Multiplier based on quality of produce
MultiplierFromFeet = Flavorful feet multiplier (1 if regular feet, more if sim is challenged [pun intended])
MakeStyleModifier = Multiplier based on the kind of nectar you made (extended, concentrated, mass produce, etc.)

What is the min/max range for the random number used for num2 and what are the values of the Max Combo Multiplier and Median Combo Multiplier used in generating num7?  Does anyone know???  I'm trying to figure out the minimum theoretical recipe value based on ingredient values that could top the "9 Lives w/a Pomegranate" recipe.