public override bool PreDrawCatalyst(SpriteBatch spriteBatch, Projectile projectile, Player player, ref Color lightColor) { Texture2D texture; Vector2 position; Color color; OrchidModProjectile.SetSpriteBatch(spriteBatch, blendState: BlendState.Additive); { /*if (player.itemAnimation > 0) * { * var progress = 1 - player.itemAnimation / (float)player.itemAnimationMax; * var scale = projectile.scale * 0.5f * OrchidHelper.GradientValue<float>(MathHelper.Lerp, progress, 0, .8f, 1, .8f, .4f, 0); * * texture = OrchidHelper.GetExtraTexture(15); * position = projectile.Center - Main.screenPosition + new Vector2(0, projectile.gfxOffY) + new Vector2(MathHelper.Lerp(20f, -20f, progress), 0).RotatedBy(projectile.ai[0]); * color = Main.DiscoColor * 0.8f; * spriteBatch.Draw(texture, position, new Rectangle(0, 0, 180, 30), color, projectile.ai[0] + MathHelper.PiOver2, new Vector2(90, 30), scale, SpriteEffects.None, 0); * }*/ texture = OrchidHelper.GetExtraTexture(16); position = projectile.Center - Main.screenPosition + new Vector2(0, projectile.gfxOffY); color = Main.DiscoColor * 0.55f; spriteBatch.Draw(texture, position, null, color, projectile.rotation, texture.Size() * 0.5f, projectile.scale, SpriteEffects.None, 0f); } OrchidModProjectile.SetSpriteBatch(spriteBatch); lightColor = Color.White; return(true); }
public override bool OrchidPreDraw(SpriteBatch spriteBatch, Color lightColor) { SetSpriteBatch(spriteBatch: spriteBatch, blendState: BlendState.Additive); { // Light Effect Texture2D lightTexture = OrchidHelper.GetExtraTexture(11); Vector2 drawPosition = projectile.Center + new Vector2(0, projectile.gfxOffY) - Main.screenPosition; spriteBatch.Draw(lightTexture, drawPosition, null, mainColor, projectile.rotation, lightTexture.Size() * 0.5f, projectile.scale * 0.5f, SpriteEffects.None, 0); // Lens Flare if (projectile.timeLeft < 15 && projectile.ai[1] == 2) { Texture2D texture = OrchidHelper.GetExtraTexture(6); float size = MathHelper.SmoothStep(1, 0, Math.Abs(1f - projectile.timeLeft * 2 / 15)) * 0.9f; Color color = mainColor; color.A = 200; spriteBatch.Draw(texture, drawPosition, null, color, 0f, texture.Size() * 0.5f, size, SpriteEffects.None, 0); } // Trail for (int k = 0; k < projectile.oldPos.Length; k++) { drawPosition = projectile.oldPos[k] + projectile.Size * 0.5f - Main.screenPosition + new Vector2(0f, projectile.gfxOffY); float num = ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); Color color = mainColor * num * 0.8f; spriteBatch.Draw(OrchidHelper.GetExtraTexture(0), drawPosition, null, color, projectile.oldRot[k], OrchidHelper.GetExtraTexture(0).Size() * .5f, projectile.scale * num, SpriteEffects.None, 0f); } } SetSpriteBatch(spriteBatch: spriteBatch); return(false); }
void IDrawAdditive.DrawAdditive(SpriteBatch spriteBatch) { var texture = OrchidHelper.GetExtraTexture(14); var drawPos = projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY); spriteBatch.Draw(texture, drawPos, null, BoreanStriderScepterProj.EffectColor * 0.5f, projectile.timeLeft * 0.05f, texture.Size() * 0.5f, projectile.scale * 0.8f, SpriteEffects.None, 0); }
void IDrawAdditive.DrawAdditive(SpriteBatch spriteBatch) { var texture = OrchidHelper.GetExtraTexture(11); var position = projectile.position + projectile.Size * 0.5f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; spriteBatch.Draw(texture, position + new Vector2(-4, 0).RotatedBy(projectile.rotation), null, EffectColor * 0.6f, 0f, texture.Size() * 0.5f, projectile.scale * 0.4f, SpriteEffects.None, 0); }
public override bool OrchidPreDraw(SpriteBatch spriteBatch, Color lightColor) { Vector2 drawPosition = projectile.position - Main.screenPosition + projectile.Size * 0.5f; // Light Effect SetSpriteBatch(spriteBatch: spriteBatch, blendState: BlendState.Additive); { Texture2D radialGradient = OrchidHelper.GetExtraTexture(11); spriteBatch.Draw(radialGradient, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY) + new Vector2(0, -11), null, new Color(36, 129, 234) * 0.35f, 0f, radialGradient.Size() * 0.5f, 0.75f * projectile.scale, SpriteEffects.None, 0f); } // Aura var effect = EffectsManager.ShroomiteZoneEffect; SetSpriteBatch(spriteBatch: spriteBatch, spriteSortMode: SpriteSortMode.Immediate, blendState: BlendState.Additive, samplerState: SamplerState.PointClamp, effect: effect); { this.SetEffectParameters(ref effect); if (zoneTexture != null) { spriteBatch.Draw(zoneTexture, drawPosition, null, Color.White, projectile.rotation, zoneTexture.Size() * 0.5f, 2f * MathHelper.SmoothStep(0, 1, RadiusProgress), SpriteEffects.None, 0f); } } SetSpriteBatch(spriteBatch: spriteBatch); return(false); // Let's draw the projectile ourselves }
public override void OnSpawn() { var trail = new Content.Trails.RoundedTrail(target: projectile, length: 16 * 7, width: (p) => 16 * (1 - p * 0.8f), color: (p) => Color.Lerp(EffectColor, new Color(11, 26, 138), p) * (1 - p) * 0.4f, additive: true, smoothness: 15); trail.SetDissolveSpeed(0.35f); trail.SetEffectTexture(OrchidHelper.GetExtraTexture(5)); PrimitiveTrailSystem.NewTrail(trail); }
public override void AI() { float progress = 1 - projectile.timeLeft / (float)_timeLeft; projectile.scale = OrchidHelper.GradientValue <float>(MathHelper.Lerp, progress, 1, 1.3f, 1.1f, 0.5f, 0.2f, 0f); projectile.rotation += projectile.ai[0]; Lighting.AddLight(projectile.Center, BoreanStriderScepterProj.EffectColor.ToVector3() * 0.35f * (1 - progress)); }
void IDrawAdditive.DrawAdditive(SpriteBatch spriteBatch) { var drawPos = projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY); var texture = OrchidHelper.GetExtraTexture(14); spriteBatch.Draw(texture, drawPos, null, EffectColor * 0.2f, projectile.timeLeft * 0.1f, texture.Size() * 0.5f, projectile.scale * 0.65f, SpriteEffects.None, 0); spriteBatch.Draw(texture, drawPos, null, EffectColor * 0.4f, projectile.timeLeft * 0.2f, texture.Size() * 0.5f, projectile.scale * 0.5f, SpriteEffects.None, 0); texture = Main.projectileTexture[projectile.type]; spriteBatch.Draw(texture, drawPos, null, new Color(220, 220, 220, 230), projectile.rotation, texture.Size() * 0.5f, projectile.scale, SpriteEffects.None, 0); }
public static void Load() { _simpleTexture = OrchidHelper.GetExtraTexture(7); if (Main.dedServ) { return; } _simpleEffect = OrchidMod.Instance.GetEffect("Effects/Primitive"); }
public override void OnSpawn() { _trail = new SimpleTrail(target: projectile, length: 16 * 6, width: (progress) => 18, color: (progress) => Color.Lerp(new Color(198, 61, 255), new Color(107, 61, 255), progress) * (1 - progress)); _trail.SetMaxPoints(15); _trail.SetEffectTexture(OrchidHelper.GetExtraTexture(4)); PrimitiveTrailSystem.NewTrail(_trail); projectile.friendly = false; this.IsGreen = false; }
public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) { Vector2 drawPos = projectile.Center - Main.screenPosition + new Vector2(0, projectile.gfxOffY); Rectangle rect = new Rectangle(0, 20 * this.IsGreen.ToInt(), 20, 20); Vector2 origin = new Vector2(10, 10); float val = (float)Math.Sin(Main.GlobalTime); for (int i = 0; i < 4; i++) { spriteBatch.Draw(OrchidHelper.GetExtraTexture(1), drawPos + new Vector2(3.5f, 0).RotatedBy(Main.GlobalTime + MathHelper.PiOver2 * i) * val, rect, Color.White * 0.35f, projectile.rotation, origin, projectile.scale, SpriteEffects.None, 0f); } spriteBatch.Draw(OrchidHelper.GetExtraTexture(1), drawPos, rect, Color.White, projectile.rotation, origin, projectile.scale, SpriteEffects.None, 0f); }
public static void Load(Mod mod) { if (!Main.dedServ) { ShroomiteZoneEffect = mod.GetEffect("Effects/ShroomiteScepter"); ShroomiteZoneEffect.Parameters["perlinTexture"].SetValue(ModContent.GetTexture("Terraria/Misc/Perlin")); WyvernMorayEffect = mod.GetEffect("Effects/WyvernMoray"); WyvernMorayEffect.Parameters["texture0"].SetValue(OrchidHelper.GetExtraTexture(5)); WyvernMorayEffect.Parameters["texture1"].SetValue(OrchidHelper.GetExtraTexture(2)); WyvernMorayLingeringEffect = mod.GetEffect("Effects/WyvernMorayLingering"); WyvernMorayLingeringEffect.Parameters["texture1"].SetValue(OrchidHelper.GetExtraTexture(10)); } }
public override void OnSpawn() { OrchidHelper.SpawnDustCircle( center: projectile.Center, radius: 70, count: 25, type: (index) => 102, onSpawn: (dust, index, angleFromCenter) => { dust.alpha = 50; dust.velocity = new Vector2(Main.rand.NextFloat(1, 2.5f), 0).RotatedBy(angleFromCenter); dust.scale *= 0.5f; } ); }
public override void Kill(int timeLeft) { Main.PlaySound(SoundID.Item, (int)projectile.Center.X, (int)projectile.Center.Y, 91); Player player = Main.player[projectile.owner]; OrchidModPlayer modPlayer = player.GetModPlayer <OrchidModPlayer>(); int nbBonds = OrchidModShamanHelper.getNbShamanicBonds(player, modPlayer, mod); // Spawn Dusts { Action <Dust> spawnDustAction = new Action <Dust>((dust) => { dust.velocity *= 0.05f; dust.fadeIn = 1f; dust.scale = 0.8f; dust.noGravity = true; }); OrchidHelper.SpawnDustCircle(center: projectile.Center, type: 62, radius: 55, count: 35, onSpawn: spawnDustAction); OrchidHelper.SpawnDustCircle(center: projectile.Center, type: 62, radius: 42, count: 27, onSpawn: spawnDustAction); for (int i = 0; i < 3; i++) { float rotation = i / (float)3 * MathHelper.TwoPi + (float)Main.time; for (int j = 0; j < 3; j++) { var dust = Dust.NewDustPerfect(projectile.Center + new Vector2(43 + j * 4, 0).RotatedBy(rotation), 62); spawnDustAction?.Invoke(dust); } } } if (nbBonds >= 3) { for (int i = 0; i < 3; i++) { Vector2 perturbedSpeed = new Vector2(0f, -5f).RotatedByRandom(MathHelper.ToRadians(30)); Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, ModContent.ProjectileType <StarScouterScepterProjAlt>(), (int)(projectile.damage * 0.70), 0.0f, player.whoAmI, 0.0f, 0.0f); } } }
public override void Kill(int timeLeft) { Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 85); OrchidHelper.SpawnDustCircle( center: projectile.Center, radius: 20, count: 10, type: (index) => 102, onSpawn: (dust, index, angleFromCenter) => { dust.alpha = 100; dust.velocity = new Vector2(Main.rand.NextFloat(1, 2.5f), 0).RotatedBy(angleFromCenter); } ); int dmg = projectile.damage + (int)((1200 - timeLeft) / 10); int projType = ProjectileType <Gambler.Projectiles.SapCardProjExplosion>(); bool dummy = projectile.GetGlobalProjectile <OrchidModGlobalProjectile>().gamblerDummyProj; OrchidModGamblerHelper.DummyProjectile(Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, projType, dmg, 3f, projectile.owner, 0.0f, 0.0f), dummy); }
public override bool OrchidPreDraw(SpriteBatch spriteBatch, Color lightColor) { spriteBatch.End(); spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); Texture2D radialGradient = OrchidHelper.GetExtraTexture(11); spriteBatch.Draw(radialGradient, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), null, new Color(255, 225, 0) * 0.35f, 0f, radialGradient.Size() * 0.5f, 0.75f * projectile.scale, SpriteEffects.None, 0f); spriteBatch.End(); spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); Vector2 drawOrigin = new Vector2(Main.projectileTexture[projectile.type].Width * 0.5f, projectile.height * 0.5f); for (int k = 0; k < projectile.oldPos.Length; k++) { Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); float num = ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); Color color = Color.Lerp(new Color(100, 100, 100), new Color(250, 250, 250), num) * num * 0.75f; spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.oldRot[k], drawOrigin, projectile.scale * num, SpriteEffects.None, 0f); } return(true); }
public override bool OrchidPreDraw(SpriteBatch spriteBatch, Color lightColor) { Vector2 drawPos = projectile.Center - Main.screenPosition + new Vector2(0, projectile.gfxOffY); Color color = projectile.GetAlpha(Lighting.GetColor((int)projectile.Center.X / 16, (int)projectile.Center.Y / 16, Color.White)); Texture2D texture = OrchidHelper.GetExtraTexture(11); SetSpriteBatch(spriteBatch: spriteBatch, blendState: BlendState.Additive); { spriteBatch.Draw(texture, drawPos, null, new Color(0.44f, 0.92f, 0f) * 0.5f, 0f, texture.Size() * 0.5f, projectile.scale * this.GreenLightProgress, SpriteEffects.None, 0f); } SetSpriteBatch(spriteBatch: spriteBatch); texture = Main.projectileTexture[projectile.type]; float val = (float)Math.Sin(Main.GlobalTime + MathHelper.Pi); for (int i = 0; i < 4; i++) { spriteBatch.Draw(texture, drawPos + new Vector2(5.5f, 0).RotatedBy(Main.GlobalTime + MathHelper.PiOver2 * i) * val, null, color * 0.22f, projectile.rotation, texture.Size() * 0.5f, projectile.scale, SpriteEffects.None, 0f); } spriteBatch.Draw(texture, drawPos, null, color, projectile.rotation, texture.Size() * 0.5f, projectile.scale, SpriteEffects.None, 0f); return(false); }
// ... void IGlowingItem.DrawItemGlowmask(PlayerDrawInfo drawInfo) { OrchidHelper.DrawSimpleItemGlowmaskOnPlayer(drawInfo, ModContent.GetTexture(this.Texture + "_Glow")); }
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { OrchidHelper.DrawSimpleItemGlowmaskInWorld(item, spriteBatch, ModContent.GetTexture("OrchidMod/Assets/Textures/Items/PrototypeSecrecy_Glow"), Color.White * 0.7f, rotation, scale); }
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { OrchidHelper.DrawSimpleItemGlowmaskInWorld(item, spriteBatch, ModContent.GetTexture("OrchidMod/Glowmasks/MushroomThread_Glowmask"), new Color(250, 250, 250, 200) * OrchidWorld.alchemistMushroomArmorProgress, rotation, scale); }
public sealed override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { OrchidHelper.DrawSimpleItemGlowmaskInWorld(item, spriteBatch, ModContent.GetTexture(this.Texture + "_Glow"), Color.White, rotation, scale); }
public override Color?GetAlpha(Dust dust, Color lightColor) => new Color(255, 192, 0) * OrchidHelper.GradientValue <float>(MathHelper.Lerp, 1 - dust.scale, .0f, .7f, .9f, .7f, .3f, .1f, .0f);
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { OrchidHelper.DrawSimpleItemGlowmaskInWorld(item, spriteBatch, ModContent.GetTexture("OrchidMod/Glowmasks/AbyssPrecinct_Glowmask"), Color.White, rotation, scale); }
public void DrawItemGlowmask(PlayerDrawInfo drawInfo) { OrchidHelper.DrawSimpleItemGlowmaskOnPlayer(drawInfo, ModContent.GetTexture("OrchidMod/Glowmasks/AbyssPrecinct_Glowmask")); }
public void DrawItemGlowmask(PlayerDrawInfo drawInfo) { OrchidHelper.DrawSimpleItemGlowmaskOnPlayer(drawInfo, ModContent.GetTexture("OrchidMod/Glowmasks/ShroomiteScepter_Glowmask")); }