Fixes, better fx
This commit is contained in:
1 parent
9893b189a5
commit
8b76755f10
3 files changed
+50
-13
No files matched your search
@@ -1,7 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Prefixes;
|
||||
using CalamityMod.Projectiles.Environment;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
@@ -42,21 +46,49 @@ namespace CalamityMod.Items.Tools
|
||||
{
|
||||
if (VoucherReforgeSystem.RollWon)
|
||||
{
|
||||
for (int d = 0; d < 24; d++)
|
||||
for (int dustCount = 0; dustCount < 8; dustCount++)
|
||||
{
|
||||
int dust = Dust.NewDust(player.position, player.width, player.height, DustID.Confetti, 0f, 0f, 100, default, 1f);
|
||||
Main.dust[dust].velocity *= 2f;
|
||||
Main.dust[dust].noGravity = false;
|
||||
// Light dust and sparks
|
||||
Vector2 sparkVel = Main.rand.NextVector2CircularEdge(1f, 1f) * Main.rand.NextFloat(3f, 12f);
|
||||
Vector2 dustVel = (sparkVel).SafeNormalize(Vector2.UnitY).RotatedBy(Main.rand.Next(100)) * Main.rand.NextFloat(1f, 15f);
|
||||
Vector2 fxPos = player.Center + sparkVel;
|
||||
Color fxColor = Color.Lerp(Color.MediumAquamarine, Color.MediumSeaGreen, Main.rand.NextFloat(1f));
|
||||
|
||||
Particle fx = new CustomSpark(fxPos, sparkVel, "CalamityMod/Particles/Sparkle", false, (int)(Main.rand.Next(30, 60)), Main.rand.NextFloat(1.3f, 1.8f), fxColor, new Vector2(0.5f, 1.1f), extraRotation: 0, shrinkSpeed: Main.rand.NextFloat(0.1f, 0.3f));
|
||||
GeneralParticleHandler.SpawnParticle(fx);
|
||||
|
||||
Dust dust = Dust.NewDustPerfect(fxPos, ModContent.DustType<LightDust>(), dustVel, 0, default, Main.rand.NextFloat(0.8f, 1.6f));
|
||||
dust.noGravity = true;
|
||||
dust.color = fxColor;
|
||||
|
||||
|
||||
// Crit sparkles
|
||||
Vector2 velocity = Main.rand.NextVector2CircularEdge(1f, 1f) * Main.rand.NextFloat(1f, 25f);
|
||||
Color color = Main.rand.NextBool() ? Color.LightBlue : Color.LightSkyBlue;
|
||||
|
||||
Particle sparkle = new CritSpark(player.MountedCenter, velocity, color, bloom: Color.Cyan, scale: 1f, lifeTime: Main.rand.Next(15, 60));
|
||||
GeneralParticleHandler.SpawnParticle(sparkle);
|
||||
}
|
||||
|
||||
SoundEngine.PlaySound(SoundID.Item4, player.position);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int d = 0; d < 20; d++)
|
||||
for (int d = 0; d < 10; d++)
|
||||
{
|
||||
int dust = Dust.NewDust(player.position, player.width, player.height, DustID.Smoke, 0f, 0f, 100, default, 1.2f);
|
||||
Main.dust[dust].velocity *= 1.5f;
|
||||
for (int smokeCount = 0; smokeCount < 3; smokeCount++)
|
||||
{
|
||||
Vector2 velocity = Main.rand.NextVector2CircularEdge(1f, 1f) * Main.rand.NextFloat(3f, 12f);
|
||||
Color smokeStart = Main.rand.NextBool() ? Color.Gray : Color.LightGray;
|
||||
Color smokeEnd = Color.DimGray;
|
||||
float smokeSize = Main.rand.NextFloat(0.9f, 2f);
|
||||
|
||||
Particle smoke = new SmallSmokeParticle(player.MountedCenter, velocity, smokeStart, smokeEnd, smokeSize, Main.rand.Next(90, 140));
|
||||
GeneralParticleHandler.SpawnParticle(smoke);
|
||||
}
|
||||
|
||||
Particle skull = new DesertProwlerSkullParticle(player.Center, new Vector2(2.5f, 2.5f).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1f), Main.rand.NextBool() ? Color.LightGray : Color.Silver, Color.Gray, Main.rand.NextFloat(0.15f, 0.5f), Main.rand.Next(100, 190));
|
||||
GeneralParticleHandler.SpawnParticle(skull);
|
||||
}
|
||||
|
||||
SoundEngine.PlaySound(SoundID.Item16, player.position);
|
||||
@@ -192,6 +224,7 @@ namespace CalamityMod.Items.Tools
|
||||
Item.height = 20;
|
||||
Item.rare = ItemRarityID.Green;
|
||||
Item.value = 0;
|
||||
Item.maxStack = 9999;
|
||||
}
|
||||
|
||||
public override bool CanApply(Player player, Item itemBeingReforged, bool isAccessory)
|
||||
@@ -247,6 +280,7 @@ namespace CalamityMod.Items.Tools
|
||||
Item.height = 20;
|
||||
Item.rare = ItemRarityID.Green;
|
||||
Item.value = 0;
|
||||
Item.maxStack = 9999;
|
||||
}
|
||||
|
||||
public override bool CanApply(Player player, Item itemBeingReforged, bool isAccessory)
|
||||
@@ -275,6 +309,7 @@ namespace CalamityMod.Items.Tools
|
||||
Item.height = 20;
|
||||
Item.rare = ItemRarityID.Green;
|
||||
Item.value = 0;
|
||||
Item.maxStack = 9999;
|
||||
}
|
||||
|
||||
public override bool CanApply(Player player, Item itemBeingReforged, bool isAccessory)
|
||||
@@ -301,6 +336,7 @@ namespace CalamityMod.Items.Tools
|
||||
Item.height = 20;
|
||||
Item.rare = ItemRarityID.Green;
|
||||
Item.value = 0;
|
||||
Item.maxStack = 9999;
|
||||
}
|
||||
|
||||
public override bool CanApply(Player player, Item itemBeingReforged, bool isAccessory)
|
||||
@@ -329,6 +365,7 @@ namespace CalamityMod.Items.Tools
|
||||
Item.height = 20;
|
||||
Item.rare = ItemRarityID.Green;
|
||||
Item.value = 0;
|
||||
Item.maxStack = 9999;
|
||||
}
|
||||
|
||||
public override bool CanApply(Player player, Item itemBeingReforged, bool isAccessory)
|
||||
|
||||
@@ -18,7 +18,7 @@ AggressiveVoucher: {
|
||||
Tooltip:
|
||||
'''
|
||||
Favorite this item in your inventory to increase the likelihood of obtaining a desirable reforge
|
||||
This effect only applies when reforging accessories
|
||||
This effect only applies when reforging accessories
|
||||
Targeted Reforge: {0}
|
||||
Selectable Reforges: {1}
|
||||
[c/aaaaaa:Shift-<right> in your inventory to cycle between targeted reforges]
|
||||
@@ -158,7 +158,7 @@ CombatVoucher: {
|
||||
Tooltip:
|
||||
'''
|
||||
Favorite this item in your inventory to increase the likelihood of obtaining a desirable reforge
|
||||
This effect only applies when reforging weapons
|
||||
This effect only applies when reforging weapons
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ HurriedVoucher: {
|
||||
Tooltip:
|
||||
'''
|
||||
Favorite this item in your inventory to increase the likelihood of obtaining a desirable reforge
|
||||
This effect only applies when reforging accessories
|
||||
This effect only applies when reforging accessories
|
||||
Targeted Reforge: {0}
|
||||
Selectable Reforges: {1}
|
||||
[c/aaaaaa:Shift-<right> in your inventory to cycle between targeted reforges]
|
||||
@@ -306,7 +306,7 @@ OddVoucher: {
|
||||
Tooltip:
|
||||
'''
|
||||
Favorite this item in your inventory to increase the likelihood of obtaining a desirable reforge
|
||||
This effect only applies when reforging accessories
|
||||
This effect only applies when reforging accessories
|
||||
Targeted Reforge: {0}
|
||||
Selectable Reforges: {1}
|
||||
[c/aaaaaa:Shift-<right> in your inventory to cycle between targeted reforges]
|
||||
@@ -429,7 +429,7 @@ UnbreakableVoucher: {
|
||||
Tooltip:
|
||||
'''
|
||||
Favorite this item in your inventory to increase the likelihood of obtaining a desirable reforge
|
||||
This effect only applies when reforging accessories
|
||||
This effect only applies when reforging accessories
|
||||
Targeted Reforge: {0}
|
||||
Selectable Reforges: {1}
|
||||
[c/aaaaaa:Shift-<right> in your inventory to cycle between targeted reforges]
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace CalamityMod.Prefixes
|
||||
{
|
||||
valueMult = 2.5f;
|
||||
}
|
||||
public override float RollChance(Item item) => 10; // Is manually applied by an item, can't be rerolled normally
|
||||
public override float RollChance(Item item) => 0; // Is manually applied by an item, can't be rerolled normally
|
||||
public override bool CanRoll(Item item)
|
||||
{
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user