private static void ShowEasterEggItemIntake(Farmer who, EasterEggItem easterEggItem) { if (easterEggItem == null) { return; } bool finishedPickingUp = who.ActiveObject is EasterEggItem && who.FarmerSprite.currentAnimationIndex == 5; if (!finishedPickingUp) { TemporaryAnimatedSprite temporaryAnimatedSprite = CreateTemporaryAnimatedSpriteForEasterEggItemIntake(who, easterEggItem); who.currentLocation.temporarySprites.Add(temporaryAnimatedSprite); } if (who.FarmerSprite.currentAnimationIndex == 5) { who.Halt(); who.FarmerSprite.CurrentAnimation = null; } }
private static TemporaryAnimatedSprite CreateTemporaryAnimatedSpriteForEasterEggItemIntake(EasterEggItem easterEggItem, float animationInterval, Vector2 location, float layerDepth, float alphaFade, float scaleChange) { Rectangle sourceRectangle = Game1.getSourceRectForStandardTileSheet(DeepWoodsTextures.Textures.Festivals, easterEggItem.eggTileIndex, 16, 16); return(new TemporaryAnimatedSprite("Maps\\Festivals", sourceRectangle, animationInterval, 1, 0, location, false, false, layerDepth, alphaFade, Color.White, 4f, scaleChange, 0.0f, 0.0f, false)); }
private static TemporaryAnimatedSprite CreateTemporaryAnimatedSpriteForEasterEggItemIntake(Farmer who, EasterEggItem easterEggItem) { float layerDepth = who.getStandingY() / 10000f + 0.01f; if (who.FacingDirection == 0) { layerDepth = who.getStandingY() / 10000f - 0.001f; } Vector2 location = who.Position + GetEasterEggItemIntakeOffsetFor(who.FacingDirection, who.FarmerSprite.currentAnimationIndex); float animationInterval = 100f; if (who.FarmerSprite.currentAnimationIndex > 3) { animationInterval = 200f; } float alphaFade = 0; float scaleChange = 0; if (who.FarmerSprite.currentAnimationIndex == 5) { alphaFade = 0.02f; scaleChange = -0.02f; } return(CreateTemporaryAnimatedSpriteForEasterEggItemIntake(easterEggItem, animationInterval, location, layerDepth, alphaFade, scaleChange)); }