Conflict resolution between Starfleet+Starmada reworks and 1.4.4
This commit is contained in:
commit
5d202684fb
111 files changed
+1006
-633
No files matched your search
@@ -800,6 +800,7 @@ namespace CalamityMod.CalPlayer
|
||||
public bool badgeOfBravery = false;
|
||||
public bool WarbanneroftheRighteous = false;
|
||||
public bool warbannerGlow = false;
|
||||
public float warbannerDamageMult = 0;
|
||||
public bool tesla = false;
|
||||
public bool teslaVisuals = true;
|
||||
public bool cryogenSoul = false;
|
||||
|
||||
@@ -416,8 +416,8 @@ namespace CalamityMod.CalPlayer
|
||||
else // Decrementing
|
||||
{
|
||||
lucreciaEnergyMaxSFXPlayed = false;
|
||||
// Once every 8 ticks
|
||||
if (lucreciaEnergyTimer >= 8)
|
||||
// Once every 20 ticks
|
||||
if (lucreciaEnergyTimer >= 20)
|
||||
{
|
||||
lucreciaEnergy--;
|
||||
lucreciaEnergyTimer = 0;
|
||||
@@ -4038,9 +4038,6 @@ namespace CalamityMod.CalPlayer
|
||||
Player.npcTypeNoAggro[ModContent.NPCType<GammaSlime>()] = true;
|
||||
}
|
||||
|
||||
if (dArtifact)
|
||||
Player.GetDamage<GenericDamageClass>() *= 1.2f;
|
||||
|
||||
if (trippy)
|
||||
Player.GetDamage<GenericDamageClass>() += OddMushroom.DamageBoost;
|
||||
|
||||
@@ -4486,6 +4483,15 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
// Gem Tech stats based on gems.
|
||||
GemTechState.ProvideGemBoosts();
|
||||
|
||||
// Add any multiplicative damage bonuses here
|
||||
float multiplicativeDamage = 1;
|
||||
if (dArtifact)
|
||||
multiplicativeDamage += 0.2f;
|
||||
if (WarbanneroftheRighteous)
|
||||
multiplicativeDamage += warbannerDamageMult;
|
||||
if (multiplicativeDamage != 1)
|
||||
Player.GetDamage<GenericDamageClass>() *= multiplicativeDamage;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -36,14 +36,14 @@ namespace CalamityMod.Cooldowns
|
||||
{
|
||||
base.DrawExpanded(spriteBatch, position, opacity, scale);
|
||||
|
||||
CalamityUtils.DrawBorderStringEightWay(spriteBatch, FontAssets.MouseText.Value, (-instance.timeLeft + 20).ToString() + "%", position + TextPosition, TextColor, TextBorderColor);
|
||||
CalamityUtils.DrawBorderStringEightWay(spriteBatch, FontAssets.MouseText.Value, (-instance.timeLeft + 15).ToString() + "%", position + TextPosition, TextColor, TextBorderColor);
|
||||
}
|
||||
|
||||
public override void DrawCompact(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale)
|
||||
{
|
||||
base.DrawCompact(spriteBatch, position, opacity, scale);
|
||||
|
||||
CalamityUtils.DrawBorderStringEightWay(spriteBatch, FontAssets.MouseText.Value, (-instance.timeLeft + 20).ToString() + "%", position + TextPosition, TextColor, TextBorderColor);
|
||||
CalamityUtils.DrawBorderStringEightWay(spriteBatch, FontAssets.MouseText.Value, (-instance.timeLeft + 15).ToString() + "%", position + TextPosition, TextColor, TextBorderColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@ namespace CalamityMod.Items.Accessories
|
||||
public class WarbanneroftheRighteous : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
internal const float MaxBonus = 0.5f;
|
||||
internal const float MaxBonus = 0.3f;
|
||||
internal const float MaxDistance = 700f;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
@@ -57,18 +57,15 @@ namespace CalamityMod.Items.Accessories
|
||||
}
|
||||
|
||||
int maxValue = (int)(MaxBonus * 100);
|
||||
float bonus = CalculateBonus(player) - 0.3f;
|
||||
float displayBonus = (int)((bonus + 0.3f) * 100); // Should range from 0 to the maxValue
|
||||
float bonus = CalculateBonus(player) - 0.15f;
|
||||
float displayBonus = (int)((bonus + 0.15f) * 100); // Should range from 0 to the maxValue
|
||||
|
||||
if (player.Calamity().cooldowns.TryGetValue(WarbanneroftheRighteousBuff.ID, out var cooldown))
|
||||
cooldown.timeLeft = maxValue - (int)displayBonus;
|
||||
else
|
||||
player.AddCooldown(WarbanneroftheRighteousBuff.ID, maxValue);
|
||||
|
||||
if (bonus > 0)
|
||||
player.GetDamage<GenericDamageClass>() += bonus;
|
||||
else
|
||||
player.GetDamage<GenericDamageClass>() += bonus;
|
||||
player.Calamity().warbannerDamageMult = bonus;
|
||||
|
||||
int targetCount = 0;
|
||||
foreach (NPC npc in Main.ActiveNPCs) // More targets gradually reduces the burn damage for ALL targets
|
||||
@@ -100,7 +97,7 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
modNPC.warbannerBurnIntensity = intensity;
|
||||
modNPC.warbannerBurnDirection = Utils.DirectionTo(player.Center, nPC.Center);
|
||||
int burnDamage = (int)player.GetBestClassDamage().ApplyTo(45 * damageMult); // There is up to a 3x multiplier on this damage depending on distance from the enemy
|
||||
int burnDamage = (int)player.GetBestClassDamage().ApplyTo(37 * damageMult); // There is up to a 3x multiplier on this damage depending on distance from the enemy
|
||||
modNPC.warbannerBurnDamage = burnDamage;
|
||||
modNPC.warbannerBurnStacks++;
|
||||
modNPC.warbannerBurnTimer = 180;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using CalamityMod.Enums;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Fishing;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.PermanentBoosters;
|
||||
using CalamityMod.Items.Placeables.Furniture.DevPaintings;
|
||||
@@ -279,23 +280,18 @@ namespace CalamityMod.Items
|
||||
loot.AddHardmodeOresToCrates(HardmodeCrateType.Mythril);
|
||||
break;
|
||||
|
||||
// Non-crafted underground Gold Chest loot @ 20%; Individually 5%
|
||||
case ItemID.GoldenCrate:
|
||||
loot.Add(new OneFromOptionsNotScaledWithLuckDropRule(5, 1,
|
||||
ItemID.FlareGun,
|
||||
ItemID.Mace,
|
||||
ItemID.BandofRegeneration,
|
||||
ItemID.ShoeSpikes)); // Climbing Claws is in Wooden/Pearlwood (vanilla) in case you're curious
|
||||
RemoveBaitFromGoldenCrates(loot);
|
||||
loot.Add(NewGoldenCrateBaitRule);
|
||||
loot.Add(UndergroundChestLootRule);
|
||||
break;
|
||||
|
||||
case ItemID.GoldenCrateHard:
|
||||
RemoveHardmodeOresFromStandardCrates(loot);
|
||||
loot.AddHardmodeOresToCrates(HardmodeCrateType.Titanium);
|
||||
loot.Add(new OneFromOptionsNotScaledWithLuckDropRule(5, 1,
|
||||
ItemID.FlareGun,
|
||||
ItemID.Mace,
|
||||
ItemID.BandofRegeneration,
|
||||
ItemID.ShoeSpikes));
|
||||
RemoveBaitFromGoldenCrates(loot);
|
||||
loot.Add(NewGoldenCrateBaitRule);
|
||||
loot.Add(UndergroundChestLootRule);
|
||||
break;
|
||||
|
||||
case ItemID.CorruptFishingCrateHard:
|
||||
@@ -538,6 +534,33 @@ namespace CalamityMod.Items
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void RemoveBaitFromGoldenCrates(ItemLoot loot)
|
||||
{
|
||||
List<IItemDropRule> rules = loot.Get(false);
|
||||
IItemDropRule toRemove = null;
|
||||
|
||||
foreach (IItemDropRule rule in rules)
|
||||
if (rule is CommonDrop c && c.itemId == ItemID.MasterBait)
|
||||
toRemove = c;
|
||||
|
||||
if (toRemove is not null)
|
||||
loot.Remove(toRemove);
|
||||
}
|
||||
|
||||
// Replaced bait rules for Golden/Titanium Crates
|
||||
// Vanilla: 3-7 Master Bait @ 66.67%
|
||||
// Calamity: 3-7 Master Bait @ 33.33% OR 3-7 Grand Marquis Bait @ 16.67%
|
||||
private static IItemDropRule NewGoldenCrateBaitRule => ItemDropRule.SequentialRulesNotScalingWithLuck(2,
|
||||
ItemDropRule.NotScalingWithLuck(ModContent.ItemType<GrandMarquisBait>(), 3, 3, 7),
|
||||
ItemDropRule.NotScalingWithLuck(ItemID.MasterBait, 1, 3, 7));
|
||||
|
||||
// Non-crafted underground Gold Chest loot for Golden/Titanium Crates @ 20%; Individually 5%
|
||||
private static IItemDropRule UndergroundChestLootRule => new OneFromOptionsNotScaledWithLuckDropRule(5, 1,
|
||||
ItemID.FlareGun,
|
||||
ItemID.Mace,
|
||||
ItemID.BandofRegeneration,
|
||||
ItemID.ShoeSpikes); // Climbing Claws is in Wooden/Pearlwood (vanilla) in case you're curious
|
||||
#endregion
|
||||
|
||||
#region Goodie Bag Bat Hook
|
||||
|
||||
@@ -3,9 +3,6 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using CalamityMod.Balancing;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Buffs.StatBuffs;
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.ChatTags;
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.DataStructures;
|
||||
@@ -1753,7 +1750,112 @@ namespace CalamityMod.Items
|
||||
return false;
|
||||
}
|
||||
|
||||
if (line.Name == "ItemName" && line.Mod == "Terraria" && item.type == ModContent.ItemType<Orderbringer>())
|
||||
if (line.Mod == "Terraria" && item.type == ModContent.ItemType<OntologicalDespoiler>() && (line.Name == "Tooltip1" || line.Name == "Tooltip2" || line.Name == "Tooltip4" || line.Name == "Tooltip5" || line.Name == "Tooltip7"))
|
||||
{
|
||||
Color rarityColor = Color.Black;
|
||||
Vector2 basePosition = new Vector2(line.X, line.Y);
|
||||
Vector2 backScale = line.BaseScale;
|
||||
Player Owner = Main.LocalPlayer;
|
||||
if (Owner is null)
|
||||
return false;
|
||||
|
||||
float sine = (float)Math.Sin(Main.GlobalTimeWrappedHourly * 5 / MathHelper.Pi);
|
||||
int draws = 20;
|
||||
Color usedColor = Color.White;
|
||||
if (line.Name == "Tooltip1" || line.Name == "Tooltip4" || line.Name == "Tooltip7") // Give the shifting color to the lines that need it
|
||||
{
|
||||
float rate = (Main.GlobalTimeWrappedHourly * 3);
|
||||
List<Color> eColors = new List<Color>()
|
||||
{
|
||||
Owner.shirtColor,
|
||||
Color.Lerp(Owner.shirtColor, Color.Black, 0.15f),
|
||||
Color.Lerp(Owner.shirtColor, Color.White, 0.05f),
|
||||
Color.Lerp(Owner.shirtColor, Color.White, 0.25f)
|
||||
};
|
||||
int colorIndex = (int)(rate / 2 % eColors.Count);
|
||||
Color currentColor = eColors[colorIndex];
|
||||
Color nextColor = eColors[(colorIndex + 1) % eColors.Count];
|
||||
usedColor = Color.Lerp(currentColor, nextColor, rate % 2f >= 1f ? 1f : rate % 1f);
|
||||
if (Owner.shirtColor == Color.White)
|
||||
usedColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB);
|
||||
}
|
||||
|
||||
if (line.Name == "Tooltip5") // Shaky black outline
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
Vector2 shake = Main.rand.NextVector2Circular(5, 5);
|
||||
Vector2 backPosition = basePosition + shake;
|
||||
ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, line.Font, line.Text, backPosition, rarityColor, line.Rotation, line.Origin, backScale, line.MaxWidth, line.Spread);
|
||||
}
|
||||
}
|
||||
if (line.Name == "Tooltip2" || line.Name == "Tooltip5") // Negative lines (inverted colors)
|
||||
{
|
||||
for (int i = 0; i < draws; i++)
|
||||
{
|
||||
Color clr = (line.Name == "Tooltip5") ? Color.Lerp(Color.White, Color.Black, sine) : Color.White;
|
||||
Vector2 backPosition = basePosition + (MathHelper.TwoPi * i / draws).ToRotationVector2() * (1.5f + 0.2f * sine);
|
||||
ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, line.Font, line.Text, backPosition, clr with { A = 0 }, line.Rotation, line.Origin, backScale, line.MaxWidth, line.Spread);
|
||||
}
|
||||
Color clr2 = (line.Name == "Tooltip5") ? Color.Lerp(Color.Black, Color.White, sine) : Color.Black;
|
||||
ChatManager.DrawColorCodedString(Main.spriteBatch, line.Font, line.Text, basePosition, clr2, line.Rotation, line.Origin, backScale);
|
||||
return false;
|
||||
|
||||
}
|
||||
else if (line.Name == "Tooltip4") // Double outline
|
||||
{
|
||||
for (int i = 0; i < draws; i++)
|
||||
{
|
||||
Vector2 backPosition = basePosition + (MathHelper.TwoPi * i / draws).ToRotationVector2() * (4.5f + 0.2f * sine);
|
||||
ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, line.Font, line.Text, backPosition, usedColor with { A = 0 }, line.Rotation, line.Origin, backScale, line.MaxWidth, line.Spread);
|
||||
}
|
||||
for (int i = 0; i < draws; i++)
|
||||
{
|
||||
Vector2 backPosition = basePosition + (MathHelper.TwoPi * i / draws).ToRotationVector2() * (2.5f + 0.2f * sine);
|
||||
ChatManager.DrawColorCodedString(Main.spriteBatch, line.Font, line.Text, backPosition, Color.Black, line.Rotation, line.Origin, backScale);
|
||||
}
|
||||
|
||||
ChatManager.DrawColorCodedString(Main.spriteBatch, line.Font, line.Text, basePosition, Color.White, line.Rotation, line.Origin, backScale);
|
||||
return false;
|
||||
}
|
||||
if (line.Name == "Tooltip7") // Dark horizon thing
|
||||
{
|
||||
Texture2D texture = ModContent.Request<Texture2D>("CalamityMod/Particles/Light").Value;
|
||||
|
||||
Vector2 drawPosition = basePosition;
|
||||
Color drawColor = Color.Black;
|
||||
Vector2 rotationPoint = texture.Size() * 0.5f;
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
int length = line.Text.Length;
|
||||
Main.EntitySpriteDraw(texture, basePosition + Vector2.UnitX * length * 4 + Vector2.UnitY * 10 + Vector2.UnitX * (i % 2 == 0 ? -7 * i : 7 * i), null, usedColor with { A = 0 }, (MathHelper.PiOver2), rotationPoint, new Vector2(0.9f - 0.085f * i, 1 + 2.7f * i * 1f) * 0.7f * Main.rand.NextFloat(0.95f, 1f), SpriteEffects.None);
|
||||
Main.EntitySpriteDraw(texture, basePosition + Vector2.UnitX * length * 4 + Vector2.UnitY * 10 + Vector2.UnitX * (i % 2 == 0 ? -7 * i : 7 * i), null, drawColor, (MathHelper.PiOver2), rotationPoint, new Vector2(0.9f - 0.05f * i, 1 + 4.5f * i * 1f) * 0.55f * Main.rand.NextFloat(0.95f, 1f), SpriteEffects.None);
|
||||
}
|
||||
|
||||
for (int i = 0; i < draws; i++)
|
||||
{
|
||||
Vector2 backPosition = basePosition + (MathHelper.TwoPi * i / draws).ToRotationVector2() * (1.5f);
|
||||
ChatManager.DrawColorCodedString(Main.spriteBatch, line.Font, line.Text, backPosition, usedColor with { A = 0 } * 0.6f, line.Rotation, line.Origin, backScale);
|
||||
}
|
||||
ChatManager.DrawColorCodedString(Main.spriteBatch, line.Font, line.Text, basePosition, Color.Black, line.Rotation, line.Origin, backScale);
|
||||
return false;
|
||||
}
|
||||
if (line.Name == "Tooltip1")
|
||||
{
|
||||
ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, line.Font, line.Text, basePosition, usedColor, line.Rotation, line.Origin, backScale, line.MaxWidth, line.Spread);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Draw the front text as usual as a backup just in case.
|
||||
ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, line.Font, line.Text, basePosition, Color.White, line.Rotation, line.Origin, line.BaseScale, line.MaxWidth, line.Spread);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Rainbow effect originally made for Orderbringer because it used to have a special rarity
|
||||
// But why did it have one in the first place??
|
||||
// Might be used for Miracle stuff later or something idk
|
||||
/*if (line.Name == "ItemName" && line.Mod == "Terraria" && item.type == ModContent.ItemType<Orderbringer>())
|
||||
{
|
||||
Color rarityColor = Color.White;
|
||||
Vector2 basePosition = new Vector2(line.X, line.Y);
|
||||
@@ -1809,7 +1911,7 @@ namespace CalamityMod.Items
|
||||
ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, line.Font, line.Text, shake + basePosition, rarityColor, line.Rotation, line.Origin, line.BaseScale, line.MaxWidth, line.Spread);
|
||||
|
||||
return false;
|
||||
}
|
||||
}*/
|
||||
return true;
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -89,8 +89,8 @@ namespace CalamityMod.Items
|
||||
{ ItemID.CrimsonYoyo, Do(AutoReuse, DamageExact(20)) }, // Artery
|
||||
{ ItemID.CrystalBullet, Do(DamageExact(6)) },
|
||||
{ ItemID.CrystalDart, Do(DamageExact(20)) },
|
||||
{ ItemID.CrystalSerpent, Do(DamageExact(45)) },
|
||||
{ ItemID.CrystalStorm, Do(DamageExact(40)) },
|
||||
{ ItemID.CrystalVileShard, Do(DamageExact(35)) },
|
||||
{ ItemID.CursedArrow, Do(DamageExact(14)) },
|
||||
{ ItemID.CursedDart, Do(DamageExact(25)) },
|
||||
{ ItemID.Cutlass, Do(UseRatio(0.9f), DamageExact(90)) },
|
||||
@@ -107,10 +107,9 @@ namespace CalamityMod.Items
|
||||
{ ItemID.DemonBow, Do(DamageExact(12), AutoReuse) },
|
||||
{ ItemID.DemonScythe, Do(AutoReuse, DamageExact(28)) },
|
||||
{ ItemID.DyeTradersScimitar, Do(AutoReuse, UseTurn, DamageExact(24)) }, // Exotic Scimitar
|
||||
{ ItemID.ElectrosphereLauncher, Do(DamageExact(44)) },
|
||||
{ ItemID.ElfMelter, Do(ShootSpeedDelta(+5f)) },
|
||||
{ ItemID.EmeraldStaff, Do(DamageExact(27)) },
|
||||
{ ItemID.EmpressBlade, Do(AutoReuse, DamageExact(60), UseExact(20)) }, // Terraprisma
|
||||
{ ItemID.EmpressBlade, Do(AutoReuse, DamageExact(50), UseExact(20)) }, // Terraprisma
|
||||
{ ItemID.EnchantedBoomerang, Do(DamageExact(24)) },
|
||||
{ ItemID.EnchantedSword, Do(UseMeleeSpeed, DamageExact(30), ShootSpeedExact(15f)) },
|
||||
{ ItemID.EndlessMusketPouch, Do(DamageExact(8)) },
|
||||
@@ -119,13 +118,12 @@ namespace CalamityMod.Items
|
||||
{ ItemID.FalconBlade, Do(UseTurn, UseExact(13)) },
|
||||
{ ItemID.FireworksLauncher, Do(DamageExact(50), UseExact(25)) }, // Celebration
|
||||
{ ItemID.Flamarang, Do(DamageExact(37)) },
|
||||
{ ItemID.Flamelash, Do(DamageExact(40)) },
|
||||
{ ItemID.Flamelash, Do(DamageExact(36), ManaExact(18)) },
|
||||
{ ItemID.Flamethrower, Do(DamageExact(21), ShootSpeedDelta(+3f)) },
|
||||
{ ItemID.FlowerofFire, Do(AutoReuse, ManaExact(7), UseRatio(0.88f), DamageRatio(0.7f)) }, // Uses ratios due to remix seed
|
||||
{ ItemID.FlowerofFrost, Do(AutoReuse, ManaExact(7), UseExact(22), DamageExact(70), ShootSpeedExact(14)) },
|
||||
{ ItemID.FlyingKnife, Do(DamageExact(53)) },
|
||||
{ ItemID.Frostbrand, Do(UseMeleeSpeed, DamageExact(88)) },
|
||||
{ ItemID.FrostStaff, Do(DamageExact(160), UseExact(37), ShootSpeedExact(20f)) }, // has 1 extra update
|
||||
{ ItemID.Gatligator, Do(UseExact(6)) },
|
||||
{ ItemID.GoldShortsword, Do(AutoReuse, TrueMelee, DamageExact(17)) },
|
||||
{ ItemID.GolemFist, Do(DamageExact(150)) },
|
||||
@@ -141,7 +139,7 @@ namespace CalamityMod.Items
|
||||
{ ItemID.HornetStaff, Do(AutoReuse, DamageExact(18), UseExact(30)) },
|
||||
{ ItemID.IceBlade, Do(UseMeleeSpeed) },
|
||||
{ ItemID.IceBoomerang, Do(UseExact(25), ShootSpeedExact(9)) },
|
||||
{ ItemID.IceRod, Do(UseExact(6), DamageExact(30), ShootSpeedExact(20)) },
|
||||
{ ItemID.IceRod, Do(UseExact(6), ShootSpeedExact(20)) },
|
||||
{ ItemID.IceSickle, Do(AutoReuse, UseMeleeSpeed, DamageExact(75), ShootSpeedExact(20f)) },
|
||||
{ ItemID.IchorArrow, Do(DamageExact(13)) },
|
||||
{ ItemID.IchorBullet, Do(DamageExact(11)) },
|
||||
@@ -158,11 +156,10 @@ namespace CalamityMod.Items
|
||||
{ ItemID.LeadShortsword, Do(AutoReuse, TrueMelee, DamageExact(11)) },
|
||||
{ ItemID.LeafBlower, Do(DamageExact(61)) },
|
||||
{ ItemID.LightDisc, Do(DamageExact(80), ShootSpeedExact(18)) },
|
||||
{ ItemID.LunarFlareBook, Do(DamageExact(120)) },
|
||||
{ ItemID.LunarFlareBook, Do(DamageExact(110)) },
|
||||
{ ItemID.MagicalHarp, Do(DamageExact(50), ShootSpeedExact(12f)) },
|
||||
{ ItemID.MagicDagger, Do(DamageRatio(1.8f), UseRatio(1.88f), ShootSpeedExact(30)) }, // Uses ratios due to remix seed
|
||||
{ ItemID.MagicMissile, Do(DamageExact(23), ManaExact(10), UseAnimationExact(20), UseTimeExact(10)) },
|
||||
{ ItemID.Marrow, Do(DamageExact(69)) },
|
||||
{ ItemID.Marrow, Do(DamageExact(60)) },
|
||||
{ ItemID.MedusaHead, Do(ManaExact(6), DamageExact(48)) },
|
||||
{ ItemID.Meowmere, Do(UseMeleeSpeed, DamageExact(240)) },
|
||||
{ ItemID.MeteorStaff, Do(DamageExact(58), ManaExact(7), ShootSpeedExact(13f)) },
|
||||
@@ -197,9 +194,7 @@ namespace CalamityMod.Items
|
||||
{ ItemID.PearlwoodBow, Do(AutoReuse, DamageExact(32)) },
|
||||
{ ItemID.PearlwoodSword, Do(UseTurn, DamageExact(45)) },
|
||||
{ ItemID.PewMaticHorn, Do(DamageExact(25), ShootSpeedExact(15)) },
|
||||
{ ItemID.Phantasm, Do(DamageExact(48)) },
|
||||
{ ItemID.PhoenixBlaster, Do(AutoReuse, UseExact(20)) },
|
||||
{ ItemID.PlatinumBow, Do(DamageExact(12)) },
|
||||
{ ItemID.PlatinumShortsword, Do(AutoReuse, TrueMelee, DamageExact(18)) },
|
||||
{ ItemID.PoisonStaff, Do(DamageExact(57)) },
|
||||
{ ItemID.PossessedHatchet, Do(DamageExact(135)) },
|
||||
@@ -233,7 +228,7 @@ namespace CalamityMod.Items
|
||||
{ ItemID.Shroomerang, Do(ShootSpeedExact(11)) },
|
||||
{ ItemID.SilverBullet, Do(DamageExact(8)) },
|
||||
{ ItemID.SilverShortsword, Do(AutoReuse, TrueMelee, DamageExact(14)) },
|
||||
{ ItemID.SkyFracture, Do(DamageExact(54), ShootSpeedExact(30f)) },
|
||||
{ ItemID.SkyFracture, Do(DamageExact(46)) },
|
||||
{ ItemID.SlapHand, Do(UseTurn, DamageExact(120)) },
|
||||
{ ItemID.Smolstar, Do(DamageExact(9), AutoReuse, UseExact(25)) }, // Blade Staff
|
||||
{ ItemID.SniperRifle, Do(DamageExact(200), UseExact(40)) },
|
||||
@@ -1398,22 +1393,20 @@ namespace CalamityMod.Items
|
||||
shimmerTransmute[ItemID.StaffofEarth] = ItemID.EyeoftheGolem;
|
||||
|
||||
// Duke Fishron
|
||||
shimmerTransmute[ItemID.FishronWings] = ItemID.Flairon;
|
||||
shimmerTransmute[ItemID.Flairon] = ItemID.Tsunami;
|
||||
shimmerTransmute[ItemID.Tsunami] = ItemID.BubbleGun;
|
||||
shimmerTransmute[ItemID.BubbleGun] = ItemID.RazorbladeTyphoon;
|
||||
shimmerTransmute[ItemID.RazorbladeTyphoon] = ItemID.TempestStaff;
|
||||
shimmerTransmute[ItemID.TempestStaff] = ModContent.ItemType<DukesDecapitator>();
|
||||
shimmerTransmute[ModContent.ItemType<DukesDecapitator>()] = ItemID.FishronWings;
|
||||
shimmerTransmute[ModContent.ItemType<DukesDecapitator>()] = ItemID.Flairon;
|
||||
|
||||
// Empress of Light (Yes these are actually the IDs)
|
||||
shimmerTransmute[ItemID.RainbowWings] = ItemID.PiercingStarlight;
|
||||
shimmerTransmute[ItemID.PiercingStarlight] = ItemID.FairyQueenRangedItem;
|
||||
shimmerTransmute[ItemID.FairyQueenRangedItem] = ItemID.FairyQueenMagicItem;
|
||||
shimmerTransmute[ItemID.FairyQueenMagicItem] = ItemID.SparkleGuitar;
|
||||
shimmerTransmute[ItemID.SparkleGuitar] = ItemID.RainbowWhip;
|
||||
shimmerTransmute[ItemID.RainbowWhip] = ItemID.EmpressBlade;
|
||||
shimmerTransmute[ItemID.EmpressBlade] = ItemID.RainbowWings;
|
||||
shimmerTransmute[ItemID.EmpressBlade] = ItemID.PiercingStarlight;
|
||||
|
||||
// Moon Lord
|
||||
shimmerTransmute[ItemID.Meowmere] = ItemID.StarWrath;
|
||||
|
||||
@@ -18,6 +18,10 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal";
|
||||
public static readonly SoundStyle PlasmaSound = new("CalamityMod/Sounds/Item/PlasmaSmall");
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
ItemID.Sets.IsRangedSpecialistWeapon[Type] = true;
|
||||
}
|
||||
public override void SetDefaults()
|
||||
{
|
||||
CalamityGlobalItem modItem = Item.Calamity();
|
||||
@@ -44,7 +48,6 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
}
|
||||
|
||||
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => false;
|
||||
public override void HoldItem(Player player) => player.Calamity().mouseWorldListener = true;
|
||||
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
|
||||
{
|
||||
|
||||
@@ -21,6 +21,10 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public int FiringTimer = 30;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
ItemID.Sets.IsRangedSpecialistWeapon[Type] = true;
|
||||
}
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 100;
|
||||
|
||||
@@ -22,13 +22,13 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType<GoldenEagle>();
|
||||
base.SetStaticDefaults();
|
||||
}
|
||||
|
||||
public override bool SizeModifiers => false;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 66;
|
||||
Item.height = 66;
|
||||
Item.damage = 4000;
|
||||
Item.DamageType = TrueMeleeDamageClass.Instance;
|
||||
Item.damage = 2090;
|
||||
Item.DamageType = TrueMeleeNoSpeedDamageClass.Instance;
|
||||
Item.useAnimation = Item.useTime = 65;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.knockBack = 15f;
|
||||
@@ -40,7 +40,6 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true;
|
||||
base.SetDefaults();
|
||||
}
|
||||
|
||||
public override bool AltFunctionUse(Player player)
|
||||
{
|
||||
return true;
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
Item.width = 66;
|
||||
Item.height = 70;
|
||||
Item.damage = 351;
|
||||
Item.damage = 300;
|
||||
Item.DamageType = DamageClass.MeleeNoSpeed;
|
||||
Item.noMelee = true;
|
||||
Item.useTurn = true;
|
||||
|
||||
@@ -29,5 +29,6 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
}
|
||||
|
||||
public override bool AltFunctionUse(Player player) => true;
|
||||
public override bool MeleePrefix() => true;
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
Item.height = 118;
|
||||
Item.damage = 143;
|
||||
Item.DamageType = TrueMeleeDamageClass.Instance;
|
||||
Item.useAnimation = Item.useTime = 33;
|
||||
Item.useAnimation = Item.useTime = 28;
|
||||
|
||||
Item.useTurn = true;
|
||||
Item.knockBack = 7.75f;
|
||||
|
||||
@@ -15,6 +15,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
public int shots = 0;
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 48;
|
||||
@@ -38,18 +39,11 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.shootSpeed = 24f;
|
||||
Item.shoot = ModContent.ProjectileType<CardHeart>();
|
||||
Item.useAmmo = AmmoID.Bullet;
|
||||
Item.consumeAmmoOnLastShotOnly = true;
|
||||
}
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(-5, 0);
|
||||
}
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player)
|
||||
{
|
||||
if (Main.rand.Next(0, 100) < 80)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-5, 0);
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
|
||||
@@ -23,6 +23,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public static int AftershotCooldownFrames = 9;
|
||||
public static int Charge1Frames = 156;
|
||||
public static int Charge2Frames = 308;
|
||||
public static Color mainColor = new Color(116, 225, 0);
|
||||
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
|
||||
@@ -32,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
Item.width = 58;
|
||||
Item.height = 28;
|
||||
Item.damage = 172;
|
||||
Item.damage = 125;
|
||||
Item.DamageType = DamageClass.Ranged;
|
||||
Item.useAnimation = Item.useTime = AftershotCooldownFrames;
|
||||
Item.noMelee = true;
|
||||
@@ -65,8 +66,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
CreateRecipe().
|
||||
AddIngredient<OpalStriker>().
|
||||
AddIngredient<MagnaCannon>().
|
||||
AddIngredient<LifeAlloy>(3).
|
||||
AddIngredient(ItemID.MartianConduitPlating, 15).
|
||||
AddIngredient<CoreofCalamity>().
|
||||
AddTile(TileID.MythrilAnvil).
|
||||
Register();
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
@@ -11,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public class Archerfish : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
|
||||
public static int AmmoSavedPercent = 33;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent);
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 78;
|
||||
@@ -61,11 +66,6 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player)
|
||||
{
|
||||
if (Main.rand.Next(0, 100) < 33)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.Next(100) >= AmmoSavedPercent;
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public class AstrealDefeat : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 40;
|
||||
@@ -19,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.DamageType = DamageClass.Ranged;
|
||||
Item.useTime = 4;
|
||||
Item.useAnimation = 20;
|
||||
Item.useLimitPerAnimation = 5;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.noMelee = true;
|
||||
Item.knockBack = 5.5f;
|
||||
@@ -29,11 +31,11 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.shoot = ModContent.ProjectileType<AstrealArrow>();
|
||||
Item.shootSpeed = 4f;
|
||||
Item.useAmmo = AmmoID.Arrow;
|
||||
Item.consumeAmmoOnLastShotOnly = true;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
|
||||
float speed = velocity.Length();
|
||||
if (speed > 8f)
|
||||
velocity *= 8f / speed;
|
||||
@@ -47,13 +49,6 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player)
|
||||
{
|
||||
if (Main.rand.Next(0, 100) < 67)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
|
||||
@@ -60,8 +60,6 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
public override void HoldItem(Player player) => player.scope = true;
|
||||
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.Next(100) >= 50;
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
|
||||
@@ -5,6 +5,7 @@ using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
@@ -15,6 +16,10 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
|
||||
public static readonly SoundStyle Nanomachines = new("CalamityMod/Sounds/Item/NanoSwarm") { PitchVariance = 0.45f, Volume = 0.4f };
|
||||
|
||||
public static int AmmoSavedPercent = 33;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent);
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 76;
|
||||
@@ -34,16 +39,10 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.shootSpeed = 7f;
|
||||
Item.useAmmo = AmmoID.Gel;
|
||||
}
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player)
|
||||
{
|
||||
if (Main.rand.Next(0, 100) < 50)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(-10, 0);
|
||||
}
|
||||
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-10, 0);
|
||||
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.Next(100) >= AmmoSavedPercent;
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
|
||||
@@ -10,6 +10,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public class BlossomFlux : LegendaryItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
|
||||
public override Color? TooltipExtensionColor => new Color(109, 161, 84);
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
@@ -32,15 +33,13 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.shoot = ModContent.ProjectileType<LeafArrow>();
|
||||
Item.shootSpeed = 10f;
|
||||
Item.useAmmo = AmmoID.Arrow;
|
||||
Item.consumeAmmoOnFirstShotOnly = true;
|
||||
|
||||
Item.value = CalamityGlobalItem.RarityLimeBuyPrice;
|
||||
Item.rare = ItemRarityID.Lime;
|
||||
}
|
||||
|
||||
public override bool AltFunctionUse(Player player)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public override bool AltFunctionUse(Player player) => true;
|
||||
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
@@ -48,12 +47,14 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
Item.useTime = 25;
|
||||
Item.useAnimation = 25;
|
||||
Item.useLimitPerAnimation = 1;
|
||||
Item.UseSound = SoundID.Item77;
|
||||
}
|
||||
else
|
||||
{
|
||||
Item.useTime = 3;
|
||||
Item.useAnimation = 15;
|
||||
Item.useLimitPerAnimation = 5;
|
||||
Item.UseSound = SoundID.Item5;
|
||||
}
|
||||
return base.CanUseItem(player);
|
||||
@@ -71,12 +72,5 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player)
|
||||
{
|
||||
if (Main.rand.Next(0, 100) < 50)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
@@ -14,7 +15,8 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
|
||||
public int FlareCounter = 0;
|
||||
public static int AmmoSavedPercent = 50;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent);
|
||||
|
||||
public override void SetStaticDefaults() => ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true;
|
||||
|
||||
@@ -46,7 +48,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public override void HoldItem(Player player) => player.Calamity().mouseWorldListener = true;
|
||||
|
||||
// Spawning the holdout cannot consume ammo
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0;
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0 && Main.rand.Next(100) >= AmmoSavedPercent;
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
|
||||
@@ -10,6 +10,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public class ConferenceCall : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 66;
|
||||
@@ -30,17 +31,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.useAmmo = AmmoID.Bullet;
|
||||
}
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(-10, 0);
|
||||
}
|
||||
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player)
|
||||
{
|
||||
if (Main.rand.Next(0, 100) < 50)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-10, 0);
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
|
||||
@@ -7,6 +7,7 @@ using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
@@ -14,6 +15,10 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public class DaemonsFlame : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
|
||||
public static int AmmoSavedPercent = 66;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent);
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType<FatesReveal>();
|
||||
@@ -44,7 +49,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
|
||||
|
||||
// Spawning the holdout cannot consume ammo
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.NextBool(3) && player.ownedProjectileCounts[Item.shoot] > 0;
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0 && Main.rand.Next(100) >= AmmoSavedPercent;
|
||||
|
||||
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
|
||||
{
|
||||
|
||||
@@ -9,6 +9,7 @@ using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
@@ -17,12 +18,14 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
|
||||
public static int AmmoSavedPercent = 80;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent);
|
||||
|
||||
public static readonly SoundStyle FireballSound = new("CalamityMod/Sounds/Custom/Yharon/YharonFireball", 3) { PitchVariance = 0.3f, Volume = 0.75f };
|
||||
public static readonly SoundStyle WeldingStart = new("CalamityMod/Sounds/Item/DragonsBreathStrongStart") { Volume = 1.75f };
|
||||
public static readonly SoundStyle WeldingBurn = new("CalamityMod/Sounds/Item/WeldingBurn") { Volume = 0.65f };
|
||||
public static readonly SoundStyle WeldingShoot = new("CalamityMod/Sounds/Item/WeldingShoot") { Volume = 0.45f };
|
||||
|
||||
public int Counter = 0;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType<PhoenixFlameBarrage>();
|
||||
@@ -50,7 +53,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.rare = ModContent.RarityType<BurnishedAuric>();
|
||||
Item.value = CalamityGlobalItem.RarityVioletBuyPrice;
|
||||
}
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0;
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0 && Main.rand.Next(100) >= AmmoSavedPercent;
|
||||
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
|
||||
public override void HoldItem(Player player) => player.Calamity().mouseWorldListener = true;
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
|
||||
@@ -5,6 +5,7 @@ using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
@@ -12,6 +13,10 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public class FetidEmesis : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
|
||||
public static int AmmoSavedPercent = 66;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent);
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType<SepticSkewer>();
|
||||
@@ -20,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
Item.width = 76;
|
||||
Item.height = 46;
|
||||
Item.damage = 315;
|
||||
Item.damage = 424;
|
||||
Item.DamageType = DamageClass.Ranged;
|
||||
Item.useAnimation = Item.useTime = 6;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
@@ -38,7 +43,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.rare = ModContent.RarityType<PureGreen>();
|
||||
}
|
||||
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0;
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0 && Main.rand.Next(100) >= AmmoSavedPercent;
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType<FetidEmesisHoldout>(), damage, knockback, player.whoAmI);
|
||||
|
||||
@@ -3,6 +3,7 @@ using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
@@ -11,6 +12,9 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
|
||||
public static int AmmoSavedPercent = 33;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent);
|
||||
|
||||
// This is intentionally stored on the item instead of the holdout to prevent swapping items to instantly reset the heat
|
||||
// This could be theoretically exploited using multiple items, but the heat dissipates fast enough that I can't really care
|
||||
public int BuiltUpHeat = 0;
|
||||
@@ -54,12 +58,8 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
}
|
||||
|
||||
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0 && !player.Calamity().mouseRight;
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0; // Spawning the holdout cannot consume ammo
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<FirestormCannonHoldout>(), damage, knockback, player.whoAmI);
|
||||
return false;
|
||||
}
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0 && Main.rand.Next(100) >= AmmoSavedPercent;
|
||||
public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) => type = Item.shoot;
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@ using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
@@ -10,6 +11,10 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public class FlurrystormCannon : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
|
||||
public static int AmmoSavedPercent = 50;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent);
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 68;
|
||||
@@ -38,7 +43,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
|
||||
|
||||
// Spawning the holdout cannot consume ammo
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.NextBool() && player.ownedProjectileCounts[Item.shoot] > 0;
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0 && Main.rand.Next(100) >= AmmoSavedPercent;
|
||||
|
||||
public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) => type = Item.shoot;
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.autoReuse = true;
|
||||
|
||||
Item.useAmmo = AmmoID.Gel;
|
||||
Item.consumeAmmoOnFirstShotOnly = true;
|
||||
Item.shootSpeed = 12f;
|
||||
Item.shoot = ModContent.ProjectileType<HalleysComet>();
|
||||
|
||||
@@ -49,8 +50,6 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
public override void HoldItem(Player player) => player.scope = true;
|
||||
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.Next(100) >= 50;
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
|
||||
@@ -8,6 +8,7 @@ using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
@@ -16,6 +17,10 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
public int SineCounter = 0;
|
||||
|
||||
public static int AmmoSavedPercent = 80;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent);
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true;
|
||||
@@ -29,6 +34,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.DamageType = DamageClass.Ranged;
|
||||
Item.useTime = 1;
|
||||
Item.useAnimation = 4;
|
||||
Item.useLimitPerAnimation = 4;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.noMelee = true;
|
||||
Item.knockBack = 1f;
|
||||
@@ -39,6 +45,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.shoot = ProjectileID.PurificationPowder;
|
||||
Item.shootSpeed = 6f;
|
||||
Item.useAmmo = AmmoID.Bullet;
|
||||
Item.consumeAmmoOnLastShotOnly = true;
|
||||
}
|
||||
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-5, 0);
|
||||
@@ -68,12 +75,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player)
|
||||
{
|
||||
if (Main.rand.Next(0, 100) < 20 && SineCounter % 4 == 0)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.Next(100) >= AmmoSavedPercent;
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
|
||||
@@ -41,10 +41,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.useAmmo = AmmoID.Bullet;
|
||||
}
|
||||
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
return CalamityGlobalItem.HasEnoughAmmo(player, Item, 5);
|
||||
}
|
||||
public override bool CanUseItem(Player player) => CalamityGlobalItem.HasEnoughAmmo(player, Item, 5);
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
@@ -57,20 +54,13 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
// Consume 5 ammo per shot
|
||||
CalamityGlobalItem.ConsumeAdditionalAmmo(player, Item, 5);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Disable vanilla ammo consumption
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => false;
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(-20, 0);
|
||||
}
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-20, 0);
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
|
||||
@@ -7,6 +7,7 @@ using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
@@ -15,6 +16,10 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public class Kingsbane : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
|
||||
public static int AmmoSavedPercent = 95;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent);
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 92;
|
||||
@@ -37,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.rare = ModContent.RarityType<BurnishedAuric>();
|
||||
}
|
||||
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.NextFloat() > 0.95f && player.ownedProjectileCounts[Item.shoot] > 0;
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0 && Main.rand.Next(100) >= AmmoSavedPercent;
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Projectile holdout = Projectile.NewProjectileDirect(source, position, velocity, Item.shoot, damage, knockback, player.whoAmI);
|
||||
|
||||
@@ -6,6 +6,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
@@ -13,6 +14,10 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public class MagnomalyCannon : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
|
||||
public static int AmmoSavedPercent = 50;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent);
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 84;
|
||||
@@ -33,19 +38,11 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.rare = ModContent.RarityType<BurnishedAuric>();
|
||||
}
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(-30, -10);
|
||||
}
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-30, -10);
|
||||
|
||||
public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) => type = Item.shoot;
|
||||
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player)
|
||||
{
|
||||
if (Main.rand.Next(0, 100) < 66)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.Next(100) >= AmmoSavedPercent;
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
|
||||
@@ -43,17 +43,16 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public override bool AltFunctionUse(Player player) => true;
|
||||
public override float UseSpeedMultiplier(Player player)
|
||||
{
|
||||
|
||||
if (player.altFunctionUse == 2)
|
||||
return 1.3f;
|
||||
return 1.3f - (float)(1 - Math.Pow(Utils.GetLerpValue(0, shotType ? 0.175f : 0.25f, mult, true), 2.5f));
|
||||
|
||||
if (Main.zenithWorld)
|
||||
return 3 * (shotType ? 0.7f : 1);
|
||||
|
||||
if (!shotType)
|
||||
return 1.5f - mult;
|
||||
return 1.5f - ((mult > 0.25f) ? mult : 0);
|
||||
|
||||
return 1f - mult;
|
||||
return 1f - ((mult > 0.175f) ? mult : 0);
|
||||
}
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
@@ -75,7 +74,8 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
for (int i = 0; i < 3; i++)
|
||||
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<NullShot>(), damage / 3, 0, player.whoAmI, 0, 0, i);
|
||||
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<NullFlash>(), damage / 2, 0, player.whoAmI, 0, 0);
|
||||
if (mult < 0.175f)
|
||||
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<NullFlash>(), damage, 0, player.whoAmI, 0, 0);
|
||||
if (mult < 0.35f)
|
||||
mult += 0.013f;
|
||||
}
|
||||
@@ -83,14 +83,27 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
Projectile aBeam = Projectile.NewProjectileDirect(source, position, velocity, ModContent.ProjectileType<NullShot>(), (int)(damage * 0.7f), 0, player.whoAmI, 0, 5);
|
||||
aBeam.penetrate = 1;
|
||||
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<NullFlash>(), damage / 2, 0, player.whoAmI, 0, 5);
|
||||
if (mult < 0.25f)
|
||||
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<NullFlash>(), (int)(damage * 0.75f), 0, player.whoAmI, 0, 5);
|
||||
if (mult < 0.5f)
|
||||
mult += 0.013f;
|
||||
}
|
||||
if (player.altFunctionUse != 2)
|
||||
{
|
||||
SoundStyle fire = new("CalamityMod/Sounds/Item/NullShot");
|
||||
SoundEngine.PlaySound(fire with { Volume = 0.7f, Pitch = Main.rand.NextFloat(0f, 0.2f) + (!shotType ? 0.3f : 0) }, position);
|
||||
SoundEngine.PlaySound(fire with { Volume = 0.7f, Pitch = Main.rand.NextFloat(0f, 0.2f) + (!shotType ? 0.3f : 0) - (shotType ? ((mult > 0.25f) ? mult : 0) : ((mult > 0.175f) ? mult : 0)) }, position);
|
||||
|
||||
if (mult >= (shotType ? 0.175f : 0.25f))
|
||||
{
|
||||
for (int i = 0; i < 18; i++)
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(position + velocity * 8, ModContent.DustType<UnstableDust>(), (velocity).RotatedByRandom(0.5) * Main.rand.NextFloat(0.4f, 1f));
|
||||
dust.noGravity = !Main.rand.NextBool(4);
|
||||
dust.scale = Main.rand.NextFloat(1.2f, 1.8f);
|
||||
dust.color = Main.rand.NextBool() ? Color.White : (Main.rand.NextBool() ? Color.Orchid : Color.Turquoise);
|
||||
dust.fadeIn = 7.5f;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using CalamityMod.Rarities;
|
||||
@@ -55,15 +54,12 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
}
|
||||
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 25;
|
||||
public override bool AltFunctionUse(Player player) => true;
|
||||
|
||||
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
|
||||
|
||||
public override void HoldItem(Player player)
|
||||
{
|
||||
if (Main.myPlayer == player.whoAmI)
|
||||
player.Calamity().rightClickListener = true;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
// Only one out at a time
|
||||
@@ -72,7 +68,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
// 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction
|
||||
|
||||
if (player.Calamity().mouseRight && player.whoAmI == Main.myPlayer && !Main.mapFullscreen && !Main.blockMouse)
|
||||
if (player.Calamity().mouseRight && player.whoAmI == Main.myPlayer && !Main.mapFullscreen && !Main.blockMouse && player.Calamity().despoilerNerf)
|
||||
{
|
||||
Projectile holdout2 = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, Item.shoot, player.ActiveItem().damage, 0f, player.whoAmI, 0, 0, 10 + (shotType ? 5 : 0));
|
||||
holdout2.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero);
|
||||
@@ -87,38 +83,12 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public override void ModifyTooltips(List<TooltipLine> list)
|
||||
{
|
||||
Player Owner = Main.LocalPlayer;
|
||||
if (Owner is null)
|
||||
return;
|
||||
float rate = (Main.GlobalTimeWrappedHourly * 3);
|
||||
List<Color> eColors = new List<Color>()
|
||||
{
|
||||
Owner.shirtColor,
|
||||
Color.Lerp(Owner.shirtColor, Color.Black, 0.3f),
|
||||
Color.Lerp(Owner.shirtColor, Color.White, 0.2f),
|
||||
Color.Lerp(Owner.shirtColor, Color.White, 0.4f)
|
||||
};
|
||||
int colorIndex = (int)(rate / 2 % eColors.Count);
|
||||
Color currentColor = eColors[colorIndex];
|
||||
Color nextColor = eColors[(colorIndex + 1) % eColors.Count];
|
||||
Color eTooltipColor = Color.Lerp(currentColor, nextColor, rate % 2f > 1f ? 1f : rate % 1f);
|
||||
if (Owner.shirtColor == Color.White)
|
||||
eTooltipColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB);
|
||||
|
||||
TooltipLine line = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip7");
|
||||
if (line != null)
|
||||
line.OverrideColor = Color.Lerp(eTooltipColor, Color.White, 0.2f);
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<ArcNovaDiffuser>().
|
||||
AddIngredient<NullificationPistol>().
|
||||
AddIngredient<DarkPlasma>(2).
|
||||
AddIngredient<CoreofCalamity>().
|
||||
AddIngredient<DarkPlasma>(3).
|
||||
AddTile(TileID.MythrilAnvil).
|
||||
Register();
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
@@ -9,6 +10,10 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public class OnyxChainBlaster : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
|
||||
public static int AmmoSavedPercent = 50;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent);
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 64;
|
||||
@@ -29,10 +34,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.useAmmo = AmmoID.Bullet;
|
||||
}
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(-5, 0);
|
||||
}
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-5, 0);
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
@@ -52,12 +54,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player)
|
||||
{
|
||||
if (Main.rand.Next(0, 100) < 50)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.Next(100) >= AmmoSavedPercent;
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@ using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
@@ -12,7 +13,9 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public class Onyxia : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
const int NotConsumeAmmo = 50;
|
||||
|
||||
public static int AmmoSavedPercent = 50;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent);
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -33,10 +36,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.useAmmo = AmmoID.Bullet;
|
||||
}
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(-11, 3);
|
||||
}
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-11, 3);
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
@@ -60,12 +60,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player)
|
||||
{
|
||||
if (Main.rand.Next(0, 100) < NotConsumeAmmo)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.Next(100) >= AmmoSavedPercent;
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@ using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
@@ -12,6 +13,10 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public class OverloadedBlaster : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
|
||||
public static int AmmoSavedPercent = 25;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent);
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType<AbyssalTome>();
|
||||
@@ -37,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-4, -5);
|
||||
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.Next(100) >= 25;
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.Next(100) >= AmmoSavedPercent;
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@ using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
@@ -13,6 +14,9 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
|
||||
public static int AmmoSavedPercent = 50;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent);
|
||||
|
||||
public bool fireShot = true;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -43,6 +47,6 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => fireShot && Main.rand.NextFloat() < 0.25f;
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => fireShot && Main.rand.Next(100) >= AmmoSavedPercent;
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
@@ -20,8 +21,9 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
|
||||
// Left-click stats
|
||||
public static float AmmoNotConsumeChance = 0.95f;
|
||||
public static int AmmoSavedPercent = 95;
|
||||
public static int LightBombCooldown = 10;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent);
|
||||
|
||||
// Right-click stats
|
||||
public static float RightClickVelocityMult = 2.5f;
|
||||
|
||||
@@ -3,6 +3,7 @@ using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
@@ -13,6 +14,9 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
private int counter = 0;
|
||||
|
||||
public static int AmmoSavedPercent = 50;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent);
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 68;
|
||||
@@ -38,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-12, -6);
|
||||
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.Next(0, 100) >= 33;
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.Next(100) >= AmmoSavedPercent;
|
||||
|
||||
public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback)
|
||||
{
|
||||
|
||||
@@ -70,10 +70,8 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
player.AddCooldown(FuryFuel.ID, max);
|
||||
}
|
||||
}
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player)
|
||||
{
|
||||
return (player.altFunctionUse != 2); // Right click doesn't use ammo, it's crystal powder not gel
|
||||
}
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => player.altFunctionUse != 2; // Right click doesn't use ammo, it's crystal powder not gel
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.altFunctionUse == 2)
|
||||
|
||||
@@ -7,6 +7,7 @@ using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
@@ -15,6 +16,10 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public class Riftburst : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
|
||||
public static int AmmoSavedPercent = 66;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent);
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 48;
|
||||
@@ -39,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
|
||||
|
||||
// Spawning the holdout cannot consume ammo
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.NextBool(3) && player.ownedProjectileCounts[Item.shoot] > 0;
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0 && Main.rand.Next(100) >= AmmoSavedPercent;
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
|
||||
@@ -7,6 +7,7 @@ using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
@@ -15,6 +16,9 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
|
||||
public static int AmmoSavedPercent = 66;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent);
|
||||
|
||||
private int ShotCounter = 0;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -53,12 +57,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player)
|
||||
{
|
||||
if (Main.rand.Next(0, 100) < 50)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.Next(100) >= AmmoSavedPercent;
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@ using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
@@ -12,6 +13,10 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public class Sandblaster : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
|
||||
public static int AmmoSavedPercent = 50;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent);
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 62;
|
||||
@@ -33,18 +38,9 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-10, 0);
|
||||
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player)
|
||||
{
|
||||
if (Main.rand.Next(0, 100) < 50)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.Next(100) >= AmmoSavedPercent;
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<SandblasterBullet>(), damage, knockback, player.whoAmI);
|
||||
return false;
|
||||
}
|
||||
public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) => type = Item.shoot;
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
|
||||
@@ -7,6 +7,7 @@ using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
using static Terraria.ModLoader.ModContent;
|
||||
|
||||
@@ -17,6 +18,9 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
public static readonly SoundStyle RocketShoot = new("CalamityMod/Sounds/Item/ScorpioShot") { Volume = 0.45f };
|
||||
|
||||
public static int AmmoSavedPercent = 50;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent);
|
||||
|
||||
public static int OriginalUseTime = 60;
|
||||
public static int TimeBetweenBursts = 10;
|
||||
public static int ProjectilesPerBurst = 4;
|
||||
@@ -45,7 +49,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] == 0;
|
||||
|
||||
// Spawning the holdout won't consume ammo.
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] != 0;
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0 && Main.rand.Next(100) >= AmmoSavedPercent;
|
||||
|
||||
// Makes the rotation of the mouse around the player sync in multiplayer.
|
||||
public override void HoldItem(Player player) => player.Calamity().mouseRotationListener = true;
|
||||
@@ -56,7 +60,6 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
// We set the rotation to the direction to the mouse so the first frame doesn't appear bugged out.
|
||||
holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public class Shredder : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true;
|
||||
@@ -37,6 +38,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.shoot = ProjectileID.Bullet;
|
||||
Item.shootSpeed = 5f;
|
||||
Item.useAmmo = AmmoID.Bullet;
|
||||
Item.consumeAmmoOnLastShotOnly = true;
|
||||
}
|
||||
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-5, 0);
|
||||
@@ -54,12 +56,6 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player)
|
||||
{
|
||||
if (Main.rand.Next(0, 100) < 60)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@ using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
@@ -15,6 +16,9 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
private static readonly float XYInaccuracy = 0.32f;
|
||||
|
||||
public static int AmmoSavedPercent = 80;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent);
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 94;
|
||||
@@ -63,7 +67,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.NextFloat() > 0.8f;
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.Next(100) >= AmmoSavedPercent;
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@ using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
@@ -12,6 +13,9 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
|
||||
public static int AmmoSavedPercent = 33;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent);
|
||||
|
||||
// This is intentionally stored on the item instead of the holdout to prevent swapping items to instantly reset the heat
|
||||
// This could be theoretically exploited using multiple items, but the heat dissipates fast enough that I can't really care
|
||||
public int BuiltUpHeat = 0;
|
||||
@@ -54,12 +58,8 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
}
|
||||
}
|
||||
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0 && !player.Calamity().mouseRight;
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0; // Spawning the holdout cannot consume ammo
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<SpectralstormCannonHoldout>(), damage, knockback, player.whoAmI);
|
||||
return false;
|
||||
}
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0 && Main.rand.Next(100) >= AmmoSavedPercent;
|
||||
public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) => type = Item.shoot;
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
|
||||
@@ -37,19 +37,10 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.shoot = ModContent.ProjectileType<SputterComet>();
|
||||
Item.shootSpeed = 15f;
|
||||
Item.useAmmo = AmmoID.FallenStar;
|
||||
Item.consumeAmmoOnFirstShotOnly = true;
|
||||
}
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(-5, 0);
|
||||
}
|
||||
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) //consume ammo only once per round
|
||||
{
|
||||
if (counter == 1 || counter == 2 || counter == 4 || counter == 5 || counter == 7 || counter == 8 || counter == 10 || counter == 11)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-5, 0);
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
|
||||
@@ -7,6 +7,7 @@ using CalamityMod.Rarities;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
using Microsoft.Xna.Framework;
|
||||
|
||||
@@ -16,6 +17,10 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public class Starmada : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
|
||||
public static int AmmoSavedPercent = 66;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent);
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 122;
|
||||
|
||||
@@ -8,6 +8,7 @@ using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
@@ -16,6 +17,10 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
public int SineCounter = 0;
|
||||
|
||||
public static int AmmoSavedPercent = 80;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent);
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true;
|
||||
@@ -27,7 +32,8 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.damage = 232;
|
||||
Item.DamageType = DamageClass.Ranged;
|
||||
Item.useTime = 1;
|
||||
Item.useAnimation = 3;
|
||||
Item.useAnimation = 4;
|
||||
Item.useLimitPerAnimation = 4;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.noMelee = true;
|
||||
Item.knockBack = 3.5f;
|
||||
@@ -41,14 +47,11 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.shootSpeed = 6f;
|
||||
Item.shoot = ProjectileID.PurificationPowder;
|
||||
Item.useAmmo = AmmoID.Bullet;
|
||||
Item.consumeAmmoOnLastShotOnly = true;
|
||||
}
|
||||
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-5, 0);
|
||||
public override bool AltFunctionUse(Player player)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public override void HoldItem(Player player) => player.scope = false;
|
||||
public override bool AltFunctionUse(Player player) => true;
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
@@ -75,12 +78,8 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player)
|
||||
{
|
||||
if (Main.rand.Next(0, 100) > 90 && SineCounter % 4 == 0)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.Next(100) >= AmmoSavedPercent;
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public int shots = 0;
|
||||
public int frame = 0;
|
||||
public int frameCounter = 0;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.RegisterItemAnimation(Type, new DrawAnimationVertical(3, 5));
|
||||
@@ -31,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.damage = 83;
|
||||
Item.DamageType = DamageClass.Ranged;
|
||||
Item.useTime = 3;
|
||||
Item.useAnimation = 25;
|
||||
Item.useAnimation = 24;
|
||||
Item.useLimitPerAnimation = 8;
|
||||
Item.knockBack = 7.5f;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
@@ -45,9 +46,9 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.shoot = ModContent.ProjectileType<TelluricGlareArrow>();
|
||||
Item.shootSpeed = 18f;
|
||||
Item.useAmmo = AmmoID.Arrow;
|
||||
Item.consumeAmmoOnLastShotOnly = true;
|
||||
}
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-14f, 0f);
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.NextFloat() < 0.25f;
|
||||
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale)
|
||||
{
|
||||
Texture2D texture;
|
||||
|
||||
@@ -6,6 +6,7 @@ using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
@@ -28,6 +29,8 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public static readonly float RightClickCopperMultiplier = 0.04f;
|
||||
public static readonly float RightClickSilverMultiplier = 0.08f;
|
||||
public static readonly float RightClickGoldMultiplier = 0.16f;
|
||||
public static int RightClickAmmoSavedPercent = 80;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RightClickAmmoSavedPercent);
|
||||
|
||||
public static readonly float DoublesMultiplier = 1f; // Unfortunately doubles can't be doubles. Balancing!
|
||||
public static readonly float TriplesCherryMultiplier = 1f;
|
||||
@@ -67,10 +70,10 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
public override bool? UseItem(Player player)
|
||||
{
|
||||
// Right click has a 20% chance to consume money
|
||||
// Right click has a chance to save money
|
||||
if (player.altFunctionUse == 2)
|
||||
{
|
||||
bool consumeCoin = Main.rand.NextFloat() > 0.8f;
|
||||
bool consumeCoin = Main.rand.Next(100) >= RightClickAmmoSavedPercent;
|
||||
long coinCount = Utils.CoinsCount(out bool overflow, player.inventory);
|
||||
int price;
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.DamageType = DamageClass.Ranged;
|
||||
Item.useTime = 2;
|
||||
Item.useAnimation = 20;
|
||||
Item.useLimitPerAnimation = 10;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.noMelee = true;
|
||||
Item.knockBack = 3.5f;
|
||||
@@ -39,18 +40,11 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.shoot = ModContent.ProjectileType<TheStormLightningShot>();
|
||||
Item.shootSpeed = 12f;
|
||||
Item.useAmmo = AmmoID.Arrow;
|
||||
Item.consumeAmmoOnLastShotOnly = true;
|
||||
}
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(-10, 0);
|
||||
}
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player)
|
||||
{
|
||||
if (Main.rand.Next(0, 100) < 95)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-10, 0);
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (shots % 2 == 0)
|
||||
|
||||
@@ -7,6 +7,7 @@ using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
@@ -14,6 +15,10 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public class Ultima : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
|
||||
public static int AmmoSavedPercent = 66;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent);
|
||||
|
||||
public const float FullChargeTime = 420f;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -45,7 +50,8 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.Next(0, 100) >= 90;
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0 && Main.rand.Next(100) >= AmmoSavedPercent;
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
|
||||
@@ -15,6 +15,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public class UniversalGenesis : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 158;
|
||||
@@ -76,8 +77,6 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.NextBool();
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
|
||||
@@ -6,6 +6,7 @@ using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
@@ -16,10 +17,8 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
private int shotType = 1;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
// Long live Megafleet. You will be missed. Maybe one day we can revive you.
|
||||
}
|
||||
public static int AmmoSavedPercent = 50;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent);
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -43,10 +42,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.Calamity().devItem = true;
|
||||
}
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(-10, 0);
|
||||
}
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-10, 0);
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
@@ -68,12 +64,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player)
|
||||
{
|
||||
if (Main.rand.Next(0, 100) < 50 || shotType % 2 == 0)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.Next(100) >= AmmoSavedPercent && shotType % 2 == 1;
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@ using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
@@ -13,10 +14,11 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public class WildfireBloom : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
|
||||
public int FlareCounter = 0;
|
||||
public int WildfireUseTime = 8;
|
||||
|
||||
public static int AmmoSavedPercent = 50;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent);
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 114;
|
||||
@@ -45,7 +47,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public override void HoldItem(Player player) => player.Calamity().mouseWorldListener = true;
|
||||
|
||||
// Spawning the holdout cannot consume ammo
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0;
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0 && Main.rand.Next(100) >= AmmoSavedPercent;
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
@@ -54,7 +56,6 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
// 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction
|
||||
// We set the rotation to the direction to the mouse so the first frame doesn't appear bugged out.
|
||||
holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Summon
|
||||
{
|
||||
Item.width = 66;
|
||||
Item.height = 70;
|
||||
Item.damage = 200;
|
||||
Item.damage = 175;
|
||||
Item.DamageType = DamageClass.Summon;
|
||||
Item.buffType = ModContent.BuffType<Phantom>();
|
||||
Item.shoot = ModContent.ProjectileType<PhantomGuy>();
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Summon
|
||||
{
|
||||
Item.width = 24;
|
||||
Item.height = 26;
|
||||
Item.damage = 275;
|
||||
Item.damage = 250;
|
||||
Item.DamageType = DamageClass.Summon;
|
||||
Item.buffType = ModContent.BuffType<MutatedTruffleBuff>();
|
||||
Item.shoot = ModContent.ProjectileType<MutatedTruffleMinion>();
|
||||
|
||||
@@ -2073,8 +2073,8 @@ WarbanneroftheRighteous: {
|
||||
DisplayName: Warbanner of the Righteous
|
||||
Tooltip:
|
||||
'''
|
||||
Grants a scaling damage boost based on how close you are to enemies
|
||||
Maximum damage boost is 20%, minimum damage boost is -30%
|
||||
Multiplies all damage based on how close you are to enemies
|
||||
Maximum damage boost is 15%, minimum damage boost is -15%
|
||||
Emit a blazing aura that burns and repels nearby enemies
|
||||
Enemies take increasing damage the closer they are to you and the longer they are near you
|
||||
Effects are transparent and silent if visibility is disabled
|
||||
|
||||
@@ -653,6 +653,7 @@ GildedProboscis: {
|
||||
The thrust begins weak, but becomes more powerful the longer it's held
|
||||
<right> to dash forward with a mighty upstrike
|
||||
The distance you dash depends on if you are moving with or against the dash
|
||||
Always critically strikes
|
||||
'''
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ AcesHigh: {
|
||||
Spades pierce enemies
|
||||
Diamonds violently explode
|
||||
Clubs split into three
|
||||
80% chance to save ammo
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -86,7 +85,7 @@ Archerfish: {
|
||||
Tooltip:
|
||||
'''
|
||||
Converts musket balls into streams of water
|
||||
33% chance to save ammo
|
||||
{$CommonItemTooltip.PercentChanceToSaveAmmo}
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -96,7 +95,7 @@ ArcNovaDiffuser: {
|
||||
'''
|
||||
Charges and fires a rapid burst of nova bolts
|
||||
The first charging stage increases the fire rate of the burst
|
||||
The second charging stage replaces the rapid burst with a devastating nova blast
|
||||
The second charging stage replaces the rapid burst with a devastating nova blast that always crits
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -126,11 +125,7 @@ AstralBlaster: {
|
||||
|
||||
AstrealDefeat: {
|
||||
DisplayName: Astreal Defeat
|
||||
Tooltip:
|
||||
'''
|
||||
All arrows are converted to Astreal Arrows that emit flames as they travel
|
||||
33% chance to save ammo
|
||||
'''
|
||||
Tooltip: All arrows are converted to Astreal Arrows that emit flames as they travel
|
||||
}
|
||||
|
||||
Auralis: {
|
||||
@@ -143,7 +138,6 @@ Auralis: {
|
||||
Standing still for 5 or more seconds while using the scope ability will summon an aurora
|
||||
The aurora reduces the damage of the next projectile hit by 100
|
||||
This effect lasts up to 20 seconds and has a 30 second cooldown
|
||||
50% chance to save ammo
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -184,7 +178,7 @@ BlightSpewer: {
|
||||
'''
|
||||
Fires clouds of plague nanomachines that stick to tiles
|
||||
Nanomachines aggressively lock onto nearby enemies
|
||||
40% chance to save ammo
|
||||
{$CommonItemTooltip.PercentChanceToSaveAmmo}
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -214,7 +208,6 @@ BlossomFlux: {
|
||||
'''
|
||||
Fires a stream of leaves
|
||||
Press <right> to fire a spore orb that explodes into a cloud of spore gas
|
||||
50% chance to save ammo
|
||||
'''
|
||||
LegendaryText:
|
||||
'''
|
||||
@@ -265,7 +258,7 @@ ChromaticEruption: {
|
||||
'''
|
||||
Charges up to spew rainbow flames and pairs of homing chromatic flares
|
||||
Uses gel for ammo
|
||||
70% chance to save ammo
|
||||
{$CommonItemTooltip.PercentChanceToSaveAmmo}
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -307,7 +300,6 @@ ConferenceCall: {
|
||||
Tooltip:
|
||||
'''
|
||||
Fires a tight spread of bullets that call more bullets from the sky
|
||||
50% chance to save ammo
|
||||
[c/768EE6:@everyone]
|
||||
'''
|
||||
}
|
||||
@@ -360,7 +352,7 @@ DaemonsFlame: {
|
||||
Tooltip:
|
||||
'''
|
||||
Shoots daemon flame fireballs as well as 4 regular arrows
|
||||
66% chance to save ammo
|
||||
{$CommonItemTooltip.PercentChanceToSaveAmmo}
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -411,7 +403,7 @@ DragonsBreath: {
|
||||
Upon firing for long enough, you will begin using a cartridge of energy
|
||||
While using a cartridge you will shoot a draconic beam of fire that doesn't consume ammo
|
||||
Once a cartridge has been ejected you will return to the original fire rate
|
||||
80% chance to save ammo
|
||||
{$CommonItemTooltip.PercentChanceToSaveAmmo}
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -450,7 +442,7 @@ FetidEmesis: {
|
||||
When the barrel overheats, a spread of fetid chunks is vomited out
|
||||
After firing, the gun must cool back down before it can be used again
|
||||
Pressing <right> while firing will instantly launch the chunks
|
||||
75% chance to save ammo
|
||||
{$CommonItemTooltip.PercentChanceToSaveAmmo}
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -461,7 +453,7 @@ FirestormCannon: {
|
||||
Fires a rapid barrage of flares that builds up a searing heat in the weapon
|
||||
Firing for too long overheats the weapon, leaving it unusable for a short period
|
||||
Press <right> to put away the weapon, which preserves its heat
|
||||
70% chance to save ammo
|
||||
{$CommonItemTooltip.PercentChanceToSaveAmmo}
|
||||
'What could go wrong?'
|
||||
'''
|
||||
}
|
||||
@@ -502,7 +494,7 @@ FlurrystormCannon: {
|
||||
'''
|
||||
Fires a chain of snowballs that become faster over time
|
||||
Has a chance to also fire an ice chunk that shatters into shards
|
||||
50% chance to save ammo
|
||||
{$CommonItemTooltip.PercentChanceToSaveAmmo}
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -563,7 +555,6 @@ HalleysInferno: {
|
||||
Fires a burst of intensely concentrated lunar fire jets
|
||||
Press <right> to zoom out
|
||||
Uses gel for ammo
|
||||
50% chance to save ammo
|
||||
'Halley arrived sooner than expected'
|
||||
'''
|
||||
}
|
||||
@@ -640,7 +631,7 @@ Infinity: {
|
||||
'''
|
||||
Fires a twin stream of energy bolts that split
|
||||
Press <right> to fire a barrage of normal bullets
|
||||
80% chance to save ammo
|
||||
{$CommonItemTooltip.PercentChanceToSaveAmmo}
|
||||
'They say infinity is neverending, yet you hold it in your hands'
|
||||
'''
|
||||
}
|
||||
@@ -658,7 +649,7 @@ Kingsbane: {
|
||||
When you stop firing you will release a barrage of auric bullets
|
||||
Auric bullets aggressively home in on enemies and ignore 50 points of defense
|
||||
Constantly consumes ammo while in use
|
||||
90% chance to save ammo
|
||||
{$CommonItemTooltip.PercentChanceToSaveAmmo}
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -709,7 +700,7 @@ MagnomalyCannon: {
|
||||
'''
|
||||
Launches a powerful exo rocket to nuke anything and everything
|
||||
Rockets are surrounded by an invisible damaging aura and split into damaging beams on hit
|
||||
66% chance to save ammo
|
||||
{$CommonItemTooltip.PercentChanceToSaveAmmo}
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -841,7 +832,7 @@ OntologicalDespoiler: {
|
||||
Null condensate shots fire rapidly and home in on enemies
|
||||
At 50% charge or higher, rate of fire significantly increases
|
||||
Fully charged unstable condensate lobs a homing disruption sphere
|
||||
Fully charged null condensate emits a hitscan null-annihilation beam
|
||||
Fully charged null condensate emits a hitscan null-annihilation beam that always crits
|
||||
Each mode charges slower when used repeatedly and resets to full speed when swapped
|
||||
'Rob them of continuity and the laws of physics they hold so dear.'
|
||||
'''
|
||||
@@ -852,7 +843,7 @@ OnyxChainBlaster: {
|
||||
Tooltip:
|
||||
'''
|
||||
Fires a spread of bullets and an onyx shard
|
||||
50% chance to save ammo
|
||||
{$CommonItemTooltip.PercentChanceToSaveAmmo}
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -861,7 +852,7 @@ Onyxia: {
|
||||
Tooltip:
|
||||
'''
|
||||
Fires a storm of bullets and onyx shards
|
||||
50% chance to save ammo
|
||||
{$CommonItemTooltip.PercentChanceToSaveAmmo}
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -882,7 +873,7 @@ OverloadedBlaster: {
|
||||
Overloaded slime pearls deal 60% more damage but no longer pierce
|
||||
Slime pearls bounce off of walls at very high speed
|
||||
Uses gel for ammo
|
||||
25% chance to save ammo
|
||||
{$CommonItemTooltip.PercentChanceToSaveAmmo}
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -892,7 +883,7 @@ P90: {
|
||||
'''
|
||||
Unleashes a stream of armor-piercing rounds at an incredible rate
|
||||
Armor-piercing rounds ignore 30 defense
|
||||
75% chance to save ammo
|
||||
{$CommonItemTooltip.PercentChanceToSaveAmmo}
|
||||
'It's a bullet hose'
|
||||
'''
|
||||
}
|
||||
@@ -918,7 +909,7 @@ Photoviscerator: {
|
||||
Emits a continuous beam of exo radiation that disintegrates everything
|
||||
Press <right> to fire homing exo flares which stick to and incinerate enemies
|
||||
Uses gel for ammo
|
||||
95% chance to save ammo
|
||||
The beam has a {0}% chance to save ammo
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -970,7 +961,7 @@ PridefulHuntersPlanarRipper: {
|
||||
Lightning bolt crits grant a stacking speed boost to the player
|
||||
This stacks up to 20 percent bonus movement speed and acceleration
|
||||
The boost will reset if the player holds a different item
|
||||
33% chance to save ammo
|
||||
{$CommonItemTooltip.PercentChanceToSaveAmmo}
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -1023,7 +1014,7 @@ Riftburst: {
|
||||
Tooltip:
|
||||
'''
|
||||
Fires a spread of 5 arrows and emits phantom arrows on enemy hits
|
||||
66% chance to save ammo
|
||||
{$CommonItemTooltip.PercentChanceToSaveAmmo}
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -1042,7 +1033,7 @@ Sandblaster: {
|
||||
'''
|
||||
Fires sand bullets that explode and slow enemies on hit
|
||||
Uses sand as ammo
|
||||
50% chance to save ammo
|
||||
{$CommonItemTooltip.PercentChanceToSaveAmmo}
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -1052,7 +1043,7 @@ ScorchedEarth: {
|
||||
'''
|
||||
Fires a burst of four heat seeking missiles that rapidly accelerate after a short delay
|
||||
All rockets explode into napalm cluster bombs on impact
|
||||
50% chance to save ammo
|
||||
{$CommonItemTooltip.PercentChanceToSaveAmmo}
|
||||
'Burns your targets to a fine crisp'
|
||||
'''
|
||||
}
|
||||
@@ -1072,7 +1063,7 @@ SDFMG: {
|
||||
DisplayName: SDFMG
|
||||
Tooltip:
|
||||
'''
|
||||
50% chance to save ammo
|
||||
{$CommonItemTooltip.PercentChanceToSaveAmmo}
|
||||
'It came from the edge of Terraria'
|
||||
'''
|
||||
}
|
||||
@@ -1133,7 +1124,6 @@ Shredder: {
|
||||
'''
|
||||
Fires a barrage of energy bolts that split and bounce
|
||||
Press <right> to fire a barrage of normal bullets instead
|
||||
60% chance to save ammo
|
||||
'The myth, the legend, the weapon that drops more frames than any other'
|
||||
'''
|
||||
}
|
||||
@@ -1158,7 +1148,7 @@ SomaPrime: {
|
||||
Shred deals 600 DPS per stack and scales with your ranged stats
|
||||
Damage ticks of Shred can critically strike for 3x damage and can supercrit
|
||||
Replaces musket balls with enhanced High Velocity Bullets
|
||||
80% chance to save ammo
|
||||
{$CommonItemTooltip.PercentChanceToSaveAmmo}
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -1180,7 +1170,7 @@ SpectralstormCannon: {
|
||||
Firing for too long overheats the weapon, leaving it unusable for a short period
|
||||
However, triggering overheat releases a powerful burst of souls and resets heat
|
||||
Press <right> to put away the weapon, which preserves its heat
|
||||
70% chance to save ammo
|
||||
{$CommonItemTooltip.PercentChanceToSaveAmmo}
|
||||
'Ectoplasmic blast rated visor mandatory'
|
||||
'''
|
||||
}
|
||||
@@ -1309,6 +1299,7 @@ Svantechnical: {
|
||||
'''
|
||||
Fires a trinity of energy bolts that split into beams that track your cursor
|
||||
Press <right> to fire a barrage of normal bullets
|
||||
{$CommonItemTooltip.PercentChanceToSaveAmmo}
|
||||
'The age old balance of trading damage for frames'
|
||||
'''
|
||||
}
|
||||
@@ -1332,7 +1323,6 @@ TelluricGlare: {
|
||||
Rapidly fires volleys of arrows
|
||||
Every other arrow is converted into radiant greatarrows which pierce but quicky dissapear after striking
|
||||
Wooden arrows are converted into more powerful greatarrows that deal increased damage
|
||||
75% chance to save ammo
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -1382,7 +1372,7 @@ TheSevensStriker: {
|
||||
Press <left> to consume 1 coin and play a slot machine
|
||||
The quality of the outcome depends on the coin used
|
||||
Press <right> to rapidly fire a barrage of coins
|
||||
The coin barrage has an 80% chance to save ammo and will not fire platinum coins
|
||||
The coin barrage has an {0}% chance to save ammo and will not fire platinum coins
|
||||
'A gun given to a great gunslinger
|
||||
Forged by the arms of a man given no name'
|
||||
'''
|
||||
@@ -1395,7 +1385,6 @@ TheStorm: {
|
||||
'''
|
||||
Fires a spread of homing lightning bolts and arrows from the sky
|
||||
Converts wooden arrows into powerful electric beams
|
||||
95% chance to save ammo
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -1432,7 +1421,7 @@ Ultima: {
|
||||
Casts a continuous stream of plasma bolts
|
||||
Over time the bolts are replaced with powerful lasers
|
||||
Bolts power up into solid beams as you continue shooting
|
||||
90% chance to save ammo
|
||||
{$CommonItemTooltip.PercentChanceToSaveAmmo}
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -1442,7 +1431,6 @@ UniversalGenesis: {
|
||||
'''
|
||||
Fires a spread of bullets from the gun and a flurry of stars to rain down on the cursor
|
||||
Converts musket balls into starcaller shots that summon additional stars on enemy hits
|
||||
50% chance to save ammo
|
||||
'Let the starry sky fall upon your enemies'
|
||||
'''
|
||||
}
|
||||
@@ -1462,7 +1450,7 @@ Voidragon: {
|
||||
'''
|
||||
Fires void blasts that explode every other shot
|
||||
Shoots demon flame tentacles alongside every shot
|
||||
75% chance to save ammo
|
||||
Void blasts consume no ammo and bullets have a {0}% chance to save ammo
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -1477,7 +1465,7 @@ WildfireBloom: {
|
||||
'''
|
||||
Charges up to emit a stream of energized flames and pairs of homing wildfire flares
|
||||
Uses gel for ammo
|
||||
50% chance to save ammo
|
||||
{$CommonItemTooltip.PercentChanceToSaveAmmo}
|
||||
'''
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,10 @@ AcidGunStream.DisplayName: Acid Stream
|
||||
AcidicReed.DisplayName: Acidic Reed
|
||||
AcidicSaxBubble.DisplayName: Acid Bubble
|
||||
AcidicSaxMist.DisplayName: Acid Mist
|
||||
AerSigilMissile.DisplayName: Aer Missile
|
||||
AerSigil.DisplayName: Aer Sigil
|
||||
AerSigilBlast.DisplayName: Aer Blast
|
||||
AerSigilFeather.DisplayName: Aer Feather
|
||||
AerSigilMissile.DisplayName: Aer Missile
|
||||
AetherBeam.DisplayName: Aether Beam
|
||||
AnahitasArpeggioNote.DisplayName: Anahita's Song
|
||||
Ancient2.DisplayName: Ancient Dust
|
||||
@@ -12,6 +14,7 @@ ApoctosisBlast.DisplayName: Apoctosis Blast
|
||||
ApotheosisEnergy.DisplayName: Apotheosis Energy
|
||||
ApotheosisWorm.DisplayName: The Devourer of Gods
|
||||
AquamarineBolt.DisplayName: Aqua Bolt
|
||||
AquaSigil.DisplayName: Aqua Sigil
|
||||
AquaSigilWaterball.DisplayName: Aqua Waterball
|
||||
AquaSigilWaterballExplosion.DisplayName: Aqua Waterball Explosion
|
||||
AquaSigilWaterdroplet.DisplayName: Aqua Waterdroplet
|
||||
@@ -104,6 +107,7 @@ IceBlockIcicle.DisplayName: Ice Barrage Icicle
|
||||
IceCluster.DisplayName: Ice Cluster
|
||||
Icicle.DisplayName: Icicle
|
||||
IcicleStaffProj.DisplayName: Furious Icicle
|
||||
IgnisSigil.DisplayName: Ignis Sigil
|
||||
IgnisSigilFireballExplosion.DisplayName: Ignis Fireball Explosion
|
||||
IgnisSigilFireball.DisplayName: Ignis Fireball
|
||||
IgnisSigilEmbers.DisplayName: Ignis Ember
|
||||
@@ -156,9 +160,12 @@ NightOrb.DisplayName: Night's Orb
|
||||
NightsRayBeam.DisplayName: Night's Ray
|
||||
NuclearFuryProjectile.DisplayName: Nuclear Fury
|
||||
OmicronBeam.DisplayName: Omicron Beam
|
||||
OrdoSigil.DisplayName: Ordo Sigil
|
||||
OrdoSigilBeam.DisplayName: Ordo Beam
|
||||
PartySparkle.DisplayName: Pretty Sparkle
|
||||
PerditoSigil.DisplayName: Perdito Sigil
|
||||
PerditoSigilShot.DisplayName: Perdito Shot
|
||||
PerditoSigilShotCreator.DisplayName: Perdito Shot Creator
|
||||
PhantasmalFuryProj.DisplayName: Phantasmal Fury
|
||||
Phantom.DisplayName: Phantom
|
||||
PhasedGodRay.DisplayName: Phased God Ray
|
||||
@@ -209,6 +216,7 @@ SHPExplosion.DisplayName: SHPB Explosion
|
||||
SHPL.DisplayName: SHPL
|
||||
SHPS.DisplayName: SHPS
|
||||
SHPV.DisplayName: SHPV
|
||||
SigilSet.DisplayName: Sigil Set
|
||||
SilvaBurst.DisplayName: Silva Burst
|
||||
SlitheringEelProjectile.DisplayName: Slithering Eel
|
||||
SmallSpirit.DisplayName: Small Angry Spirit
|
||||
@@ -230,6 +238,7 @@ SylvRay.DisplayName: Sylv Ray
|
||||
TacticiansElectricBoom.DisplayName: Electric Explosion
|
||||
TacticiansTrumpCardProj.DisplayName: Trump Beam
|
||||
TearsofHeavenProjectile.DisplayName: Tears of Heaven
|
||||
TerraSigil.DisplayName: Terra Sigil
|
||||
TerraSigilLargeRock.DisplayName: Terra Large Rock
|
||||
TerraSigilMediumRock.DisplayName: Terra Medium Rock
|
||||
TerraSigilSmallRock.DisplayName: Terra Small Rock
|
||||
@@ -250,6 +259,7 @@ VenusianExplosion.DisplayName: Venusian Explosion
|
||||
VenusianFlame.DisplayName: Venusian Cinder
|
||||
VisceraBeam.DisplayName: Viscera
|
||||
VisceraBoom.DisplayName: Viscera Boom
|
||||
VisNeedle.DisplayName: Vis Needle
|
||||
VitriolicViperFang.DisplayName: Vitriolic Fang
|
||||
VitriolicViperSpit.DisplayName: Vitriolic Spit
|
||||
VividBeam.DisplayName: Vivid Beam
|
||||
@@ -264,7 +274,9 @@ VolterionOrb.DisplayName: Unstable Ball Lightning
|
||||
VolterionShot.DisplayName: Ultracharged Filament
|
||||
VortexElementalBeam.DisplayName: Vortex Lightning
|
||||
WaterLeechProj.DisplayName: Water Leech
|
||||
WarpSigil.DisplayName: Warp Sigil
|
||||
WarpSigilShot.DisplayName: Warped Shot
|
||||
WarpSigilShotCreator.DisplayName: Warped Shot Creator
|
||||
WaywasherProj.DisplayName: Waywasher Wave
|
||||
WingmanGrenade.DisplayName: Mana Grenade
|
||||
WingmanShot.DisplayName: Mana Shot
|
||||
|
||||
@@ -113,7 +113,7 @@ namespace CalamityMod.NPCs.Abyss
|
||||
|
||||
public override void ModifyNPCLoot(NPCLoot npcLoot)
|
||||
{
|
||||
npcLoot.Add(ItemID.Flipper, 8);
|
||||
npcLoot.Add(ItemID.Flipper, 15);
|
||||
}
|
||||
|
||||
public override void HitEffect(NPC.HitInfo hit)
|
||||
|
||||
@@ -181,9 +181,9 @@ namespace CalamityMod.NPCs
|
||||
break;
|
||||
|
||||
// Armored Skeleton
|
||||
// Beam Sword @ 5% (0.67% in Vanilla)
|
||||
// Beam Sword @ 2.5% (0.67% in Vanilla)
|
||||
case NPCID.ArmoredSkeleton:
|
||||
npcLoot.ChangeDropRate(ItemID.BeamSword, 1, 20);
|
||||
npcLoot.ChangeDropRate(ItemID.BeamSword, 1, 40);
|
||||
break;
|
||||
|
||||
// Black Recluse
|
||||
|
||||
@@ -190,6 +190,7 @@ namespace CalamityMod.NPCs
|
||||
"Gol D. Roger", // <@!256228859110752257> (xtra3678)
|
||||
"Yarrim", // <@!290061123137306624> (borb9834)
|
||||
"Hector Barbossa", // <@!615704209303797790> (thatrockisfullamagic)
|
||||
"Blunderbeard", // <@!1039460813490102293> (parmiigianoreggiano)
|
||||
};
|
||||
private static readonly string[] PrincessNames =
|
||||
{
|
||||
@@ -350,7 +351,6 @@ namespace CalamityMod.NPCs
|
||||
"Lucerne", // <@!271954788676141066> (lord_lucerne)
|
||||
"Milo", // <@!401849201597874179> (maskedmilo)
|
||||
"Octo", // <@!796112889353994281> (octolinggrimm)
|
||||
"Chease", // <@!1039460813490102293> (parmiigianoreggiano)
|
||||
};
|
||||
private static readonly string[] TownCatSiameseNames = null;
|
||||
private static readonly string[] TownCatBlackNames =
|
||||
|
||||
@@ -717,7 +717,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
|
||||
// Phase HP ratios
|
||||
float phase2LifeRatio = death ? 0.85f : 0.7f;
|
||||
float finalPhaseLifeRatio = death ? 0.3f : 0.15f;
|
||||
float finalPhaseLifeRatio = death ? 0.4f : 0.25f;
|
||||
|
||||
// Movement variables
|
||||
float phase1MaxSpeedIncrease = death ? 2.25f : 4.5f;
|
||||
|
||||
@@ -168,7 +168,11 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
public override bool OnTileCollide(Vector2 oldVelocity) => false;
|
||||
|
||||
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 16f, targetHitbox);
|
||||
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox)
|
||||
{
|
||||
Vector2 centerPos = Projectile.frame >= 2 ? Projectile.Bottom - Vector2.UnitY * 16f : Projectile.Center;
|
||||
return CalamityUtils.CircularHitboxCollision(centerPos, 16f, targetHitbox);
|
||||
}
|
||||
|
||||
public override bool CanHitPlayer(Player target) => Projectile.localAI[1] <= 900f && Projectile.localAI[1] > 120f;
|
||||
|
||||
|
||||
@@ -330,9 +330,9 @@ namespace CalamityMod.Projectiles
|
||||
|
||||
if (source is EntitySource_OnHit e)
|
||||
{
|
||||
// Nerf Orichalcum armor's set bonus petal damage by 25%
|
||||
// Nerf Orichalcum armor's set bonus petal damage by 11%
|
||||
if (e.Context == "SetBonus_Orichalcum")
|
||||
projectile.damage = (int)(projectile.damage * 0.75f);
|
||||
projectile.damage = (int)(projectile.damage * 0.889f);
|
||||
// Nerf Spectre armor's set bonus soul damage by 50%
|
||||
if (e.Context == "SetBonus_GhostHurt")
|
||||
projectile.damage /= 2;
|
||||
|
||||
@@ -131,8 +131,6 @@ namespace CalamityMod.Projectiles
|
||||
{ ProjectileID.CobaltDrill, standardDrillTweaks },
|
||||
{ ProjectileID.CobaltNaginata, Do(TrueMelee, LocalIFrames(9)) },
|
||||
{ ProjectileID.CrystalBullet, Do(ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) },
|
||||
{ ProjectileID.CrystalVileShardHead, Do(LocalIFrames(23)) },
|
||||
{ ProjectileID.CrystalVileShardShaft, Do(LocalIFrames(23)) },
|
||||
{ ProjectileID.CursedBullet, Do(ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) },
|
||||
{ ProjectileID.ClusterRocketI, Do(LocalIFrames(15)) },
|
||||
{ ProjectileID.ClusterFragmentsI, Do(IDStaticIFrames(15)) },
|
||||
@@ -144,13 +142,11 @@ namespace CalamityMod.Projectiles
|
||||
{ ProjectileID.DD2SquireSonicBoom, Do(PiercingExact(3), DefaultIDStaticIFrames) }, // Flying Dragon
|
||||
{ ProjectileID.DeadlySphere, Do(LocalIFrames(30)) },
|
||||
{ ProjectileID.EmeraldBolt, Do(NoPiercing) },
|
||||
{ ProjectileID.EmpressBlade, Do(LocalIFrames(30)) }, // Terraprisma
|
||||
{ ProjectileID.EnchantedBoomerang, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) },
|
||||
{ ProjectileID.ExplosiveBullet, Do(ExtraUpdatesDelta(+2), IDStaticIFrames(5)) }, // Has an exception in Vanilla iframe code, uses 5 iframes
|
||||
{ ProjectileID.FairyQueenRangedItemShot, Do(PiercingExact(7), ExtraUpdatesExact(1)) }, // Eventide Convert
|
||||
{ ProjectileID.FlaironBubble, Do(ExtraUpdatesExact(1), TimeLeftExact(150), DefaultIDStaticIFrames) },
|
||||
{ ProjectileID.Flamarang, Do(ExtraUpdatesExact(2), DefaultIDStaticIFrames) },
|
||||
{ ProjectileID.Flames, Do(IDStaticIFrames(5)) }, // Flamethrower AND Elf Melter flames
|
||||
{ ProjectileID.FlamingJack, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) },
|
||||
{ ProjectileID.FlowerPetal, Do(MaxUpdatesExact(4), LocalIFrames(10)) }, // Orichalcum armor
|
||||
{ ProjectileID.FlyingKnife, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) },
|
||||
@@ -190,7 +186,6 @@ namespace CalamityMod.Projectiles
|
||||
{ ProjectileID.PalladiumChainsaw, standardChainsawTweaks },
|
||||
{ ProjectileID.PalladiumDrill, standardDrillTweaks },
|
||||
{ ProjectileID.PartyBullet, Do(ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) },
|
||||
{ ProjectileID.PoisonFang, Do(LocalIFrames(10)) },
|
||||
{ ProjectileID.PurpleCounterweight, counterweightTweaks },
|
||||
{ ProjectileID.QueenSlimeGelAttack, Do(NoPiercing) },
|
||||
{ ProjectileID.QueenSlimeMinionPinkBall, Do(NoPiercing) },
|
||||
@@ -214,7 +209,6 @@ namespace CalamityMod.Projectiles
|
||||
{ ProjectileID.Trimarang, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) },
|
||||
{ ProjectileID.TrueNightsEdge, Do(PiercingExact(4)) },
|
||||
{ ProjectileID.VenomBullet, Do(ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) },
|
||||
{ ProjectileID.VenomFang, Do(LocalIFrames(10)) },
|
||||
{ ProjectileID.VenomSpider, Do( ExtraUpdatesExact(2), LocalIFrames(45)) }, //Spider Staff spiders. It has Venom, Dangerous, and Jumping spiders.
|
||||
{ ProjectileID.VortexDrill, standardDrillTweaks },
|
||||
{ ProjectileID.Wasp, Do(PiercingExact(2)) },
|
||||
@@ -341,6 +335,8 @@ namespace CalamityMod.Projectiles
|
||||
{ ProjectileID.CrystalPulse2, defaultIFrames },
|
||||
{ ProjectileID.CrystalShard, defaultIFrames },
|
||||
{ ProjectileID.CrystalStorm, defaultIFrames },
|
||||
{ ProjectileID.CrystalVileShardHead, defaultIFrames },
|
||||
{ ProjectileID.CrystalVileShardShaft, defaultIFrames },
|
||||
{ ProjectileID.CursedArrow, defaultIFrames },
|
||||
{ ProjectileID.CursedDart, defaultIFrames },
|
||||
{ ProjectileID.CursedDartFlame, defaultIFrames },
|
||||
|
||||
@@ -7,8 +7,9 @@ using Terraria.Audio;
|
||||
|
||||
namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
public class AerSigil : ModProjectile
|
||||
public class AerSigil : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Magic";
|
||||
private bool spawnedProjectile = false;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
|
||||
@@ -7,8 +7,9 @@ using System;
|
||||
namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
// This projectile is intended to be a simple VFX projectile.
|
||||
public class AerSigilFeather : ModProjectile
|
||||
public class AerSigilFeather : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Magic";
|
||||
private float extraRotation = 0;
|
||||
private float intervalModifier = 1f;
|
||||
private bool randomized = false;
|
||||
|
||||
@@ -7,8 +7,9 @@ using Terraria.Audio;
|
||||
|
||||
namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
public class AquaSigil : ModProjectile
|
||||
public class AquaSigil : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Magic";
|
||||
private bool spawnedProjectile = false;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
|
||||
@@ -8,8 +8,9 @@ using Terraria.ID;
|
||||
|
||||
namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
public class IgnisSigil : ModProjectile
|
||||
public class IgnisSigil : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Magic";
|
||||
private bool spawnedProjectile = false;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
|
||||
@@ -8,8 +8,9 @@ using Terraria.Audio;
|
||||
|
||||
namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
public class OrdoSigil : ModProjectile
|
||||
public class OrdoSigil : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Magic";
|
||||
private bool spawnedProjectile = false;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
|
||||
@@ -7,8 +7,9 @@ using CalamityMod.Projectiles.Ranged;
|
||||
|
||||
namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
public class PerditoSigil : ModProjectile
|
||||
public class PerditoSigil : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Magic";
|
||||
private bool spawnedProjectile = false;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
|
||||
@@ -7,8 +7,9 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
public class PerditoSigilShotCreator : ModProjectile
|
||||
public class PerditoSigilShotCreator : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Magic";
|
||||
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
|
||||
|
||||
public ref float FiringTimer => ref Projectile.ai[0];
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
public class SigilSet : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Magic";
|
||||
public ref float FadeoutFlag => ref Projectile.ai[2];
|
||||
private const float RuneLerpTime = 22f;
|
||||
private const float RuneDelayTime = 3f;
|
||||
|
||||
@@ -7,8 +7,9 @@ using Terraria.Audio;
|
||||
|
||||
namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
public class TerraSigil : ModProjectile
|
||||
public class TerraSigil : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Magic";
|
||||
private bool spawnedProjectile = false;
|
||||
|
||||
public override void SetDefaults()
|
||||
|
||||
@@ -150,7 +150,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
GeneralParticleHandler.SpawnParticle(shootPulse);
|
||||
|
||||
// Spawn needle
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, (Projectile.velocity * 35f).RotatedBy(Main.rand.NextFloat(-0.07f, 0.07f)), ModContent.ProjectileType<VisNeedle>(), Projectile.damage * (int) 0.8f, Projectile.knockBack, Projectile.owner);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, (Projectile.velocity * 35f).RotatedBy(Main.rand.NextFloat(-0.07f, 0.07f)), ModContent.ProjectileType<VisNeedle>(), (int) (Projectile.damage * 0.8f), Projectile.knockBack, Projectile.owner);
|
||||
shootingTimer = 0f;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -17,6 +17,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
public class VisNeedle : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Magic";
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
ProjectileID.Sets.TrailCacheLength[Type] = 10;
|
||||
|
||||
@@ -9,8 +9,9 @@ using CalamityMod.Particles;
|
||||
|
||||
namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
public class WarpSigil : ModProjectile
|
||||
public class WarpSigil : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Magic";
|
||||
private bool spawnedProjectile = false;
|
||||
private bool spawnedIntroParticle = false;
|
||||
public override void SetDefaults()
|
||||
|
||||
@@ -9,8 +9,9 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
public class WarpSigilShotCreator : ModProjectile
|
||||
public class WarpSigilShotCreator : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Magic";
|
||||
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
|
||||
|
||||
public ref float FiringTimer => ref Projectile.ai[0];
|
||||
|
||||
@@ -14,6 +14,7 @@ using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Buffs.StatBuffs;
|
||||
using CalamityMod.Projectiles.Melee.Shortswords;
|
||||
using System.Runtime.InteropServices;
|
||||
using CalamityMod.Sounds;
|
||||
|
||||
namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
@@ -31,9 +32,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
public override int swingTime { get; set; }
|
||||
public override bool AlternateSwings { get => base.AlternateSwings; set => base.AlternateSwings = value; }
|
||||
public override float lineCollisionLength => 82;
|
||||
public override Color AfterImageColor => Color.CornflowerBlue with { A = 0 };
|
||||
|
||||
// Boolshit
|
||||
public bool helixFired = false;
|
||||
public bool gotEnergyThisSwing = false;
|
||||
public bool trailFXTriggered = false;
|
||||
@@ -48,6 +47,8 @@ namespace CalamityMod.Projectiles.Melee
|
||||
public int thrustStartupTime = 33;
|
||||
public int thrustForwardTime = 7;
|
||||
public int thrustCooldownTime = 17;
|
||||
public float thrustSpinRotation = 0f;
|
||||
public bool playedAlternateThrustStartupWhoosh = false;
|
||||
|
||||
public override void Defaults()
|
||||
{
|
||||
@@ -106,33 +107,54 @@ namespace CalamityMod.Projectiles.Melee
|
||||
RotateInStartup = 0.8f;
|
||||
RotateInCooldown = 0;
|
||||
}
|
||||
|
||||
if (AlternateSwings)
|
||||
modplayer.swingNum = (modplayer.swingNum + 1) % 2;
|
||||
}
|
||||
|
||||
public override void AdditionalAI()
|
||||
{
|
||||
Player player = Main.player[Projectile.owner];
|
||||
var modplayer = player.GetModPlayer<BaseSwordHoldoutPlayer>();
|
||||
|
||||
if (IsAlternateThrust)
|
||||
{
|
||||
if (inStartup)
|
||||
{
|
||||
trailFXTriggered = false; // Reset bool just in case
|
||||
Projectile.Opacity += 0.01f; // Fade in
|
||||
Projectile.scale = baseScale * MathHelper.Lerp(1f, 0.85f, MathF.Pow(StartupCompletion, 0.3f));
|
||||
|
||||
// Pullback
|
||||
float eased = MathF.Pow(StartupCompletion, 0.3f);
|
||||
OffsetDistance = (int)MathHelper.Lerp(44, 34, eased);
|
||||
Projectile.scale = baseScale * MathHelper.Lerp(1f, 0.85f, eased);
|
||||
|
||||
|
||||
if (!sparkTriggered && Projectile.scale < 0.96f) // Right before thrusting forward
|
||||
if (StartupCompletion >= 0.12f && !playedAlternateThrustStartupWhoosh)
|
||||
{
|
||||
// Won't happen again this right-click
|
||||
sparkTriggered = true;
|
||||
SoundEngine.PlaySound(CommonCalamitySounds.MeatySlashSound with { Volume = 0.55f, Pitch = -0.05f }, Projectile.Center);
|
||||
playedAlternateThrustStartupWhoosh = true;
|
||||
}
|
||||
|
||||
GenericSparkle sparker = new GenericSparkle(Projectile.Center, Vector2.Zero, Color.AntiqueWhite, Color.Lerp(Color.MediumPurple, Color.CornflowerBlue, 0.5f) * 0.3f, 2f, 8, Projectile.velocity.ToRotation() + (Main.rand.NextBool() ? -0.25f : 0.25f), 1f);
|
||||
GeneralParticleHandler.SpawnParticle(sparker);
|
||||
// Every 8 ticks during this part of startup, release a sparkle.
|
||||
if (StartupCompletion > 0.12f && StartupCompletion < 0.44f)
|
||||
{
|
||||
if (timer % 8 == 0)
|
||||
{
|
||||
Vector2 pos = player.Center + Projectile.rotation.ToRotationVector2() * 60f;
|
||||
Particle sparkle = new CritSpark(pos, new Vector2(7f, 0).RotatedBy(Projectile.rotation), Color.Lerp(Color.CornflowerBlue, Color.MediumPurple, Main.rand.NextFloat()), Color.White * 0.33f, 1.2f, 12, 0.3f, 1.2f);
|
||||
GeneralParticleHandler.SpawnParticle(sparkle);
|
||||
}
|
||||
Particle smear = new CircularSmearVFX(player.Center, Color.CornflowerBlue * 0.25f, Projectile.rotation, Projectile.scale * 1.25f);
|
||||
GeneralParticleHandler.SpawnParticle(smear);
|
||||
}
|
||||
|
||||
// Easing on spin
|
||||
float t = MathHelper.Clamp(StartupCompletion * 2f, 0f, 1f);
|
||||
float eased = 0.5f - 0.5f * MathF.Cos(MathHelper.Pi * t);
|
||||
thrustSpinRotation = eased * MathHelper.TwoPi;
|
||||
|
||||
// Pull back
|
||||
if (StartupCompletion >= 0.5f)
|
||||
{
|
||||
float easedPullback = MathF.Pow((StartupCompletion - 0.5f) * 2f, 0.3f);
|
||||
OffsetDistance = (int)MathHelper.Lerp(44, 34, easedPullback);
|
||||
}
|
||||
else
|
||||
{
|
||||
OffsetDistance = 44;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,23 +163,22 @@ namespace CalamityMod.Projectiles.Melee
|
||||
Projectile.Opacity -= 0.0135f;
|
||||
|
||||
// During cooldown, pull back slightly
|
||||
Projectile.scale = baseScale * MathHelper.Lerp(1.6f, 1.55f, CooldownCompletion);
|
||||
OffsetDistance = (int)MathHelper.Lerp(68, 42, CooldownCompletion);
|
||||
Projectile.scale = baseScale * MathHelper.Lerp(1.4f, 1.25f, CooldownCompletion);
|
||||
OffsetDistance = (int)MathHelper.Lerp(78, 38, CooldownCompletion);
|
||||
}
|
||||
|
||||
else if (inSwing)
|
||||
{
|
||||
// Thrust forward
|
||||
OffsetDistance = (int)MathHelper.Lerp(34, 68, SwingCompletion);
|
||||
OffsetDistance = (int)MathHelper.Lerp(34, 78, SwingCompletion);
|
||||
Main.player[Projectile.owner].Calamity().GeneralScreenShakePower = 3.5f;
|
||||
|
||||
// Scaling adjustments
|
||||
var t = MathHelper.Clamp(SwingCompletion, 0f, 1f);
|
||||
var eased = MathF.Pow(t, 0.125f);
|
||||
Projectile.scale = baseScale * MathHelper.Lerp(0.9f, 1.6f, eased);
|
||||
Projectile.scale = baseScale * MathHelper.Lerp(0.9f, 1.4f, eased);
|
||||
|
||||
// VFX vars
|
||||
Player player = Main.player[Projectile.owner];
|
||||
Vector2 mousePosition = Main.MouseWorld;
|
||||
Vector2 fireDirection = Vector2.Normalize(mousePosition - player.Center);
|
||||
|
||||
@@ -167,10 +188,10 @@ namespace CalamityMod.Projectiles.Melee
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), player.Center, fireDirection * 5, ModContent.ProjectileType<LucreciaDNATrailCreator>(), Projectile.damage * 8, Projectile.knockBack, Projectile.owner, 0f, 0f);
|
||||
|
||||
SoundStyle swish = new("CalamityMod/Sounds/Custom/MeatySlash");
|
||||
SoundEngine.PlaySound(swish with { Volume = 0.45f, Pitch = Main.rand.NextFloat(-0.1f, 0.1f) }, Projectile.Center);
|
||||
SoundEngine.PlaySound(swish with { Volume = 0.3f, Pitch = Main.rand.NextFloat(0.1f, 0.2f) }, Projectile.Center);
|
||||
|
||||
SoundStyle projectile = new("CalamityMod/Sounds/Item/OmicronBeam");
|
||||
SoundEngine.PlaySound(projectile with { Volume = 0.75f, Pitch = Main.rand.NextFloat(0.15f, 0.2f) }, Projectile.Center);
|
||||
SoundEngine.PlaySound(projectile with { Volume = 0.85f, Pitch = Main.rand.NextFloat(0.15f, 0.2f) }, Projectile.Center);
|
||||
}
|
||||
|
||||
trailFXTriggered = true;
|
||||
@@ -195,8 +216,6 @@ namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
if (inStartup)
|
||||
{
|
||||
AfterImageLength = 0;
|
||||
|
||||
Projectile.Opacity += 0.01f; // Fade in
|
||||
gotEnergyThisSwing = false;
|
||||
helixFired = false;
|
||||
@@ -205,8 +224,6 @@ namespace CalamityMod.Projectiles.Melee
|
||||
|
||||
else if (inCooldown)
|
||||
{
|
||||
AfterImageLength = 0;
|
||||
|
||||
helixFired = false;
|
||||
Projectile.Opacity -= 0.09f;
|
||||
Projectile.scale = baseScale * MathHelper.Lerp(0.85f, 0.625f, CooldownCompletion);
|
||||
@@ -217,8 +234,14 @@ namespace CalamityMod.Projectiles.Melee
|
||||
if (!helixFired)
|
||||
{
|
||||
helixFired = true;
|
||||
var player = Main.player[Projectile.owner];
|
||||
var mousePosition = Main.MouseWorld;
|
||||
|
||||
// Smear fx on swing
|
||||
Vector2 shootDir = player.Center.DirectionTo(mousePosition) * 10f;
|
||||
int dir = -Math.Sign(mousePosition.X);
|
||||
Particle swipe = new CustomSpark(player.Center - shootDir * 4, shootDir.RotatedBy(0.075f * (dir * (modplayer.swingNum % 2 == 0 ? 1 : -1))) * 1.22f, "CalamityMod/Particles/VerticalSmearLarge", false, (int)(14 / player.GetAttackSpeed(DamageClass.Melee)), 0.3f, modplayer.swingNum % 2 == 0 ? Color.CornflowerBlue * 0.85f : Color.MediumPurple * 0.8f, new Vector2(1.1f, 1.3f), true, false, 0, false, false);
|
||||
GeneralParticleHandler.SpawnParticle(swipe);
|
||||
|
||||
var fireDirection = Vector2.Normalize(mousePosition - player.Center);
|
||||
var helixSpeed = 12f;
|
||||
var helixVelocity = fireDirection * helixSpeed;
|
||||
@@ -228,8 +251,6 @@ namespace CalamityMod.Projectiles.Melee
|
||||
SoundEngine.PlaySound(projectile with { Volume = 0.8f, Pitch = Main.rand.NextFloat(-0.06f, 0.1f) }, Projectile.Center);
|
||||
}
|
||||
|
||||
AfterImageLength = 30;
|
||||
|
||||
var t = MathHelper.Clamp(SwingCompletion, 0f, 1f);
|
||||
var parabola = 1f - MathF.Pow(t - 0.5f, 2f) * 4f;
|
||||
OffsetDistance = (int)MathHelper.Lerp(36 * 1f, 36 * 1.435f, parabola);
|
||||
@@ -237,6 +258,18 @@ namespace CalamityMod.Projectiles.Melee
|
||||
var eased = MathF.Pow(upPhase, 2.6f);
|
||||
Projectile.scale = baseScale * MathHelper.Lerp(0.8f, 1.4f, eased);
|
||||
|
||||
// Every 5 ticks during swing, release a particle
|
||||
if (t > 0.05f && t < 0.5f)
|
||||
{
|
||||
if (timer % 5 == 0)
|
||||
{
|
||||
var fireDirection = Vector2.Normalize(Main.MouseWorld - player.Center);
|
||||
var helixVelocity = fireDirection * 14f;
|
||||
|
||||
SparkParticle orb3 = new SparkParticle(player.Center + fireDirection * 3, helixVelocity.RotatedByRandom(1f), true, 16, 0.5f, Color.Lerp(Color.CornflowerBlue, Color.MediumPurple, Main.rand.NextFloat()) * 0.66f, true);
|
||||
GeneralParticleHandler.SpawnParticle(orb3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
base.AdditionalAI();
|
||||
@@ -248,19 +281,8 @@ namespace CalamityMod.Projectiles.Melee
|
||||
|
||||
if (IsAlternateThrust)
|
||||
{
|
||||
var modplayer = player.GetModPlayer<BaseSwordHoldoutPlayer>();
|
||||
float swingDirection = Projectile.spriteDirection;
|
||||
|
||||
if (inStartup)
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
|
||||
if (timer < StartupTime + swingTime)
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
|
||||
return thrustSpinRotation;
|
||||
else
|
||||
return 0f; // Just retract and fade out without moving the angle
|
||||
}
|
||||
@@ -269,7 +291,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
var modplayer = player.GetModPlayer<BaseSwordHoldoutPlayer>();
|
||||
float swingDirection = Projectile.spriteDirection;
|
||||
if (modplayer.swingNum == 1)
|
||||
if (modplayer.swingNum % 2 == 1)
|
||||
swingDirection *= -1;
|
||||
|
||||
var parabolicFactorPrimary = 1f - MathF.Pow(SwingCompletion - 0.5f, 2f) * 4f;
|
||||
@@ -289,6 +311,8 @@ namespace CalamityMod.Projectiles.Melee
|
||||
// Add energy for the primary attack
|
||||
if (!IsAlternateThrust && !gotEnergyThisSwing)
|
||||
{
|
||||
SoundEngine.PlaySound(CommonCalamitySounds.SwiftSliceSound with { Volume = CommonCalamitySounds.SwiftSliceSound.Volume * 0.3f }, Projectile.Center);
|
||||
|
||||
gotEnergyThisSwing = true;
|
||||
var player = Main.player[Projectile.owner];
|
||||
var modPlayer = player.Calamity();
|
||||
@@ -303,12 +327,12 @@ namespace CalamityMod.Projectiles.Melee
|
||||
Vector2 spinningPoint = Vector2.Normalize(new Vector2(-1f, -1f)).RotatedByRandom(100);
|
||||
|
||||
var modplayer = player.GetModPlayer<BaseSwordHoldoutPlayer>();
|
||||
Color useColor = modplayer.swingNum == 1 ? Color.CornflowerBlue : Color.MediumPurple; // Alternate each swing
|
||||
Color useColor = modplayer.swingNum % 2 == 0 ? Color.CornflowerBlue : Color.MediumPurple; // Alternate each swing
|
||||
|
||||
for (int k = 0; k < points; k++)
|
||||
{
|
||||
Vector2 velocity = spinningPoint.RotatedBy(radians * k).RotatedBy(-0.45f);
|
||||
Particle spark = new GlowSparkParticle((target.Center + velocity * 7.5f), velocity * 0.5f, false, 9, 0.05f, useColor, new Vector2(0.5f, 0.4f), true, false);
|
||||
Particle spark = new GlowSparkParticle((target.Center + velocity * 7.5f), velocity * 0.5f, false, 9, 0.05f, useColor, new Vector2(0.5f, 0.6f), true, false);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
|
||||
public float ClawOpenness = MathHelper.ToRadians(80);
|
||||
public float BubbleSize = 0f;
|
||||
public int m2KillTimer = 0;
|
||||
public new string LocalizationCategory => "Projectiles.Melee";
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Melee/MantisClaws";
|
||||
|
||||
@@ -48,10 +49,15 @@ namespace CalamityMod.Projectiles.Melee
|
||||
|
||||
if (BubbleSize < 0.05f)
|
||||
{
|
||||
Projectile.scale -= 0.1f;
|
||||
|
||||
if (Projectile.scale < 0.1f)
|
||||
if (Projectile.scale > 0 && m2KillTimer <= 10)
|
||||
Projectile.scale -= 0.1f;
|
||||
if (Projectile.scale < 0.1f && m2KillTimer <= 0)
|
||||
Projectile.active = false;
|
||||
else
|
||||
{
|
||||
Owner.altFunctionUse = 2;
|
||||
m2KillTimer--;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -67,6 +73,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
if (BubbleSize != 0f)
|
||||
{
|
||||
Owner.Calamity().mouseWorldListener = true;
|
||||
m2KillTimer = 20;
|
||||
|
||||
// 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Owner.Center + new Vector2(20, 0).RotatedBy(Projectile.rotation),
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Melee.Spears
|
||||
else
|
||||
{
|
||||
if (timer == StartupTime - 1)
|
||||
Projectile.damage = (int)(Projectile.damage * 0.75 * (channelCharge / 60f)); //scales from 0x to 3.75x power
|
||||
Projectile.damage = (int)(Projectile.damage * 0.75 * (channelCharge / 75f)); //scales from 0x to 3x power
|
||||
}
|
||||
//Make the sprite rotation look right in game
|
||||
Projectile.rotation -= (MathHelper.PiOver2) * (angle.X > 0 ? 1 : -1);
|
||||
@@ -265,7 +265,16 @@ namespace CalamityMod.Projectiles.Melee.Spears
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<VermillionFlux>(), 900);
|
||||
Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, (int)Math.Round(hit.Damage * 0.002));
|
||||
Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, (int)Math.Round(hit.Damage * 0.0015));
|
||||
if (Projectile.damage > 1)
|
||||
Projectile.damage = (int)(Projectile.damage * 0.85f);
|
||||
}
|
||||
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
|
||||
{
|
||||
modifiers.SetCrit();
|
||||
|
||||
float critDamage = Math.Min(Main.player[Projectile.owner].GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f);
|
||||
modifiers.SourceDamage *= 1 + critDamage;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -239,9 +239,12 @@ namespace CalamityMod.Projectiles.Melee
|
||||
if ((useAnim > 0 || DrawUnconditionally) && Owner.ItemAnimationActive)
|
||||
{
|
||||
Asset<Texture2D> tex = ModContent.Request<Texture2D>(Texture);
|
||||
Asset<Texture2D> swoosh = ModContent.Request<Texture2D>("CalamityMod/Particles/CircularSmearSmokey");
|
||||
|
||||
float r = FlipAsSword ? MathHelper.ToRadians(90) : 0f;
|
||||
|
||||
Main.EntitySpriteDraw(swoosh.Value, Owner.Center - Main.screenPosition, null, Color.Turquoise with { A = 0 } * (float)Math.Pow(fadeIn, 3), Projectile.rotation + MathHelper.PiOver4 * Owner.direction + RotationOffset * 1.75f, swoosh.Size() * 0.5f, Projectile.scale * 2f, spriteEffects != SpriteEffects.None ? spriteEffects : (FlipAsSword ? SpriteEffects.FlipHorizontally : SpriteEffects.None));
|
||||
|
||||
for (int i = 0; i < 25; i++)
|
||||
{
|
||||
Texture2D centerTexture = ModContent.Request<Texture2D>("CalamityMod/Projectiles/Melee/StellarStrikerGhost").Value;
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
using System;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Projectiles.BaseProjectiles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
using ReLogic.Utilities;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
@@ -18,12 +21,21 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
public override float OffsetXUpwards => -5f;
|
||||
public override float BaseOffsetY => -5f;
|
||||
public override float OffsetYDownwards => 5f;
|
||||
public override float RecoilResolveSpeed => (KeepRefreshingLifetime || CurrentChargingFrames < ArcNovaDiffuser.Charge2Frames) ? 0.4f : 0.04f;
|
||||
|
||||
public static int FramesPerLoad = 13;
|
||||
public static int MaxLoadableShots = 15;
|
||||
public static float BulletSpeed = 12f;
|
||||
public SlotId NovaChargeSlot;
|
||||
|
||||
public Vector2 effectSpot;
|
||||
public float effectScale = 0;
|
||||
public Vector2 effectSpot2;
|
||||
public float effectScale2 = 0;
|
||||
public Vector2 effectSpot3;
|
||||
public float effectScale3 = 0;
|
||||
public int time = 0;
|
||||
|
||||
public ref float CurrentChargingFrames => ref Projectile.ai[0];
|
||||
public ref float ShotsLoaded => ref Projectile.ai[1];
|
||||
public ref float ShootRecoilTimer => ref Projectile.ai[2]; // Dual functions for rapid fire shooting cooldown and recoil
|
||||
@@ -55,21 +67,37 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
Projectile.timeLeft = ArcNovaDiffuser.AftershotCooldownFrames * 2;
|
||||
|
||||
ChargeSound?.Stop();
|
||||
SoundEngine.PlaySound(ArcNovaDiffuser.BigShot, Projectile.position);
|
||||
SoundEngine.PlaySound(ArcNovaDiffuser.BigShot, Projectile.Center);
|
||||
|
||||
Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * BulletSpeed;
|
||||
int charge2Damage = Projectile.damage * 20;
|
||||
int charge2Damage = (int)(Projectile.damage * 9f);
|
||||
float charge2KB = Projectile.knockBack * 3f;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity, ModContent.ProjectileType<NovaChargedShot>(), charge2Damage, charge2KB, Projectile.owner);
|
||||
if (Main.myPlayer == Projectile.owner)
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity, ModContent.ProjectileType<NovaChargedShot>(), charge2Damage, charge2KB, Projectile.owner);
|
||||
Owner.Calamity().GeneralScreenShakePower = 6.5f;
|
||||
for (int i = 0; i <= 25; i++)
|
||||
for (int i = 0; i <= 45; i++)
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(GunTipPosition - Projectile.velocity * 15, 107, shootVelocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.2f, 1.2f), 0, default, Main.rand.NextFloat(1f, 2.3f));
|
||||
Dust dust = Dust.NewDustPerfect(GunTipPosition - Projectile.velocity * 15, ModContent.DustType<SquashDust>(), shootVelocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.6f, 1.9f), 0, default, Main.rand.NextFloat(2f, 3.3f));
|
||||
dust.noGravity = true;
|
||||
dust.color = Main.rand.NextBool(3) ? Color.Lime : ArcNovaDiffuser.mainColor;
|
||||
dust.fadeIn = 2.5f;
|
||||
if (Main.rand.NextBool(4))
|
||||
{
|
||||
dust.scale = Main.rand.NextFloat(0.8f, 0.95f);
|
||||
dust.fadeIn = -0.85f;
|
||||
dust.velocity /= 2;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
Particle spark2 = new CustomSpark(GunTipPosition, Projectile.velocity * 25, "CalamityMod/Particles/BloomCircle", false, 16, 0.95f, ArcNovaDiffuser.mainColor, new Vector2(1.8f, 0.8f), true, true, glowOpacity: 0.9f, shrinkSpeed: 0.8f);
|
||||
GeneralParticleHandler.SpawnParticle(spark2);
|
||||
}
|
||||
Particle spark = new CustomSpark(GunTipPosition, Projectile.velocity * 2, "CalamityMod/Particles/BloomRing", false, 12, 0.7f, ArcNovaDiffuser.mainColor, new Vector2(0.5f, 1.5f), true, false, extraRotation: -MathHelper.PiOver2, noShrink: true);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
|
||||
ShotsLoaded = 0;
|
||||
ShootRecoilTimer = 24f;
|
||||
ShootRecoilTimer = Projectile.timeLeft = 55;
|
||||
OffsetLengthFromArm -= 25f;
|
||||
}
|
||||
// Retracting recoil
|
||||
@@ -88,36 +116,34 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
if (ShootRecoilTimer <= 0f)
|
||||
{
|
||||
ChargeSound?.Stop();
|
||||
SoundEngine.PlaySound(ArcNovaDiffuser.SmallShot, Projectile.position);
|
||||
SoundEngine.PlaySound(ArcNovaDiffuser.SmallShot, Projectile.Center);
|
||||
|
||||
Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * BulletSpeed;
|
||||
Vector2 fireVec = shootVelocity.RotatedByRandom(MathHelper.ToRadians(2f));
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, fireVec, ModContent.ProjectileType<NovaShot>(), Projectile.damage, Projectile.knockBack, Projectile.owner);
|
||||
if (Main.myPlayer == Projectile.owner)
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, fireVec * (ChargeLV1 ? 1 : 0.7f), ModContent.ProjectileType<NovaShot>(), Projectile.damage, Projectile.knockBack, Projectile.owner);
|
||||
for (int i = 0; i <= 4; i++)
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(GunTipPosition - Projectile.velocity * 15, 107, shootVelocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.9f, 1.2f), 0, default, Main.rand.NextFloat(0.8f, 1.8f));
|
||||
Dust dust = Dust.NewDustPerfect(GunTipPosition - Projectile.velocity * 15, ModContent.DustType<SquashDust>(), shootVelocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(1.2f, 1.6f), 0, default, Main.rand.NextFloat(0.8f, 1.8f));
|
||||
dust.noGravity = true;
|
||||
dust.color = Main.rand.NextBool(3) ? Color.Lime : ArcNovaDiffuser.mainColor;
|
||||
dust.fadeIn = 1.5f;
|
||||
if (Main.rand.NextBool(6))
|
||||
{
|
||||
dust.scale = Main.rand.NextFloat(0.4f, 0.5f);
|
||||
dust.fadeIn = -0.85f;
|
||||
dust.velocity /= 2;
|
||||
}
|
||||
}
|
||||
|
||||
ShotsLoaded--;
|
||||
ShootRecoilTimer = 16f;
|
||||
OffsetLengthFromArm -= 5f;
|
||||
ShootRecoilTimer = (int)MathHelper.Lerp(33, 13, Math.Min(CurrentChargingFrames / ArcNovaDiffuser.Charge1Frames, 1));
|
||||
OffsetLengthFromArm -= 6f;
|
||||
}
|
||||
}
|
||||
// Retracting any remaining recoil
|
||||
else if (ShootRecoilTimer > 0)
|
||||
ShootRecoilTimer -= 2;
|
||||
|
||||
// Fires a burst of sparks on the last shot
|
||||
if (ShotsLoaded == 0)
|
||||
{
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
SparkParticle spark2 = new SparkParticle((GunTipPosition - Projectile.velocity * 3) + Main.rand.NextVector2Circular(10, 10), -Projectile.velocity * Main.rand.NextFloat(9.1f, 17.8f), false, Main.rand.Next(9, 12), Main.rand.NextFloat(0.2f, 0.3f), Main.rand.NextBool(4) ? Color.Chartreuse : Color.Lime);
|
||||
GeneralParticleHandler.SpawnParticle(spark2);
|
||||
}
|
||||
ShotsLoaded--;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -152,16 +178,6 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
if (CurrentChargingFrames >= 10)
|
||||
{
|
||||
float particleScale = MathHelper.Clamp(CurrentChargingFrames, 0f, ArcNovaDiffuser.Charge2Frames);
|
||||
for (int i = 0; i < (ChargeLV2 ? 4 : ChargeLV1 ? 3 : 2); i++)
|
||||
{
|
||||
SparkParticle spark2 = new SparkParticle((GunTipPosition - Projectile.velocity * 4) + Main.rand.NextVector2Circular(12, 12), -Projectile.velocity * Main.rand.NextFloat(16.1f, 30.8f), false, Main.rand.Next(2, 7), Main.rand.NextFloat(particleScale / 350f, particleScale / 270f), Main.rand.NextBool(4) ? Color.Chartreuse : Color.Lime);
|
||||
GeneralParticleHandler.SpawnParticle(spark2);
|
||||
}
|
||||
Particle orb = new GenericBloom(GunTipPosition, Projectile.velocity, Color.Lime, particleScale / 270f, 2, false);
|
||||
GeneralParticleHandler.SpawnParticle(orb);
|
||||
Particle orb2 = new GenericBloom(GunTipPosition, Projectile.velocity, Color.White, particleScale / 400f, 2, false);
|
||||
GeneralParticleHandler.SpawnParticle(orb2);
|
||||
|
||||
float strength = particleScale / 45f;
|
||||
Vector3 DustLight = new Vector3(0.000f, 0.255f, 0.000f);
|
||||
Lighting.AddLight(GunTipPosition, DustLight * strength);
|
||||
@@ -170,25 +186,30 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
// Full charge dusts
|
||||
if (CurrentChargingFrames == ArcNovaDiffuser.Charge1Frames)
|
||||
{
|
||||
for (int i = 0; i < 36; i++)
|
||||
for (int i = 0; i < 25; i++)
|
||||
{
|
||||
Dust chargefull = Dust.NewDustPerfect(GunTipPosition, 107);
|
||||
chargefull.velocity = (MathHelper.TwoPi * i / 36f).ToRotationVector2() * 8f + Owner.velocity;
|
||||
chargefull.scale = Main.rand.NextFloat(1f, 1.3f);
|
||||
Dust chargefull = Dust.NewDustPerfect(GunTipPosition, ModContent.DustType<SquashDust>());
|
||||
chargefull.velocity = (MathHelper.TwoPi * i / 25f).ToRotationVector2() * Main.rand.NextFloat(8, 9.5f);
|
||||
chargefull.scale = Main.rand.NextFloat(1.2f, 1.5f);
|
||||
chargefull.noGravity = true;
|
||||
chargefull.color = Main.rand.NextBool(3) ? Color.Lime : ArcNovaDiffuser.mainColor;
|
||||
chargefull.fadeIn = 1;
|
||||
}
|
||||
}
|
||||
if (CurrentChargingFrames == ArcNovaDiffuser.Charge2Frames)
|
||||
{
|
||||
for (int i = 0; i < 45; i++)
|
||||
for (int i = 0; i < 35; i++)
|
||||
{
|
||||
Dust chargefull = Dust.NewDustPerfect(GunTipPosition, 107);
|
||||
chargefull.velocity = (MathHelper.TwoPi * i / 36f).ToRotationVector2() * 12f + Owner.velocity;
|
||||
chargefull.scale = Main.rand.NextFloat(1.2f, 1.4f);
|
||||
Dust chargefull = Dust.NewDustPerfect(GunTipPosition, ModContent.DustType<SquashDust>());
|
||||
chargefull.velocity = (MathHelper.TwoPi * i / 35f).ToRotationVector2() * Main.rand.NextFloat(11, 13.5f);
|
||||
chargefull.scale = Main.rand.NextFloat(1.7f, 1.9f);
|
||||
chargefull.noGravity = true;
|
||||
chargefull.color = Main.rand.NextBool(3) ? Color.Lime : ArcNovaDiffuser.mainColor;
|
||||
chargefull.fadeIn = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
time++;
|
||||
}
|
||||
|
||||
public override void OnKill(int timeLeft)
|
||||
@@ -199,20 +220,52 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
if (time < 2)
|
||||
return false;
|
||||
Texture2D texture = TextureAssets.Projectile[Type].Value;
|
||||
Vector2 drawPosition = Projectile.Center - Main.screenPosition;
|
||||
Vector2 tipDrawPosition = GunTipPosition - Main.screenPosition;
|
||||
float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f);
|
||||
Vector2 rotationPoint = texture.Size() * 0.5f;
|
||||
SpriteEffects flipSprite = (Projectile.spriteDirection * Owner.gravDir == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None;
|
||||
Color color = ArcNovaDiffuser.mainColor;
|
||||
|
||||
float chargeScale = KeepRefreshingLifetime ? Math.Min(Utils.GetLerpValue(0, ArcNovaDiffuser.Charge1Frames, CurrentChargingFrames, false), 2) : 0;
|
||||
if (!Owner.CantUseHoldout())
|
||||
{
|
||||
float rumble = MathHelper.Clamp(CurrentChargingFrames, 0f, ArcNovaDiffuser.Charge2Frames);
|
||||
drawPosition += Main.rand.NextVector2Circular(rumble / 70f, rumble / 70f);
|
||||
}
|
||||
|
||||
float sine = (float)Math.Sin(time * 0.15f / MathHelper.Pi);
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
Vector2 drawOffset = (MathHelper.TwoPi * i / 10f).ToRotationVector2() * (2f + sine * 0.3f);
|
||||
Main.EntitySpriteDraw(texture, drawPosition + drawOffset * chargeScale, null, color with { A = 0 } * Math.Min(chargeScale, 1) * 0.3f, drawRotation, rotationPoint, Projectile.scale, flipSprite, 0);
|
||||
}
|
||||
Asset<Texture2D> tex2 = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle");
|
||||
Asset<Texture2D> tex3 = ModContent.Request<Texture2D>("CalamityMod/Particles/ForwardSmear");
|
||||
|
||||
Main.EntitySpriteDraw(texture, drawPosition, null, Projectile.GetAlpha(lightColor), drawRotation, rotationPoint, Projectile.scale * Owner.gravDir, flipSprite);
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
Vector2 place = Vector2.One.RotateRandom(MathHelper.TwoPi) * Main.rand.NextFloat(1, 5.5f) * Math.Min(chargeScale, 1);
|
||||
Vector2 vel = Projectile.velocity.RotatedByRandom(0.3f);
|
||||
Main.EntitySpriteDraw(tex3.Value, tipDrawPosition + place - Vector2.Lerp(place, -Projectile.velocity, 0.9f) * Main.rand.NextFloat(15, 35) + Projectile.velocity * -8 * (6 - chargeScale * 2), null, (Main.rand.NextBool(3) ? Color.Lime : color) with { A = 0 } * 0.8f * Math.Min(chargeScale, 1), vel.ToRotation() - MathHelper.PiOver2, new Vector2(tex3.Width() / 2, tex3.Height()), new Vector2(0.25f * chargeScale, (1.7f + (Main.rand.NextBool(4) ? 1.8f : 0))) * Projectile.scale * 0.05f * Math.Min(chargeScale, 1), SpriteEffects.None, 0);
|
||||
}
|
||||
for (int i = 0; i < 3; i++)
|
||||
Main.EntitySpriteDraw(tex2.Value, tipDrawPosition, null, Color.Lerp(color, Color.White, i * 0.25f) with { A = 0 } * 0.8f, Main.rand.NextFloat(-5, 5), tex2.Size() * 0.5f, new Vector2(1.35f, 1f) * Projectile.scale * chargeScale * (1 - 0.27f * i) * 0.23f, SpriteEffects.None, 0);
|
||||
if (CurrentChargingFrames >= ArcNovaDiffuser.Charge2Frames)
|
||||
{
|
||||
for (int y = 0; y < 3; y++)
|
||||
{
|
||||
Vector2 angleVel = (MathHelper.TwoPi * y / 3f).ToRotationVector2().RotatedBy(time * 0.18f);
|
||||
Vector2 drawOffset = (new Vector2(angleVel.X * 0.7f, angleVel.Y * 1.2f)).RotatedBy(Projectile.rotation) * chargeScale * 12;
|
||||
for (int i = 0; i < 2; i++)
|
||||
Main.EntitySpriteDraw(tex2.Value, tipDrawPosition + drawOffset, null, Color.Lerp(color, Color.White, i) with { A = 0 } * 0.8f, Main.rand.NextFloat(-5, 5), tex2.Size() * 0.5f, new Vector2(1f, 1f) * Projectile.scale * chargeScale * (1 - 0.25f * i) * 0.085f * (CurrentChargingFrames <= ArcNovaDiffuser.Charge2Frames + 3 ? 3 : 1), SpriteEffects.None, 0);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
using CalamityMod.Projectiles.BaseProjectiles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -13,6 +15,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
public class ChromaticEruptionHoldout : BaseGunHoldoutProjectile
|
||||
{
|
||||
public override int AssociatedItemID => ModContent.ItemType<ChromaticEruption>();
|
||||
public override string Texture => "CalamityMod/Projectiles/Ranged/ChromaticEruptionHoldout";
|
||||
public override float MaxOffsetLengthFromArm => 40f;
|
||||
public override float OffsetXUpwards => -10f;
|
||||
public override float BaseOffsetY => -12f;
|
||||
@@ -47,7 +50,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
if (ShotCooldown == 0)
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item34, Projectile.Center);
|
||||
Owner.PickAmmo(Owner.ActiveItem(), out _, out float shootSpeed, out int damage, out float knockback, out _, Main.rand.NextFloat() < 0.70f);
|
||||
Owner.PickAmmo(Owner.ActiveItem(), out _, out float shootSpeed, out int damage, out float knockback, out _);
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, (Projectile.velocity * 10).RotatedByRandom(0.12f), ModContent.ProjectileType<ChromaticFire>(), damage, knockback, Projectile.owner);
|
||||
@@ -94,5 +97,15 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
public override void SendExtraAIHoldout(BinaryWriter writer) => writer.Write(FireBlobs);
|
||||
|
||||
public override void ReceiveExtraAIHoldout(BinaryReader reader) => FireBlobs = reader.ReadInt32();
|
||||
public override void PostDraw(Color lightColor)
|
||||
{
|
||||
Texture2D texture = TextureAssets.Projectile[Type].Value;
|
||||
Vector2 origin = texture.Size() * 0.5f;
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (Projectile.spriteDirection == -1)
|
||||
spriteEffects = SpriteEffects.FlipVertically;
|
||||
|
||||
Main.EntitySpriteDraw(ModContent.Request<Texture2D>("CalamityMod/Projectiles/Ranged/ChromaticEruptionHoldoutGlow").Value, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, 0, texture.Width, texture.Height)), Color.White, Projectile.rotation, origin, Projectile.scale, spriteEffects, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
@@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
// If the time reaches Item.useTime, it'll shoot the projectile, fire and reset the timer.
|
||||
if (fireTimer >= Owner.itemTimeMax && Main.myPlayer == Projectile.owner)
|
||||
{
|
||||
Owner.PickAmmo(Owner.ActiveItem(), out _, out float shootSpeed, out int damage, out float knockback, out _, !Main.rand.NextBool(5));
|
||||
Owner.PickAmmo(Owner.ActiveItem(), out _, out float shootSpeed, out int damage, out float knockback, out _);
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(0.15f * i * 0.5f) * shootSpeed * (i == 0 ? 0.5f : i == 1 ? 0.7f : 1) * Main.rand.NextFloat(0.8f, 1f), ModContent.ProjectileType<DragonsBreathFlames>(), damage, knockback, Projectile.owner);
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
revSpeed = Utils.Remap(revFrames, 0, maxFrames - 120, 1, 20, true);
|
||||
if (shootingTimer >= initialFireTime && revFrames < maxFrames && secondShot)
|
||||
{
|
||||
Owner.PickAmmo(Owner.ActiveItem(), out int bulletAMMO, out float SpeedNoUse, out int bulletDamage, out float kBackNoUse, out _, !Main.rand.NextBool(4));
|
||||
Owner.PickAmmo(Owner.ActiveItem(), out int bulletAMMO, out float SpeedNoUse, out int bulletDamage, out float kBackNoUse, out _);
|
||||
|
||||
SoundStyle fire = new("CalamityMod/Sounds/Item/GunShotSmallAlt");
|
||||
SoundEngine.PlaySound(fire with { Volume = 0.7f, Pitch = -0.1f + revSpeed * 0.01f }, Projectile.Center);
|
||||
@@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
}
|
||||
if (shootingTimer >= 60 && revFrames < maxFrames)
|
||||
{
|
||||
Owner.PickAmmo(Owner.ActiveItem(), out int bulletAMMO, out float SpeedNoUse, out int bulletDamage, out float kBackNoUse, out _, !Main.rand.NextBool(4));
|
||||
Owner.PickAmmo(Owner.ActiveItem(), out int bulletAMMO, out float SpeedNoUse, out int bulletDamage, out float kBackNoUse, out _);
|
||||
Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * 19;
|
||||
float spread = 0.045f * Utils.GetLerpValue(0, maxFrames, revFrames, true);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, (shootVelocity).RotatedByRandom(spread).RotatedByRandom(0.04f), bulletAMMO, Projectile.damage / 2, Projectile.knockBack, Projectile.owner);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.IO;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Particles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
@@ -111,7 +112,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
return;
|
||||
|
||||
// The bullet disappears in a puff of dust.
|
||||
ProduceWarpCrossDust(Projectile.Center, (int)CalamityDusts.PurpleCosmilite);
|
||||
ProduceWarpCrossDust(Projectile.Center, ModContent.DustType<SquashDust>(), 0.5f, Color.Magenta);
|
||||
|
||||
// The warp must be performed client side because it requires knowledge of the player's mouse position.
|
||||
Projectile.netUpdate = true;
|
||||
@@ -144,7 +145,17 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
|
||||
// Now that the bullet has warped, produce a tiny puff of dust at its back for effect.
|
||||
Vector2 warpInDustPos = Projectile.Center - bulletToMouseVec * TextureHeight;
|
||||
ProduceWarpCrossDust(warpInDustPos, (int)CalamityDusts.BlueCosmilite);
|
||||
ProduceWarpCrossDust(warpInDustPos, ModContent.DustType<SquashDust>(), 1f, Color.Cyan);
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
Vector2 dustVel = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(0.05f) * Main.rand.NextFloat(9, 15);
|
||||
Dust d = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType<VoidDust>());
|
||||
d.position = warpInDustPos;
|
||||
d.velocity = dustVel;
|
||||
d.noGravity = true;
|
||||
d.scale *= Main.rand.NextFloat(0.6f, 1f);
|
||||
d.color = Color.Cyan;
|
||||
}
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor) => new Color(255, 255, 255, 140);
|
||||
@@ -168,18 +179,21 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
Projectile.Damage();
|
||||
|
||||
// Create a fancy triangle of dust.
|
||||
int dustID = (int)CalamityDusts.BlueCosmilite;
|
||||
int dustID = ModContent.DustType<SquashDust>();
|
||||
int numDust = 9;
|
||||
float triangleAngle = Main.rand.NextFloat(MathHelper.TwoPi);
|
||||
for (int i = 0; i < numDust; ++i)
|
||||
{
|
||||
float speed = MathHelper.Lerp(0.2f, 3.6f, i / (float)(numDust - 1));
|
||||
Vector2 dustVel = Vector2.UnitX.RotatedBy(triangleAngle) * speed;
|
||||
float lerp = i / (float)(numDust - 1);
|
||||
float speed = MathHelper.Lerp(0.2f, 3.6f, lerp);
|
||||
Vector2 dustVel = Vector2.UnitX.RotatedBy(triangleAngle) * speed * 2;
|
||||
Dust d = Dust.NewDustDirect(Projectile.Center, 0, 0, dustID);
|
||||
d.position = Projectile.Center;
|
||||
d.velocity = dustVel;
|
||||
d.noGravity = true;
|
||||
d.scale *= Main.rand.NextFloat(1.1f, 1.4f);
|
||||
d.fadeIn = 1.5f;
|
||||
d.scale *= Main.rand.NextFloat(1.4f, 1.9f) - lerp * 0.5f;
|
||||
d.color = Color.Lerp(Color.Cyan, Color.Magenta, lerp);
|
||||
Dust.CloneDust(d).velocity = dustVel.RotatedBy(MathHelper.Pi * 2f / 3f);
|
||||
Dust.CloneDust(d).velocity = dustVel.RotatedBy(MathHelper.Pi * 4f / 3f);
|
||||
}
|
||||
@@ -199,17 +213,36 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
return true;
|
||||
}
|
||||
|
||||
private void ProduceWarpCrossDust(Vector2 dustPos, int dustID)
|
||||
private void ProduceWarpCrossDust(Vector2 dustPos, int dustID, float speedMultiplier, Color color)
|
||||
{
|
||||
for (int i = 0; i < 4; ++i)
|
||||
if (speedMultiplier > 0.8f) //dark
|
||||
{
|
||||
float speed = Main.rand.NextFloat(2.0f, 4.1f);
|
||||
Vector2 dustVel = Vector2.UnitX * speed;
|
||||
for (int i = 0; i < 2; ++i)
|
||||
{
|
||||
Particle pulse = new CustomPulse(dustPos, Vector2.Zero, Color.Black, "CalamityMod/ExtraTextures/BasicCircle", Vector2.One, 0, 0.4f * speedMultiplier, 0.05f * speedMultiplier, 12, false);
|
||||
GeneralParticleHandler.SpawnParticle(pulse);
|
||||
Particle pulse2 = new CustomPulse(dustPos, Vector2.Zero, color, "CalamityMod/Particles/BloomRing", Vector2.One, 0, 0.15f * (1 + i * 0.2f) * speedMultiplier, 0.025f * (1 + i * 0.2f) * speedMultiplier, 12, true);
|
||||
GeneralParticleHandler.SpawnParticle(pulse2);
|
||||
}
|
||||
}
|
||||
else //light
|
||||
{
|
||||
Particle pulse = new CustomSpark(dustPos, Vector2.Zero, "CalamityMod/Particles/BloomCircle", false, 10, 0.3f * speedMultiplier, color, new Vector2(1f, 1f), true, true, glowOpacity: 1f);
|
||||
GeneralParticleHandler.SpawnParticle(pulse);
|
||||
}
|
||||
|
||||
|
||||
for (int i = 0; i < 5; ++i)
|
||||
{
|
||||
float speed = Main.rand.NextFloat(3f, 6f);
|
||||
Vector2 dustVel = Vector2.UnitX * speed * speedMultiplier * 1.5f;
|
||||
Dust d = Dust.NewDustDirect(Projectile.Center, 0, 0, dustID);
|
||||
d.position = dustPos;
|
||||
d.velocity = dustVel;
|
||||
d.noGravity = true;
|
||||
d.scale *= Main.rand.NextFloat(1.1f, 1.4f);
|
||||
d.scale *= Main.rand.NextFloat(1.8f, 2.2f) * (1 - speed / 7);
|
||||
d.color = color;
|
||||
d.fadeIn = 1;
|
||||
Dust.CloneDust(d).velocity = dustVel.RotatedBy(MathHelper.PiOver2);
|
||||
Dust.CloneDust(d).velocity = dustVel.RotatedBy(MathHelper.Pi);
|
||||
Dust.CloneDust(d).velocity = dustVel.RotatedBy(-MathHelper.PiOver2);
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
using CalamityMod.Projectiles.BaseProjectiles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
using ReLogic.Utilities;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
@@ -14,7 +15,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
public class MagnaCannonHoldout : BaseGunHoldoutProjectile
|
||||
{
|
||||
public override int AssociatedItemID => ModContent.ItemType<MagnaCannon>();
|
||||
public override float MaxOffsetLengthFromArm => 20f;
|
||||
public override float MaxOffsetLengthFromArm => 28f;
|
||||
public override float OffsetXUpwards => -5f;
|
||||
public override float BaseOffsetY => -5f;
|
||||
|
||||
@@ -26,6 +27,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
public static int FramesPerLoad = 9;
|
||||
public static int MaxLoadableShots = 20;
|
||||
public static float BulletSpeed = 12f;
|
||||
public int time = 0;
|
||||
|
||||
public override void KillHoldoutLogic()
|
||||
{
|
||||
@@ -59,9 +61,12 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity.RotatedByRandom(MathHelper.ToRadians(9f)), ModContent.ProjectileType<MagnaShot>(), Projectile.damage, Projectile.knockBack * (FullyCharged ? 3 : 1), Projectile.owner);
|
||||
for (int i = 0; i <= 3; i++)
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(GunTipPosition, 187, shootVelocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.9f, 1.2f), 0, default, Main.rand.NextFloat(1.5f, 2.3f));
|
||||
dust.noGravity = true;
|
||||
Dust dust = Dust.NewDustPerfect(GunTipPosition, ModContent.DustType<SquashDust>(), shootVelocity.RotatedByRandom(MathHelper.ToRadians(25f)) * Main.rand.NextFloat(0.2f, 0.9f), 0, default, Main.rand.NextFloat(1.3f, 1.6f));
|
||||
dust.noGravity = false;
|
||||
dust.color = Main.rand.NextBool(3) ? Color.DodgerBlue : Color.RoyalBlue;
|
||||
dust.fadeIn = 0.3f;
|
||||
}
|
||||
OffsetLengthFromArm -= 5f;
|
||||
|
||||
ShotsLoaded--;
|
||||
ShootTimer = FullyCharged ? 4f : 5f;
|
||||
@@ -90,16 +95,8 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
// Charge-up visuals
|
||||
if (CurrentChargingFrames >= 10)
|
||||
{
|
||||
if (!FullyCharged)
|
||||
{
|
||||
Particle streak = new ManaDrainStreak(Owner, Main.rand.NextFloat(0.06f + (CurrentChargingFrames / 180), 0.08f + (CurrentChargingFrames / 180)), Main.rand.NextVector2CircularEdge(2f, 2f) * Main.rand.NextFloat(0.3f * CurrentChargingFrames, 0.3f * CurrentChargingFrames), 0f, Color.White, Color.Aqua, 7, GunTipPosition);
|
||||
GeneralParticleHandler.SpawnParticle(streak);
|
||||
}
|
||||
float orbScale = MathHelper.Clamp(CurrentChargingFrames, 0f, MagnaCannon.FullChargeFrames);
|
||||
Particle orb = new GenericBloom(GunTipPosition, Projectile.velocity, Color.DarkBlue, orbScale / 135f, 2);
|
||||
GeneralParticleHandler.SpawnParticle(orb);
|
||||
Particle orb2 = new GenericBloom(GunTipPosition, Projectile.velocity, Color.Aqua, orbScale / 200f, 2);
|
||||
GeneralParticleHandler.SpawnParticle(orb2);
|
||||
float orbScale = MathHelper.Clamp(CurrentChargingFrames, 0f, MagnaCannon.FullChargeFrames) / 200;
|
||||
Lighting.AddLight(GunTipPosition, Color.DodgerBlue.ToVector3() * orbScale);
|
||||
}
|
||||
|
||||
// Full charge dusts
|
||||
@@ -107,13 +104,16 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
for (int i = 0; i < 36; i++)
|
||||
{
|
||||
Dust chargefull = Dust.NewDustPerfect(GunTipPosition, 160);
|
||||
chargefull.velocity = (MathHelper.TwoPi * i / 36f).ToRotationVector2() * 18f + Owner.velocity;
|
||||
chargefull.scale = Main.rand.NextFloat(1f, 1.5f);
|
||||
Dust chargefull = Dust.NewDustPerfect(GunTipPosition, ModContent.DustType<SquashDust>());
|
||||
chargefull.velocity = (MathHelper.TwoPi * i / 36f).ToRotationVector2() * Main.rand.NextFloat(6, 7.5f);
|
||||
chargefull.scale = Main.rand.NextFloat(2f, 2.5f);
|
||||
chargefull.noGravity = true;
|
||||
chargefull.color = Main.rand.NextBool(3) ? Color.Cyan : Color.RoyalBlue;
|
||||
chargefull.fadeIn = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
time++;
|
||||
}
|
||||
|
||||
public override void OnKill(int timeLeft)
|
||||
@@ -124,6 +124,8 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
if (time < 2)
|
||||
return false;
|
||||
Texture2D texture = TextureAssets.Projectile[Type].Value;
|
||||
Vector2 drawPosition = Projectile.Center - Main.screenPosition;
|
||||
float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f);
|
||||
@@ -136,8 +138,14 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
drawPosition += Main.rand.NextVector2Circular(rumble / 43f, rumble / 43f);
|
||||
}
|
||||
|
||||
Asset<Texture2D> tex2 = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle");
|
||||
|
||||
Main.EntitySpriteDraw(texture, drawPosition, null, Projectile.GetAlpha(lightColor), drawRotation, rotationPoint, Projectile.scale * Owner.gravDir, flipSprite);
|
||||
|
||||
float chargeScale = KeepRefreshingLifetime ? Utils.GetLerpValue(0, MagnaCannon.FullChargeFrames, CurrentChargingFrames, true) : 0;
|
||||
for (int i = 0; i < 3; i++)
|
||||
Main.EntitySpriteDraw(tex2.Value, GunTipPosition - Main.screenPosition, null, Color.Lerp(FullyCharged ? Color.DodgerBlue : Color.RoyalBlue, Color.White, i * 0.25f) with { A = 0 } * 0.8f, Main.rand.NextFloat(-5, 5), tex2.Size() * 0.5f, new Vector2(1.35f, 1f) * Projectile.scale * chargeScale * (1 - 0.27f * i) * 0.25f * ((chargeScale >= 1 && CurrentChargingFrames <= MagnaCannon.FullChargeFrames + 3) ? 1.75f : FullyCharged ? 1.4f : 1), SpriteEffects.None, 0);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Particles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
@@ -19,36 +20,41 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
Projectile.width = Projectile.height = 5;
|
||||
Projectile.friendly = true;
|
||||
Projectile.alpha = 25;
|
||||
Projectile.penetrate = 1;
|
||||
Projectile.timeLeft = 300;
|
||||
Projectile.DamageType = DamageClass.Ranged;
|
||||
Projectile.extraUpdates = 2;
|
||||
Projectile.usesLocalNPCImmunity = true;
|
||||
Projectile.localNPCHitCooldown = 50;
|
||||
Projectile.localNPCHitCooldown = -1;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center, 187);
|
||||
dust.noGravity = true;
|
||||
dust.scale = 0.5f;
|
||||
|
||||
Vector2 trailPos = Projectile.Center + Main.rand.NextVector2Circular(4, 4) - Projectile.velocity;
|
||||
float trailScale = Main.rand.NextFloat(0.04f, 0.05f);
|
||||
Color trailColor = Main.rand.NextBool(3) ? Color.DodgerBlue : Color.RoyalBlue;
|
||||
Particle Trail = new CustomSpark(trailPos, Projectile.velocity.RotatedByRandom(0.03f) * Main.rand.NextFloat(0.1f, 0.4f), "CalamityMod/Particles/SquareRotated", false, Main.rand.NextBool(7) ? 35 : 6, trailScale, trailColor, new Vector2(1f, 1f), true, true, glowOpacity: 0.5f, extraRotation: Main.rand.NextFloat(0, MathHelper.TwoPi));
|
||||
GeneralParticleHandler.SpawnParticle(Trail);
|
||||
|
||||
}
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1);
|
||||
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.DodgerBlue with { A = 0 }, 1);
|
||||
return false;
|
||||
}
|
||||
public override void OnKill(int timeLeft)
|
||||
{
|
||||
for (int i = 0; i <= 3; i++)
|
||||
for (int i = 0; i <= 2; i++)
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.position, 187, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(30f)) / 2, 0, default, Main.rand.NextFloat(1.1f, 1.3f));
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType<SquashDust>(), -Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(10f)) * Main.rand.NextFloat(0.8f, 1.8f), 0, default, Main.rand.NextFloat(0.9f, 1.3f));
|
||||
dust.noGravity = false;
|
||||
SoundEngine.PlaySound(SoundID.DD2_WitherBeastCrystalImpact with { Volume = 0.8f, PitchVariance = 0.3f }, Projectile.Center);
|
||||
dust.color = Main.rand.NextBool(3) ? Color.DodgerBlue : Color.RoyalBlue;
|
||||
dust.fadeIn = -0.15f;
|
||||
}
|
||||
SoundEngine.PlaySound(SoundID.DD2_WitherBeastCrystalImpact with { Volume = 0.8f, PitchVariance = 0.3f }, Projectile.Center);
|
||||
}
|
||||
public override bool? CanDamage() => base.CanDamage();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using CalamityMod.Particles;
|
||||
using System;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
using CalamityMod.Particles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
@@ -35,19 +38,32 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
Time++;
|
||||
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(-3, 3), 107);
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(-3, 3), ModContent.DustType<SquashDust>());
|
||||
dust.noGravity = true;
|
||||
dust.scale = 1.2f;
|
||||
dust.scale = Main.rand.NextFloat(0.9f, 1.3f);
|
||||
dust.color = ArcNovaDiffuser.mainColor;
|
||||
dust.fadeIn = -0.4f;
|
||||
if (Time < 120)
|
||||
{
|
||||
if (Main.rand.NextBool())
|
||||
{
|
||||
Vector2 trailPos = Projectile.Center + Main.rand.NextVector2Circular(10, 10);
|
||||
float trailScale = Main.rand.NextFloat(0.8f, 1.2f);
|
||||
Color trailColor = Main.rand.NextBool(3) ? Color.Chartreuse : Color.Lime;
|
||||
Particle Trail = new SparkParticle(trailPos, Projectile.velocity * 0.2f, false, 60, trailScale, trailColor);
|
||||
float trailScale = Main.rand.NextFloat(0.6f, 0.75f);
|
||||
Color trailColor = Main.rand.NextBool(3) ? Color.Chartreuse : ArcNovaDiffuser.mainColor;
|
||||
Particle Trail = new CustomSpark(trailPos, Projectile.velocity * 0.2f, "CalamityMod/Particles/BloomCircle", false, 50, trailScale, trailColor, new Vector2(0.2f, 1.4f), true, true, shrinkSpeed: 0.1f);
|
||||
GeneralParticleHandler.SpawnParticle(Trail);
|
||||
}
|
||||
if (Time % 2 == 0)
|
||||
{
|
||||
for (int i = -1; i <= 1; i += 2)
|
||||
{
|
||||
float sine = (float)Math.Sin(Projectile.timeLeft * 0.45f / MathHelper.Pi);
|
||||
Dust dust2 = Dust.NewDustPerfect(Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(MathHelper.PiOver2) * sine * 28 * i, ModContent.DustType<SquashDust>(), Projectile.velocity * Main.rand.NextFloat(0.6f, 0.8f), 0, default, Main.rand.NextFloat(0.8f, 0.85f));
|
||||
dust2.noGravity = true;
|
||||
dust2.color = Main.rand.NextBool(3) ? Color.Lime : ArcNovaDiffuser.mainColor;
|
||||
dust2.fadeIn = -0.55f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,45 +75,43 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
}
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
return new Color(50, 255, 50, Projectile.alpha);
|
||||
return ArcNovaDiffuser.mainColor with { A = 0 };
|
||||
}
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
target.AddBuff(BuffID.CursedInferno, 900);
|
||||
|
||||
}
|
||||
public override void OnKill(int timeLeft)
|
||||
{
|
||||
for (int i = 0; i <= 19; i++)
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center, 107, new Vector2(0, -18).RotatedByRandom(MathHelper.ToRadians(35f)) * Main.rand.NextFloat(0.1f, 1.9f));
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType<SquashDust>(), new Vector2(0, -18).RotatedByRandom(MathHelper.ToRadians(35f)) * Main.rand.NextFloat(0.1f, 1.9f));
|
||||
dust.noGravity = false;
|
||||
dust.scale = Main.rand.NextFloat(0.8f, 1.5f);
|
||||
Dust dust2 = Dust.NewDustPerfect(Projectile.Center, 107, new Vector2(0, -7).RotatedByRandom(MathHelper.ToRadians(35f)) * Main.rand.NextFloat(0.1f, 1.9f));
|
||||
dust.scale = Main.rand.NextFloat(0.8f, 2.3f);
|
||||
dust.color = ArcNovaDiffuser.mainColor;
|
||||
Dust dust2 = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType<SquashDust>(), new Vector2(0, -7).RotatedByRandom(MathHelper.ToRadians(35f)) * Main.rand.NextFloat(0.1f, 1.9f));
|
||||
dust2.noGravity = false;
|
||||
dust2.scale = Main.rand.NextFloat(0.8f, 1.5f);
|
||||
dust2.scale = Main.rand.NextFloat(0.8f, 2.3f);
|
||||
dust2.color = Color.Lime;
|
||||
}
|
||||
SoundEngine.PlaySound(ChargeImpact, Projectile.position);
|
||||
Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Lime, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0.1f, 0.6f, 20);
|
||||
SoundEngine.PlaySound(ChargeImpact, Projectile.Center);
|
||||
Particle pulse = new CustomPulse(Projectile.Center, Vector2.Zero, ArcNovaDiffuser.mainColor, "CalamityMod/Particles/BloomRing", new Vector2(1f, 1f), 0, 0.2f, 1.3f, 16);
|
||||
GeneralParticleHandler.SpawnParticle(pulse);
|
||||
Particle pulse2 = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Chartreuse, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0.1f, 0.5f, 16);
|
||||
Particle pulse2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Lime, "CalamityMod/Particles/BloomCircle", new Vector2(1f, 1f), 0, 0.8f, 0.1f, 20);
|
||||
GeneralParticleHandler.SpawnParticle(pulse2);
|
||||
|
||||
for (int i = 0; i < 25; ++i)
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
int bloodLifetime = Main.rand.Next(22, 36);
|
||||
float bloodScale = Main.rand.NextFloat(0.6f, 0.8f);
|
||||
Color bloodColor = Color.Lerp(Color.Lime, Color.Chartreuse, Main.rand.NextFloat());
|
||||
bloodColor = Color.Lerp(bloodColor, new Color(51, 22, 94), Main.rand.NextFloat(0.65f));
|
||||
|
||||
if (Main.rand.NextBool(20))
|
||||
bloodScale *= 2f;
|
||||
|
||||
float randomSpeedMultiplier = Main.rand.NextFloat(1.25f, 2.25f);
|
||||
Vector2 bloodVelocity = Main.rand.NextVector2Unit() * 5 * randomSpeedMultiplier;
|
||||
bloodVelocity.Y -= 5f;
|
||||
BloodParticle blood = new BloodParticle(Projectile.Center, bloodVelocity, bloodLifetime, bloodScale, bloodColor);
|
||||
GeneralParticleHandler.SpawnParticle(blood);
|
||||
Particle spark2 = new CustomSpark(Projectile.Center, Vector2.Zero, "CalamityMod/Particles/BloomCircle", false, 16, 0.95f, ArcNovaDiffuser.mainColor, new Vector2(1f, 1f), true, true, glowOpacity: 0.9f);
|
||||
GeneralParticleHandler.SpawnParticle(spark2);
|
||||
}
|
||||
|
||||
}
|
||||
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
|
||||
{
|
||||
modifiers.SetCrit();
|
||||
Player Owner = Main.player[Projectile.owner];
|
||||
float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f);
|
||||
modifiers.SourceDamage *= 1 + critDamage;
|
||||
}
|
||||
public override bool? CanDamage() => base.CanDamage();
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
using CalamityMod.Particles;
|
||||
using System;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
using CalamityMod.Particles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Ranged
|
||||
@@ -11,6 +12,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
public bool FirstFrameNoDraw = true;
|
||||
public new string LocalizationCategory => "Projectiles.Ranged";
|
||||
public int sineDir = 0;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
ProjectileID.Sets.TrailCacheLength[Type] = 8;
|
||||
@@ -33,15 +35,24 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (sineDir == 0)
|
||||
sineDir = Main.rand.NextBool() ? -1 : 1;
|
||||
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
|
||||
//Dust dust = Dust.NewDustPerfect(Projectile.Center, 107); // + Main.rand.NextVector2Circular(-3, 3)
|
||||
//dust.noGravity = true;
|
||||
//dust.scale = 0.5f;
|
||||
if (Projectile.timeLeft % 2 == 0 && Projectile.timeLeft < 290)
|
||||
{
|
||||
SparkParticle spark = new SparkParticle(Projectile.Center - Projectile.velocity * 0.5f, Projectile.velocity * 0.01f, false, 5, 1f, Color.Lime * 0.6f);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
|
||||
Particle Trail = new CustomSpark(Projectile.Center - Projectile.velocity * 0.5f, Projectile.velocity * 0.01f, "CalamityMod/Particles/BloomCircle", false, 7, 0.33f, ArcNovaDiffuser.mainColor * 0.8f, new Vector2(0.2f, 1.4f), true, true, shrinkSpeed: 0.4f, glowOpacity: 0.8f);
|
||||
GeneralParticleHandler.SpawnParticle(Trail);
|
||||
}
|
||||
if (Main.rand.NextBool(3))
|
||||
{
|
||||
float sine = (float)Math.Sin(Projectile.timeLeft * 0.45f / MathHelper.Pi);
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(MathHelper.PiOver2 * sineDir) * sine * 8, ModContent.DustType<SquashDust>(), Projectile.velocity * Main.rand.NextFloat(0.85f, 0.9f), 0, default, Main.rand.NextFloat(0.4f, 0.45f) * 3);
|
||||
dust.noGravity = true;
|
||||
dust.color = Main.rand.NextBool(3) ? Color.Lime : ArcNovaDiffuser.mainColor;
|
||||
dust.fadeIn = Main.rand.NextBool(8) ? -0.4f : 1.75f;
|
||||
}
|
||||
}
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
@@ -51,11 +62,26 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
}
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
return new Color(50, 255, 50, Projectile.alpha);
|
||||
return ArcNovaDiffuser.mainColor with { A = 0 };
|
||||
}
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
target.AddBuff(BuffID.CursedInferno, 90);
|
||||
if (Projectile.numHits == 0)
|
||||
{
|
||||
for (int i = 0; i <= 4; i++)
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType<SquashDust>(), Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(0.4f) * Main.rand.NextFloat(7f, 9f), 0, default, Main.rand.NextFloat(0.8f, 1.8f));
|
||||
dust.noGravity = true;
|
||||
dust.color = Main.rand.NextBool(3) ? Color.Lime : ArcNovaDiffuser.mainColor;
|
||||
dust.fadeIn = 1.5f;
|
||||
if (Main.rand.NextBool(3))
|
||||
{
|
||||
dust.scale = Main.rand.NextFloat(0.4f, 0.5f);
|
||||
dust.fadeIn = -0.85f;
|
||||
dust.velocity /= 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
|
||||
{
|
||||
|
||||
@@ -1,17 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.NPCs.NormalNPCs;
|
||||
using CalamityMod.Particles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Ranged
|
||||
@@ -23,6 +15,8 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
public ref float time => ref Projectile.ai[0];
|
||||
public Color baseColor = Color.White;
|
||||
public bool fading = false;
|
||||
public int sineDir = 0;
|
||||
public float fadeMultiplier = 1;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = 45;
|
||||
@@ -42,7 +36,8 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
Player Owner = Main.player[Projectile.owner];
|
||||
float targetDist = Vector2.Distance(Owner.Center, Projectile.Center);
|
||||
bool inRange = targetDist < 1400;
|
||||
|
||||
if (sineDir == 0)
|
||||
sineDir = Main.rand.NextBool() ? 1 : -1;
|
||||
Projectile.rotation = Projectile.velocity.ToRotation();
|
||||
if (time <= 5)
|
||||
Projectile.scale = 0.1f;
|
||||
@@ -53,8 +48,21 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
Projectile.velocity *= 0.992f;
|
||||
Projectile.scale *= 0.992f;
|
||||
}
|
||||
if (time > 11)
|
||||
if (fading)
|
||||
fadeMultiplier -= 0.007f;
|
||||
if (time > 11 && inRange)
|
||||
{
|
||||
if (fadeMultiplier > 0.01f)
|
||||
{
|
||||
for (int i = -1 * sineDir; (sineDir == 1 ? (i <= 1) : (i >= -1)); i += 2 * sineDir)
|
||||
{
|
||||
float sine = (float)Math.Sin(Projectile.timeLeft * 0.25f / MathHelper.Pi);
|
||||
|
||||
Particle beam = new CustomSpark(Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(MathHelper.PiOver2) * sine * 35 * i * fadeMultiplier, Projectile.velocity.SafeNormalize(Vector2.UnitX) * 4 * Main.rand.NextFloat(0.6f, 0.8f), "CalamityMod/Particles/Light", false, 45, 0.4f * fadeMultiplier * MathHelper.Lerp(Math.Abs(sine), 0.55f, 0.6f), i == 1 ? Color.White : Color.Black, new Vector2(1f, 1f), i == 1 ? true : false, false, 0, false, false, 0, noShrink: true);
|
||||
GeneralParticleHandler.SpawnParticle(beam);
|
||||
}
|
||||
}
|
||||
|
||||
if (Main.rand.NextBool(4) && !fading)
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(20, 20), (Main.rand.NextBool() ? ModContent.DustType<VoidDustInverted>() : ModContent.DustType<VoidDust>()), Projectile.velocity.RotatedByRandom(0.1f) * Main.rand.NextFloat(2.3f, 5.8f));
|
||||
@@ -111,10 +119,10 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
SoundStyle fire = new("CalamityMod/Sounds/Item/OntologicalDespoilerLargeImpact");
|
||||
SoundEngine.PlaySound(fire with { Volume = 0.65f, MaxInstances = 3 }, Projectile.Center);
|
||||
SoundEngine.PlaySound(fire with { Volume = 0.65f, MaxInstances = -1}, Projectile.Center);
|
||||
}
|
||||
SoundStyle fire2 = new("CalamityMod/Sounds/Item/MeldExplosion");
|
||||
SoundEngine.PlaySound(fire2 with { Volume = 1, Pitch = Main.rand.NextFloat(-0.5f, -0.6f) }, Projectile.Center);
|
||||
SoundEngine.PlaySound(fire2 with { Volume = 1, Pitch = Main.rand.NextFloat(-0.5f, -0.6f), MaxInstances = -1 }, Projectile.Center);
|
||||
}
|
||||
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
|
||||
{
|
||||
|
||||
Loaded 100 of 111 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user