From 2ee3ec4b0d7d360577f55dbfe258f91be76e2e95 Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 7 Jul 2022 00:42:50 -0500 Subject: [PATCH] Vines --- Tiles/PerennialTree.cs | 21 ++++++++++++++------- Tiles/PerennialTreeVines.png | Bin 394 -> 607 bytes 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Tiles/PerennialTree.cs b/Tiles/PerennialTree.cs index ec21f82fe8..f9c05a1ac3 100644 --- a/Tiles/PerennialTree.cs +++ b/Tiles/PerennialTree.cs @@ -61,23 +61,30 @@ namespace CalamityMod.Tiles } BezierCurve vineCurve = new(controlPoints); - int drawCount = (int)(totalVinesToDraw * 1.25f); + int drawCount = (int)(totalVinesToDraw * 2.4f); for (int i = 0; i < drawCount - 1; i++) { - bool useFruitFrame = RNG.NextBool(25); Vector2 vineCenter = vineCurve.Evaluate(i / (float)(drawCount - 1f)); Vector2 ahead = vineCurve.Evaluate((i + 1f) / (float)(drawCount - 1f)); - float rotation = (ahead - vineCenter).ToRotation() + MathHelper.PiOver2; + float rotation = (ahead - vineCenter).ToRotation() - MathHelper.PiOver2; vineCenter += PreviousPoint.ToWorldCoordinates() - Main.screenPosition; // Calculate light values. Vector2 lightPosition = vineCenter + lightOffset + Main.screenPosition; - Rectangle frame = vineTexture.Frame(2, 2, useFruitFrame.ToInt(), i == drawCount - 1 ? 1 : 0, -2, -2); + int frameX = 0; + int frameY = 0; + if (i > 0) + frameY = RNG.Next(1, 3); + if (i >= drawCount - 3) + { + frameY = 3; + frameX = RNG.Next(3); + } + if (i == drawCount - 2) + frameY = 4; - // Make fruit emit small quantities of light. - if (useFruitFrame) - Lighting.AddLight(lightPosition, Color.Pink.ToVector3() * 0.5f); + Rectangle frame = vineTexture.Frame(3, 5, frameX, frameY, -2, -2); Color color = Lighting.GetColor(lightPosition.ToTileCoordinates()); Main.spriteBatch.Draw(vineTexture, vineCenter, frame, color, rotation, frame.Size() * 0.5f, 1f, 0f, 0); diff --git a/Tiles/PerennialTreeVines.png b/Tiles/PerennialTreeVines.png index 6a7ed7932084d84d5964e45057f58f2c222f6795..19356dd5fe896054782009902b72a35a4b0736b3 100644 GIT binary patch delta 588 zcmV-S0<-;!1K$K8iBL{Q4GJ0x0000DNk~Le0000q000152m=5B0Kiy<^N}GSe-cnk zR7F2e8c=Q~bdEJBH5ZYpJpcdz0yS~t00006bW%=J|NsC0{{XYUq`v?F010qNS#tmY z4!-~Z4!;371ydvd00G2FL_t(oN41xWcETVKL?M{}|K)NS_9WUixD%aIBaC}F%kt2c zy{nWuR7P(t7b;x<+x9MY58AfYf41$LP^9*Fl+xOC7jhwzdUVzLZ3xv0^mfTD2##e{ zIclB$r96nxDEN1w`JR#ou~nl86o2}cav_3QTn@){7xJL~*9A)H6WhpuzzElKxC^-u z;T*!&-a}l7A^_ZR8y%;8r zru;h)fwM70A_N=>E1ZJdg`TC4kK{BAWf*VMdyxh0du*UXDhvaCA{P29hgkm4LRT`N aeg6S%MnUy@byhh50000#A~;2i}S4c-I=-o000_ob*BIT00?waPE-H?|NsC0{{Y^Dy;+fN z7k>cfNklKErCHw$I