Exemplo n.º 1
0
 public override void onCast(SFarmer player, int level, int targetX, int targetY)
 {
     Log.debug(player.Name + " casted Blink.");
     player.position.X = targetX - player.GetBoundingBox().Width / 2;
     player.position.Y = targetY - player.GetBoundingBox().Height / 2;
     Game1.playSound("powerup");
     player.addMagicExp(5);
 }
Exemplo n.º 2
0
            private void update(object sender, EventArgs args)
            {
                if (player.yJumpVelocity == 0 && prevJumpVel < 0)
                {
                    player.canMove = true;

                    GameEvents.UpdateTick -= update;
                }
                else
                {
                    int tx = (int)player.position.X / Game1.tileSize;
                    int ty = (int)player.position.Y / Game1.tileSize;
                    int ox = 0, oy = 0; // Offset x, y
                    switch (player.facingDirection.Value)
                    {
                    case Game1.up:    oy = -1; break;

                    case Game1.down:  oy = 1; break;

                    case Game1.left:  ox = -1; break;

                    case Game1.right: ox = 1; break;
                    }

                    var bb  = player.GetBoundingBox();
                    var bb1 = player.GetBoundingBox();
                    bb1.X += ox * Game1.tileSize;
                    bb1.Y += oy * Game1.tileSize;
                    var bb2 = player.GetBoundingBox();
                    bb2.X += ox * Game1.tileSize * 2;
                    bb2.Y += oy * Game1.tileSize * 2;

                    bool n0 = player.currentLocation.isCollidingPosition(bb, Game1.viewport, true, 0, false, player);
                    bool n1 = player.currentLocation.isCollidingPosition(bb1, Game1.viewport, true, 0, false, player);
                    bool n2 = player.currentLocation.isCollidingPosition(bb2, Game1.viewport, true, 0, false, player);

                    Log.trace($"{n0} {n1} {n2}");
                    if (n0 || (!n0 && n1 && !n2) /*|| wasGoingOver*/)
                    {
                        //wasGoingOver = true;
                        Game1.player.canMove = false;
                        player.position.X   += ox * 5;
                        player.position.Y   += oy * 5;
                    }
                }

                prevJumpVel = player.yJumpVelocity;
            }
        public SpellProjectile(SFarmer theSource, ProjectileSpell theSpell, int dmg, float theDir, float theVel)
        {
            source = theSource;
            spell  = theSpell;
            damage = dmg;
            dir    = theDir;
            vel    = theVel;

            theOneWhoFiredMe.Set(theSource.currentLocation, source);
            position.Value        = source.getStandingPosition();
            position.X           += source.GetBoundingBox().Width;
            position.Y           += source.GetBoundingBox().Height;
            rotation              = theDir;
            xVelocity.Value       = (float)Math.Cos(dir) * vel;
            yVelocity.Value       = (float)Math.Sin(dir) * vel;
            damagesMonsters.Value = true;

            tex   = Content.loadTexture("magic/" + spell.ParentSchoolId + "/" + spell.Id + "/projectile.png");
            texId = Content.loadTextureKey("magic/" + spell.ParentSchoolId + "/" + spell.Id + "/projectile.png");
        }
        public override void DoFunction(GameLocation location, int x, int y, int power, StardewValley.Farmer who)
        {
            this.lastUser = who;
            //base.DoFunction(location, x, y, power, who);
            power = who.toolPower;
            who.stopJittering();
            List <Vector2> source = IridiumTiles.AFTiles(new Vector2((float)(x / Game1.tileSize), (float)(y / Game1.tileSize)), power, who);

            if (location.doesTileHaveProperty(x / Game1.tileSize, y / Game1.tileSize, "Water", "Back") != null || location.doesTileHaveProperty(x / Game1.tileSize, y / Game1.tileSize, "WaterSource", "Back") != null || location is BuildableGameLocation && (location as BuildableGameLocation).getBuildingAt(source.First <Vector2>()) != null && ((location as BuildableGameLocation).getBuildingAt(source.First <Vector2>()).buildingType.Equals("Well") && (location as BuildableGameLocation).getBuildingAt(source.First <Vector2>()).daysOfConstructionLeft <= 0))
            {
                who.jitterStrength = 0.5f;
                switch (this.upgradeLevel)
                {
                case 0:
                    this.waterCanMax = 40;
                    break;

                case 1:
                    this.waterCanMax = 55;
                    break;

                case 2:
                    this.waterCanMax = 70;
                    break;

                case 3:
                    this.waterCanMax = 85;
                    break;

                case 4:
                    this.waterCanMax = 100;
                    break;
                }
                this.waterLeft = this.waterCanMax;
                Game1.playSound("slosh");
                DelayedAction.playSoundAfterDelay("glug", 250);
            }
            else if (this.waterLeft > 0)
            {
                who.Stamina -= (float)(2 * (power + 1)) - (float)who.FarmingLevel * 0.1f;
                int num = 0;
                foreach (Vector2 index in source)
                {
                    //UP function in process

                    if (location.terrainFeatures.ContainsKey(index))
                    {
                        if (location.terrainFeatures.ContainsKey(index) && location.terrainFeatures[index].GetType() == typeof(HoeDirt))
                        {
                            HoeDirt joeDirt = new HoeDirt();
                            if (location.terrainFeatures.ContainsKey(index) && location.terrainFeatures[index].GetType() == typeof(HoeDirt))
                            {
                                joeDirt = (HoeDirt)location.terrainFeatures[index];
                            }
                            IridiumTiles.perfWaterAction(this, 0, index, (GameLocation)null, joeDirt);
                        }
                        location.terrainFeatures[index].performToolAction((Tool)this, 0, index, (GameLocation)null);
                    }


                    if (location.objects.ContainsKey(index))
                    {
                        location.Objects[index].performToolAction((Tool)this);
                    }
                    location.performToolAction((Tool)this, (int)index.X, (int)index.Y);
                    location.temporarySprites.Add(new TemporaryAnimatedSprite(13, new Vector2(index.X * (float)Game1.tileSize, index.Y * (float)Game1.tileSize), Color.White, 10, Game1.random.NextDouble() < 0.5, 70f, 0, Game1.tileSize, (float)(((double)index.Y * (double)Game1.tileSize + (double)(Game1.tileSize / 2)) / 10000.0 - 0.00999999977648258), -1, 0)
                    {
                        delayBeforeAnimationStart = 200 + num * 10
                    });
                    ++num;
                }
                this.waterLeft -= power + 1;
                Vector2 vector2 = new Vector2(who.position.X - (float)(Game1.tileSize / 2) - (float)Game1.pixelZoom, who.position.Y - (float)(Game1.tileSize / 4) - (float)Game1.pixelZoom);
                switch (who.facingDirection)
                {
                case 0:
                    vector2 = Vector2.Zero;
                    break;

                case 1:
                    vector2.X += (float)(Game1.tileSize * 2 + Game1.pixelZoom * 2);
                    break;

                case 2:
                    vector2.X += (float)(Game1.tileSize + Game1.pixelZoom * 2);
                    vector2.Y += (float)(Game1.tileSize / 2 + Game1.pixelZoom * 3);
                    break;
                }
                if (vector2.Equals(Vector2.Zero))
                {
                    return;
                }
                for (int index = 0; index < 30; ++index)
                {
                    location.temporarySprites.Add(new TemporaryAnimatedSprite(Game1.staminaRect, new Microsoft.Xna.Framework.Rectangle(0, 0, 1, 1), 999f, 1, 999, vector2 + new Vector2((float)(Game1.random.Next(-3, 0) * Game1.pixelZoom), (float)(Game1.random.Next(2) * Game1.pixelZoom)), false, false, (float)(who.GetBoundingBox().Bottom + Game1.tileSize / 2) / 10000f, 0.04f, Game1.random.NextDouble() < 0.5 ? Color.DeepSkyBlue : Color.LightBlue, (float)Game1.pixelZoom, 0.0f, 0.0f, 0.0f, false)
                    {
                        delayBeforeAnimationStart = index * 15,
                        motion       = new Vector2((float)Game1.random.Next(-10, 11) / 100f, 0.5f),
                        acceleration = new Vector2(0.0f, 0.1f)
                    });
                }
            }
            else
            {
                who.doEmote(4);
                Game1.showRedMessage(Game1.content.LoadString("Strings\\StringsFromCSFiles:WateringCan.cs.14335"));
            }
        }
Exemplo n.º 5
0
        private static bool DoToolFunction(GameLocation location, StardewValley.Farmer who, Tool tool, int x, int y)
        {
            bool    performedAction = false;
            Vector2 index           = new Vector2(x, y);
            Vector2 vector2         = new Vector2((float)(x + 0.5), (float)(y + 0.5));

            if (tool is MeleeWeapon && tool.Name.ToLower().Contains("scythe"))
            {
                var snapshotPlayerExperience = Game1.player.experiencePoints;
                if (location.objects[index] != null)
                {
                    StardewValley.Object hitObject = location.objects[index];
                    if (hitObject.name.Contains("Weed") && hitObject.performToolAction(tool, location))
                    {
                        if (hitObject.type == "Crafting" && hitObject.fragility != 2)
                        {
                            location.debris.Add(new Debris(hitObject.bigCraftable ? -hitObject.parentSheetIndex : hitObject.parentSheetIndex, index, index));
                        }
                        hitObject.performRemoveAction(index, location);
                        location.objects.Remove(index);
                        performedAction = true;
                    }
                }
                else if (location.terrainFeatures.ContainsKey(index) && location.terrainFeatures[index].performToolAction(tool, 0, index, (GameLocation)null))
                {
                    location.terrainFeatures.Remove(index);
                    performedAction = true;
                }
                RestorePlayerExperience(snapshotPlayerExperience);
            }
            else if (tool is Axe)
            {
                var       snapshotPlayerExperience = Game1.player.experiencePoints;
                Rectangle rectangle = new Rectangle(x * Game1.tileSize, y * Game1.tileSize, Game1.tileSize, Game1.tileSize);
                location.performToolAction(tool, x, y);
                if (location.terrainFeatures.ContainsKey(index) && location.terrainFeatures[index].performToolAction(tool, 0, index, (GameLocation)null))
                {
                    location.terrainFeatures.Remove(index);
                    performedAction = true;
                }
                Rectangle boundingBox;
                if (location.largeTerrainFeatures != null)
                {
                    for (int index2 = location.largeTerrainFeatures.Count - 1; index2 >= 0; --index2)
                    {
                        boundingBox = location.largeTerrainFeatures[index2].getBoundingBox();
                        if (boundingBox.Intersects(rectangle) && location.largeTerrainFeatures[index2].performToolAction(tool, 0, index, (GameLocation)null))
                        {
                            location.largeTerrainFeatures.RemoveAt(index2);
                        }
                    }
                }
                if (location.terrainFeatures.ContainsKey(index) && location.terrainFeatures[index] is Tree)
                {
                    if (!(location.terrainFeatures[index] as Tree).stump || EquivalentExchange.IsShiftKeyPressed())
                    {
                        performedAction = true;
                    }
                }
                if (!location.Objects.ContainsKey(index) || location.Objects[index].Type == null || !location.Objects[index].performToolAction(tool, location))
                {
                    return(performedAction);
                }
                if (location.Objects[index].type.Equals("Crafting") && location.Objects[index].fragility != 2)
                {
                    var    debris1     = location.debris;
                    int    objectIndex = location.Objects[index].bigCraftable ? -location.Objects[index].ParentSheetIndex : location.Objects[index].ParentSheetIndex;
                    Debris debris2     = new Debris(objectIndex, index, index);
                    debris1.Add(debris2);
                }
                location.Objects[index].performRemoveAction(index, location);
                location.Objects.Remove(index);
                performedAction = true;
                RestorePlayerExperience(snapshotPlayerExperience);
            }
            else if (tool is Pickaxe)
            {
                var snapshotPlayerExperience = Game1.player.experiencePoints;
                int power = who.toolPower;
                if (location.performToolAction(tool, x, y))
                {
                    return(true);
                }
                StardewValley.Object objectHit = (StardewValley.Object)null;
                location.Objects.TryGetValue(index, out objectHit);
                if (objectHit == null)
                {
                    if (location.terrainFeatures.ContainsKey(index) && location.terrainFeatures[index].performToolAction(tool, 0, index, (GameLocation)null))
                    {
                        location.terrainFeatures.Remove(index);
                        performedAction = true;
                    }
                }

                if (objectHit != null)
                {
                    if (objectHit.Name.Equals("Stone"))
                    {
                        Game1.playSound("hammer");
                        if (objectHit.minutesUntilReady > 0)
                        {
                            int num3 = Math.Max(1, tool.upgradeLevel + 1);
                            objectHit.minutesUntilReady.Set(objectHit.minutesUntilReady - num3);
                            objectHit.shakeTimer = 200;
                            if (objectHit.minutesUntilReady > 0)
                            {
                                Game1.createRadialDebris(Game1.currentLocation, 14, x, y, Game1.random.Next(2, 5), false, -1, false, -1);
                                return(performedAction);
                            }
                        }
                        if (objectHit.ParentSheetIndex < 200 && !Game1.objectInformation.ContainsKey(objectHit.ParentSheetIndex + 1))
                        {
                            location.TemporarySprites.Add(new TemporaryAnimatedSprite(objectHit.ParentSheetIndex + 1, 300f, 1, 2, new Vector2((float)(x) * Game1.tileSize, (float)(y) * Game1.tileSize), true, objectHit.flipped)
                            {
                                alphaFade = 0.01f
                            });
                        }
                        else
                        {
                            location.TemporarySprites.Add(new TemporaryAnimatedSprite(47, new Vector2((float)(x * Game1.tileSize), (float)(y * Game1.tileSize)), Color.Gray, 10, false, 80f, 0, -1, -1f, -1, 0));
                        }
                        Game1.createRadialDebris(location, 14, x, y, Game1.random.Next(2, 5), false, -1, false, -1);
                        location.TemporarySprites.Add(new TemporaryAnimatedSprite(46, new Vector2((float)(x * Game1.tileSize), (float)(y * Game1.tileSize)), Color.White, 10, false, 80f, 0, -1, -1f, -1, 0)
                        {
                            motion       = new Vector2(0.0f, -0.6f),
                            acceleration = new Vector2(0.0f, 1f / 500f),
                            alphaFade    = 0.015f
                        });
                        if (!location.Name.StartsWith("UndergroundMine"))
                        {
                            if (objectHit.parentSheetIndex == 343 || objectHit.parentSheetIndex == 450)
                            {
                                Random random = new Random((int)Game1.stats.DaysPlayed + (int)Game1.uniqueIDForThisGame / 2 + x * 2000 + y);
                                if (random.NextDouble() < 0.035 && Game1.stats.DaysPlayed > 1U)
                                {
                                    Game1.createObjectDebris(535 + (Game1.stats.DaysPlayed <= 60U || random.NextDouble() >= 0.2 ? (Game1.stats.DaysPlayed <= 120U || random.NextDouble() >= 0.2 ? 0 : 2) : 1), x, y, tool.getLastFarmerToUse().uniqueMultiplayerID);
                                }
                                if (random.NextDouble() < 0.035 * (who.professions.Contains(21) ? 2.0 : 1.0) && Game1.stats.DaysPlayed > 1U)
                                {
                                    Game1.createObjectDebris(382, x, y, tool.getLastFarmerToUse().uniqueMultiplayerID);
                                }
                                if (random.NextDouble() < 0.01 && Game1.stats.DaysPlayed > 1U)
                                {
                                    Game1.createObjectDebris(390, x, y, tool.getLastFarmerToUse().uniqueMultiplayerID);
                                }
                            }
                            location.breakStone(objectHit.parentSheetIndex, x, y, who, new Random((int)Game1.stats.DaysPlayed + (int)Game1.uniqueIDForThisGame / 2 + x * 4000 + y));
                        }
                        else
                        {
                            Game1.mine.checkStoneForItems(objectHit.ParentSheetIndex, x, y, who);
                        }
                        if (objectHit.minutesUntilReady > 0)
                        {
                            return(performedAction);
                        }
                        location.Objects.Remove(index);
                        Game1.playSound("stoneCrack");
                        performedAction = true;
                    }
                    else
                    {
                        if (!objectHit.performToolAction(tool, location))
                        {
                            return(performedAction);
                        }
                        objectHit.performRemoveAction(index, location);
                        if (objectHit.type.Equals("Crafting") && objectHit.fragility != 2)
                        {
                            var       debris1      = Game1.currentLocation.debris;
                            int       objectIndex  = objectHit.bigCraftable ? -objectHit.ParentSheetIndex : objectHit.ParentSheetIndex;
                            Vector2   toolLocation = who.GetToolLocation(false);
                            Rectangle boundingBox  = who.GetBoundingBox();
                            double    x1           = (double)boundingBox.Center.X;
                            boundingBox = who.GetBoundingBox();
                            double  y1             = (double)boundingBox.Center.Y;
                            Vector2 playerPosition = new Vector2((float)x1, (float)y1);
                            Debris  debris2        = new Debris(objectIndex, toolLocation, playerPosition);
                            debris1.Add(debris2);
                        }
                        Game1.currentLocation.Objects.Remove(index);
                        performedAction = true;
                    }
                    RestorePlayerExperience(snapshotPlayerExperience);
                }
                else
                {
                    Game1.playSound("woodyHit");
                    if (location.doesTileHaveProperty(x, y, "Diggable", "Back") == null)
                    {
                        return(false);
                    }
                    location.TemporarySprites.Add(new TemporaryAnimatedSprite(12, new Vector2((float)(x * Game1.tileSize), (float)(y * Game1.tileSize)), Color.White, 8, false, 80f, 0, -1, -1f, -1, 0)
                    {
                        alphaFade = 0.015f
                    });
                }
            }
            else if (tool is Hoe)
            {
                var snapshotPlayerExperience = Game1.player.experiencePoints;
                if (location.terrainFeatures.ContainsKey(index))
                {
                    if (location.terrainFeatures[index].performToolAction(tool, 0, index, (GameLocation)null))
                    {
                        location.terrainFeatures.Remove(index);
                        performedAction = true;
                    }
                }
                else
                {
                    if (location.objects.ContainsKey(index) && location.Objects[index].performToolAction(tool, location))
                    {
                        if (location.Objects[index].type.Equals("Crafting") && location.Objects[index].fragility != 2)
                        {
                            var     debris1      = location.debris;
                            int     objectIndex  = location.Objects[index].bigCraftable ? -location.Objects[index].ParentSheetIndex : location.Objects[index].ParentSheetIndex;
                            Vector2 toolLocation = who.GetToolLocation(false);
                            Microsoft.Xna.Framework.Rectangle boundingBox = who.GetBoundingBox();
                            double x1 = (double)boundingBox.Center.X;
                            boundingBox = who.GetBoundingBox();
                            double  y1             = (double)boundingBox.Center.Y;
                            Vector2 playerPosition = new Vector2((float)x1, (float)y1);
                            Debris  debris2        = new Debris(objectIndex, toolLocation, playerPosition);
                            debris1.Add(debris2);
                        }
                        location.Objects[index].performRemoveAction(index, location);
                        location.Objects.Remove(index);
                        performedAction = true;
                    }
                    if (location.doesTileHaveProperty((int)index.X, (int)index.Y, "Diggable", "Back") != null)
                    {
                        if (location.Name.Equals("UndergroundMine") && !location.isTileOccupied(index, ""))
                        {
                            location.terrainFeatures.Add(index, (TerrainFeature) new HoeDirt());
                            performedAction = true;
                            Game1.removeSquareDebrisFromTile((int)index.X, (int)index.Y);
                            location.checkForBuriedItem((int)index.X, (int)index.Y, false, false);
                            location.temporarySprites.Add(new TemporaryAnimatedSprite(12, new Vector2(vector2.X * (float)Game1.tileSize, vector2.Y * (float)Game1.tileSize), Color.White, 8, Game1.random.NextDouble() < 0.5, 50f, 0, -1, -1f, -1, 0));
                        }
                        else if (!location.isTileOccupied(index, "") && location.isTilePassable(new xTile.Dimensions.Location((int)index.X, (int)index.Y), Game1.viewport))
                        {
                            location.makeHoeDirt(index);
                            performedAction = true;
                            Game1.removeSquareDebrisFromTile((int)index.X, (int)index.Y);
                            location.temporarySprites.Add(new TemporaryAnimatedSprite(12, new Vector2(index.X * (float)Game1.tileSize, index.Y * (float)Game1.tileSize), Color.White, 8, Game1.random.NextDouble() < 0.5, 50f, 0, -1, -1f, -1, 0));
                            location.checkForBuriedItem((int)index.X, (int)index.Y, false, false);
                        }
                    }
                }
                RestorePlayerExperience(snapshotPlayerExperience);
            }
            return(performedAction);
        }
Exemplo n.º 6
0
        public override void DoFunction(GameLocation location, int x, int y, int power, StardewValley.Farmer who)
        {
            this.lastUser = who;
            if (location.Name.Equals("UndergroundMine"))
            {
                power = 1;
            }
            who.Stamina -= (float)(2 * power) - (float)who.FarmingLevel * 0.1f;
            power        = who.toolPower;
            who.stopJittering();
            Game1.playSound("woodyHit");
            Vector2        vector2     = new Vector2((float)(x / Game1.tileSize), (float)(y / Game1.tileSize));
            List <Vector2> vector2List = IridiumTiles.AFTiles(vector2, power, who);

            foreach (Vector2 index in vector2List)
            {
                index.Equals(vector2);
                if (location.terrainFeatures.ContainsKey(index))
                {
                    //terrainfeatures.performToolAction apparently always returns false
                    if (location.terrainFeatures[index].performToolAction((Tool)this, 0, index, (GameLocation)null))
                    {
                        location.terrainFeatures.Remove(index);
                    }
                }
                else
                {
                    //Test of object[index].performToolAction
                    StardewValley.Object obj = null;
                    if (location.Objects.ContainsKey(index))
                    {
                        obj = location.Objects[index];
                    }
                    //if (location.objects.ContainsKey(index) && location.Objects[index].performToolAction((Tool)this))


                    if (location.objects.ContainsKey(index) && IridiumTiles.perfHoeAtion(this, obj))
                    {
                        if (location.Objects[index].type.Equals("Crafting") && location.Objects[index].fragility != 2)
                        {
                            List <Debris> debris1      = location.debris;
                            int           objectIndex  = location.Objects[index].bigCraftable ? -location.Objects[index].ParentSheetIndex : location.Objects[index].ParentSheetIndex;
                            Vector2       toolLocation = who.GetToolLocation(false);
                            Microsoft.Xna.Framework.Rectangle boundingBox = who.GetBoundingBox();
                            double x1 = (double)boundingBox.Center.X;
                            boundingBox = who.GetBoundingBox();
                            double  y1             = (double)boundingBox.Center.Y;
                            Vector2 playerPosition = new Vector2((float)x1, (float)y1);
                            Debris  debris2        = new Debris(objectIndex, toolLocation, playerPosition);
                            debris1.Add(debris2);
                        }
                        location.Objects[index].performRemoveAction(index, location);
                        location.Objects.Remove(index);
                    }
                    if (location.doesTileHaveProperty((int)index.X, (int)index.Y, "Diggable", "Back") != null)
                    {
                        if (location.Name.Equals("UndergroundMine") && !location.isTileOccupied(index, ""))
                        {
                            if (Game1.mine.mineLevel < 40 || Game1.mine.mineLevel >= 80)
                            {
                                location.terrainFeatures.Add(index, (TerrainFeature) new HoeDirt());
                                Game1.playSound("hoeHit");
                            }
                            else if (Game1.mine.mineLevel < 80)
                            {
                                location.terrainFeatures.Add(index, (TerrainFeature) new HoeDirt());
                                Game1.playSound("hoeHit");
                            }
                            Game1.removeSquareDebrisFromTile((int)index.X, (int)index.Y);
                            location.checkForBuriedItem((int)index.X, (int)index.Y, false, false);
                            location.temporarySprites.Add(new TemporaryAnimatedSprite(12, new Vector2(vector2.X * (float)Game1.tileSize, vector2.Y * (float)Game1.tileSize), Color.White, 8, Game1.random.NextDouble() < 0.5, 50f, 0, -1, -1f, -1, 0));
                            if (vector2List.Count > 2)
                            {
                                location.temporarySprites.Add(new TemporaryAnimatedSprite(6, new Vector2(index.X * (float)Game1.tileSize, index.Y * (float)Game1.tileSize), Color.White, 8, Game1.random.NextDouble() < 0.5, Vector2.Distance(vector2, index) * 30f, 0, -1, -1f, -1, 0));
                            }
                        }
                        else if (!location.isTileOccupied(index, "") && location.isTilePassable(new Location((int)index.X, (int)index.Y), Game1.viewport))
                        {
                            location.makeHoeDirt(index);
                            Game1.playSound("hoeHit");
                            Game1.removeSquareDebrisFromTile((int)index.X, (int)index.Y);
                            location.temporarySprites.Add(new TemporaryAnimatedSprite(12, new Vector2(index.X * (float)Game1.tileSize, index.Y * (float)Game1.tileSize), Color.White, 8, Game1.random.NextDouble() < 0.5, 50f, 0, -1, -1f, -1, 0));
                            if (vector2List.Count > 2)
                            {
                                location.temporarySprites.Add(new TemporaryAnimatedSprite(6, new Vector2(index.X * (float)Game1.tileSize, index.Y * (float)Game1.tileSize), Color.White, 8, Game1.random.NextDouble() < 0.5, Vector2.Distance(vector2, index) * 30f, 0, -1, -1f, -1, 0));
                            }
                            location.checkForBuriedItem((int)index.X, (int)index.Y, false, false);
                        }
                        ++Game1.stats.DirtHoed;
                    }
                }
            }
        }
Exemplo n.º 7
0
        public static void drawDuringUse(int frameOfFarmerAnimation, int facingDirection, SpriteBatch spriteBatch, Vector2 playerPosition, SFarmer f, Rectangle sourceRect, int type, bool isOnSpecial)
        {
            if (f.CurrentTool is ICustomWeaponDraw)
            {
                (f.CurrentTool as ICustomWeaponDraw).draw(frameOfFarmerAnimation, facingDirection, spriteBatch, playerPosition, f, sourceRect, type, isOnSpecial);
                return;
            }

            var MeleeWeapon_center = new Vector2(1f, 15f);

            Tool currentTool = f.CurrentTool;

            if (type != 1)
            {
                if (isOnSpecial)
                {
                    if (type == 3)
                    {
                        switch (f.FacingDirection)
                        {
                        case 0:
                            spriteBatch.Draw(Tool.weaponsTexture, new Vector2((float)((double)playerPosition.X + (double)Game1.tileSize - 8.0), playerPosition.Y - 44f), new Rectangle?(sourceRect), Color.White, -1.767146f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() - 1) / 10000f));
                            break;

                        case 1:
                            spriteBatch.Draw(Tool.weaponsTexture, new Vector2((float)((double)playerPosition.X + (double)Game1.tileSize - 8.0), playerPosition.Y - 4f), new Rectangle?(sourceRect), Color.White, -3f * (float)Math.PI / 16f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + 1) / 10000f));
                            break;

                        case 2:
                            spriteBatch.Draw(Tool.weaponsTexture, new Vector2((float)((double)playerPosition.X + (double)Game1.tileSize - 52.0), playerPosition.Y + 4f), new Rectangle?(sourceRect), Color.White, -5.105088f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + 2) / 10000f));
                            break;

                        case 3:
                            spriteBatch.Draw(Tool.weaponsTexture, new Vector2((float)((double)playerPosition.X + (double)Game1.tileSize - 56.0), playerPosition.Y - 4f), new Rectangle?(sourceRect), Color.White, -0.9817477f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + 1) / 10000f));
                            break;
                        }
                    }
                    else
                    {
                        if (type != 2)
                        {
                            return;
                        }
                        if (facingDirection == 1)
                        {
                            switch (frameOfFarmerAnimation)
                            {
                            case 0:
                                spriteBatch.Draw(Tool.weaponsTexture, new Vector2((float)((double)playerPosition.X - (double)(Game1.tileSize / 2) - 12.0), playerPosition.Y - (float)(Game1.tileSize * 5 / 4)), new Rectangle?(sourceRect), Color.White, -3f * (float)Math.PI / 8f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize) / 10000f));
                                break;

                            case 1:
                                spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + (float)Game1.tileSize, (float)((double)playerPosition.Y - (double)Game1.tileSize - 48.0)), new Rectangle?(sourceRect), Color.White, 0.3926991f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize) / 10000f));
                                break;

                            case 2:
                                spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + (float)(Game1.tileSize * 2) - (float)(Game1.pixelZoom * 4), playerPosition.Y - (float)Game1.tileSize - (float)(Game1.pixelZoom * 3)), new Rectangle?(sourceRect), Color.White, 3f * (float)Math.PI / 8f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize) / 10000f));
                                break;

                            case 3:
                                spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + 72f, (float)((double)playerPosition.Y - (double)Game1.tileSize + (double)(Game1.tileSize / 4) - 32.0)), new Rectangle?(sourceRect), Color.White, 0.3926991f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize) / 10000f));
                                break;

                            case 4:
                                spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + (float)(Game1.tileSize * 3 / 2), (float)((double)playerPosition.Y - (double)Game1.tileSize + (double)(Game1.tileSize / 4) - 16.0)), new Rectangle?(sourceRect), Color.White, 0.7853982f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize) / 10000f));
                                break;

                            case 5:
                                spriteBatch.Draw(Tool.weaponsTexture, new Vector2((float)((double)playerPosition.X + (double)(Game1.tileSize * 3 / 2) - 12.0), playerPosition.Y - (float)Game1.tileSize + (float)(Game1.tileSize / 4)), new Rectangle?(sourceRect), Color.White, 0.7853982f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize) / 10000f));
                                break;

                            case 6:
                                spriteBatch.Draw(Tool.weaponsTexture, new Vector2((float)((double)playerPosition.X + (double)(Game1.tileSize * 3 / 2) - 16.0), (float)((double)playerPosition.Y - (double)Game1.tileSize + (double)Game1.tileSize * 0.625 - 8.0)), new Rectangle?(sourceRect), Color.White, 0.7853982f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize) / 10000f));
                                break;

                            case 7:
                                spriteBatch.Draw(Tool.weaponsTexture, new Vector2((float)((double)playerPosition.X + (double)(Game1.tileSize * 3 / 2) - 8.0), playerPosition.Y + (float)Game1.tileSize * 0.625f), new Rectangle?(sourceRect), Color.White, 0.9817477f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize) / 10000f));
                                break;
                            }
                        }
                        else if (facingDirection == 3)
                        {
                            switch (frameOfFarmerAnimation)
                            {
                            case 0:
                                spriteBatch.Draw(Tool.weaponsTexture, new Vector2((float)((double)playerPosition.X + (double)Game1.tileSize - 4.0 + 8.0), playerPosition.Y - 56f - (float)Game1.tileSize), new Rectangle?(sourceRect), Color.White, 0.3926991f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize) / 10000f));
                                break;

                            case 1:
                                spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X - (float)(Game1.tileSize / 2), playerPosition.Y - (float)(Game1.tileSize / 2)), new Rectangle?(sourceRect), Color.White, -1.963495f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize) / 10000f));
                                break;

                            case 2:
                                spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X - 12f, playerPosition.Y + (float)(Game1.pixelZoom * 2)), new Rectangle?(sourceRect), Color.White, -2.748894f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize) / 10000f));
                                break;

                            case 3:
                                spriteBatch.Draw(Tool.weaponsTexture, new Vector2((float)((double)playerPosition.X - (double)(Game1.tileSize / 2) - 4.0), playerPosition.Y + (float)(Game1.pixelZoom * 2)), new Rectangle?(sourceRect), Color.White, -2.356194f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize) / 10000f));
                                break;

                            case 4:
                                spriteBatch.Draw(Tool.weaponsTexture, new Vector2((float)((double)playerPosition.X - (double)(Game1.tileSize / 4) - 24.0), (float)((double)playerPosition.Y + (double)Game1.tileSize + 12.0) - (float)Game1.tileSize), new Rectangle?(sourceRect), Color.White, 4.31969f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize) / 10000f));
                                break;

                            case 5:
                                spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X - 20f, (float)((double)playerPosition.Y + (double)Game1.tileSize + 40.0) - (float)Game1.tileSize), new Rectangle?(sourceRect), Color.White, 3.926991f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize) / 10000f));
                                break;

                            case 6:
                                spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X - 16f, (float)((double)playerPosition.Y + (double)Game1.tileSize + 56.0)), new Rectangle?(sourceRect), Color.White, 3.926991f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize) / 10000f));
                                break;

                            case 7:
                                spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X - 8f, (float)((double)playerPosition.Y + (double)Game1.tileSize + 64.0)), new Rectangle?(sourceRect), Color.White, 3.730641f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize) / 10000f));
                                break;
                            }
                        }
                        else
                        {
                            switch (frameOfFarmerAnimation)
                            {
                            case 0:
                                spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X - 24f, (float)((double)playerPosition.Y - (double)(Game1.tileSize / 3) - 8.0) - (float)Game1.tileSize), new Rectangle?(sourceRect), Color.White, -0.7853982f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize / 2) / 10000f));
                                break;

                            case 1:
                                spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X - 16f, playerPosition.Y - (float)(Game1.tileSize / 3) - (float)Game1.tileSize + (float)Game1.pixelZoom), new Rectangle?(sourceRect), Color.White, -0.7853982f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize / 2) / 10000f));
                                break;

                            case 2:
                                spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X - 16f, (float)((double)playerPosition.Y - (double)(Game1.tileSize / 3) + 20.0) - (float)Game1.tileSize), new Rectangle?(sourceRect), Color.White, -0.7853982f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize / 2) / 10000f));
                                break;

                            case 3:
                                if (facingDirection == 2)
                                {
                                    spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + (float)Game1.tileSize + (float)(Game1.pixelZoom * 2), playerPosition.Y + (float)(Game1.tileSize / 2)), new Rectangle?(sourceRect), Color.White, -3.926991f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize / 2) / 10000f));
                                    break;
                                }
                                spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X - 16f, (float)((double)playerPosition.Y - (double)(Game1.tileSize / 3) + 32.0) - (float)Game1.tileSize), new Rectangle?(sourceRect), Color.White, -0.7853982f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize / 2) / 10000f));
                                break;

                            case 4:
                                if (facingDirection == 2)
                                {
                                    spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + (float)Game1.tileSize + (float)(Game1.pixelZoom * 2), playerPosition.Y + (float)(Game1.tileSize / 2)), new Rectangle?(sourceRect), Color.White, -3.926991f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize / 2) / 10000f));
                                    break;
                                }
                                break;

                            case 5:
                                if (facingDirection == 2)
                                {
                                    spriteBatch.Draw(Tool.weaponsTexture, new Vector2((float)((double)playerPosition.X + (double)Game1.tileSize + 12.0), (float)((double)playerPosition.Y + (double)Game1.tileSize - 20.0)), new Rectangle?(sourceRect), Color.White, 2.356194f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize / 2) / 10000f));
                                    break;
                                }
                                break;

                            case 6:
                                if (facingDirection == 2)
                                {
                                    spriteBatch.Draw(Tool.weaponsTexture, new Vector2((float)((double)playerPosition.X + (double)Game1.tileSize + 12.0), (float)((double)playerPosition.Y + (double)Game1.tileSize + 54.0)), new Rectangle?(sourceRect), Color.White, 2.356194f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize / 2) / 10000f));
                                    break;
                                }
                                break;

                            case 7:
                                if (facingDirection == 2)
                                {
                                    spriteBatch.Draw(Tool.weaponsTexture, new Vector2((float)((double)playerPosition.X + (double)Game1.tileSize + 12.0), (float)((double)playerPosition.Y + (double)Game1.tileSize + 58.0)), new Rectangle?(sourceRect), Color.White, 2.356194f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize / 2) / 10000f));
                                    break;
                                }
                                break;
                            }
                            if (f.facingDirection != 0)
                            {
                                return;
                            }
                            f.FarmerRenderer.draw(spriteBatch, f.FarmerSprite, f.FarmerSprite.SourceRect, f.getLocalPosition(Game1.viewport), new Vector2(0.0f, (float)(((double)f.yOffset + (double)(Game1.tileSize * 2) - (double)(f.GetBoundingBox().Height / 2)) / 4.0 + 4.0)), Math.Max(0.0f, (float)((double)f.getStandingY() / 10000.0 + 0.00989999994635582)), Color.White, 0.0f, f);
                        }
                    }
                }
                else if (facingDirection == 1)
                {
                    switch (frameOfFarmerAnimation)
                    {
                    case 0:
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + 40f, (float)((double)playerPosition.Y - (double)Game1.tileSize + 8.0)), new Rectangle?(sourceRect), Color.White, -0.7853982f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() - 1) / 10000f));
                        break;

                    case 1:
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + 56f, (float)((double)playerPosition.Y - (double)Game1.tileSize + 28.0)), new Rectangle?(sourceRect), Color.White, 0.0f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() - 1) / 10000f));
                        break;

                    case 2:
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + (float)Game1.tileSize - (float)Game1.pixelZoom, playerPosition.Y - (float)(4 * Game1.pixelZoom)), new Rectangle?(sourceRect), Color.White, 0.7853982f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() - 1) / 10000f));
                        break;

                    case 3:
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + (float)Game1.tileSize - (float)Game1.pixelZoom, playerPosition.Y - (float)Game1.pixelZoom), new Rectangle?(sourceRect), Color.White, 1.570796f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize) / 10000f));
                        break;

                    case 4:
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + (float)Game1.tileSize - (float)(7 * Game1.pixelZoom), playerPosition.Y + (float)Game1.pixelZoom), new Rectangle?(sourceRect), Color.White, 1.963495f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize) / 10000f));
                        break;

                    case 5:
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + (float)Game1.tileSize - (float)(12 * Game1.pixelZoom), playerPosition.Y + (float)Game1.pixelZoom), new Rectangle?(sourceRect), Color.White, 2.356194f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize) / 10000f));
                        break;

                    case 6:
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + (float)Game1.tileSize - (float)(12 * Game1.pixelZoom), playerPosition.Y + (float)Game1.pixelZoom), new Rectangle?(sourceRect), Color.White, 2.356194f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize) / 10000f));
                        break;

                    case 7:
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2((float)((double)playerPosition.X + (double)Game1.tileSize - 16.0), (float)((double)playerPosition.Y + (double)Game1.tileSize + 12.0)), new Rectangle?(sourceRect), Color.White, 1.963495f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize) / 10000f));
                        break;
                    }
                }
                else if (facingDirection == 3)
                {
                    switch (frameOfFarmerAnimation)
                    {
                    case 0:
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X - (float)(4 * Game1.pixelZoom), playerPosition.Y - (float)Game1.tileSize - (float)(4 * Game1.pixelZoom)), new Rectangle?(sourceRect), Color.White, 0.7853982f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.FlipHorizontally, Math.Max(0.0f, (float)(f.getStandingY() - 1) / 10000f));
                        break;

                    case 1:
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X - (float)(12 * Game1.pixelZoom), playerPosition.Y - (float)Game1.tileSize + (float)(5 * Game1.pixelZoom)), new Rectangle?(sourceRect), Color.White, 0.0f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.FlipHorizontally, Math.Max(0.0f, (float)(f.getStandingY() - 1) / 10000f));
                        break;

                    case 2:
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X - (float)Game1.tileSize + (float)(8 * Game1.pixelZoom), playerPosition.Y + (float)(4 * Game1.pixelZoom)), new Rectangle?(sourceRect), Color.White, -0.7853982f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.FlipHorizontally, Math.Max(0.0f, (float)(f.getStandingY() - 1) / 10000f));
                        break;

                    case 3:
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + (float)Game1.pixelZoom, playerPosition.Y + (float)(11 * Game1.pixelZoom)), new Rectangle?(sourceRect), Color.White, -1.570796f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.FlipHorizontally, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize) / 10000f));
                        break;

                    case 4:
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + (float)(11 * Game1.pixelZoom), playerPosition.Y + (float)(13 * Game1.pixelZoom)), new Rectangle?(sourceRect), Color.White, -1.963495f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.FlipHorizontally, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize) / 10000f));
                        break;

                    case 5:
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + (float)(20 * Game1.pixelZoom), playerPosition.Y + (float)(10 * Game1.pixelZoom)), new Rectangle?(sourceRect), Color.White, -2.356194f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.FlipHorizontally, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize) / 10000f));
                        break;

                    case 6:
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + (float)(20 * Game1.pixelZoom), playerPosition.Y + (float)(10 * Game1.pixelZoom)), new Rectangle?(sourceRect), Color.White, -2.356194f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.FlipHorizontally, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize) / 10000f));
                        break;

                    case 7:
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X - 44f, playerPosition.Y + 96f), new Rectangle?(sourceRect), Color.White, -5.105088f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.FlipVertically, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize) / 10000f));
                        break;
                    }
                }
                else if (facingDirection == 0)
                {
                    switch (frameOfFarmerAnimation)
                    {
                    case 0:
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + 32f, playerPosition.Y - 32f), new Rectangle?(sourceRect), Color.White, -2.356194f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() - Game1.tileSize / 2 - 8) / 10000f));
                        break;

                    case 1:
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + 32f, playerPosition.Y - 48f), new Rectangle?(sourceRect), Color.White, -1.570796f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() - Game1.tileSize / 2 - 8) / 10000f));
                        break;

                    case 2:
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + 48f, playerPosition.Y - 52f), new Rectangle?(sourceRect), Color.White, -3f * (float)Math.PI / 8f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() - Game1.tileSize / 2 - 8) / 10000f));
                        break;

                    case 3:
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + 48f, playerPosition.Y - 52f), new Rectangle?(sourceRect), Color.White, -0.3926991f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() - Game1.tileSize / 2 - 8) / 10000f));
                        break;

                    case 4:
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2((float)((double)playerPosition.X + (double)Game1.tileSize - 8.0), playerPosition.Y - 40f), new Rectangle?(sourceRect), Color.White, 0.0f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() - Game1.tileSize / 2 - 8) / 10000f));
                        break;

                    case 5:
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + (float)Game1.tileSize, playerPosition.Y - 40f), new Rectangle?(sourceRect), Color.White, 0.3926991f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() - Game1.tileSize / 2 - 8) / 10000f));
                        break;

                    case 6:
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + (float)Game1.tileSize, playerPosition.Y - 40f), new Rectangle?(sourceRect), Color.White, 0.3926991f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() - Game1.tileSize / 2 - 8) / 10000f));
                        break;

                    case 7:
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2((float)((double)playerPosition.X + (double)Game1.tileSize - 44.0), playerPosition.Y + (float)Game1.tileSize), new Rectangle?(sourceRect), Color.White, -1.963495f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() - Game1.tileSize / 2 - 8) / 10000f));
                        break;
                    }
                }
                else
                {
                    if (facingDirection != 2)
                    {
                        return;
                    }
                    switch (frameOfFarmerAnimation)
                    {
                    case 0:
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + 56f, playerPosition.Y - 16f), new Rectangle?(sourceRect), Color.White, 0.3926991f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize / 2) / 10000f));
                        break;

                    case 1:
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + 52f, playerPosition.Y - 8f), new Rectangle?(sourceRect), Color.White, 1.570796f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize / 2) / 10000f));
                        break;

                    case 2:
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + 40f, playerPosition.Y), new Rectangle?(sourceRect), Color.White, 1.570796f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize / 2) / 10000f));
                        break;

                    case 3:
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + 16f, playerPosition.Y + 4f), new Rectangle?(sourceRect), Color.White, 2.356194f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize / 2) / 10000f));
                        break;

                    case 4:
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + 8f, playerPosition.Y + 8f), new Rectangle?(sourceRect), Color.White, 3.141593f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize / 2) / 10000f));
                        break;

                    case 5:
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + 12f, playerPosition.Y), new Rectangle?(sourceRect), Color.White, 3.534292f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize / 2) / 10000f));
                        break;

                    case 6:
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + 12f, playerPosition.Y), new Rectangle?(sourceRect), Color.White, 3.534292f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize / 2) / 10000f));
                        break;

                    case 7:
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + 44f, playerPosition.Y + (float)Game1.tileSize), new Rectangle?(sourceRect), Color.White, -5.105088f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize / 2) / 10000f));
                        break;
                    }
                }
            }
            else
            {
                frameOfFarmerAnimation %= 2;
                if (facingDirection == 1)
                {
                    if (frameOfFarmerAnimation != 0)
                    {
                        if (frameOfFarmerAnimation != 1)
                        {
                            return;
                        }
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + (float)Game1.tileSize - (float)(2 * Game1.pixelZoom), playerPosition.Y - 24f), new Rectangle?(sourceRect), Color.White, 0.7853982f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize) / 10000f));
                    }
                    else
                    {
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + (float)Game1.tileSize - (float)(4 * Game1.pixelZoom), playerPosition.Y - 16f), new Rectangle?(sourceRect), Color.White, 0.7853982f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize) / 10000f));
                    }
                }
                else if (facingDirection == 3)
                {
                    if (frameOfFarmerAnimation != 0)
                    {
                        if (frameOfFarmerAnimation != 1)
                        {
                            return;
                        }
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + (float)(2 * Game1.pixelZoom), playerPosition.Y - 24f), new Rectangle?(sourceRect), Color.White, -2.356194f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize) / 10000f));
                    }
                    else
                    {
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + (float)(4 * Game1.pixelZoom), playerPosition.Y - 16f), new Rectangle?(sourceRect), Color.White, -2.356194f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize) / 10000f));
                    }
                }
                else if (facingDirection == 0)
                {
                    if (frameOfFarmerAnimation != 0)
                    {
                        if (frameOfFarmerAnimation != 1)
                        {
                            return;
                        }
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2((float)((double)playerPosition.X + (double)Game1.tileSize - 16.0), playerPosition.Y - (float)(12 * Game1.pixelZoom)), new Rectangle?(sourceRect), Color.White, -0.7853982f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() - Game1.tileSize / 2) / 10000f));
                    }
                    else
                    {
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2((float)((double)playerPosition.X + (double)Game1.tileSize - 4.0), playerPosition.Y - (float)(10 * Game1.pixelZoom)), new Rectangle?(sourceRect), Color.White, -0.7853982f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() - Game1.tileSize / 2) / 10000f));
                    }
                }
                else
                {
                    if (facingDirection != 2)
                    {
                        return;
                    }
                    if (frameOfFarmerAnimation != 0)
                    {
                        if (frameOfFarmerAnimation != 1)
                        {
                            return;
                        }
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + (float)(Game1.tileSize / 3), playerPosition.Y), new Rectangle?(sourceRect), Color.White, 2.356194f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize / 2) / 10000f));
                    }
                    else
                    {
                        spriteBatch.Draw(Tool.weaponsTexture, new Vector2(playerPosition.X + (float)(Game1.tileSize / 2), playerPosition.Y - 12f), new Rectangle?(sourceRect), Color.White, 2.356194f, MeleeWeapon_center, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0.0f, (float)(f.getStandingY() + Game1.tileSize / 2) / 10000f));
                    }
                }
            }
        }