public TransformationAppearanceDefinition(AuraAnimationInfo auraAnimation, ReadOnlyColor lightColor, HairAppearance hair, Color?eyeColor) { this.auraAnimation = auraAnimation; this.lightColor = lightColor; this.hair = hair; this.eyeColor = eyeColor; }
public TransformationAppearanceDefinition(AuraAnimationInfo auraAnimation, ReadOnlyColor lightColor, string hairTexture, ReadOnlyColor hairColor, int?hairShader, Color?eyeColor) { this.auraAnimation = auraAnimation; this.lightColor = lightColor; this.hair = new HairAppearance(hairTexture, hairColor, hairShader); this.eyeColor = eyeColor; }
public static void DrawAura(MyPlayer modPlayer, AuraAnimationInfo aura) { Player player = modPlayer.player; Texture2D texture = aura.GetTexture(); Rectangle textureRectangle = new Rectangle(0, aura.GetHeight() * modPlayer.AuraCurrentFrame, texture.Width, aura.GetHeight()); float scale = aura.GetAuraScale(modPlayer); Tuple <float, Vector2> rotationAndPosition = aura.GetAuraRotationAndPosition(modPlayer); float rotation = rotationAndPosition.Item1; Vector2 position = rotationAndPosition.Item2; SamplerState samplerState = Main.DefaultSamplerState; if (player.mount.Active) { samplerState = Main.MountedSamplerState; } Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Immediate, aura.BlendState, samplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); // custom draw routine Main.spriteBatch.Draw(texture, position - Main.screenPosition, textureRectangle, Color.White, rotation, new Vector2(aura.GetWidth(), aura.GetHeight()) * 0.5f, scale, SpriteEffects.None, 0f); Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, samplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); }
public static void DoFabulousDust(MyPlayer modPlayer, AuraAnimationInfo aura) { var position = aura.GetAuraRotationAndPosition(modPlayer).Item2; if (Main.rand.NextFloat() < 0.5f) { Dust dust = Dust.NewDustDirect(position, aura.GetWidth(), aura.GetHeight(), 91, 0f, 0f, 0, new Color(Main.DiscoColor.R, Main.DiscoColor.G, Main.DiscoColor.B), 0.75f); dust.noGravity = true; } if (Main.rand.NextFloat() < 0.25f) { Dust dust = Dust.NewDustDirect(position, aura.GetWidth(), aura.GetHeight(), 91, 0f, 0f, 0, new Color(Main.DiscoColor.R, Main.DiscoColor.G, Main.DiscoColor.B), 0.25f); dust.noGravity = true; } }
public static void DrawAura(this MyPlayer modPlayer, AuraAnimationInfo aura) { Player player = modPlayer.player; Texture2D texture = aura.GetTexture(); Rectangle textureRectangle = new Rectangle(0, aura.GetHeight() * modPlayer.auraCurrentFrame, texture.Width, aura.GetHeight()); float scale = aura.GetAuraScale(modPlayer); Tuple <float, Vector2> rotationAndPosition = aura.GetAuraRotationAndPosition(modPlayer); float rotation = rotationAndPosition.Item1; Vector2 position = rotationAndPosition.Item2; AnimationHelper.SetSpriteBatchForPlayerLayerCustomDraw(aura.blendState, player.GetPlayerSamplerState()); // custom draw routine Main.spriteBatch.Draw(texture, position - Main.screenPosition, textureRectangle, Color.White, rotation, new Vector2(aura.GetWidth(), aura.GetHeight()) * 0.5f, scale, SpriteEffects.None, 0f); AnimationHelper.ResetSpriteBatchForPlayerDrawLayers(player.GetPlayerSamplerState()); }
public static void DoChargeDust(MyPlayer modPlayer, AuraAnimationInfo auraInfo) { var position = auraInfo.GetAuraRotationAndPosition(modPlayer).Item2; for (int d = 0; d < 1; d++) { if (Main.rand.NextFloat() < 0.5f) { Dust dust = Dust.NewDustDirect(position, auraInfo.GetWidth(), auraInfo.GetHeight(), 63, 0f, 0f, 0, new Color(255, 255, 255), 0.75f); dust.noGravity = true; } if (Main.rand.NextFloat() < 0.25f) { Dust dust = Dust.NewDustDirect(position, auraInfo.GetWidth(), auraInfo.GetHeight(), 63, 0f, 0f, 0, new Color(255, 255, 255), 1.5f); dust.noGravity = true; } } }
public static void DoFalseUIDust(MyPlayer modPlayer, AuraAnimationInfo aura) { //blue dust if (Main.rand.NextFloat() < 1f) { Dust dust; Vector2 center = aura.GetCenter(modPlayer); Vector2 position = center + new Vector2(-15, -20); dust = Terraria.Dust.NewDustDirect(position, 42, 58, 187, 0f, -5.526316f, 0, new Color(255, 255, 255), 0.8552632f); dust.noGravity = true; dust.fadeIn = 0.5131579f; } //white dust if (Main.rand.NextFloat() < 0.5263158f) { Dust dust; Vector2 center = aura.GetCenter(modPlayer); Vector2 position = center + new Vector2(-17, -10); dust = Terraria.Dust.NewDustDirect(position, 26, 52, 63, 0f, -7.368421f, 0, new Color(255, 255, 255), 0.8552632f); dust.noGravity = true; dust.fadeIn = 0.7894737f; } }
public static void DoSSJ1Dust(MyPlayer modPlayer, AuraAnimationInfo aura) { const float aurawidth = 3.0f; for (int i = 0; i < 20; i++) { float xPos = ((Vector2.UnitX * 5.0f) + (Vector2.UnitX * (Main.rand.Next(-10, 10) * aurawidth))).X; float yPos = ((Vector2.UnitY * modPlayer.player.height) - (Vector2.UnitY * Main.rand.Next(0, modPlayer.player.height))).Y - 0.5f; Dust tDust = Dust.NewDustDirect(modPlayer.player.position + new Vector2(xPos, yPos), 1, 1, 87, 0f, 0f, 0, new Color(0, 0, 0, 0), 0.4f * Main.rand.Next(1, 4)); if ((Math.Abs((tDust.position - (modPlayer.player.position + (Vector2.UnitX * 7.0f))).X)) < 10) { tDust.scale *= 0.75f; } Vector2 dir = -(tDust.position - ((modPlayer.player.position + (Vector2.UnitX * 5.0f)) - (Vector2.UnitY * modPlayer.player.height))); dir.Normalize(); tDust.velocity = new Vector2(dir.X * 2.0f, -1 * Main.rand.Next(1, 5)); tDust.noGravity = true; } }
public AuraDrawLayer(string mod, string name, PlayerLayer parent, AuraAnimationInfo aura, Action <PlayerDrawInfo> layer) : base(mod, name, parent, layer) { _aura = aura; }