Flower stamen effects from player wind
This commit is contained in:
1 parent
a32a18f657
commit
12f2467008
8 files changed
+51
-1
No files matched your search
@@ -48,6 +48,7 @@ namespace CalamityMod.ILEditing
|
||||
On.Terraria.GameContent.Drawing.TileDrawing.PreDrawTiles += ClearForegroundStuff;
|
||||
On.Terraria.GameContent.Drawing.TileDrawing.Draw += ClearTilePings;
|
||||
On.Terraria.GameContent.ItemDropRules.CommonCode.ModifyItemDropFromNPC += ColorBlightedGel;
|
||||
On.Terraria.GameContent.Drawing.TileDrawing.Update += StoreWindGrid;
|
||||
|
||||
// NPC behavior
|
||||
IL.Terraria.Main.UpdateTime += PermitNighttimeTownNPCSpawning;
|
||||
@@ -171,6 +172,7 @@ namespace CalamityMod.ILEditing
|
||||
On.Terraria.GameContent.Drawing.TileDrawing.PreDrawTiles -= ClearForegroundStuff;
|
||||
On.Terraria.GameContent.Drawing.TileDrawing.Draw -= ClearTilePings;
|
||||
On.Terraria.GameContent.ItemDropRules.CommonCode.ModifyItemDropFromNPC -= ColorBlightedGel;
|
||||
On.Terraria.GameContent.Drawing.TileDrawing.Update -= StoreWindGrid;
|
||||
|
||||
// NPC behavior
|
||||
IL.Terraria.Main.UpdateTime -= PermitNighttimeTownNPCSpawning;
|
||||
|
||||
@@ -9,6 +9,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using Terraria;
|
||||
using Terraria.GameContent.Drawing;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -17,6 +18,12 @@ namespace CalamityMod.ILEditing
|
||||
{
|
||||
public partial class ILChanges
|
||||
{
|
||||
public static WindGrid Windgrid
|
||||
{
|
||||
get;
|
||||
internal set;
|
||||
}
|
||||
|
||||
#region Decrease Sandstorm Wind Speed Requirement
|
||||
private static void DecreaseSandstormWindSpeedRequirement(ILContext il)
|
||||
{
|
||||
@@ -654,5 +661,16 @@ namespace CalamityMod.ILEditing
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Store The Stupid Fucking Private Wind Map In Public Field
|
||||
private static void StoreWindGrid(On.Terraria.GameContent.Drawing.TileDrawing.orig_Update orig, TileDrawing self)
|
||||
{
|
||||
orig(self);
|
||||
|
||||
// FUCK YOU FUCK YOU FUCK YOU FUCK YOU FUCK YOU FUCK YOU FUCK YOU FUCK YOU FUCK YOU FUCK
|
||||
if (Windgrid is null)
|
||||
Windgrid = typeof(TileDrawing).GetField("_windGrid", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(self) as WindGrid;
|
||||
}
|
||||
#endregion Store The Stupid Fucking Private Wind Map In Public Field
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ namespace CalamityMod.Tiles.FloralParadise
|
||||
{
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
Main.tileNoFail[Type] = true;
|
||||
Main.tileCut[Type] = true;
|
||||
Main.tileObsidianKill[Type] = true;
|
||||
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2);
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using CalamityMod.ILEditing;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
@@ -11,6 +14,8 @@ namespace CalamityMod.Tiles.FloralParadise
|
||||
{
|
||||
public const int Variants = 2;
|
||||
|
||||
public const int WindPushLifetime = 48;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
@@ -42,6 +47,28 @@ namespace CalamityMod.Tiles.FloralParadise
|
||||
{
|
||||
offsetY = 2;
|
||||
}
|
||||
|
||||
public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData)
|
||||
{
|
||||
if (drawData.tileFrameX % 72 == 0 && drawData.tileFrameY == 0)
|
||||
Main.instance.TilesRenderer.AddSpecialLegacyPoint(i, j);
|
||||
}
|
||||
|
||||
public override void SpecialDraw(int i, int j, SpriteBatch spriteBatch)
|
||||
{
|
||||
ILChanges.Windgrid.GetWindTime(i, j, WindPushLifetime, out int windTimeLeft, out int direction);
|
||||
float windInterpolant = windTimeLeft / (float)WindPushLifetime;
|
||||
float windRotation = Utils.GetLerpValue(0f, 0.5f, windInterpolant, true) * Utils.GetLerpValue(1f, 0.5f, windInterpolant, true) * direction * 0.34f;
|
||||
|
||||
int frameX = Main.tile[i, j].TileFrameX;
|
||||
Color drawColor = Lighting.GetColor(i, j);
|
||||
Texture2D stamenTexture = ModContent.Request<Texture2D>("CalamityMod/Tiles/FloralParadise/PinkFlowerBigStamen").Value;
|
||||
Rectangle stamenFrame = stamenTexture.Frame(2, 1, frameX > 72 ? 1 : 0, 0);
|
||||
Vector2 stamenOrigin = stamenFrame.Size() * new Vector2(0.5f, 1f);
|
||||
Vector2 drawOffset = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
|
||||
Vector2 drawPos = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffset;
|
||||
Main.spriteBatch.Draw(stamenTexture, drawPos + new Vector2(31f, 38f), stamenFrame, drawColor, windRotation, stamenOrigin, 1f, SpriteEffects.None, 0f);
|
||||
}
|
||||
|
||||
public override void NumDust(int i, int j, bool fail, ref int num)
|
||||
{
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 797 B After Width: | Height: | Size: 620 B |
Binary file not shown.
|
After Width: | Height: | Size: 349 B |
@@ -13,6 +13,7 @@ namespace CalamityMod.Tiles.FloralParadise
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
Main.tileCut[Type] = true;
|
||||
Main.tileNoFail[Type] = true;
|
||||
Main.tileObsidianKill[Type] = true;
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ namespace CalamityMod.Tiles.FloralParadise
|
||||
{
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
Main.tileNoFail[Type] = true;
|
||||
Main.tileCut[Type] = true;
|
||||
Main.tileObsidianKill[Type] = true;
|
||||
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1);
|
||||
|
||||
Reference in new issue
Block a user