public override Item getOne() { ExtraSeeds ExtraSeeds = new ExtraSeeds(this.parentSheetIndex, this.tileLocation, this.inventoryMaxSize); /* * drawPosition = this.drawPosition; * defaultBoundingBox = this.defaultBoundingBox; * boundingBox = this.boundingBox; * currentRotation = this.currentRotation - 1; * rotations = this.rotations; * rotate(); */ return(ExtraSeeds); }
public override bool canBePlacedHere(GameLocation l, Vector2 tile) { return(false); if ((l is FarmHouse)) { for (int i = 0; i < this.boundingBox.Width / Game1.tileSize; i++) { for (int j = 0; j < this.boundingBox.Height / Game1.tileSize; j++) { Vector2 vector = tile * (float)Game1.tileSize + new Vector2((float)i, (float)j) * (float)Game1.tileSize; vector.X += (float)(Game1.tileSize / 2); vector.Y += (float)(Game1.tileSize / 2); foreach (KeyValuePair <Vector2, StardewValley.Object> something in l.objects) { StardewValley.Object obj = something.Value; if ((obj.GetType()).ToString().Contains("ExtraSeeds")) { ExtraSeeds current = (ExtraSeeds)obj; if (current.Decoration_type == 11 && current.getBoundingBox(current.tileLocation).Contains((int)vector.X, (int)vector.Y) && current.heldObject == null && this.getTilesWide() == 1) { bool result = true; return(result); } if ((current.Decoration_type != 12 || this.Decoration_type == 12) && current.getBoundingBox(current.tileLocation).Contains((int)vector.X, (int)vector.Y)) { bool result = false; return(result); } } } } } return(base.canBePlacedHere(l, tile)); } else { // Game1.showRedMessage("NOT FARMHOUSE"); for (int i = 0; i < this.boundingBox.Width / Game1.tileSize; i++) { for (int j = 0; j < this.boundingBox.Height / Game1.tileSize; j++) { Vector2 vector = tile * (float)Game1.tileSize + new Vector2((float)i, (float)j) * (float)Game1.tileSize; vector.X += (float)(Game1.tileSize / 2); vector.Y += (float)(Game1.tileSize / 2); /* * foreach (ExtraSeeds current in (l as FarmHouse).ExtraSeeds) * { * if (current.Decoration_type == 11 && current.getBoundingBox(current.tileLocation).Contains((int)vector.X, (int)vector.Y) && current.heldObject == null && this.getTilesWide() == 1) * { * bool result = true; * return result; * } * if ((current.Decoration_type != 12 || this.Decoration_type == 12) && current.getBoundingBox(current.tileLocation).Contains((int)vector.X, (int)vector.Y)) * { * bool result = false; * return result; * } * } */ } } return(Util.canBePlacedHere(this, l, tile)); } }