Exemplo n.º 1
0
        public override bool RunBehavior()
        {
            GameObject gameObject = this.mDestination.Object.GetContainedObject(this.mDestination.PlacementSlot) as GameObject;
            TrueBlood  tb         = gameObject as TrueBlood;

            if (tb != null)
            {
                int num;
                if (this.RunPaymentBehavior(out num))
                {
                    Sim        instanceActor = this.LinkedInteractionInstance.InstanceActor;
                    Bartending bartending    = (Bartending)instanceActor.SkillManager.AddElement(SkillNames.Bartending);
                    if (bartending != null)
                    {
                        Sim simInChargeOfBar = this.GetSimInChargeOfBar();
                        bartending.OnServedSim(this.Actor, simInChargeOfBar, num, Quality.Nice, this.Target.LotCurrent, DrinkDescription);
                        instanceActor.ModifyFunds(num);
                    }


                    if (CarrySystem.PickUpWithoutRouting(this.Actor, tb, true))
                    {
                        tb.PushEatHeldFoodInteraction(this.Actor);
                    }
                    else
                    {
                        gameObject.FadeOut(false, true);
                    }

                    return(true);
                }
                gameObject.FadeOut(true, true);
            }
            return(false);
        }
        public static void InitTrueBloodInstance(TrueBlood tb)
        {
            Recipe recipe = Recipe.NameToRecipeHash["TrueBlood"];

            tb.CreateFinishedFoodFromRecipe(recipe, Recipe.MealQuantity.Single, Quality.Nice,
                                            Math.Max(5, Cooking.RecipeLevelFoodPoints[recipe.CookingSkillLevelRequired]), null, false);
        }
Exemplo n.º 3
0
        public override bool RunMakeBehavior()
        {
            Recipe    recipe = Recipe.NameToRecipeHash["TrueBlood"];
            TrueBlood tb     = GlobalFunctions.CreateObjectOutOfWorld(recipe.ObjectToCreateInFridge, recipe.CodeVersion) as TrueBlood;

            tb.ParentToSlot(this.Actor, Sim.ContainmentSlots.RightHand);
            CarrySystem.EnterWhileHolding(this.Actor, tb);
            return(true);
        }
        public bool CreateFinalCookingObjectAndExit(TrueBlood trueBlood)
        {
            this.Target.SimStateMachineClient.SetActor((trueBlood as IMicrowavable).ActorNameForMicrowave, trueBlood);
            this.Target.SimStateMachineClient.RequestState("x", "Exit - " + "BowlLarge");
            CarrySystem.EnterWhileHolding(this.Actor, trueBlood as ICarryable);
            if (this.CheckForCancelAndCleanup())
            {
                return(false);
            }
            trueBlood.PushEatSnack(this.Actor);

            return(true);
        }
 public static void InitTrueBloodInstance(TrueBlood tb)
 {
     Recipe recipe = Recipe.NameToRecipeHash["TrueBlood"];
     tb.CreateFinishedFoodFromRecipe(recipe, Recipe.MealQuantity.Single, Quality.Nice,
         Math.Max(5, Cooking.RecipeLevelFoodPoints[recipe.CookingSkillLevelRequired]), null, false);
 }
        public override bool Run()
        {
            if (this.CheckForCancelAndCleanup())
            {
                return(false);
            }
            if (!this.Target.RouteToMicrowave(this, false))
            {
                return(false);
            }
            if (this.CheckForCancelAndCleanup())
            {
                return(false);
            }
            TrueBlood trueBlood = this.Target.GetContainedObject(Microwave.kContainmentSlot) as TrueBlood;

            if (trueBlood == null || trueBlood.CookingProcess == null)
            {
                return(false);
            }
            base.StandardEntry();

            this.Target.SimStateMachineClient.EnterState("x", "Enter - Hands Empty");
            this.Target.SimStateMachineClient.SetActor("x", this.Actor);
            this.Target.SimStateMachineClient.SetActor("BowlLarge", trueBlood);
            bool flag = this.Actor.HasTrait(TraitNames.NaturalCook) &&
                        this.Actor.SkillManager.GetSkillLevel(SkillNames.Cooking) >= TraitTuning.NaturalCookTraitLevelToEnhanceFood &&
                        RandomUtil.RandomChance01(TraitTuning.NaturalCookTraitChanceToPlayEnhanceAnimation);

            this.Target.SimStateMachineClient.SetParameter("isNaturalCook", flag);
            if (flag)
            {
                trueBlood.CookingProcess.NaturalCookEnhanced = true;
            }
            if (this.Actor.HasTrait(TraitNames.BornToCook))
            {
                trueBlood.CookingProcess.BornToCookEnhanced = true;
            }

            this.MicrowaveCookLoop(trueBlood);

            if (trueBlood.CookingProcess.IsDoneCooking)
            {
                this.CreateFinalCookingObjectAndExit(trueBlood);
            }
            else
            {
                this.Target.SimStateMachineClient.RequestState("x", "Exit - Hands Empty");
            }
            if (this.CheckForCancelAndCleanup())
            {
                return(false);
            }
            Counter counter = this.Target.Parent as Counter;

            if (counter != null && counter.IsCleanable)
            {
                counter.Cleanable.DirtyInc(this.Actor);
            }
            base.StandardExit();
            return(true);
        }
        public override bool Run()
        {
            if (this.CheckForCancelAndCleanup())
            {
                return(false);
            }
            if (!Target.RouteToOpen(this, true))
            {
                return(false);
            }
            if (Target.InUse)
            {
                this.Actor.AddExitReason(ExitReason.RouteFailed);
                return(false);
            }
            this.mImpassableRegion.AddMember(this.Actor);
            this.mImpassableRegion.AddMember(this.Target);
            this.mImpassableRegion.UpdateFootprint();
            base.StandardEntry();

            bool flag = true;
            List <Ingredient> ingredientsUsed = new List <Ingredient>();

            if (this.ChosenRecipe.UseUpIngredientsFrom(this.Actor, ref ingredientsUsed, Recipe.MealQuantity.Single) || this.Actor.IsNPC)
            {
                Fridge.EnterStateMachine(this);
                TrueBlood  trueBlood  = GlobalFunctions.CreateObjectOutOfWorld(this.ChosenRecipe.ObjectToCreateInFridge, this.ChosenRecipe.CodeVersion) as TrueBlood;
                GameObject gameObject = trueBlood as GameObject;
                gameObject.AddToUseList(this.Actor);
                try
                {
                    this.Target.PutOnFridgeShelf(gameObject);
                    trueBlood.InitializeForRecipe(this.ChosenRecipe);
                    Recipe.MealDestination destination = Recipe.MealDestination.SurfaceOrEat;
                    CookingProcess         process     = new CookingProcess(ChosenRecipe, new List <Ingredient>(), Target, Actor.LotCurrent, destination,
                                                                            Recipe.MealQuantity.Single, Recipe.MealRepetition.MakeOne, "Tru Blood", new String[] { }, trueBlood, Actor, false);
                    trueBlood.CookingProcess = process;
                    CookingProcess.MoveToNextStep(trueBlood, Actor);
                    base.SetActor(trueBlood.ActorNameForFridge, gameObject);

                    base.AnimateSim("Remove - " + trueBlood.ActorNameForFridge);
                }
                catch
                {
                    gameObject.Destroy();
                    throw;
                }
                CarrySystem.EnterWhileHolding(this.Actor, trueBlood, false);
                if (this.CheckForCancelAndCleanup())
                {
                    return(false);
                }
                if (this.Actor.HasTrait(TraitNames.NaturalCook))
                {
                    TraitTipsManager.ShowTraitTip(13271263770231522448uL, this.Actor, TraitTipsManager.TraitTipCounterIndex.NaturalCook, TraitTipsManager.kNaturalCookCountOfMealsCooked);
                }

                InteractionDefinition warmUp = PutBloodToMicrowave.Singleton;
                Actor.InteractionQueue.PushAsContinuation(warmUp, gameObject, true);
                base.AnimateSim("Exit - Standing");
            }
            else
            {
                flag = false;
            }
            base.StandardExit();
            if (flag)
            {
                ActiveTopic.AddToSim(this.Actor, "Has Made Food");
            }
            return(flag);
        }