public SObject Copy(SObject obj)
        {
            SObject copy = (SObject)obj.getOne();

            copy.heldObject.Value  = obj.heldObject.Value;
            copy.MinutesUntilReady = obj.MinutesUntilReady;
            copy.Quality           = obj.Quality;
            return(copy);
        }
예제 #2
0
        public SObject Copy(SObject obj)
        {
            SObject copy = (SObject)obj.getOne();

            copy.heldObject.Value        = obj.heldObject.Value;
            copy.minutesUntilReady.Value = obj.minutesUntilReady.Value;
            copy.quality.Value           = obj.quality.Value;
            return(copy);
        }
        /// <summary>Get the output item.</summary>
        public override ITrackedStack GetOutput()
        {
            SObject machine    = this.Machine;
            SObject heldObject = machine.heldObject;

            return(new TrackedItem(heldObject.getOne(), item =>
            {
                machine.MinutesUntilReady = this.Reflection.GetMethod(machine, "getMinutesForCrystalarium").Invoke <int>(heldObject.ParentSheetIndex);
                machine.readyForHarvest.Value = false;
            }));
        }
예제 #4
0
 /// <summary>Get the output item.</summary>
 public override ITrackedStack GetOutput()
 {
     Cask cask = this.Machine;
     SObject heldObject = this.Machine.heldObject.Value;
     return new TrackedItem(heldObject.getOne(), item =>
     {
         cask.heldObject.Value = null;
         cask.MinutesUntilReady = 0;
         cask.readyForHarvest.Value = false;
         cask.agingRate.Value = 0;
         cask.daysToMature.Value = 0;
     });
 }
예제 #5
0
 public override bool performObjectDropInAction(StardewValley.Object dropIn, bool probe, Farmer who)
 {
     if ((this.furniture_type == 11 || this.furniture_type == 5) && this.heldObject == null && !dropIn.bigCraftable && (!(dropIn is Furniture) || ((dropIn as Furniture).getTilesWide() == 1 && (dropIn as Furniture).getTilesHigh() == 1)))
     {
         this.heldObject = (StardewValley.Object)dropIn.getOne();
         this.heldObject.tileLocation  = this.tileLocation;
         this.heldObject.boundingBox.X = this.boundingBox.X;
         this.heldObject.boundingBox.Y = this.boundingBox.Y;
         this.heldObject.performDropDownAction(who);
         if (!probe)
         {
             Game1.playSound("woodyStep");
             if (who != null)
             {
                 who.reduceActiveItemByOne();
             }
         }
         return(true);
     }
     return(false);
 }
        /// <summary>Get the output item.</summary>
        public override ITrackedStack GetOutput()
        {
            SObject heldObject = this.Machine.heldObject;

            return(new TrackedItem(heldObject.getOne(), onEmpty: this.GenericReset));
        }
예제 #7
0
파일: Cask.cs 프로젝트: avere001/sprinklers
        public override bool performObjectDropInAction(StardewValley.Object dropIn, bool probe, Farmer who)
        {
            if (dropIn != null && dropIn.bigCraftable)
            {
                return(false);
            }
            if (this.heldObject != null)
            {
                return(false);
            }
            if (!probe && (who == null || !(who.currentLocation is Cellar)))
            {
                Game1.showRedMessageUsingLoadString("Strings\\Objects:CaskNoCellar");
                return(false);
            }
            if (this.quality >= 4)
            {
                return(false);
            }
            bool  flag             = false;
            float num              = 1f;
            int   parentSheetIndex = dropIn.parentSheetIndex;

            if (parentSheetIndex <= 348)
            {
                if (parentSheetIndex != 303)
                {
                    if (parentSheetIndex != 346)
                    {
                        if (parentSheetIndex == 348)
                        {
                            flag = true;
                            num  = 1f;
                        }
                    }
                    else
                    {
                        flag = true;
                        num  = 2f;
                    }
                }
                else
                {
                    flag = true;
                    num  = 1.66f;
                }
            }
            else if (parentSheetIndex != 424)
            {
                if (parentSheetIndex != 426)
                {
                    if (parentSheetIndex == 459)
                    {
                        flag = true;
                        num  = 2f;
                    }
                }
                else
                {
                    flag = true;
                    num  = 4f;
                }
            }
            else
            {
                flag = true;
                num  = 4f;
            }
            if (flag)
            {
                this.heldObject = (dropIn.getOne() as StardewValley.Object);
                if (!probe)
                {
                    this.agingRate         = num;
                    this.daysToMature      = 56f;
                    this.minutesUntilReady = 999999;
                    if (this.heldObject.quality == 1)
                    {
                        this.daysToMature = 42f;
                    }
                    else if (this.heldObject.quality == 2)
                    {
                        this.daysToMature = 28f;
                    }
                    else if (this.heldObject.quality == 4)
                    {
                        this.daysToMature      = 0f;
                        this.minutesUntilReady = 1;
                    }
                    Game1.playSound("Ship");
                    Game1.playSound("bubbles");
                    who.currentLocation.temporarySprites.Add(new TemporaryAnimatedSprite(Game1.animations, new Rectangle(256, 1856, 64, 128), 80f, 6, 999999, this.tileLocation * (float)Game1.tileSize + new Vector2(0f, (float)(-(float)Game1.tileSize * 2)), false, false, (this.tileLocation.Y + 1f) * (float)Game1.tileSize / 10000f + 0.0001f, 0f, Color.Yellow * 0.75f, 1f, 0f, 0f, 0f, false)
                    {
                        alphaFade = 0.005f
                    });
                }
                return(true);
            }
            return(false);
        }