Merge branch '1.4.4' into MegalodonLine
No files matched your search
@@ -188,6 +188,8 @@ namespace CalamityMod.Balancing
|
||||
#region Astrum Aureus
|
||||
// 30% resist to The Ballista's greatarrows.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<AstrumAureus>(), Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<BallistaGreatArrow>()))));
|
||||
// 30% resist to Whitewater.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<AstrumAureus>(), Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<WhitewaterProj>(), ProjectileType<WhitewaterAura>(), ProjectileType<WhitewaterSpear>()))));
|
||||
#endregion
|
||||
|
||||
#region Duke Fishron
|
||||
@@ -216,6 +218,9 @@ namespace CalamityMod.Balancing
|
||||
// 50% resist to Icicle Arrows.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<IcicleArrowProj>()))));
|
||||
|
||||
// 50% resist to Whitewater.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<WhitewaterAura>(), ProjectileType<WhitewaterProj>(), ProjectileType<WhitewaterSpear>()))));
|
||||
|
||||
// 35% resist to Flying Dragon.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileID.DD2SquireSonicBoom))));
|
||||
|
||||
@@ -295,9 +300,6 @@ namespace CalamityMod.Balancing
|
||||
#endregion
|
||||
|
||||
#region Providence
|
||||
// 80% resist to Hell's Sun.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<Providence>(), new ProjectileResistBalancingRule(0.2f, ProjectileType<HellsSunProj>())));
|
||||
|
||||
// 35% resist to Vanishing Point. This thing desperately needs a rework.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<Providence>(), new ProjectileResistBalancingRule(0.65f, ProjectileType<SpatialSpear>(), ProjectileType<SpatialSpear2>(), ProjectileType<SpatialSpear3>(), ProjectileType<SpatialSpear4>())));
|
||||
#endregion
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
using CalamityMod.Items.Mounts;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Mounts
|
||||
{
|
||||
public class ExoTankBuff : ModBuff
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.buffNoTimeDisplay[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
player.mount.SetMount(ModContent.MountType<ExoTank>(), player);
|
||||
player.buffTime[buffIndex] = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 573 B |
@@ -1,5 +1,8 @@
|
||||
using Terraria;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Particles;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using Microsoft.Xna.Framework;
|
||||
|
||||
namespace CalamityMod.Buffs.StatDebuffs
|
||||
{
|
||||
@@ -11,5 +14,29 @@ namespace CalamityMod.Buffs.StatDebuffs
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
}
|
||||
public override void Update(NPC npc, ref int buffIndex)
|
||||
{
|
||||
if (npc.Calamity().relicOfResilienceWeakness < npc.buffTime[buffIndex])
|
||||
npc.Calamity().relicOfResilienceWeakness = npc.buffTime[buffIndex];
|
||||
npc.DelBuff(buffIndex);
|
||||
buffIndex--;
|
||||
}
|
||||
internal static void DrawEffects(NPC npc, ref Color drawColor)
|
||||
{
|
||||
Vector2 npcSize = npc.Center + new Vector2(Main.rand.NextFloat(-npc.width / 2, npc.width / 2), Main.rand.NextFloat(-npc.height / 2, npc.height / 2));
|
||||
|
||||
if (Main.rand.NextBool(5))
|
||||
{
|
||||
Particle spark = new CustomSpark(npcSize, Vector2.Zero, "CalamityMod/Projectiles/Typeless/ArtifactOfResilienceShard" + Main.rand.Next(1, 6 + 1).ToString(), true, Main.rand.Next(9, 22 + 1), Main.rand.NextFloat(0.4f, 0.8f), Color.White * Main.rand.NextFloat(0.4f, 0.9f), new Vector2(1.1f, 0.8f), false, false, Main.rand.NextFloat(-5, 5), false, false);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
}
|
||||
|
||||
if (Main.rand.NextBool(5))
|
||||
{
|
||||
Dust dust = Dust.NewDustDirect(npc.position - new Vector2(2f), npc.width + 4, npc.height + 4, ModContent.DustType<LightDust>(), npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, Main.rand.NextFloat(0.9f, 1.7f));
|
||||
dust.noGravity = Main.rand.NextBool(3);
|
||||
dust.color = Main.rand.NextBool() ? Color.Sienna : Color.Goldenrod;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -212,6 +212,10 @@ namespace CalamityMod.CalPlayer
|
||||
public int StellarHammer = 0;
|
||||
public int GalaxyHammer = 0;
|
||||
public bool despoilerNerf = false;
|
||||
public int amputatorBuff = 0;
|
||||
public int rOfResilienceCooldown = 0;
|
||||
public int rOfResilienceEffect = 0;
|
||||
public int rOfResilienceOrbitOffset = 0;
|
||||
public int NorfleetCounter = 0;
|
||||
public int hideOfDeusMeleeBoostTimer = 0;
|
||||
public int alcoholPoisonLevel = 0;
|
||||
@@ -504,6 +508,8 @@ namespace CalamityMod.CalPlayer
|
||||
public bool unstableGraniteCore = false;
|
||||
public bool regenator = false;
|
||||
public bool theBee = false;
|
||||
public bool arcFlashRing = false;
|
||||
public bool arcFlashRingVisual = false;
|
||||
public bool shouldTriggerBeeCooldown = false;
|
||||
public int theBeeCooldown = 0;
|
||||
public bool alluringBait = false;
|
||||
@@ -517,12 +523,14 @@ namespace CalamityMod.CalPlayer
|
||||
public bool stressPills = false;
|
||||
public bool laudanum = false;
|
||||
public bool heartOfDarkness = false;
|
||||
public bool profanedSoulRelicBuff = false;
|
||||
public bool draedonsHeart = false;
|
||||
public bool vexation = false;
|
||||
public bool dodgeScarf = false;
|
||||
public bool evasionScarf = false;
|
||||
public bool badgeOfBravery = false;
|
||||
public bool warbannerOfTheSun = false;
|
||||
public bool WarbanneroftheRighteous = false;
|
||||
public bool warbannerGlow = false;
|
||||
public bool tesla = false;
|
||||
public bool teslaVisuals = true;
|
||||
public bool cryogenSoul = false;
|
||||
@@ -577,6 +585,7 @@ namespace CalamityMod.CalPlayer
|
||||
public int gSabatonFall = 0;
|
||||
public bool gSabatonFalling = false;
|
||||
public int gSabatonTempJumpSpeed = 0;
|
||||
public bool rOfDelivarenceRam = false;
|
||||
public bool sGlyph = false;
|
||||
public bool sRegen = false;
|
||||
public bool tracersDust = false;
|
||||
@@ -1751,6 +1760,8 @@ namespace CalamityMod.CalPlayer
|
||||
regenator = false;
|
||||
deepDiver = false;
|
||||
theBee = false;
|
||||
arcFlashRing = false;
|
||||
arcFlashRingVisual = false;
|
||||
alluringBait = false;
|
||||
enchantedPearl = false;
|
||||
fishingStation = false;
|
||||
@@ -1758,7 +1769,8 @@ namespace CalamityMod.CalPlayer
|
||||
bloodyWormTooth = false;
|
||||
vexation = false;
|
||||
badgeOfBravery = false;
|
||||
warbannerOfTheSun = false;
|
||||
WarbanneroftheRighteous = false;
|
||||
warbannerGlow = false;
|
||||
aSpark = false;
|
||||
transformer = false;
|
||||
hideOfDeus = false;
|
||||
@@ -1798,6 +1810,7 @@ namespace CalamityMod.CalPlayer
|
||||
nucleogenesis = false;
|
||||
nuclearFuelRod = false;
|
||||
heartOfDarkness = false;
|
||||
profanedSoulRelicBuff = false;
|
||||
shadowMinions = false;
|
||||
holyMinions = false;
|
||||
alchFlask = false;
|
||||
@@ -2420,6 +2433,7 @@ namespace CalamityMod.CalPlayer
|
||||
gSabatonFall = 0;
|
||||
gSabatonFalling = false;
|
||||
gSabatonTempJumpSpeed = 0;
|
||||
rOfDelivarenceRam = false;
|
||||
astralStarRainCooldown = 0;
|
||||
AbaddonCooldown = 0;
|
||||
VoidCooldown = 0;
|
||||
@@ -2430,6 +2444,8 @@ namespace CalamityMod.CalPlayer
|
||||
bloodflareMageCooldown = 0;
|
||||
tarraRangedCooldown = 0;
|
||||
hideOfDeusMeleeBoostTimer = 0;
|
||||
rOfResilienceCooldown = 0;
|
||||
rOfResilienceEffect = 0;
|
||||
|
||||
externalAbyssLight = 0;
|
||||
externalBreathLossMultBoost = 0f;
|
||||
@@ -3150,7 +3166,7 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (Player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
int mark = Projectile.NewProjectile(source, Main.MouseWorld, Vector2.Zero, ProjectileType<CircletMark>(), damage, kBack, Player.whoAmI);
|
||||
int mark = Projectile.NewProjectile(source, Player.ClampedMouseWorld(), Vector2.Zero, ProjectileType<CircletMark>(), damage, kBack, Player.whoAmI);
|
||||
if (mark.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[mark].DamageType = DamageClass.Generic;
|
||||
}
|
||||
@@ -4252,8 +4268,9 @@ namespace CalamityMod.CalPlayer
|
||||
var MedallionSource = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<RustyMedallion>()));
|
||||
int d = (int)Player.GetTotalDamage<RangedDamageClass>().ApplyTo(RustyMedallion.AcidDropBaseDamage);
|
||||
|
||||
Vector2 startingPosition = Main.MouseWorld - Vector2.UnitY.RotatedByRandom(0.3f) * 1250f;
|
||||
Vector2 directionToMouse = (Main.MouseWorld - startingPosition).SafeNormalize(Vector2.UnitX);
|
||||
Vector2 mouse = Player.ClampedMouseWorld();
|
||||
Vector2 startingPosition = mouse - Vector2.UnitY.RotatedByRandom(0.3f) * 1250f;
|
||||
Vector2 directionToMouse = (mouse - startingPosition).SafeNormalize(Vector2.UnitX);
|
||||
int drop = Projectile.NewProjectile(MedallionSource, startingPosition, directionToMouse * 15f, ProjectileType<AcidBarrelDrop>(), d, 0f, Player.whoAmI, 3);
|
||||
if (drop.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
@@ -4784,6 +4801,10 @@ namespace CalamityMod.CalPlayer
|
||||
if ((it.IsAir || !it.CountsAsClass<RogueDamageClass>()) && GemTechSet && GemTechState.IsRedGemActive)
|
||||
playerUsingWeapon = false;
|
||||
|
||||
// Molten Amputator consumes stealth in a special way
|
||||
if (it.type == ModContent.ItemType<MoltenAmputator>())
|
||||
playerUsingWeapon = false;
|
||||
|
||||
// Animation check depends on whether the item is "clockwork", like Clockwork Assault Rifle.
|
||||
// "Clockwork" weapons can chain-fire multiple stealth strikes (really only 2 max) until you run out of stealth.
|
||||
bool animationCheck = it.useAnimation == it.useTime
|
||||
|
||||
@@ -397,6 +397,7 @@ namespace CalamityMod.CalPlayer
|
||||
direction = DashDirection.Directionless;
|
||||
|
||||
// God Slayer armor's dash will dash towards the player's cursor.
|
||||
// 14NOV2024: Ozzatron: Intentionally does not use clamped mouse position so that player dash direction is not strangely bent on larger screens.
|
||||
Vector2 dashVel = Main.MouseWorld - Player.Center;
|
||||
dashVel = dashVel.SafeNormalize(Vector2.UnitX) * UsedDash.CalculateDashSpeed(Player);
|
||||
|
||||
@@ -517,6 +518,22 @@ namespace CalamityMod.CalPlayer
|
||||
DoMountDashDamage(damageHitbox, damage, knockback, NPCImmuneTime, playerImmuneTime);
|
||||
}
|
||||
|
||||
if (Player.mount.Active && Player.mount.Type == ModContent.MountType<ExoTank>() && Math.Abs(Player.velocity.X) > Player.mount.RunSpeed)
|
||||
{
|
||||
Rectangle damageHitbox = Player.getRect();
|
||||
|
||||
if (Player.direction == 1)
|
||||
damageHitbox.Offset(Player.width - 1, 0);
|
||||
|
||||
damageHitbox.Width = 2;
|
||||
damageHitbox.Inflate(6, 12);
|
||||
float damage = Player.GetTotalDamage<SummonDamageClass>().ApplyTo(ExoTank.DashDamage);
|
||||
float knockback = 10f;
|
||||
int NPCImmuneTime = 30;
|
||||
int playerImmuneTime = 6;
|
||||
DoMountDashDamage(damageHitbox, damage, knockback, NPCImmuneTime, playerImmuneTime);
|
||||
}
|
||||
|
||||
if (Player.mount.Active && Player.mount.Type == ModContent.MountType<RimehoundMount>() && Math.Abs(Player.velocity.X) > Player.mount.RunSpeed / 2f)
|
||||
{
|
||||
Rectangle damageHitbox = Player.getRect();
|
||||
|
||||
@@ -22,7 +22,6 @@ using CalamityMod.Items.Mounts;
|
||||
using CalamityMod.Items.Placeables.Furniture;
|
||||
using CalamityMod.Items.Potions;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using CalamityMod.Items.Tools;
|
||||
using CalamityMod.Items.VanillaArmorChanges;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.NPCs;
|
||||
@@ -796,12 +795,6 @@ namespace CalamityMod.CalPlayer
|
||||
if (npc.Calamity().tSad > 0)
|
||||
contactDamageReduction += 0.5;
|
||||
|
||||
if (npc.Calamity().relicOfResilienceWeakness > 0)
|
||||
{
|
||||
contactDamageReduction += Items.Weapons.Typeless.RelicOfResilience.WeaknessDR;
|
||||
npc.Calamity().relicOfResilienceWeakness = 0;
|
||||
}
|
||||
|
||||
if (eskimoSet)
|
||||
{
|
||||
if (npc.coldDamage)
|
||||
@@ -1513,6 +1506,16 @@ namespace CalamityMod.CalPlayer
|
||||
theBeeCooldown = TheBee.CooldownLength;
|
||||
}
|
||||
|
||||
// TODO: If possible, find a way to make it so parries don't activate the hit
|
||||
if (rOfResilienceCooldown == 0 && rOfResilienceEffect > 0 && hurtInfo.Damage > 1)
|
||||
{
|
||||
int cooldownTime = (Player.Calamity().profanedSoulRelicBuff ? 300 : 600);
|
||||
rOfResilienceCooldown = cooldownTime;
|
||||
Player.AddCooldown(Cooldowns.RelicOfResilienceCooldown.ID, cooldownTime);
|
||||
SoundStyle youGotHit = new("CalamityMod/Sounds/Custom/ProfanedGuardians/GuardianRockShieldActivate");
|
||||
SoundEngine.PlaySound(youGotHit with { Volume = 0.7f, Pitch = -0.1f }, Player.Center);
|
||||
}
|
||||
|
||||
if (alchFlask)
|
||||
{
|
||||
for (int i = 0; i < 9; i++)
|
||||
@@ -1598,6 +1601,30 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
}
|
||||
|
||||
if (rOfDelivarenceRam)
|
||||
{
|
||||
foreach (NPC n in Main.ActiveNPCs)
|
||||
{
|
||||
// Ignore critters with the Guide to Critter Companionship
|
||||
if (Player.dontHurtCritters && NPCID.Sets.CountsAsCritter[n.type])
|
||||
continue;
|
||||
|
||||
if (!n.dontTakeDamage && !n.friendly && n.Calamity().dashImmunityTime[Player.whoAmI] <= 0)
|
||||
{
|
||||
Rectangle npcHitbox = n.getRect();
|
||||
if ((Player.getRect()).Intersects(npcHitbox) && (n.noTileCollide || Collision.CanHit(Player.position, Player.width, Player.height, n.position, n.width, n.height)))
|
||||
{
|
||||
// 17APR2024: Ozzatron: This item gives iframes when passing through enemies for projectile safety.
|
||||
// This is a fixed and intentionally very low number of iframes, and is not boosted by Cross Necklace.
|
||||
n.Calamity().dashImmunityTime[Player.whoAmI] = 4;
|
||||
Player.GiveUniversalIFrames(InterstellarStompers.PassthroughIFrames, false);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If no other effects occurred, run vanilla code
|
||||
return base.FreeDodge(info);
|
||||
}
|
||||
@@ -1790,6 +1817,35 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
|
||||
SoundEngine.PlaySound(BlazingCore.ParrySuccessSound, Player.Center);
|
||||
|
||||
float power = 2;
|
||||
for (int i = 0; i < (int)(20 * power); i++)
|
||||
{
|
||||
if (Main.rand.NextBool())
|
||||
{
|
||||
Particle spark = new CustomSpark(Player.Center, ((new Vector2(19, 19) * power).RotatedByRandom(100)) * Main.rand.NextFloat(0.2f, 1f), "CalamityMod/Particles/ProvidenceMarkParticle", false, 47, Main.rand.NextFloat(1.15f, 1.3f) * power, Main.rand.NextBool(4) ? Color.Khaki : Color.Orange, new Vector2(1.3f, 0.5f), true, false, 0, false, false, Main.rand.NextFloat(0.1f, 0.2f));
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
}
|
||||
else
|
||||
{
|
||||
bool isSpark = Main.rand.NextBool(5);
|
||||
Dust dust = Dust.NewDustPerfect(Player.Center, isSpark ? 278 : ModContent.DustType<LightDust>(), ((new Vector2(15, 15) * power).RotatedByRandom(100)) * Main.rand.NextFloat(0.2f, 1f));
|
||||
dust.noGravity = true;
|
||||
dust.scale = Main.rand.NextFloat(0.85f, 1.15f) * power * (isSpark ? 0.5f : 1);
|
||||
dust.color = Main.rand.NextBool(5) ? Color.Khaki : Color.Goldenrod;
|
||||
if (isSpark)
|
||||
dust.noGravity = false;
|
||||
else
|
||||
dust.noLightEmittence = true;
|
||||
}
|
||||
}
|
||||
|
||||
Particle orb1 = new CustomPulse(Player.Center, Vector2.Zero, Color.Goldenrod, "CalamityMod/Particles/SoftRoundExplosion", new Vector2(1f, 0.8f), 0, 0, 0.14f * power, 25);
|
||||
GeneralParticleHandler.SpawnParticle(orb1);
|
||||
|
||||
Particle orb2 = new CustomPulse(Player.Center, Vector2.Zero, Color.Khaki, "CalamityMod/Particles/BloomRing", new Vector2(1f, 0.5f), 0, 0, 2.1f * power, 25);
|
||||
GeneralParticleHandler.SpawnParticle(orb2);
|
||||
|
||||
blazingCoreSuccessfulParry = 60;
|
||||
Player.AddCooldown(ParryCooldown.ID, 60 * 30, false, "blazingcore"); //cooldown is frames in seconds multiplied by the desired amount of seconds
|
||||
}
|
||||
|
||||
@@ -802,7 +802,15 @@ namespace CalamityMod.CalPlayer
|
||||
if (!blazingCursorDamage)
|
||||
return;
|
||||
|
||||
Rectangle sigilHitbox = Utils.CenteredRectangle(Main.MouseWorld, new Vector2(35f, 62f));
|
||||
// 14NOV2024: Ozzatron: was not sure whether to let Calamity function outside normal cursor range. decided on no
|
||||
//
|
||||
// Check whether the mouse cursor is within the acceptable clamped range. If it's not, don't allow for damage.
|
||||
Vector2 mouseTruePosition = Player.Calamity().mouseWorld;
|
||||
Vector2 mouseClampedPosition = Player.ClampedMouseWorld();
|
||||
if (mouseTruePosition != mouseClampedPosition)
|
||||
return;
|
||||
|
||||
Rectangle sigilHitbox = Utils.CenteredRectangle(mouseClampedPosition, new Vector2(35f, 62f));
|
||||
int sigilDamage = (int)Player.GetBestClassDamage().ApplyTo(Calamity.BaseDamage);
|
||||
|
||||
bool brightenedSigil = false;
|
||||
@@ -819,7 +827,7 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
// Draw an expanding orb effect on the cursor based on the cursor focus value.
|
||||
float cursorFocusRatio = target.Calamity().cursorFocus / (float)CalamityGlobalNPC.cursorFocusMax;
|
||||
StrongBloom indicator = new(Main.MouseWorld, Vector2.Zero, Color.Lerp(Color.Magenta, Color.Red, cursorFocusRatio), cursorFocusRatio * 0.7f, 2);
|
||||
StrongBloom indicator = new(mouseClampedPosition, Vector2.Zero, Color.Lerp(Color.Magenta, Color.Red, cursorFocusRatio), cursorFocusRatio * 0.7f, 2);
|
||||
GeneralParticleHandler.SpawnParticle(indicator);
|
||||
|
||||
if (target.Calamity().cursorFocus >= CalamityGlobalNPC.cursorFocusMax)
|
||||
@@ -1440,6 +1448,70 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
}
|
||||
|
||||
if (rOfResilienceEffect > 0)
|
||||
rOfResilienceEffect--;
|
||||
if (Player.HeldItem.type == ModContent.ItemType<RelicOfResilience>()) // All players close to a player holding RoR get the benefits
|
||||
{
|
||||
if (Player.ownedProjectileCounts[ModContent.ProjectileType<RelicGuard>()] < 1 && !Player.dead)
|
||||
{
|
||||
Projectile relic = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType<RelicGuard>(), 0, 0f, Player.whoAmI);
|
||||
}
|
||||
for (int index = 0; index < Main.player.Length; index++)
|
||||
{
|
||||
Player fella = Main.player[index];
|
||||
if (Utils.Distance(fella.Center, Player.Center) < 650 && fella.team == Player.team)
|
||||
{
|
||||
fella.Calamity().rOfResilienceEffect = (fella != Player ? 120 : 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (rOfResilienceEffect > 0)
|
||||
{
|
||||
if (Player.Calamity().mouseRight && rOfResilienceCooldown == 0)
|
||||
{
|
||||
int cooldownTime = (Player.Calamity().profanedSoulRelicBuff ? 300 : 600);
|
||||
rOfResilienceCooldown = cooldownTime;
|
||||
Player.AddCooldown(Cooldowns.RelicOfResilienceCooldown.ID, cooldownTime);
|
||||
SoundStyle y = new("CalamityMod/Sounds/Custom/ProfanedGuardians/GuardianRockShieldActivate");
|
||||
SoundEngine.PlaySound(y with { Volume = 0.7f, Pitch = -0.1f }, Player.Center);
|
||||
}
|
||||
|
||||
// Adds a floor for defense and dr at 150 and 10% respectivley, will not ignore defense damage
|
||||
if (Player.Calamity().rOfResilienceCooldown > 300 || Player.Calamity().rOfResilienceCooldown == 0)
|
||||
{
|
||||
float fadeStats = (Player.Calamity().rOfResilienceCooldown == 0 ? 1 : Utils.GetLerpValue(300, 600, Player.Calamity().rOfResilienceCooldown, true));
|
||||
int maxDefFloor = (int)(150 * fadeStats);
|
||||
float MaxDRFloor = 0.10f * fadeStats;
|
||||
if (Player.statDefense < maxDefFloor)
|
||||
Player.statDefense += maxDefFloor - Player.statDefense;
|
||||
if (Player.endurance < MaxDRFloor)
|
||||
Player.endurance += MaxDRFloor - Player.endurance;
|
||||
}
|
||||
|
||||
int numOfShards = 0;
|
||||
for (int x = 0; x < Main.maxProjectiles; x++)
|
||||
{
|
||||
Projectile projectile = Main.projectile[x];
|
||||
if (projectile.active && projectile.type == ModContent.ProjectileType<ArtifactOfResilienceShards>() && projectile.ai[1] == 0 && projectile.owner == Player.whoAmI)
|
||||
{
|
||||
numOfShards++;
|
||||
}
|
||||
}
|
||||
if (Player.miscCounter % (Player.Calamity().profanedSoulRelicBuff ? 4 : 8) == 0 && numOfShards < (Player.Calamity().profanedSoulRelicBuff ? 75 : 30) && Player.Calamity().rOfResilienceCooldown == 0)
|
||||
{
|
||||
if (numOfShards == 0)
|
||||
{
|
||||
rOfResilienceOrbitOffset = Main.rand.Next(0, 100 + 1);
|
||||
SoundStyle sound = new("CalamityMod/Sounds/Custom/ProfanedGuardians/GuardianDash");
|
||||
SoundEngine.PlaySound(sound with { Volume = 0.5f, Pitch = -0.3f }, Player.Center);
|
||||
}
|
||||
int shardDamage = (int)Player.GetBestClassDamage().ApplyTo(420);
|
||||
Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, new Vector2(1, 0), ModContent.ProjectileType<ArtifactOfResilienceShards>(), shardDamage, 0f, Player.whoAmI, 0, 0, numOfShards + 1);
|
||||
}
|
||||
}
|
||||
if (rOfResilienceCooldown > 0)
|
||||
rOfResilienceCooldown--;
|
||||
|
||||
if (unstableGraniteCore)
|
||||
{
|
||||
zapActivity += 1;
|
||||
@@ -3729,6 +3801,8 @@ namespace CalamityMod.CalPlayer
|
||||
int dmg = (int)Player.GetTotalDamage<MagicDamageClass>().ApplyTo(30);
|
||||
|
||||
Vector2 startPos = Player.RotatedRelativePoint(Player.MountedCenter, true);
|
||||
|
||||
// 14NOV2024: Ozzatron: clamped mouse position is inappropriate to apply here due to excessive use of decompiled vanilla shitcode
|
||||
Vector2 velocity = Main.MouseWorld - startPos;
|
||||
if (Player.gravDir == -1f)
|
||||
{
|
||||
|
||||
@@ -25,6 +25,7 @@ using CalamityMod.Projectiles.Typeless;
|
||||
using CalamityMod.Systems;
|
||||
using CalamityMod.Systems.Collections;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Mono.Cecil;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
@@ -137,16 +138,27 @@ namespace CalamityMod.CalPlayer
|
||||
ItemOnHit(item, damageDone, target.Center, hit.Crit, target.IsAnEnemy(false, true), targetIsDummy);
|
||||
NPCDebuffs(target, item.CountsAsClass<MeleeDamageClass>(), item.CountsAsClass<RangedDamageClass>(), item.CountsAsClass<MagicDamageClass>(), item.CountsAsClass<SummonDamageClass>(), item.CountsAsClass<ThrowingDamageClass>(), item.CountsAsClass<SummonMeleeSpeedDamageClass>());
|
||||
|
||||
// Ursa Sergeant slash cooldown is reset on kill
|
||||
if (ursaSergeant && target.life <= 0 && target.realLife == -1)
|
||||
ursaSergeantCooldown = (int)MathHelper.Clamp(ursaSergeantCooldown - 180, 0, 300);
|
||||
|
||||
// Arc Flash Ring lightning strike (Remember to change the one for projectile hits if applicable when you change this one!)
|
||||
// This one has a lot less limits than the projectile one, but that's because vanilla broadsword code is limiting (wow so surprising)
|
||||
if (arcFlashRing && (Main.rand.Next(0, 100) < 6))
|
||||
{
|
||||
var source = item.GetSource_FromThis();
|
||||
int damage = (int)((hit.Damage * 4f) * (hit.Crit ? 0.5f : 1)); // 400% damage (uneffected by crits)
|
||||
Vector2 position = target.Center + new Vector2(0, -750);
|
||||
|
||||
Projectile.NewProjectile(source, position, new Vector2(0, 10), ProjectileType<FlashBolt>(), damage, 0f, Player.whoAmI, target.whoAmI);
|
||||
}
|
||||
|
||||
// Shattered Community tracks all damage dealt with Rage Mode (ignoring dummies).
|
||||
if (targetIsDummy)
|
||||
return;
|
||||
|
||||
if (rageModeActive && shatteredCommunity)
|
||||
Player.GetModPlayer<ShatteredCommunityPlayer>().AccumulateRageDamage(damageDone);
|
||||
|
||||
// Ursa Sergeant slash cooldown is reset on kill
|
||||
if (ursaSergeant && target.life <= 0 && target.realLife == -1)
|
||||
ursaSergeantCooldown = (int)MathHelper.Clamp(ursaSergeantCooldown - UrsaSergeant.CooldownReducedPerKill, 0, UrsaSergeant.MaxCooldown);
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -275,6 +287,26 @@ namespace CalamityMod.CalPlayer
|
||||
if (ursaSergeant && target.life <= 0 && target.realLife == -1)
|
||||
ursaSergeantCooldown = (int)MathHelper.Clamp(ursaSergeantCooldown - UrsaSergeant.CooldownReducedPerKill, 0, UrsaSergeant.MaxCooldown);
|
||||
|
||||
CalamityGlobalProjectile globalProj = proj.Calamity();
|
||||
// Arc Flash Ring lightning strike (Remember to change the one for item hits if applicable when you change this one!)
|
||||
// Minions ignore the chance penalty on penetration
|
||||
bool spawnChance = (Main.rand.Next(0, 100) < MathHelper.Clamp(6 - proj.numHits, (proj.minion ? 6 : 1), 6));
|
||||
if (arcFlashRing && spawnChance && proj.type != ProjectileType<FlashBolt>() && globalProj.spawnArcFlash)
|
||||
{
|
||||
proj.active = true; // Okay so if a projectile manually kills itself on hit, it totally breaks the bolts. to prevent this we set them to active
|
||||
|
||||
var source = proj.GetSource_FromThis();
|
||||
int damage = (int)((hit.Damage * 4f) * (hit.Crit ? 0.5f : 1)); // 400% damage (uneffected by crits)
|
||||
Vector2 position = target.Center + new Vector2(0, -750);
|
||||
|
||||
Projectile bolt = Projectile.NewProjectileDirect(source, position, new Vector2(0, 10), ProjectileType<FlashBolt>(), damage, 0f, Player.whoAmI, target.whoAmI);
|
||||
bolt.DamageType = hit.DamageType;
|
||||
|
||||
globalProj.spawnArcFlash = false;
|
||||
// This is really only used for long lasting projectiles and contact damage minions
|
||||
globalProj.arcFlashCooldown = 90;
|
||||
}
|
||||
|
||||
if (!proj.npcProj && !proj.trap && proj.friendly)
|
||||
{
|
||||
if ((plaguebringerCarapace || uberBees) && FriendlyBeesList.Includes(proj.type))
|
||||
|
||||
@@ -9,7 +9,6 @@ using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using Terraria.ModLoader;
|
||||
using static Humanizer.In;
|
||||
|
||||
namespace CalamityMod.CalPlayer.Dashes
|
||||
{
|
||||
@@ -48,6 +47,11 @@ namespace CalamityMod.CalPlayer.Dashes
|
||||
dust.velocity = -player.velocity * Main.rand.NextFloat(0.6f, 1.4f);
|
||||
dust.scale = Main.rand.NextFloat(0.9f, 1.4f);
|
||||
dust.noGravity = true;
|
||||
if (d < 1)
|
||||
{
|
||||
Particle spark = new CustomSpark(player.Center + new Vector2(Main.rand.NextFloat(-6f, 6f), Main.rand.NextFloat(-15f, 15f)) - (player.velocity * 1.2f), -player.velocity.RotatedByRandom(MathHelper.ToRadians(10f)) * Main.rand.NextFloat(0.1f, 0.8f), "CalamityMod/Particles/ProvidenceMarkParticle", false, 17, Main.rand.NextFloat(1.15f, 1.25f), Main.rand.NextBool(4) ? Color.Khaki : Color.Orange, new Vector2(1.3f, 0.5f), true, false, 0, false, false, Main.rand.NextFloat(0.4f, 0.5f));
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
}
|
||||
}
|
||||
// Dash at a faster speed than the default value.
|
||||
dashSpeed = 14f;
|
||||
|
||||
@@ -98,6 +98,10 @@ namespace CalamityMod.CalPlayer.DrawLayers
|
||||
glowMask = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Ranged/VernalBolterGlow").Value;
|
||||
else if (itemType == ModContent.ItemType<VividClarity>())
|
||||
glowMask = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Magic/VividClarityGlow").Value;
|
||||
else if (itemType == ModContent.ItemType<TelluricGlare>())
|
||||
glowMask = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Ranged/TelluricGlareGlow").Value;
|
||||
else if (itemType == ModContent.ItemType<BlissfulBombardier>())
|
||||
glowMask = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Ranged/BlissfulBombardierGlow").Value;
|
||||
|
||||
if (glowMask == default)
|
||||
return;
|
||||
|
||||
@@ -3,12 +3,12 @@ using Terraria.Localization;
|
||||
|
||||
namespace CalamityMod.Cooldowns
|
||||
{
|
||||
public class RelicOfResilience : CooldownHandler
|
||||
public class RelicOfResilienceCooldown : CooldownHandler
|
||||
{
|
||||
public static new string ID => "RelicOfResilience";
|
||||
public static new string ID => "RelicOfResilienceCooldown";
|
||||
public override bool ShouldDisplay => true;
|
||||
public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}");
|
||||
public override string Texture => "CalamityMod/Cooldowns/RelicOfResilience";
|
||||
public override string Texture => "CalamityMod/Cooldowns/RelicOfResilienceCooldown";
|
||||
public override Color OutlineColor => new Color(255, 191, 73);
|
||||
public override Color CooldownStartColor => new Color(122, 66, 59);
|
||||
public override Color CooldownEndColor => new Color(165, 103, 87);
|
||||
|
Before Width: | Height: | Size: 315 B After Width: | Height: | Size: 315 B |
|
Before Width: | Height: | Size: 191 B After Width: | Height: | Size: 191 B |
|
Before Width: | Height: | Size: 173 B After Width: | Height: | Size: 173 B |
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using static Terraria.ModLoader.ModContent;
|
||||
|
||||
namespace CalamityMod.Cooldowns
|
||||
{
|
||||
public class WarbanneroftheRighteousBuff : CooldownHandler
|
||||
{
|
||||
public float CompletionPercentage => Utils.GetLerpValue(80, 0, instance.timeLeft);
|
||||
private bool IsEmpty => CompletionPercentage == 0;
|
||||
private float TextXOffset => (instance.timeLeft <= 20 ? -11 : -18f);
|
||||
private Vector2 TextPosition => new(TextXOffset, 15);
|
||||
private Color TextColor => Color.White;
|
||||
private Color TextBorderColor => Color.Black;
|
||||
|
||||
public static new string ID => "WarbanneroftheRighteousBuff";
|
||||
public override bool CanTickDown => false;
|
||||
public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}");
|
||||
public override bool ShouldDisplay => instance.player.Calamity().WarbanneroftheRighteous;
|
||||
public override string Texture => "CalamityMod/Cooldowns/" + ID;
|
||||
|
||||
public override Color CooldownStartColor => IsEmpty ? Color.DimGray : Color.Lerp(Color.SlateGray, Color.DarkGoldenrod, CompletionPercentage);
|
||||
public override Color CooldownEndColor => IsEmpty ? Color.DimGray : Color.Lerp(Color.SlateGray, Color.Gold, CompletionPercentage);
|
||||
|
||||
public override void DrawExpanded(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale)
|
||||
{
|
||||
base.DrawExpanded(spriteBatch, position, opacity, scale);
|
||||
|
||||
CalamityUtils.DrawBorderStringEightWay(spriteBatch, FontAssets.MouseText.Value, (-instance.timeLeft + 20).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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
@@ -495,6 +495,8 @@ namespace CalamityMod.DataStructures
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item78);
|
||||
int damage = (int)player.GetTotalDamage<MeleeDamageClass>().ApplyTo(OmegaBiomeBlade.WhirlwindAttunement_PassiveBaseDamage);
|
||||
|
||||
// 14NOV2024: Ozzatron: clamped mouse world unnecessary here, just used for direction
|
||||
Projectile beamSword = Projectile.NewProjectileDirect(source, player.Center, player.SafeDirectionTo(Main.MouseWorld, Vector2.One) * 15f, ProjectileType<SwordsmithsPrideBeam>(), damage, 10f, player.whoAmI, 1f);
|
||||
beamSword.timeLeft = 50;
|
||||
UseTimer++;
|
||||
@@ -638,7 +640,7 @@ namespace CalamityMod.DataStructures
|
||||
if (UseTimer % 500 == 449)
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item78);
|
||||
Projectile.NewProjectile(source, Main.MouseWorld, Vector2.Zero, ProjectileType<GalaxiaTropicRing>(), 0, 0f, player.whoAmI, 1f);
|
||||
Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, ProjectileType<GalaxiaTropicRing>(), 0, 0f, player.whoAmI, 1f);
|
||||
UseTimer++;
|
||||
}
|
||||
}
|
||||
@@ -672,7 +674,7 @@ namespace CalamityMod.DataStructures
|
||||
if (UseTimer % 500 == 449)
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item78);
|
||||
Projectile.NewProjectile(source, Main.MouseWorld, Vector2.Zero, ProjectileType<GalaxiaTropicRing>(), 0, 0f, player.whoAmI, 1f);
|
||||
Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, ProjectileType<GalaxiaTropicRing>(), 0, 0f, player.whoAmI, 1f);
|
||||
UseTimer++;
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 406 B After Width: | Height: | Size: 406 B |
|
Before Width: | Height: | Size: 503 B After Width: | Height: | Size: 503 B |
|
Before Width: | Height: | Size: 670 B After Width: | Height: | Size: 670 B |
@@ -38,6 +38,12 @@ namespace CalamityMod.ExtraTextures
|
||||
public static Asset<Texture2D> LuckIconVanilla;
|
||||
public static Asset<Texture2D> LuckIconLesser;
|
||||
|
||||
// Particles
|
||||
public static Asset<Texture2D> CircularSmear;
|
||||
public static Asset<Texture2D> CircularSmearFire1;
|
||||
public static Asset<Texture2D> CircularSmearFire2;
|
||||
public static Asset<Texture2D> CircularSmearFire3;
|
||||
|
||||
// Boss Heads
|
||||
// I know it's not exactly a Texture2D but it belongs to ExtraTextures.
|
||||
public static int BossHeadIndex_ChadPrime;
|
||||
@@ -70,6 +76,11 @@ namespace CalamityMod.ExtraTextures
|
||||
LuckIconGreater = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBuffs/LuckyGreater", AssetRequestMode.AsyncLoad);
|
||||
LuckIconVanilla = TextureAssets.Buff[BuffID.Lucky];
|
||||
LuckIconLesser = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBuffs/LuckyLesser", AssetRequestMode.AsyncLoad);
|
||||
|
||||
CircularSmear = ModContent.Request<Texture2D>("CalamityMod/Particles/CircularSmear", AssetRequestMode.AsyncLoad);
|
||||
CircularSmearFire1 = ModContent.Request<Texture2D>("CalamityMod/Particles/CircularSmearFire1", AssetRequestMode.AsyncLoad);
|
||||
CircularSmearFire2 = ModContent.Request<Texture2D>("CalamityMod/Particles/CircularSmearFire2", AssetRequestMode.AsyncLoad);
|
||||
CircularSmearFire3 = ModContent.Request<Texture2D>("CalamityMod/Particles/CircularSmearFire3", AssetRequestMode.AsyncLoad);
|
||||
}
|
||||
|
||||
public override void Unload()
|
||||
|
||||
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 587 B |
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
@@ -118,7 +117,7 @@ namespace CalamityMod.Graphics.Renderers
|
||||
var renderers = Renderers.Where(renderer => renderer.ShouldDraw && renderer.Layer is DrawLayer.NPC);
|
||||
|
||||
Main.spriteBatch.End();
|
||||
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer);
|
||||
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise);
|
||||
|
||||
foreach (var renderer in renderers)
|
||||
renderer.DrawTarget(Main.spriteBatch);
|
||||
@@ -132,7 +131,7 @@ namespace CalamityMod.Graphics.Renderers
|
||||
|
||||
var renderers = Renderers.Where(renderer => renderer.ShouldDraw && renderer.Layer is DrawLayer.Projectile);
|
||||
|
||||
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer);
|
||||
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise);
|
||||
|
||||
foreach (var renderer in renderers)
|
||||
renderer.DrawTarget(Main.spriteBatch);
|
||||
@@ -146,7 +145,7 @@ namespace CalamityMod.Graphics.Renderers
|
||||
|
||||
var renderers = Renderers.Where(renderer => renderer.ShouldDraw && renderer.Layer is DrawLayer.Player);
|
||||
|
||||
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer);
|
||||
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise);
|
||||
|
||||
foreach (var renderer in renderers)
|
||||
renderer.DrawTarget(Main.spriteBatch);
|
||||
@@ -159,13 +158,13 @@ namespace CalamityMod.Graphics.Renderers
|
||||
var renderers = Renderers.Where(renderer => renderer.ShouldDraw && renderer.Layer is DrawLayer.BeforeTiles);
|
||||
|
||||
Main.spriteBatch.End();
|
||||
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer);
|
||||
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise);
|
||||
|
||||
foreach (var renderer in renderers)
|
||||
renderer.DrawTarget(Main.spriteBatch);
|
||||
|
||||
Main.spriteBatch.End();
|
||||
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.Transform);
|
||||
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise, null, Main.Transform);
|
||||
|
||||
orig(self);
|
||||
}
|
||||
@@ -175,12 +174,12 @@ namespace CalamityMod.Graphics.Renderers
|
||||
var renderers = Renderers.Where(renderer => renderer.ShouldDraw && renderer.Layer is DrawLayer.AfterEverything);
|
||||
|
||||
Main.spriteBatch.End();
|
||||
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer);
|
||||
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise);
|
||||
foreach (var renderer in renderers)
|
||||
renderer.DrawTarget(Main.spriteBatch);
|
||||
|
||||
Main.spriteBatch.End();
|
||||
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.Transform);
|
||||
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise, null, Main.Transform);
|
||||
orig(self);
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -181,6 +181,7 @@ namespace CalamityMod.ILEditing
|
||||
IL_WorldGen.Chlorophyte += AdjustChlorophyteSpawnLimits;
|
||||
IL_UIWorldCreation.SetDefaultOptions += ChangeDefaultWorldSize;
|
||||
IL_UIWorldCreation.AddWorldSizeOptions += SwapSmallDescriptionKey;
|
||||
IL_UIWorldCreation.AddWorldDifficultyOptions += SwapMasterModeDescriptionKey;
|
||||
Terraria.IO.On_WorldFile.ClearTempTiles += ClearModdedTempTiles;
|
||||
On_WorldGen.MakeDungeon += LimitDungeonEntranceXPosition;
|
||||
IL_WorldGen.DungeonHalls += LimitDungeonHallsXPosition;
|
||||
|
||||
@@ -161,7 +161,7 @@ namespace CalamityMod.ILEditing
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Change Small World Description
|
||||
#region Change World Generation Descriptions
|
||||
/// <summary>
|
||||
/// Changes the description of Small worlds to serve as a warning.
|
||||
/// </summary>
|
||||
@@ -181,6 +181,28 @@ namespace CalamityMod.ILEditing
|
||||
|
||||
// Emit our new string "Mods.CalamityMod.UI.SmallWorldWarning".
|
||||
c.Emit(OpCodes.Ldstr, "Mods.CalamityMod.UI.SmallWorldWarning");
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Changes the description of Master Mode to mention boss changes.
|
||||
/// </summary>
|
||||
private static void SwapMasterModeDescriptionKey(ILContext il)
|
||||
{
|
||||
// Swap vanilla's Master Mode description string (UI.WorldDescriptionMaster) with Calamity's edited version (Mods.CalamityMod.UI.WorldMaster).
|
||||
var cursor = new ILCursor(il);
|
||||
|
||||
// Move to after the string.
|
||||
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdstr("UI.WorldDescriptionMaster")))
|
||||
{
|
||||
LogFailure("Change Master Mode Description", "Could not match string \"UI.WorldDescriptionMaster\".");
|
||||
return;
|
||||
}
|
||||
|
||||
// Pop this value off, then replace it with Calamity's new string.
|
||||
cursor.EmitPop();
|
||||
cursor.Emit(OpCodes.Ldstr, "Mods.CalamityMod.UI.WorldMaster");
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ namespace CalamityMod.Items.Accessories
|
||||
public class AbyssalMirror : ModItem, ILocalizedModType, IHoldShiftTooltipItem
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
public bool HasFlavorTooltip => true;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 30;
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Rarities;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public class ArcFlashRing : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 32;
|
||||
Item.height = 34;
|
||||
Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice;
|
||||
Item.rare = ModContent.RarityType<Turquoise>();
|
||||
Item.accessory = true;
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.arcFlashRing = true;
|
||||
if (!hideVisual)
|
||||
modPlayer.arcFlashRingVisual = true;
|
||||
else
|
||||
modPlayer.arcFlashRingVisual = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 888 B |
@@ -37,7 +37,7 @@ namespace CalamityMod.Items.Accessories
|
||||
CreateRecipe().
|
||||
AddIngredient(ItemID.EmpressFlightBooster).
|
||||
AddIngredient<EffulgentFeather>(5).
|
||||
AddIngredient<RuinousSoul>(5).
|
||||
AddIngredient<DivineGeode>(5).
|
||||
AddIngredient(ItemID.SoulofFlight, 10).
|
||||
AddTile(TileID.LunarCraftingStation).
|
||||
Register();
|
||||
|
||||
@@ -40,6 +40,7 @@ namespace CalamityMod.Items.Accessories
|
||||
var empowered = calPlayer.flameLickedShellEmpoweredParry;
|
||||
|
||||
NPC target = player.Center.ClosestNPCAt(1300f, true, true);
|
||||
// 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction
|
||||
Vector2 targetPosition = target?.Center ?? Main.MouseWorld;
|
||||
float projectileSpeed = 8f;
|
||||
|
||||
|
||||
@@ -247,7 +247,8 @@ namespace CalamityMod.Items.Accessories
|
||||
modPlayer.profanedCrystalAnim = maxPscAnimTime;
|
||||
Projectile.NewProjectile(player.GetSource_FromThis(), player.Center, Vector2.Zero, ModContent.ProjectileType<PscTransformAnimation>(), 0, 0f, player.whoAmI);
|
||||
}
|
||||
|
||||
if (DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs)
|
||||
player.Calamity().profanedSoulRelicBuff = true;
|
||||
|
||||
modPlayer.profanedCrystalHide = hideVisual || modPlayer.profanedCrystalAnim > 0;
|
||||
modPlayer.pSoulShieldVisible = !hideVisual;
|
||||
@@ -291,6 +292,8 @@ namespace CalamityMod.Items.Accessories
|
||||
player.Calamity().profanedSoulWeaponType = weaponType;
|
||||
player.Calamity().profanedSoulWeaponUsage = 0;
|
||||
}
|
||||
|
||||
// 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction
|
||||
Vector2 correctedVelocity = Main.MouseWorld - player.Center;
|
||||
correctedVelocity.Normalize();
|
||||
bool empowered = player.Calamity().pscState == (int)ProfanedSoulCrystalState.Empowered;
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Cooldowns;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.NPCs.NormalNPCs;
|
||||
using CalamityMod.Projectiles.Summon;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Mono.Cecil;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using static Terraria.ModLoader.ModContent;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
[AutoloadEquip(EquipType.Balloon)]
|
||||
[LegacyName("SamuraiBadge")]
|
||||
[LegacyName("WarbanneroftheSun")]
|
||||
public class WarbanneroftheRighteous : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
internal const float MaxBonus = 0.8f;
|
||||
internal const float MaxDistance = 350f;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 5));
|
||||
ItemID.Sets.AnimatesAsSoul[Type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 32;
|
||||
Item.height = 78;
|
||||
Item.value = CalamityGlobalItem.RarityPurpleBuyPrice;
|
||||
Item.rare = ItemRarityID.Purple;
|
||||
Item.accessory = true;
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.WarbanneroftheRighteous = true;
|
||||
|
||||
modPlayer.warbannerGlow = !hideVisual;
|
||||
|
||||
if (player.ownedProjectileCounts[ProjectileType<WarbannerLight>()] < 1 && !hideVisual && !player.dead)
|
||||
{
|
||||
Projectile light = Projectile.NewProjectileDirect(player.GetSource_FromThis(), player.Center, Vector2.Zero, ProjectileType<WarbannerLight>(), 0, 0f, player.whoAmI);
|
||||
}
|
||||
|
||||
int maxValue = (int)(MaxBonus * 100);
|
||||
float bonus = CalculateBonus(player) - 0.6f;
|
||||
float displayBonus = (int)((bonus + 0.6f) * 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;
|
||||
|
||||
int targetCount = 0;
|
||||
foreach (NPC npc in Main.ActiveNPCs) // More targets gradually reduces the burn damage for ALL targets
|
||||
{
|
||||
if (npc.Calamity().warbannerBurnMarked)
|
||||
targetCount++;
|
||||
}
|
||||
for (int index = 0; index < Main.npc.Length; index++)
|
||||
{
|
||||
NPC nPC = Main.npc[index];
|
||||
float generousHitboxWidth = Math.Max(nPC.Hitbox.Width / 2f, nPC.Hitbox.Height / 2f) + (100 + 80 * Utils.GetLerpValue(0, 200, Math.Max(nPC.Hitbox.Width / 2f, nPC.Hitbox.Height / 2f))); // Adds some room so max bonus isnt when you're ON the hitbox
|
||||
float intensity = Utils.Remap(Utils.Distance(player.Center, nPC.Center), MaxDistance + generousHitboxWidth, generousHitboxWidth, 1, 3, true); // We have to have this seperate from bonus, otherwise all effected enemies take damage based on the closest enemy
|
||||
|
||||
if (Utils.Distance(nPC.Center, player.Center) < MaxDistance + generousHitboxWidth && (nPC.IsAnEnemy(true, true, false) || nPC.type == ModContent.NPCType<SuperDummyNPC>()) && nPC.CanBeChasedBy())
|
||||
{
|
||||
float minDamageMult = 0.35f;
|
||||
int maxTargets = 25;
|
||||
float damageMult = Utils.Remap(targetCount, maxTargets, 1, minDamageMult, 1);
|
||||
|
||||
// Handles giving the Warbanner Burn effect
|
||||
CalamityGlobalNPC modNPC = nPC.Calamity();
|
||||
if (!modNPC.warbannerBurnMarked)
|
||||
{
|
||||
modNPC.warbannerBurnDirection = Utils.DirectionTo(player.Center, nPC.Center);
|
||||
modNPC.warbannerBurnMarked = true;
|
||||
modNPC.warbannerBurnTimer = 2;
|
||||
}
|
||||
if (modNPC.warbannerBurnMarked)
|
||||
{
|
||||
modNPC.warbannerBurnIntensity = intensity;
|
||||
modNPC.warbannerBurnDirection = Utils.DirectionTo(player.Center, nPC.Center);
|
||||
int burnDamage = (int)player.GetBestClassDamage().ApplyTo(47 * damageMult); // There is up to a 3x multiplier on this damage depending on distance from the enemy
|
||||
modNPC.warbannerBurnDamage = burnDamage;
|
||||
modNPC.warbannerBurnStacks++;
|
||||
modNPC.warbannerBurnTimer++;
|
||||
modNPC.warbannerBurnHideEffects = hideVisual;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static float CalculateBonus(Player player)
|
||||
{
|
||||
float bonus = 0f;
|
||||
|
||||
NPC closestTarget = player.Center.ClosestNPCAt(MaxDistance * 7); // extra range is to account for bonus range from massive targets
|
||||
if (closestTarget != null)
|
||||
{
|
||||
float generousHitboxWidth = Math.Max(closestTarget.Hitbox.Width / 2f, closestTarget.Hitbox.Height / 2f) + (100 + 80 * Utils.GetLerpValue(0, 200, Math.Max(closestTarget.Hitbox.Width / 2f, closestTarget.Hitbox.Height / 2f))); // Adds some room so max bonus isnt when you're ON the hitbox
|
||||
bonus = Utils.Remap(Utils.Distance(player.Center, closestTarget.Center), MaxDistance + generousHitboxWidth, generousHitboxWidth, 0, MaxBonus, true);
|
||||
}
|
||||
else
|
||||
bonus = 0;
|
||||
|
||||
return bonus;
|
||||
}
|
||||
|
||||
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
|
||||
{
|
||||
CalamityUtils.DrawInventoryCustomScale(
|
||||
spriteBatch,
|
||||
texture: TextureAssets.Item[Type].Value,
|
||||
position,
|
||||
frame,
|
||||
drawColor,
|
||||
itemColor,
|
||||
origin,
|
||||
scale,
|
||||
wantedScale: 0.6f,
|
||||
drawOffset: new(0f, -2f)
|
||||
);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
@@ -1,113 +0,0 @@
|
||||
using System;
|
||||
using CalamityMod.CalPlayer;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
[AutoloadEquip(EquipType.Balloon)]
|
||||
[LegacyName("SamuraiBadge")]
|
||||
public class WarbanneroftheSun : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
internal const float MaxBonus = 0.2f;
|
||||
internal const float MaxDistance = 480f;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 5));
|
||||
ItemID.Sets.AnimatesAsSoul[Type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 32;
|
||||
Item.height = 78;
|
||||
Item.value = CalamityGlobalItem.RarityPurpleBuyPrice;
|
||||
Item.rare = ItemRarityID.Purple;
|
||||
Item.accessory = true;
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.warbannerOfTheSun = true;
|
||||
|
||||
float bonus = CalculateBonus(player);
|
||||
player.GetAttackSpeed<MeleeDamageClass>() += bonus;
|
||||
player.GetDamage<MeleeDamageClass>() += bonus;
|
||||
player.GetDamage<TrueMeleeDamageClass>() += bonus;
|
||||
}
|
||||
|
||||
private static float CalculateBonus(Player player)
|
||||
{
|
||||
float bonus = 0f;
|
||||
|
||||
int closestNPC = -1;
|
||||
foreach (NPC nPC in Main.ActiveNPCs)
|
||||
{
|
||||
if (nPC.IsAnEnemy() && !nPC.dontTakeDamage)
|
||||
{
|
||||
closestNPC = nPC.whoAmI;
|
||||
break;
|
||||
}
|
||||
}
|
||||
float distance = -1f;
|
||||
foreach (NPC nPC in Main.ActiveNPCs)
|
||||
{
|
||||
if (nPC.IsAnEnemy() && !nPC.dontTakeDamage)
|
||||
{
|
||||
float distance2 = Math.Abs(nPC.position.X + (float)(nPC.width / 2) - (player.position.X + (float)(player.width / 2))) + Math.Abs(nPC.position.Y + (float)(nPC.height / 2) - (player.position.Y + (float)(player.height / 2)));
|
||||
if (distance == -1f || distance2 < distance)
|
||||
{
|
||||
distance = distance2;
|
||||
closestNPC = nPC.whoAmI;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (closestNPC != -1)
|
||||
{
|
||||
NPC actualClosestNPC = Main.npc[closestNPC];
|
||||
|
||||
float generousHitboxWidth = Math.Max(actualClosestNPC.Hitbox.Width / 2f, actualClosestNPC.Hitbox.Height / 2f);
|
||||
float hitboxEdgeDist = actualClosestNPC.Distance(player.Center) - generousHitboxWidth;
|
||||
|
||||
if (hitboxEdgeDist < 0)
|
||||
hitboxEdgeDist = 0;
|
||||
|
||||
if (hitboxEdgeDist < MaxDistance)
|
||||
{
|
||||
bonus = MathHelper.Lerp(0f, MaxBonus, 1f - (hitboxEdgeDist / MaxDistance));
|
||||
|
||||
if (bonus > MaxBonus)
|
||||
bonus = MaxBonus;
|
||||
}
|
||||
}
|
||||
|
||||
return bonus;
|
||||
}
|
||||
|
||||
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
|
||||
{
|
||||
CalamityUtils.DrawInventoryCustomScale(
|
||||
spriteBatch,
|
||||
texture: TextureAssets.Item[Type].Value,
|
||||
position,
|
||||
frame,
|
||||
drawColor,
|
||||
itemColor,
|
||||
origin,
|
||||
scale,
|
||||
wantedScale: 0.6f,
|
||||
drawOffset: new(0f, -2f)
|
||||
);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,9 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using System.Collections.Generic;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Items.Accessories.Vanity;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Rarities;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
@@ -25,14 +29,68 @@ namespace CalamityMod.Items.Accessories.Wings
|
||||
Item.rare = ModContent.RarityType<Turquoise>();
|
||||
Item.accessory = true;
|
||||
}
|
||||
|
||||
public override void UpdateVanity(Player player)
|
||||
{
|
||||
DrawWingEffects(player);
|
||||
}
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
player.moveSpeed += 0.1f;
|
||||
player.lavaImmune = true;
|
||||
player.noFallDmg = true;
|
||||
modPlayer.elysianWingsDust = !hideVisual;
|
||||
modPlayer.elysianWingsDust = false;
|
||||
|
||||
if (!hideVisual)
|
||||
DrawWingEffects(player);
|
||||
}
|
||||
private void DrawWingEffects(Player player)
|
||||
{
|
||||
float rate = Main.GlobalTimeWrappedHourly * 2;
|
||||
List<Color> eColors = new List<Color>()
|
||||
{
|
||||
Color.Gold,
|
||||
Color.Khaki
|
||||
};
|
||||
|
||||
int colorIndex = (int)(rate / 2 % eColors.Count);
|
||||
Color currentColor = eColors[colorIndex];
|
||||
Color nextColor = eColors[(colorIndex + 1) % eColors.Count];
|
||||
Color usedColor = Color.Lerp(currentColor, nextColor, rate % 2f > 1f ? 1f : rate % 1f);
|
||||
|
||||
|
||||
Vector2 spawnPos = player.Center + new Vector2(-25 * player.direction, 0);
|
||||
Lighting.AddLight(spawnPos, usedColor.ToVector3() * 1.2f);
|
||||
|
||||
if (player.wingTime > 0f && player.jump == 0 && player.velocity.Y != 0f)
|
||||
{
|
||||
spawnPos = player.Center + new Vector2(-25 * player.direction, 0) + Main.rand.NextVector2Circular(20, 20);
|
||||
Vector2 spawnPos2 = player.Center + new Vector2(15 * player.direction, 0) + Main.rand.NextVector2Circular(20, 20);
|
||||
|
||||
float partScale = Main.rand.NextFloat(0.3f, 0.8f);
|
||||
Vector2 partVel = new Vector2(0, 5).RotatedBy(0.5f * player.direction).RotatedByRandom(0.5f) * Main.rand.NextFloat(0.5f, 0.8f);
|
||||
|
||||
Particle smoke = new CustomSpark(spawnPos, partVel, "CalamityMod/Particles/SmallBloom", false, 13, partScale * 0.25f, usedColor * 0.4f, Vector2.One, true, false, 0, false, false);
|
||||
GeneralParticleHandler.SpawnParticle(smoke);
|
||||
|
||||
if (Main.rand.NextBool((player.controlJump ? 2 : 4)))
|
||||
{
|
||||
Particle spark3 = new CustomSpark(spawnPos, partVel, "CalamityMod/Particles/ProvidenceMarkParticle", false, 19, partScale, Main.rand.NextBool(4) ? Color.Khaki : Color.Goldenrod, new Vector2(1.3f, 0.5f), true, false, 0, false, false, Main.rand.NextFloat(0.1f, 0.2f));
|
||||
GeneralParticleHandler.SpawnParticle(spark3);
|
||||
}
|
||||
|
||||
if (Main.rand.NextBool())
|
||||
{
|
||||
Particle smoke2 = new CustomSpark(spawnPos2, partVel, "CalamityMod/Particles/SmallBloom", false, 13, partScale * 0.15f, usedColor * 0.4f, Vector2.One, true, false, 0, false, false);
|
||||
GeneralParticleHandler.SpawnParticle(smoke2);
|
||||
if (Main.rand.NextBool((player.controlJump ? 2 : 4)))
|
||||
{
|
||||
Particle spark3 = new CustomSpark(spawnPos2, partVel, "CalamityMod/Particles/ProvidenceMarkParticle", false, 19, partScale * 0.7f, Main.rand.NextBool(4) ? Color.Khaki : Color.Goldenrod, new Vector2(1.3f, 0.5f), true, false, 0, false, false, Main.rand.NextFloat(0.1f, 0.2f));
|
||||
GeneralParticleHandler.SpawnParticle(spark3);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend)
|
||||
|
||||
|
After Width: | Height: | Size: 566 B |
|
After Width: | Height: | Size: 1.8 KiB |
@@ -425,6 +425,7 @@ namespace CalamityMod.Items.Accessories
|
||||
SoundEngine.PlaySound(WulfrumAcrobaticsPack.ShootSound, Player.Center);
|
||||
if (Player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
// 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction
|
||||
Vector2 velocity = (Main.MouseWorld - Player.Center).SafeNormalize(Vector2.One) * GrappleVelocity;
|
||||
Projectile.NewProjectile(Player.GetSource_ItemUse(PackItem), Player.Center, velocity, ProjectileType<WulfrumHook>(), 0, 0, Player.whoAmI);
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@ namespace CalamityMod.Items.Armor.Hydrothermic
|
||||
|
||||
public override void UpdateEquip(Player player)
|
||||
{
|
||||
player.Calamity().rogueAmmoCost *= 0.5f;
|
||||
player.GetDamage<ThrowingDamageClass>() += 0.12f;
|
||||
player.GetCritChance<ThrowingDamageClass>() += 10;
|
||||
player.moveSpeed += 0.05f;
|
||||
|
||||
@@ -40,7 +40,6 @@ namespace CalamityMod.Items.Armor.Statigel
|
||||
|
||||
public override void UpdateEquip(Player player)
|
||||
{
|
||||
player.Calamity().rogueAmmoCost *= 0.66f;
|
||||
player.GetDamage<ThrowingDamageClass>() += 0.1f;
|
||||
player.GetCritChance<ThrowingDamageClass>() += 7;
|
||||
player.moveSpeed += 0.05f;
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace CalamityMod.Items.Armor.Tarragon
|
||||
public override void UpdateEquip(Player player)
|
||||
{
|
||||
player.GetDamage<MeleeDamageClass>() += 0.12f;
|
||||
player.GetCritChance<MeleeDamageClass>() += 10;
|
||||
player.GetCritChance<MeleeDamageClass>() += 7;
|
||||
player.endurance += 0.1f;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@ namespace CalamityMod.Items.Armor.TitanHeart
|
||||
public override void UpdateEquip(Player player)
|
||||
{
|
||||
player.Calamity().titanHeartMantle = true;
|
||||
player.Calamity().rogueAmmoCost *= 0.55f;
|
||||
// 15% attack speed penalty
|
||||
player.GetAttackSpeed<ThrowingDamageClass>() -= 0.15f;
|
||||
}
|
||||
|
||||
@@ -263,12 +263,14 @@ namespace CalamityMod.Items
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
var playerSource = player.GetSource_FromThis();
|
||||
Vector2 mouse = player.ClampedMouseWorld();
|
||||
|
||||
if (Main.myPlayer == player.whoAmI && player.Calamity().cursedSummonsEnchant)
|
||||
{
|
||||
if (NPC.CountNPCS(ModContent.NPCType<CalamitasEnchantDemon>()) < 2)
|
||||
{
|
||||
CalamityNetcode.NewNPC_ClientSide(Main.MouseWorld, ModContent.NPCType<CalamitasEnchantDemon>(), player);
|
||||
SoundEngine.PlaySound(SoundID.DD2_DarkMageSummonSkeleton, Main.MouseWorld);
|
||||
CalamityNetcode.NewNPC_ClientSide(mouse, ModContent.NPCType<CalamitasEnchantDemon>(), player);
|
||||
SoundEngine.PlaySound(SoundID.DD2_DarkMageSummonSkeleton, mouse);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -287,7 +289,7 @@ namespace CalamityMod.Items
|
||||
int monsterDamage = (int)player.GetTotalDamage<MagicDamageClass>().ApplyTo(remainingMana * damagePerManaConsumed);
|
||||
|
||||
// Spawn the Mana Monster
|
||||
Vector2 shootVelocity = player.SafeDirectionTo(Main.MouseWorld, -Vector2.UnitY).RotatedByRandom(0.07f) * Main.rand.NextFloat(4f, 5f);
|
||||
Vector2 shootVelocity = player.SafeDirectionTo(mouse, -Vector2.UnitY).RotatedByRandom(0.07f) * Main.rand.NextFloat(4f, 5f);
|
||||
Projectile.NewProjectile(source, player.Center + shootVelocity, shootVelocity, ModContent.ProjectileType<ManaMonster>(), monsterDamage, 0f, player.whoAmI);
|
||||
|
||||
// Set the player's mana to zero.
|
||||
@@ -694,6 +696,7 @@ namespace CalamityMod.Items
|
||||
if (p.type == ModContent.ProjectileType<IgneousBlade>() && p.owner == player.whoAmI && p.localAI[1] == 0f)
|
||||
{
|
||||
p.rotation = MathHelper.PiOver2 + MathHelper.PiOver4;
|
||||
// 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction
|
||||
p.velocity = p.SafeDirectionTo(Main.MouseWorld, Vector2.UnitY) * 22f;
|
||||
p.rotation += p.velocity.ToRotation();
|
||||
p.ai[0] = 180f;
|
||||
@@ -742,7 +745,8 @@ namespace CalamityMod.Items
|
||||
}
|
||||
if (canContinue && count > 0)
|
||||
{
|
||||
NPC unluckyTarget = CalamityUtils.MinionHoming(Main.MouseWorld, 1000f, player);
|
||||
Vector2 mouse = player.ClampedMouseWorld();
|
||||
NPC unluckyTarget = CalamityUtils.MinionHoming(mouse, 1000f, player);
|
||||
if (unluckyTarget != null)
|
||||
{
|
||||
int pointyThingyAmount = count;
|
||||
@@ -755,7 +759,7 @@ namespace CalamityMod.Items
|
||||
if (Main.projectile.Length == Main.maxProjectiles)
|
||||
break;
|
||||
int GlacialEmbraceDamage = (int)player.GetTotalDamage<SummonDamageClass>().ApplyTo(80);
|
||||
int projj = Projectile.NewProjectile(source, Main.MouseWorld, Vector2.Zero, ModContent.ProjectileType<GlacialEmbracePointyThing>(), GlacialEmbraceDamage, 1f, player.whoAmI, angle, 2f);
|
||||
int projj = Projectile.NewProjectile(source, mouse, Vector2.Zero, ModContent.ProjectileType<GlacialEmbracePointyThing>(), GlacialEmbraceDamage, 1f, player.whoAmI, angle, 2f);
|
||||
Main.projectile[projj].originalDamage = 80;
|
||||
|
||||
angle += angleVariance;
|
||||
|
||||
@@ -91,12 +91,12 @@ namespace CalamityMod.Items
|
||||
{
|
||||
ItemID.BeeKeeper,
|
||||
ItemID.BeesKnees,
|
||||
ItemID.BeeGun
|
||||
ItemID.BeeGun,
|
||||
ModContent.ItemType<HardenedHoneycomb>(),
|
||||
};
|
||||
loot.Add(DropHelper.CalamityStyle(DropHelper.BagWeaponDropRateFraction, queenBeeWeapons));
|
||||
loot.Add(ModContent.ItemType<TheBee>(), 10); // 10% The Bee
|
||||
loot.Add(ItemID.Stinger, 1, 8, 12); // 100% 8-12 Stinger
|
||||
loot.Add(ModContent.ItemType<HardenedHoneycomb>(), 1, 50, 75); // 100% 50-75 Hardened Honeycomb
|
||||
loot.AddRevBagAccessories();
|
||||
loot.Add(ModContent.ItemType<ThankYouPainting>(), ThankYouPainting.DropInt);
|
||||
break;
|
||||
|
||||
@@ -16,6 +16,7 @@ using CalamityMod.Items.Weapons.Rogue;
|
||||
using CalamityMod.Items.Weapons.Summon;
|
||||
using CalamityMod.Prefixes;
|
||||
using CalamityMod.World;
|
||||
using Humanizer;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Microsoft.Xna.Framework.Input;
|
||||
@@ -1127,27 +1128,25 @@ namespace CalamityMod.Items
|
||||
|
||||
// This function produces a "stat sheet" for a pair of wings from the raw stats.
|
||||
// For "vertical speed", 0 = Bad, 1 = Average, 2 = Good, 3 = Great, 4 = Excellent.
|
||||
string[] vertSpeedStrings = new string[] { "Bad vertical speed", "Average vertical speed", "Good vertical speed", "Great vertical speed", "Excellent vertical speed" };
|
||||
string[] vertSpeedStrings = new string[] { "VertSpeedQuality1", "VertSpeedQuality2", "VertSpeedQuality3", "VertSpeedQuality4", "VertSpeedQuality5" };
|
||||
string WingStatsTooltip(float hSpeed, float accelMult, int vertSpeed, int flightTime, string extraTooltip = null)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder(512);
|
||||
sb.Append('\n');
|
||||
sb.Append($"Horizontal speed: {hSpeed:N2}\n");
|
||||
sb.Append($"Acceleration multiplier: {accelMult:N1}\n");
|
||||
sb.Append(vertSpeedStrings[vertSpeed]);
|
||||
sb.Append('\n');
|
||||
sb.Append($"Flight time: {flightTime}");
|
||||
sb.Append(CalamityUtils.GetText($"Misc.HorizSpeed").Format(hSpeed.ToString("N2")) + $"\n");
|
||||
sb.Append(CalamityUtils.GetText($"Misc.AccelMult").Format(accelMult.ToString("N1")) + $"\n");
|
||||
sb.Append(CalamityUtils.GetText($"Misc.{vertSpeedStrings[vertSpeed]}") + $"\n");
|
||||
sb.Append(CalamityUtils.GetText($"Misc.FlightTime").Format(flightTime.ToString()));
|
||||
if (extraTooltip != null)
|
||||
{
|
||||
sb.Append('\n');
|
||||
sb.Append(extraTooltip);
|
||||
sb.Append(CalamityUtils.GetTextValue($"Vanilla.Wings.{extraTooltip}"));
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
// This function is shorthand for appending a stat sheet to a pair of wings.
|
||||
void AddWingStats(float h, float a, int v, int f, string s = null) => EditTooltipByNum(0, (line) => line.Text += WingStatsTooltip(h, a, v, f, s));
|
||||
void AddWingStats2(float h, float a, int v, int f, string s = null, string lineName = null) => EditTooltipByName(lineName, (line) => line.Text += WingStatsTooltip(h, a, v, f, s));
|
||||
|
||||
if (item.type == ItemID.CreativeWings)
|
||||
AddWingStats(3f, 1f, 0, 25);
|
||||
@@ -1162,26 +1161,25 @@ namespace CalamityMod.Items
|
||||
AddWingStats(6.5f, 1f, 1, 150);
|
||||
|
||||
if (item.type == ItemID.ButterflyWings)
|
||||
AddWingStats(7.5f, 1f, 1, 160, "Increases mana regeneration rate");
|
||||
AddWingStats(7.5f, 1f, 1, 160, "ButterflyWings");
|
||||
|
||||
if (item.type == ItemID.FairyWings)
|
||||
AddWingStats(6.75f, 1f, 1, 130);
|
||||
|
||||
if (item.type == ItemID.BeeWings)
|
||||
AddWingStats(7.5f, 1f, 1, 160, "Permanently gives the Honey buff");
|
||||
AddWingStats(7.5f, 1f, 1, 160, "BeeWings");
|
||||
|
||||
if (item.type == ItemID.HarpyWings)
|
||||
AddWingStats(6.75f, 1f, 1, 130, "10% increased movement speed\n" +
|
||||
"With Harpy Ring or Angel Treads equipped, most attacks sometimes launch feathers");
|
||||
AddWingStats(6.75f, 1f, 1, 130, "HarpyWings");
|
||||
|
||||
if (item.type == ItemID.BoneWings)
|
||||
AddWingStats(7.5f, 1f, 1, 240, "Halves flight time when taking a hit");
|
||||
AddWingStats(7.5f, 1f, 1, 240, "BoneWings");
|
||||
|
||||
if (item.type == ItemID.FlameWings)
|
||||
AddWingStats(7.5f, 1f, 1, 160, "Multiplies all heat debuff damage by 1.25x");
|
||||
AddWingStats(7.5f, 1f, 1, 160, "FlameWings");
|
||||
|
||||
if (item.type == ItemID.FrozenWings)
|
||||
AddWingStats(6.75f, 1f, 1, 130, "Multiplies all cold debuff damage by 1.25x");
|
||||
AddWingStats(6.75f, 1f, 1, 130, "FrozenWings");
|
||||
|
||||
if (item.type == ItemID.GhostWings)
|
||||
AddWingStats(7.5f, 1f, 1, 170);
|
||||
@@ -1190,8 +1188,7 @@ namespace CalamityMod.Items
|
||||
AddWingStats(7.5f, 1f, 1, 170);
|
||||
|
||||
if (item.type == ItemID.FinWings)
|
||||
AddWingStats(6.75f, 1f, 1, 130, "Gills effect and you can move freely through liquids\n" +
|
||||
"You fall faster while submerged in liquid");
|
||||
AddWingStats(6.75f, 1f, 1, 130, "FinWings");
|
||||
|
||||
if (item.type == ItemID.FishronWings)
|
||||
AddWingStats(8f, 2f, 2, 180);
|
||||
@@ -1200,10 +1197,10 @@ namespace CalamityMod.Items
|
||||
AddWingStats(7.5f, 1f, 1, 180);
|
||||
|
||||
if (item.type == ItemID.LeafWings)
|
||||
AddWingStats(7.5f, 1f, 1, 160, "+10 defense and permanent Dryad's Blessing");
|
||||
AddWingStats(7.5f, 1f, 1, 160, "LeafWings");
|
||||
|
||||
if (item.type == ItemID.BatWings)
|
||||
AddWingStats(7.5f, 1f, 1, 160, "Improves vision");
|
||||
AddWingStats(7.5f, 1f, 1, 160, "BatWings");
|
||||
|
||||
// All developer wings have identical stats and no special effects
|
||||
if (item.type == ItemID.Yoraiz0rWings || item.type == ItemID.JimsWings || item.type == ItemID.SkiphsWings ||
|
||||
@@ -1217,7 +1214,7 @@ namespace CalamityMod.Items
|
||||
}
|
||||
|
||||
if (item.type == ItemID.TatteredFairyWings)
|
||||
AddWingStats(7.5f, 1f, 1, 180, "You leave a trail of fairy dust as you fly");
|
||||
AddWingStats(7.5f, 1f, 1, 180, "TatteredFairyWings");
|
||||
|
||||
if (item.type == ItemID.SpookyWings)
|
||||
AddWingStats(7.5f, 1f, 1, 180);
|
||||
@@ -1226,26 +1223,25 @@ namespace CalamityMod.Items
|
||||
AddWingStats(6.5f, 1f, 1, 170);
|
||||
|
||||
if (item.type == ItemID.FestiveWings)
|
||||
AddWingStats(7.5f, 1f, 1, 180, "Homing ornaments rain down as you fly");
|
||||
AddWingStats(7.5f, 1f, 1, 180, "FestiveWings");
|
||||
|
||||
if (item.type == ItemID.MothronWings)
|
||||
AddWingStats(7.5f, 1f, 1, 200);
|
||||
|
||||
if (item.type == ItemID.WingsSolar)
|
||||
AddWingStats(9f, 2.5f, 3, 180, "Increases Solar Flare armor's dash velocity by 25%");
|
||||
AddWingStats(9f, 2.5f, 3, 180, "WingsSolar");
|
||||
|
||||
if (item.type == ItemID.WingsStardust)
|
||||
AddWingStats(9f, 2.5f, 3, 180, "Greatly increases Stardust armor's stardust guardian damage and attack range");
|
||||
AddWingStats(9f, 2.5f, 3, 180, "WingsStardust");
|
||||
|
||||
if (item.type == ItemID.WingsVortex)
|
||||
AddWingStats(6.5f, 1.5f, 2, 180, "Prevents dashes from disabling Vortex armor's stealth ability");
|
||||
AddWingStats(6.5f, 1.5f, 2, 180, "WingsVortex");
|
||||
|
||||
if (item.type == ItemID.WingsNebula)
|
||||
AddWingStats(6.5f, 1.5f, 2, 180, "Increases the pickup range of Nebula armor's nebula boosters");
|
||||
AddWingStats(6.5f, 1.5f, 2, 180, "WingsNebula");
|
||||
|
||||
// Betsy's Wings (and dev wings) are the only wings without "Allows flight and free fall"
|
||||
if (item.type == ItemID.BetsyWings)
|
||||
AddWingStats2(6f, 2.5f, 2, 150, null, "Equipable");
|
||||
AddWingStats(6f, 2.5f, 2, 150);
|
||||
|
||||
if (item.type == ItemID.RainbowWings)
|
||||
AddWingStats(7f, 2.5f, 2, 100);
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace CalamityMod.Items.Mounts
|
||||
Vector2 vel = Vector2.UnitY.RotatedByRandom(MathHelper.ToRadians(24f)) * Main.rand.NextFloat(-8f, -6f);
|
||||
int damage = (int)player.GetBestClassDamage().ApplyTo(180);
|
||||
float kb = 1f;
|
||||
Projectile birb = Projectile.NewProjectileDirect(new EntitySource_Parent(player), pos, vel, ModContent.ProjectileType<MiniatureFolly>(), damage, kb, player.whoAmI);
|
||||
Projectile birb = Projectile.NewProjectileDirect(new EntitySource_Mount(player, Type), pos, vel, ModContent.ProjectileType<MiniatureFolly>(), damage, kb, player.whoAmI);
|
||||
if (birb.whoAmI.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
birb.DamageType = DamageClass.Generic;
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Mounts
|
||||
{
|
||||
public class ExoArmamentsKit : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Mounts";
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 50;
|
||||
Item.height = 44;
|
||||
Item.useAnimation = Item.useTime = 20;
|
||||
Item.useStyle = ItemUseStyleID.HoldUp;
|
||||
Item.UseSound = SoundID.Item94;
|
||||
Item.noMelee = true;
|
||||
Item.mountType = ModContent.MountType<ExoTank>();
|
||||
|
||||
Item.value = Item.sellPrice(gold: 5);
|
||||
Item.master = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,353 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CalamityMod.Buffs.Mounts;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using CalamityMod.Sounds;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Mounts
|
||||
{
|
||||
public class ExoTank : ModMount
|
||||
{
|
||||
public static int DashDamage = 6000;
|
||||
|
||||
public static int MaxHoverTime = 600;
|
||||
|
||||
public static int MissileDamage = 1000;
|
||||
public static int MissileAttackRate = 4;
|
||||
public static int MissileLauncherFrameCount = 8;
|
||||
public static int MissileReuseDelay = 28; // Total use time = AttackRate * FrameCount + ReuseDelay (AttackRate being the "use animation" for the clockwork weapon)
|
||||
public static readonly SoundStyle MissileLaunchSound = new("CalamityMod/Sounds/Custom/ExoMechs/ArtemisApolloDash") { Volume = 0.5f };
|
||||
|
||||
public static int MinigunDamage = 400;
|
||||
public static int MinigunAttackRate = 4;
|
||||
public static int MinigunFrameCount = 4;
|
||||
|
||||
public class ExoTankData
|
||||
{
|
||||
internal bool Hovering;
|
||||
internal int HoverTime;
|
||||
internal int MinigunFrame;
|
||||
internal int MinigunFrameCounter;
|
||||
internal float MinigunRotation;
|
||||
|
||||
public ExoTankData()
|
||||
{
|
||||
Hovering = false;
|
||||
HoverTime = MaxHoverTime;
|
||||
MinigunFrame = 0;
|
||||
MinigunFrameCounter = 0;
|
||||
MinigunRotation = 0f;
|
||||
}
|
||||
}
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
MountData.spawnDust = DustID.Platinum;
|
||||
MountData.spawnDustNoGravity = true;
|
||||
MountData.buff = ModContent.BuffType<ExoTankBuff>();
|
||||
|
||||
// Horizontal movement
|
||||
MountData.runSpeed = 10f;
|
||||
MountData.dashSpeed = 22.5f;
|
||||
MountData.swimSpeed = 10f;
|
||||
MountData.acceleration = 0.5f;
|
||||
|
||||
// Vertical movement
|
||||
MountData.fallDamage = 0f;
|
||||
MountData.jumpHeight = 10;
|
||||
MountData.jumpSpeed = 12f;
|
||||
|
||||
// Frames and offsets
|
||||
MountData.totalFrames = 3;
|
||||
MountData.heightBoost = 80;
|
||||
int[] array = new int[MountData.totalFrames];
|
||||
for (int l = 0; l < array.Length; l++)
|
||||
array[l] = 76;
|
||||
|
||||
MountData.playerYOffsets = array;
|
||||
MountData.playerHeadOffset = 80;
|
||||
MountData.bodyFrame = 3;
|
||||
MountData.xOffset = 0;
|
||||
MountData.yOffset = -16;
|
||||
MountData.standingFrameCount = 1;
|
||||
MountData.standingFrameDelay = 12;
|
||||
MountData.standingFrameStart = 0;
|
||||
MountData.runningFrameCount = 3;
|
||||
MountData.runningFrameDelay = 24;
|
||||
MountData.runningFrameStart = 0;
|
||||
MountData.flyingFrameCount = 0;
|
||||
MountData.flyingFrameDelay = 0;
|
||||
MountData.flyingFrameStart = 0;
|
||||
MountData.inAirFrameCount = 1;
|
||||
MountData.inAirFrameDelay = MountData.standingFrameDelay;
|
||||
MountData.inAirFrameStart = 0;
|
||||
MountData.idleFrameCount = 1;
|
||||
MountData.idleFrameDelay = MountData.standingFrameDelay;
|
||||
MountData.idleFrameStart = 0;
|
||||
MountData.idleFrameLoop = true;
|
||||
MountData.swimFrameCount = MountData.inAirFrameCount;
|
||||
MountData.swimFrameDelay = MountData.inAirFrameDelay;
|
||||
MountData.swimFrameStart = MountData.inAirFrameStart;
|
||||
if (Main.netMode != NetmodeID.Server)
|
||||
{
|
||||
// back (back layer) -> backExtra (gun) -> front (launcher) -> frontExtra (front layer)
|
||||
MountData.backTextureExtra = ModContent.Request<Texture2D>("CalamityMod/Items/Mounts/ExoTank_BackGun");
|
||||
MountData.backTextureExtraGlow = ModContent.Request<Texture2D>("CalamityMod/Items/Mounts/ExoTank_BackGunGlow");
|
||||
MountData.frontTextureGlow = ModContent.Request<Texture2D>("CalamityMod/Items/Mounts/ExoTank_FrontGlow");
|
||||
MountData.frontTextureExtra = ModContent.Request<Texture2D>("CalamityMod/Items/Mounts/ExoTank_FrontLayer");
|
||||
MountData.frontTextureExtraGlow = ModContent.Request<Texture2D>("CalamityMod/Items/Mounts/ExoTank_FrontLayerGlow");
|
||||
MountData.textureWidth = MountData.backTexture.Width();
|
||||
MountData.textureHeight = MountData.backTexture.Height();
|
||||
}
|
||||
}
|
||||
|
||||
public override void SetMount(Player player, ref bool skipDust) => player.mount._mountSpecificData = new ExoTankData();
|
||||
|
||||
public override void Dismount(Player player, ref bool skipDust)
|
||||
{
|
||||
foreach (Projectile proj in Main.ActiveProjectiles)
|
||||
{
|
||||
if (proj.owner == player.whoAmI && proj.type == ModContent.ProjectileType<ExoTankHoverThrust>())
|
||||
{
|
||||
proj.Kill();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void UpdateEffects(Player player)
|
||||
{
|
||||
if (Main.myPlayer == player.whoAmI)
|
||||
{
|
||||
Mount tank = player.mount;
|
||||
var data = (ExoTankData)player.mount._mountSpecificData;
|
||||
ref float minigunRotation = ref data.MinigunRotation;
|
||||
|
||||
// Find the closest NPC targetable by the tank
|
||||
float range = 960f; // 60 tiles
|
||||
int targetNPC = -1;
|
||||
bool canFireLasers = true;
|
||||
Vector2 gunPosition = player.Center + Vector2.UnitX * 52f * player.direction - Vector2.UnitY * 10f;
|
||||
foreach (NPC target in Main.ActiveNPCs)
|
||||
{
|
||||
if (!target.CanBeChasedBy(tank))
|
||||
continue;
|
||||
|
||||
Vector2 targetDif = target.Center - gunPosition;
|
||||
float angle = MathF.Abs(targetDif.ToRotation());
|
||||
|
||||
// The tank has a base sight line of 120 degrees, equal to Toy Tank
|
||||
// However, the laser cannon can only pivot up to 36 degrees and any further will not fire out lasers
|
||||
if (player.direction == 1)
|
||||
{
|
||||
if (angle > MathHelper.ToRadians(60f))
|
||||
continue;
|
||||
|
||||
canFireLasers = angle <= MathHelper.ToRadians(18f);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (angle < MathHelper.ToRadians(120f))
|
||||
continue;
|
||||
|
||||
canFireLasers = angle >= MathHelper.ToRadians(162f);
|
||||
}
|
||||
|
||||
float distance = targetDif.Length();
|
||||
if (distance < range && Collision.CanHitLine(gunPosition, 0, 0, target.position, target.width, target.height))
|
||||
{
|
||||
range = distance;
|
||||
targetNPC = target.whoAmI;
|
||||
}
|
||||
}
|
||||
|
||||
var source = new EntitySource_Mount(player, Type);
|
||||
|
||||
// Release 3 missiles matching the animation frames
|
||||
if ((int)tank._frameExtraCounter % MissileAttackRate == 0)
|
||||
{
|
||||
if (tank._frameExtra > 0 && tank._frameExtra < 4)
|
||||
{
|
||||
if (tank._frameExtra == 1)
|
||||
SoundEngine.PlaySound(MissileLaunchSound, player.Center);
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
Vector2 rocketPos = player.Center - Vector2.UnitX * (60f - 4f * i - 6f * tank._frameExtra) * player.direction - Vector2.UnitY * (72f - 8f * i);
|
||||
Vector2 rocketVel = (Vector2.UnitX * player.direction).RotatedBy(-MathHelper.PiOver4 * player.direction) * 10f;
|
||||
int rocketDamage = (int)player.GetBestClassDamage().ApplyTo(MissileDamage);
|
||||
float rocketKB = 1f;
|
||||
Projectile.NewProjectile(source, rocketPos, rocketVel, ModContent.ProjectileType<ExoTankMissile>(), rocketDamage, rocketKB, player.whoAmI);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (targetNPC != -1)
|
||||
{
|
||||
tank._aiming = true;
|
||||
if (!canFireLasers)
|
||||
{
|
||||
minigunRotation = 0f;
|
||||
return;
|
||||
}
|
||||
|
||||
float idealRotation = (Main.npc[targetNPC].Center - gunPosition).SafeNormalize(Vector2.UnitX * player.direction).ToRotation();
|
||||
/*
|
||||
// Cap the rotation
|
||||
// EDIT: This looks jarring if you can't fire lasers and the lasers are pointless if they are shot anyway. Re-add if we wanted it to shoot something again
|
||||
if (!canFireLasers)
|
||||
idealRotation = (player.direction == 1 ? MathHelper.ToRadians(18f) : MathHelper.ToRadians(162f)) * MathF.Sign(idealRotation);
|
||||
*/
|
||||
|
||||
minigunRotation = idealRotation + (player.direction == 1 ? 0f : MathHelper.Pi);
|
||||
|
||||
// Fires a bullet on every frame switch
|
||||
if (data.MinigunFrameCounter % MinigunAttackRate == 0)
|
||||
{
|
||||
SoundEngine.PlaySound(CommonCalamitySounds.ExoLaserShootSound with { Volume = 0.32f }, player.Center);
|
||||
|
||||
Vector2 bulletPos = player.Center + Vector2.UnitX * 28f * player.direction - Vector2.UnitY * 10f + (idealRotation * (player.direction == 1 ? 1.33f : 1f)).ToRotationVector2() * 38f;
|
||||
Vector2 bulletVel = (Main.npc[targetNPC].Center - bulletPos).SafeNormalize(Vector2.UnitX * player.direction) * Main.rand.NextFloat(15f, 16f);
|
||||
int bulletDamage = (int)player.GetBestClassDamage().ApplyTo(MinigunDamage);
|
||||
float bulletKB = 1f;
|
||||
Projectile.NewProjectile(source, bulletPos, bulletVel, ModContent.ProjectileType<ExoTankLaser>(), bulletDamage, bulletKB, player.whoAmI);
|
||||
|
||||
Vector2 flashPos = bulletPos + bulletVel.SafeNormalize(Vector2.Zero) * 36f * (player.direction == 1 ? 1f : 1.33f);
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(flashPos, DustID.FireworksRGB);
|
||||
dust.noGravity = true;
|
||||
dust.noLight = true;
|
||||
dust.velocity = bulletVel.RotatedByRandom(MathHelper.ToRadians(5f)) * Main.rand.NextFloat(0.5f, 1f);
|
||||
dust.color = Color.Lerp(Color.OrangeRed, Color.Red, Main.rand.NextFloat(0f, 0.8f));
|
||||
dust.scale = Main.rand.NextFloat(0.5f, 0.8f);
|
||||
}
|
||||
// Muzzle flash
|
||||
// This would be attached to the gun but the frame rate is too fast for only one to exist at a time
|
||||
Projectile.NewProjectile(source, flashPos, bulletVel, ModContent.ProjectileType<ExoTankMuzzleFlash>(), 0, 0f, player.whoAmI);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
tank._aiming = false;
|
||||
minigunRotation = 0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool UpdateFrame(Player mountedPlayer, int state, Vector2 velocity)
|
||||
{
|
||||
Mount tank = mountedPlayer.mount;
|
||||
var data = (ExoTankData)tank._mountSpecificData;
|
||||
|
||||
// Hover effect
|
||||
// If grounded, your hover time is reset to max
|
||||
ref int hoverTime = ref data.HoverTime;
|
||||
ref bool hovering = ref data.Hovering;
|
||||
if (state <= 1)
|
||||
{
|
||||
hoverTime = MaxHoverTime;
|
||||
hovering = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mountedPlayer.controlJump && mountedPlayer.TryingToHoverDown && hoverTime > 0)
|
||||
{
|
||||
var source = new EntitySource_Mount(mountedPlayer, Type);
|
||||
if (mountedPlayer.ownedProjectileCounts[ModContent.ProjectileType<ExoTankHoverThrust>()] < 1)
|
||||
Projectile.NewProjectile(source, mountedPlayer.Bottom, Vector2.Zero, ModContent.ProjectileType<ExoTankHoverThrust>(), 0, 0f, mountedPlayer.whoAmI);
|
||||
|
||||
hoverTime--;
|
||||
hovering = true;
|
||||
mountedPlayer.velocity.Y -= 0.4f * mountedPlayer.gravDir;
|
||||
mountedPlayer.velocity.Y *= 0.9f;
|
||||
if (MathF.Abs(mountedPlayer.velocity.Y) < 0.05f)
|
||||
mountedPlayer.velocity.Y = 0.00001f;
|
||||
}
|
||||
else
|
||||
hovering = false;
|
||||
}
|
||||
|
||||
// Ground dust as you travel (State 1 indicates running on the ground)
|
||||
if (state == 1 && Math.Abs(velocity.X) > mountedPlayer.mount.RunSpeed)
|
||||
{
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
Dust ground = Dust.NewDustDirect(mountedPlayer.BottomLeft - Vector2.UnitX * 40f, mountedPlayer.width + 80, 6, DustID.Platinum);
|
||||
ground.velocity = new Vector2(velocity.X * 0.15f, Main.rand.NextFloat(-2f, 0f));
|
||||
ground.noLight = true;
|
||||
ground.scale = Main.rand.NextFloat(0.2f, 0.8f);
|
||||
ground.fadeIn = Main.rand.NextFloat(1f, 1.5f);
|
||||
ground.shader = GameShaders.Armor.GetSecondaryShader(mountedPlayer.cMount, mountedPlayer);
|
||||
}
|
||||
if (mountedPlayer.cMount == 0)
|
||||
{
|
||||
float direction = Math.Sign(velocity.X);
|
||||
mountedPlayer.position += new Vector2(direction * 24f, 0f);
|
||||
mountedPlayer.FloorVisuals(true);
|
||||
mountedPlayer.position -= new Vector2(direction * 24f, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
// Animation frames locked to 2 states: moving and not moving
|
||||
if (state != 0)
|
||||
state = 1;
|
||||
|
||||
// Advances weapon frames while attacking OR while not attacking but mid-animation
|
||||
if (tank._aiming || (tank._frameExtraCounter >= MissileAttackRate))
|
||||
tank._frameExtraCounter++;
|
||||
else if (tank._frameExtraCounter > 0f)
|
||||
tank._frameExtraCounter = 0f;
|
||||
|
||||
int totalUseTime = MissileReuseDelay + MissileAttackRate * MissileLauncherFrameCount;
|
||||
if (tank._frameExtraCounter >= totalUseTime)
|
||||
{
|
||||
tank._frameExtraCounter = 0f;
|
||||
tank._frameExtra = 0;
|
||||
}
|
||||
tank._frameExtra = (int)Utils.Remap(tank._frameExtraCounter, MissileReuseDelay, totalUseTime, 0f, MissileLauncherFrameCount, true);
|
||||
|
||||
// Minigun has a separate custom frame counter
|
||||
ref int minigunFrame = ref data.MinigunFrame;
|
||||
ref int minigunFrameCounter = ref data.MinigunFrameCounter;
|
||||
if (tank._aiming || minigunFrameCounter > 0)
|
||||
minigunFrameCounter++;
|
||||
|
||||
if (minigunFrameCounter >= MinigunAttackRate * MinigunFrameCount)
|
||||
{
|
||||
minigunFrameCounter = 0;
|
||||
minigunFrame = 0;
|
||||
}
|
||||
minigunFrame = minigunFrameCounter / MinigunAttackRate;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool Draw(List<DrawData> playerDrawData, int drawType, Player drawPlayer, ref Texture2D texture, ref Texture2D glowTexture, ref Vector2 drawPosition, ref Rectangle frame, ref Color drawColor, ref Color glowColor, ref float rotation, ref SpriteEffects spriteEffects, ref Vector2 drawOrigin, ref float drawScale, float shadow)
|
||||
{
|
||||
// Modify everything for backTextureExtra (minigun) and its glow
|
||||
if (drawType == 1)
|
||||
{
|
||||
var data = (ExoTankData)drawPlayer.mount._mountSpecificData;
|
||||
frame = texture.Frame(1, MinigunFrameCount, 0, data.MinigunFrame);
|
||||
drawPosition += new Vector2(drawPlayer.direction == 1 ? 15f : -15f, 7f);
|
||||
spriteEffects = drawPlayer.direction == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
|
||||
rotation = data.MinigunRotation;
|
||||
drawOrigin = new Vector2(drawPlayer.direction == 1 ? 0f : 80f, 12f);
|
||||
}
|
||||
|
||||
// Frames for frontTexture (missile launcher) and its glow
|
||||
if (drawType == 2)
|
||||
frame = texture.Frame(1, MissileLauncherFrameCount, 0, drawPlayer.mount._frameExtra);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 7.6 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 645 B |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
@@ -20,6 +20,7 @@ namespace CalamityMod.Items.Mounts
|
||||
MountData.fallDamage = 0f;
|
||||
MountData.jumpHeight = 20;
|
||||
MountData.jumpSpeed = 15f;
|
||||
MountData.constantJump = true;
|
||||
|
||||
// Frames and offsets
|
||||
MountData.totalFrames = 4;
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace CalamityMod.Items
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Misc";
|
||||
|
||||
public static int HealValue = 70;
|
||||
public static int HealValue = 60;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(HealValue);
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
@@ -24,7 +24,6 @@ namespace CalamityMod.Items
|
||||
Item.height = 46;
|
||||
Item.useAnimation = Item.useTime = 25;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.UseSound = SoundID.DD2_DarkMageCastHeal;
|
||||
Item.noMelee = true;
|
||||
Item.noUseGraphic = true;
|
||||
Item.channel = true;
|
||||
@@ -33,6 +32,11 @@ namespace CalamityMod.Items
|
||||
Item.shoot = ModContent.ProjectileType<RelicOfConvergenceCrystal>();
|
||||
}
|
||||
|
||||
public override void HoldItem(Player player)
|
||||
{
|
||||
player.Calamity().mouseWorldListener = true;
|
||||
}
|
||||
|
||||
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
|
||||
{
|
||||
itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.ToolsOther;
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
using System.Linq;
|
||||
using CalamityMod.Projectiles.Damageable;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items
|
||||
{
|
||||
public class RelicOfResilience : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Misc";
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 40;
|
||||
Item.height = 34;
|
||||
Item.value = CalamityGlobalItem.RarityPurpleBuyPrice;
|
||||
Item.rare = ItemRarityID.Purple;
|
||||
}
|
||||
public override void HoldItem(Player player)
|
||||
{
|
||||
player.Calamity().mouseWorldListener = true;
|
||||
}
|
||||
|
||||
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
|
||||
{
|
||||
itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.ToolsOther;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 787 B After Width: | Height: | Size: 787 B |
@@ -73,7 +73,7 @@ namespace CalamityMod.Items.TreasureBags
|
||||
ModContent.ItemType<Shadethrower>(),
|
||||
ModContent.ItemType<ShaderainStaff>(),
|
||||
ModContent.ItemType<DankStaff>(),
|
||||
new WeightedItemStack(ModContent.ItemType<RotBall>(), 1f, 50, 75),
|
||||
ModContent.ItemType<RotBall>(),
|
||||
}));
|
||||
|
||||
// Equipment
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace CalamityMod.Items.TreasureBags
|
||||
ModContent.ItemType<Eviscerator>(),
|
||||
ModContent.ItemType<BloodBath>(),
|
||||
ModContent.ItemType<FleshOfInfidelity>(),
|
||||
new WeightedItemStack(ModContent.ItemType<ToothBall>(), 1f, 50, 75),
|
||||
ModContent.ItemType<ToothBall>(),
|
||||
}));
|
||||
|
||||
// Equipment
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
using CalamityMod.Items.Armor.Vanity;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Armor.Vanity;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Pets;
|
||||
using CalamityMod.Items.Placeables.Furniture.DevPaintings;
|
||||
using CalamityMod.Items.Weapons.Magic;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
using CalamityMod.NPCs.StormWeaver;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -60,14 +62,14 @@ namespace CalamityMod.Items.TreasureBags
|
||||
// Weapons
|
||||
itemLoot.Add(DropHelper.CalamityStyle(DropHelper.BagWeaponDropRateFraction, new int[]
|
||||
{
|
||||
ModContent.ItemType<StormDragoon>(),
|
||||
ModContent.ItemType<SkytideDragoon>(),
|
||||
ModContent.ItemType<TheStorm>(),
|
||||
ModContent.ItemType<Thunderbolt>()
|
||||
}));
|
||||
|
||||
// Equipment
|
||||
itemLoot.Add(ModContent.ItemType<ArcFlashRing>());
|
||||
itemLoot.AddRevBagAccessories();
|
||||
// Stay tuned for Definitely Not Charged Perforator Runald's Band As A Single Item
|
||||
|
||||
// Vanity
|
||||
itemLoot.Add(ModContent.ItemType<StormWeaverMask>(), 7);
|
||||
|
||||
@@ -61,6 +61,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Projectile blade = Projectile.NewProjectileDirect(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI);
|
||||
// 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction
|
||||
blade.rotation = blade.AngleTo(Main.MouseWorld);
|
||||
blade.netUpdate = true;
|
||||
return false;
|
||||
|
||||
@@ -47,8 +47,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockBack)
|
||||
{
|
||||
Projectile north = Projectile.NewProjectileDirect(source, Main.MouseWorld + Vector2.UnitY * 30f, Vector2.Zero, type, damage, knockBack, player.whoAmI);
|
||||
Projectile south = Projectile.NewProjectileDirect(source, Main.MouseWorld - Vector2.UnitY * 30f, Vector2.Zero, type, damage, knockBack, player.whoAmI);
|
||||
Vector2 mouse = player.ClampedMouseWorld();
|
||||
Projectile north = Projectile.NewProjectileDirect(source, mouse + Vector2.UnitY * 30f, Vector2.Zero, type, damage, knockBack, player.whoAmI);
|
||||
Projectile south = Projectile.NewProjectileDirect(source, mouse - Vector2.UnitY * 30f, Vector2.Zero, type, damage, knockBack, player.whoAmI);
|
||||
north.originalDamage = Item.damage;
|
||||
south.originalDamage = Item.damage;
|
||||
north.ai[1] = 1f;
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Projectile.NewProjectile(source, Main.MouseWorld, Vector2.Zero, type, damage, knockback, player.whoAmI);
|
||||
Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,10 +44,11 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Point mouseTileCoords = Main.MouseWorld.ToTileCoordinates();
|
||||
Vector2 mouse = player.ClampedMouseWorld();
|
||||
Point mouseTileCoords = mouse.ToTileCoordinates();
|
||||
if (!CalamityUtils.ParanoidTileRetrieval(mouseTileCoords.X, mouseTileCoords.Y).HasTile)
|
||||
{
|
||||
int p = Projectile.NewProjectile(source, Main.MouseWorld, Vector2.Zero, type, damage, knockback, player.whoAmI);
|
||||
int p = Projectile.NewProjectile(source, mouse, Vector2.Zero, type, damage, knockback, player.whoAmI);
|
||||
if (Main.projectile.IndexInRange(p))
|
||||
Main.projectile[p].originalDamage = Item.damage;
|
||||
}
|
||||
|
||||
@@ -15,12 +15,14 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Magic";
|
||||
public const int UseTime = 36;
|
||||
public static Color mainColor = Color.Goldenrod;
|
||||
public static Color accentColor = Color.LightGreen;
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 94;
|
||||
Item.height = 54;
|
||||
Item.damage = 285;
|
||||
Item.damage = 355;
|
||||
Item.DamageType = DamageClass.Magic;
|
||||
Item.mana = 7;
|
||||
Item.useAnimation = Item.useTime = UseTime;
|
||||
@@ -44,6 +46,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Vector2 spawnPosition = player.RotatedRelativePoint(player.MountedCenter, true);
|
||||
// 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction
|
||||
Projectile.NewProjectile(source, spawnPosition, player.Calamity().mouseWorld - spawnPosition, ModContent.ProjectileType<AetherfluxCannonHoldout>(), damage, knockback, player.whoAmI);
|
||||
return false;
|
||||
}
|
||||
@@ -52,7 +55,6 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<NanoPurge>().
|
||||
AddIngredient<PurgeGuzzler>().
|
||||
AddIngredient<AuricBar>(5).
|
||||
AddIngredient<UelibloomBar>(12).
|
||||
AddIngredient<DivineGeode>(8).
|
||||
|
||||
@@ -42,6 +42,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Vector2 spawnPos = new Vector2(player.MountedCenter.X + Main.rand.Next(-200, 201), player.MountedCenter.Y - 600f);
|
||||
// 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction
|
||||
Vector2 targetPos = Main.MouseWorld + new Vector2(Main.rand.Next(-30, 31), Main.rand.Next(-30, 31));
|
||||
Vector2 velocityReal = targetPos - spawnPos;
|
||||
velocityReal.Normalize();
|
||||
|
||||
@@ -36,6 +36,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Vector2 rainbowPos = player.Center + (Vector2.Normalize(velocity) * Main.rand.NextFloat(-36f, 36f)).RotatedBy(MathHelper.PiOver2);
|
||||
// 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction
|
||||
Vector2 rainbowVel = Vector2.Normalize(Main.MouseWorld - rainbowPos) * Item.shootSpeed;
|
||||
Projectile.NewProjectile(source, rainbowPos, rainbowVel, type, damage, knockback, Main.myPlayer);
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
using CalamityMod.Rarities;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -37,54 +36,21 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
|
||||
Item.UseSound = SoundID.Item73;
|
||||
Item.autoReuse = true;
|
||||
Item.shootSpeed = 19f;
|
||||
Item.shootSpeed = 25f;
|
||||
Item.shoot = ModContent.ProjectileType<DivineRetributionSpear>();
|
||||
}
|
||||
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
float spearSpeed = Item.shootSpeed;
|
||||
Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true);
|
||||
float mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
|
||||
float mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
|
||||
if (player.gravDir == -1f)
|
||||
// 5 projectiles total
|
||||
Vector2 mouse = player.ClampedMouseWorld();
|
||||
for (int i = -2; i < 3; i++)
|
||||
{
|
||||
mouseYDist = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - realPlayerPos.Y;
|
||||
}
|
||||
float mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
|
||||
if ((float.IsNaN(mouseXDist) && float.IsNaN(mouseYDist)) || (mouseXDist == 0f && mouseYDist == 0f))
|
||||
{
|
||||
mouseXDist = (float)player.direction;
|
||||
}
|
||||
else
|
||||
{
|
||||
mouseDistance = spearSpeed / mouseDistance;
|
||||
}
|
||||
int numProjectiles = 5;
|
||||
for (int i = 0; i < numProjectiles; i++)
|
||||
{
|
||||
realPlayerPos = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(51) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - /* - */ player.position.X), player.MountedCenter.Y + 600f); //-
|
||||
realPlayerPos.X = (realPlayerPos.X + player.Center.X) / 2f + (float)Main.rand.Next(-50, 51); //200
|
||||
realPlayerPos.Y += (float)(100 * i); //-=
|
||||
mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X; //+ -
|
||||
mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y; //+ -
|
||||
if (mouseYDist < 0f)
|
||||
{
|
||||
mouseYDist *= -1f;
|
||||
}
|
||||
if (mouseYDist < 20f)
|
||||
{
|
||||
mouseYDist = 20f;
|
||||
}
|
||||
mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
|
||||
mouseDistance = spearSpeed / mouseDistance;
|
||||
mouseXDist *= mouseDistance;
|
||||
mouseYDist *= mouseDistance;
|
||||
float speedX6 = mouseXDist + (float)Main.rand.Next(-60, 61) * 0.02f;
|
||||
float speedY7 = mouseYDist + (float)Main.rand.Next(-60, 61) * 0.02f;
|
||||
float ai1 = Main.rand.NextFloat() + 0.5f;
|
||||
Projectile.NewProjectile(source, realPlayerPos.X, realPlayerPos.Y, speedX6, -speedY7, type, damage, knockback, player.whoAmI, 0.0f, ai1);
|
||||
Vector2 newPos = new Vector2(mouse.X + Main.rand.NextFloat(8f, 64f) * i, player.MountedCenter.Y + Main.rand.NextFloat(640f, 800f));
|
||||
Vector2 newVel = (mouse + Main.rand.NextVector2CircularEdge(4f, 4f) - newPos).SafeNormalize(Vector2.Zero) * velocity.Length() * Main.rand.NextFloat(1f, 1.25f);
|
||||
float velScale = 1f + Main.rand.NextFloat(0.02f, 0.08f) * i;
|
||||
Projectile.NewProjectile(source, newPos, newVel, type, damage, knockback, player.whoAmI, velScale);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
{
|
||||
if (player.altFunctionUse == 2)
|
||||
{
|
||||
Projectile.NewProjectile(source, Main.MouseWorld, Vector2.Zero, ModContent.ProjectileType<MelterAmp>(), damage, knockback, player.whoAmI);
|
||||
Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, ModContent.ProjectileType<MelterAmp>(), damage, knockback, player.whoAmI);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
using System;
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -12,28 +14,53 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
{
|
||||
Item.width = 34;
|
||||
Item.height = 38;
|
||||
Item.damage = 36;
|
||||
Item.damage = 40;
|
||||
Item.DamageType = DamageClass.Magic;
|
||||
Item.mana = 12;
|
||||
Item.useTime = 30;
|
||||
Item.useAnimation = 30;
|
||||
Item.mana = 22;
|
||||
Item.useTime = 80;
|
||||
Item.useAnimation = 80;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.noMelee = true;
|
||||
Item.knockBack = 5.5f;
|
||||
Item.knockBack = 5f;
|
||||
Item.value = CalamityGlobalItem.RarityOrangeBuyPrice;
|
||||
Item.rare = ItemRarityID.Orange;
|
||||
Item.UseSound = SoundID.Item20;
|
||||
Item.autoReuse = true;
|
||||
Item.shoot = ModContent.ProjectileType<FlareBoltProjectile>();
|
||||
Item.shootSpeed = 7.5f;
|
||||
Item.shootSpeed = 6.5f;
|
||||
}
|
||||
public override void HoldItem(Player player)
|
||||
{
|
||||
player.Calamity().mouseWorldListener = true;
|
||||
}
|
||||
public override void UseStyle(Player player, Rectangle heldItemFrame)
|
||||
{
|
||||
player.ChangeDir(Math.Sign((player.Calamity().mouseWorld - player.Center).X));
|
||||
float itemRotation = player.compositeFrontArm.rotation + MathHelper.PiOver2 * player.gravDir;
|
||||
|
||||
Vector2 itemPosition = player.MountedCenter + itemRotation.ToRotationVector2() * 4f;
|
||||
Vector2 itemSize = new Vector2(34, 38);
|
||||
Vector2 itemOrigin = new Vector2(-24, 4);
|
||||
|
||||
CalamityUtils.CleanHoldStyle(player, itemRotation, itemPosition, itemSize, itemOrigin);
|
||||
|
||||
base.UseStyle(player, heldItemFrame);
|
||||
}
|
||||
public override void UseItemFrame(Player player)
|
||||
{
|
||||
player.ChangeDir(Math.Sign((player.Calamity().mouseWorld - player.Center).X));
|
||||
|
||||
float animProgress = 0.5f - player.itemTime / (float)player.itemTimeMax;
|
||||
float rotation = (player.Center - player.Calamity().mouseWorld).ToRotation() * player.gravDir + MathHelper.PiOver2;
|
||||
|
||||
player.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, rotation);
|
||||
}
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient(ItemID.HellstoneBar, 6).
|
||||
AddIngredient(ItemID.Obsidian, 9).
|
||||
AddIngredient(ItemID.Fireblossom, 2).
|
||||
AddIngredient(ItemID.Ruby).
|
||||
AddTile(TileID.Bookcases).
|
||||
Register();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using System;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -10,35 +15,88 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
{
|
||||
public static readonly SoundStyle UseSound = new("CalamityMod/Sounds/Item/FrigidflashUse");
|
||||
public static readonly SoundStyle ProjDeathSound = new("CalamityMod/Sounds/Item/FrigidflashDeath");
|
||||
public static readonly SoundStyle ChargeSound = new("CalamityMod/Sounds/Item/FrigidflashCharge");
|
||||
|
||||
public new string LocalizationCategory => "Items.Weapons.Magic";
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true;
|
||||
}
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 38;
|
||||
Item.height = 42;
|
||||
Item.damage = 80;
|
||||
Item.damage = 72;
|
||||
Item.DamageType = DamageClass.Magic;
|
||||
Item.mana = 13;
|
||||
Item.useTime = 20;
|
||||
Item.useAnimation = 20;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.noMelee = true;
|
||||
Item.knockBack = 5.5f;
|
||||
Item.knockBack = 6f;
|
||||
Item.value = CalamityGlobalItem.RarityLightRedBuyPrice;
|
||||
Item.rare = ItemRarityID.LightRed;
|
||||
Item.UseSound = UseSound;
|
||||
Item.autoReuse = true;
|
||||
Item.shoot = ModContent.ProjectileType<FrigidflashBoltProjectile>();
|
||||
Item.shootSpeed = 9f;
|
||||
}
|
||||
public override bool AltFunctionUse(Player player) => true;
|
||||
public override float UseSpeedMultiplier(Player player)
|
||||
{
|
||||
if (player.altFunctionUse == 2)
|
||||
return 0.25f;
|
||||
|
||||
return 1f;
|
||||
}
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.altFunctionUse == 2) // Right Click
|
||||
{
|
||||
Projectile bigMagic = Projectile.NewProjectileDirect(source, position, velocity, type, damage, knockback, player.whoAmI, 0, 5);
|
||||
bigMagic.extraUpdates = 4;
|
||||
bigMagic.timeLeft = 370;
|
||||
bigMagic.penetrate = -1;
|
||||
}
|
||||
else // Left Click
|
||||
{
|
||||
Projectile smallMagic = Projectile.NewProjectileDirect(source, position, velocity, type, damage, knockback / 2, player.whoAmI);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public override void HoldItem(Player player)
|
||||
{
|
||||
player.Calamity().mouseWorldListener = true;
|
||||
}
|
||||
public override void UseStyle(Player player, Rectangle heldItemFrame)
|
||||
{
|
||||
player.ChangeDir(Math.Sign((player.Calamity().mouseWorld - player.Center).X));
|
||||
float itemRotation = player.compositeFrontArm.rotation + MathHelper.PiOver2 * player.gravDir;
|
||||
|
||||
Vector2 itemPosition = player.MountedCenter + itemRotation.ToRotationVector2() * 4f;
|
||||
Vector2 itemSize = new Vector2(38, 42);
|
||||
Vector2 itemOrigin = new Vector2(-24, 4);
|
||||
|
||||
CalamityUtils.CleanHoldStyle(player, itemRotation, itemPosition, itemSize, itemOrigin);
|
||||
|
||||
base.UseStyle(player, heldItemFrame);
|
||||
}
|
||||
public override void UseItemFrame(Player player)
|
||||
{
|
||||
player.ChangeDir(Math.Sign((player.Calamity().mouseWorld - player.Center).X));
|
||||
|
||||
float animProgress = 0.5f - player.itemTime / (float)player.itemTimeMax;
|
||||
float rotation = (player.Center - player.Calamity().mouseWorld).ToRotation() * player.gravDir + MathHelper.PiOver2;
|
||||
|
||||
player.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, rotation);
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<FrostBolt>().
|
||||
AddIngredient<FlareBolt>().
|
||||
AddIngredient<EssenceofHavoc>(2).
|
||||
AddIngredient<EssenceofEleum>(2).
|
||||
AddIngredient<EssenceofHavoc>(5).
|
||||
AddIngredient<EssenceofEleum>(5).
|
||||
AddTile(TileID.Bookcases).
|
||||
Register();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
using System;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -12,28 +15,53 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
{
|
||||
Item.width = 34;
|
||||
Item.height = 38;
|
||||
Item.damage = 14;
|
||||
Item.damage = 25;
|
||||
Item.DamageType = DamageClass.Magic;
|
||||
Item.mana = 6;
|
||||
Item.useTime = 20;
|
||||
Item.useAnimation = 20;
|
||||
Item.mana = 8;
|
||||
Item.useTime = 30;
|
||||
Item.useAnimation = 30;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.noMelee = true;
|
||||
Item.knockBack = 3.5f;
|
||||
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
|
||||
Item.rare = ItemRarityID.Green;
|
||||
Item.UseSound = SoundID.Item8;
|
||||
Item.autoReuse = true;
|
||||
Item.shoot = ModContent.ProjectileType<FrostBoltProjectile>();
|
||||
Item.shootSpeed = 6f;
|
||||
Item.shootSpeed = 8f;
|
||||
}
|
||||
public override void HoldItem(Player player)
|
||||
{
|
||||
player.Calamity().mouseWorldListener = true;
|
||||
}
|
||||
public override void UseStyle(Player player, Rectangle heldItemFrame)
|
||||
{
|
||||
player.ChangeDir(Math.Sign((player.Calamity().mouseWorld - player.Center).X));
|
||||
float itemRotation = player.compositeFrontArm.rotation + MathHelper.PiOver2 * player.gravDir;
|
||||
|
||||
Vector2 itemPosition = player.MountedCenter + itemRotation.ToRotationVector2() * 4f;
|
||||
Vector2 itemSize = new Vector2(34, 38);
|
||||
Vector2 itemOrigin = new Vector2(-24, 4);
|
||||
|
||||
CalamityUtils.CleanHoldStyle(player, itemRotation, itemPosition, itemSize, itemOrigin);
|
||||
|
||||
base.UseStyle(player, heldItemFrame);
|
||||
}
|
||||
public override void UseItemFrame(Player player)
|
||||
{
|
||||
player.ChangeDir(Math.Sign((player.Calamity().mouseWorld - player.Center).X));
|
||||
|
||||
float animProgress = 0.5f - player.itemTime / (float)player.itemTimeMax;
|
||||
float rotation = (player.Center - player.Calamity().mouseWorld).ToRotation() * player.gravDir + MathHelper.PiOver2;
|
||||
|
||||
player.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, rotation);
|
||||
}
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddRecipeGroup("AnyIceBlock", 20).
|
||||
AddRecipeGroup("AnySnowBlock", 10).
|
||||
AddIngredient(ItemID.Shiverthorn, 2).
|
||||
AddIngredient(ItemID.Sapphire).
|
||||
AddTile(TileID.Bookcases).
|
||||
Register();
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
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<GenesisHoldout>(), damage, knockback, player.whoAmI);
|
||||
// 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction
|
||||
holdout.velocity = player.Calamity().mouseWorld - player.RotatedRelativePoint(player.MountedCenter);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Vector2 spawnPosition = player.RotatedRelativePoint(player.MountedCenter, true);
|
||||
// 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction
|
||||
Projectile.NewProjectile(source, spawnPosition, player.Calamity().mouseWorld - spawnPosition, ModContent.ProjectileType<HeliumFlashHoldout>(), damage, knockback, player.whoAmI);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
position = Main.MouseWorld;
|
||||
position = player.ClampedMouseWorld();
|
||||
for (int x = 0; x < 10; x++)
|
||||
{
|
||||
Projectile.NewProjectile(source, position.X + (float)Main.rand.Next(-150, 150), position.Y + 600f, 0f, -10f, type, damage, knockback, player.whoAmI);
|
||||
|
||||
@@ -61,8 +61,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
}
|
||||
f = Main.rand.NextFloat() * MathHelper.TwoPi;
|
||||
}
|
||||
Vector2 mouseWorld = Main.MouseWorld;
|
||||
Vector2 projSpawnPos = mouseWorld - projSpawnOffset;
|
||||
Vector2 projSpawnPos = player.ClampedMouseWorld() - projSpawnOffset;
|
||||
Vector2 projVelocity = new Vector2(mouseXDist, mouseYDist).SafeNormalize(Vector2.UnitY) * projSpeed;
|
||||
projSpawnPos = projSpawnPos.SafeNormalize(projVelocity) * projSpeed;
|
||||
projSpawnPos = Vector2.Lerp(projSpawnPos, projVelocity, 0.25f);
|
||||
|
||||
@@ -4,6 +4,8 @@ using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Rarities;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Magic
|
||||
{
|
||||
@@ -18,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
{
|
||||
Item.width = 62;
|
||||
Item.height = 34;
|
||||
Item.damage = 60;
|
||||
Item.damage = 135;
|
||||
Item.DamageType = DamageClass.Magic;
|
||||
Item.mana = 8;
|
||||
Item.useAnimation = Item.useTime = UseTime;
|
||||
@@ -27,8 +29,8 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
Item.noUseGraphic = true;
|
||||
Item.channel = true;
|
||||
Item.knockBack = 3f;
|
||||
Item.rare = ItemRarityID.Red;
|
||||
Item.value = CalamityGlobalItem.RarityRedBuyPrice;
|
||||
Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice;
|
||||
Item.rare = ModContent.RarityType<Turquoise>();
|
||||
Item.autoReuse = true;
|
||||
Item.shoot = ModContent.ProjectileType<NanoPurgeHoldout>();
|
||||
Item.shootSpeed = 16f;
|
||||
@@ -41,6 +43,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Vector2 spawnPosition = player.RotatedRelativePoint(player.MountedCenter, true);
|
||||
// 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction
|
||||
Projectile.NewProjectile(source, spawnPosition, player.Calamity().mouseWorld - spawnPosition, ModContent.ProjectileType<NanoPurgeHoldout>(), damage, knockback, player.whoAmI);
|
||||
return false;
|
||||
}
|
||||
@@ -49,7 +52,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient(ItemID.LaserMachinegun).
|
||||
AddIngredient(ItemID.FragmentVortex, 6).
|
||||
AddIngredient<UelibloomBar>(7).
|
||||
AddIngredient(ItemID.Nanites, 100).
|
||||
AddTile(TileID.LunarCraftingStation).
|
||||
Register();
|
||||
|
||||
@@ -44,6 +44,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
AddIngredient(ItemID.AmberStaff).
|
||||
AddIngredient<PurifiedGel>(10).
|
||||
AddTile(TileID.DemonAltar).
|
||||
AddCondition(Condition.NotRemixWorld).
|
||||
Register();
|
||||
CreateRecipe().
|
||||
AddIngredient(ItemID.CrimsonRod).
|
||||
@@ -52,7 +53,29 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
AddIngredient(ItemID.AmberStaff).
|
||||
AddIngredient<PurifiedGel>(10).
|
||||
AddTile(TileID.DemonAltar).
|
||||
AddCondition(Condition.NotRemixWorld).
|
||||
Register();
|
||||
|
||||
// CIT 16NOV2024: Due to Wand of Sparking (and Frosting) being swapped with Magic Dagger in Remix, Night's Ray uses Magic Dagger in its recipe there.
|
||||
CreateRecipe().
|
||||
AddIngredient(ItemID.Vilethorn).
|
||||
AddIngredient(ItemID.MagicMissile).
|
||||
AddIngredient(ItemID.MagicDagger).
|
||||
AddIngredient(ItemID.AmberStaff).
|
||||
AddIngredient<PurifiedGel>(10).
|
||||
AddTile(TileID.DemonAltar).
|
||||
AddCondition(Condition.RemixWorld).
|
||||
Register();
|
||||
CreateRecipe().
|
||||
AddIngredient(ItemID.CrimsonRod).
|
||||
AddIngredient(ItemID.MagicMissile).
|
||||
AddIngredient(ItemID.MagicDagger).
|
||||
AddIngredient(ItemID.AmberStaff).
|
||||
AddIngredient<PurifiedGel>(10).
|
||||
AddTile(TileID.DemonAltar).
|
||||
AddCondition(Condition.RemixWorld).
|
||||
Register();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -64,6 +64,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
else
|
||||
return false;
|
||||
|
||||
// 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction
|
||||
Vector2 spawnOffset = player.SafeDirectionTo(Main.MouseWorld, Vector2.UnitY).RotatedBy(offsetAngle) * -Main.rand.NextFloat(40f, 96f);
|
||||
Vector2 shootDirection = (Main.MouseWorld - (position + spawnOffset)).SafeNormalize(Vector2.UnitX * player.direction);
|
||||
int beam = Projectile.NewProjectile(source, position + spawnOffset, shootDirection * shootSpeed, type, damage, knockback, player.whoAmI);
|
||||
|
||||
@@ -53,6 +53,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
// 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
Projectile holdout2 = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType<OmicronWingman>(), damage, knockback, player.whoAmI, 0, 0, i == 0 ? 1 : -1);
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
{
|
||||
Item.width = 72;
|
||||
Item.height = 20;
|
||||
Item.damage = 360;
|
||||
Item.damage = 160;
|
||||
Item.DamageType = DamageClass.Magic;
|
||||
Item.mana = 40;
|
||||
Item.useAnimation = Item.useTime = 40;
|
||||
@@ -39,8 +39,8 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
Item.autoReuse = true;
|
||||
Item.noMelee = true;
|
||||
|
||||
Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice;
|
||||
Item.rare = ModContent.RarityType<Turquoise>();
|
||||
Item.rare = ItemRarityID.Red;
|
||||
Item.value = CalamityGlobalItem.RarityRedBuyPrice;
|
||||
}
|
||||
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-10, 0);
|
||||
@@ -78,7 +78,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
CreateRecipe().
|
||||
AddIngredient(ItemID.ToxicFlask).
|
||||
AddIngredient(ItemID.LaserRifle).
|
||||
AddIngredient<UelibloomBar>(7).
|
||||
AddIngredient(ItemID.FragmentVortex, 6).
|
||||
AddTile(TileID.LunarCraftingStation).
|
||||
Register();
|
||||
}
|
||||
|
||||
@@ -18,31 +18,33 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
{
|
||||
Item.width = 58;
|
||||
Item.height = 44;
|
||||
Item.damage = 120;
|
||||
Item.damage = 152;
|
||||
Item.DamageType = DamageClass.Magic;
|
||||
Item.mana = 22;
|
||||
Item.useTime = 24;
|
||||
Item.useAnimation = 24;
|
||||
Item.mana = 50;
|
||||
Item.useTime = 38;
|
||||
Item.useAnimation = 38;
|
||||
Item.autoReuse = true;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.noMelee = true;
|
||||
Item.noUseGraphic = true;
|
||||
Item.channel = true;
|
||||
Item.knockBack = 4.5f;
|
||||
Item.UseSound = CommonCalamitySounds.LaserCannonSound;
|
||||
Item.shoot = ModContent.ProjectileType<HolyLaser>();
|
||||
Item.shoot = ModContent.ProjectileType<PurgeGuzzlerHoldout>();
|
||||
Item.shootSpeed = 6f;
|
||||
|
||||
Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice;
|
||||
Item.rare = ModContent.RarityType<Turquoise>();
|
||||
}
|
||||
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
|
||||
|
||||
public override void HoldItem(Player player) => player.Calamity().mouseRotationListener = true;
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
// Fire extra lasers to the left and right
|
||||
Projectile.NewProjectile(source, position, velocity.RotatedBy(-Spread), type, damage, knockback, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position, velocity.RotatedBy(+Spread), type, damage, knockback, player.whoAmI);
|
||||
|
||||
// Still also fire the center laser
|
||||
return true;
|
||||
Vector2 spawnPosition = player.RotatedRelativePoint(player.MountedCenter, true);
|
||||
// 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction
|
||||
Projectile.NewProjectileDirect(source, spawnPosition, player.Calamity().mouseWorld - spawnPosition, type, damage, knockback, player.whoAmI);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -44,7 +44,10 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
player.itemTime = Item.useTime;
|
||||
Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true);
|
||||
Vector2 projRotation = Vector2.UnitX.RotatedBy((double)player.fullRotation, default);
|
||||
|
||||
// 14NOV2024: Ozzatron: clamped mouse position is inappropriate to apply here due to excessive use of decompiled vanilla shitcode
|
||||
Vector2 projSpawnPos = Main.MouseWorld - realPlayerPos;
|
||||
|
||||
float velX = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
|
||||
float velY = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
|
||||
if (player.gravDir == -1f)
|
||||
|
||||
@@ -40,8 +40,9 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Vector2 destination = Main.MouseWorld;
|
||||
position = destination - Vector2.UnitY * (Main.MouseWorld.Y - Main.screenPosition.Y + 80f);
|
||||
Vector2 mouse = player.ClampedMouseWorld();
|
||||
Vector2 destination = mouse;
|
||||
position = destination - Vector2.UnitY * (mouse.Y - Main.screenPosition.Y + 80f);
|
||||
Vector2 cachedPosition = position;
|
||||
float maxRandomOffset = 16f;
|
||||
int totalProjectiles = 5;
|
||||
@@ -49,7 +50,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
{
|
||||
position.X += MathHelper.Lerp(-160f, 160f, i / (float)(totalProjectiles - 1));
|
||||
position += Main.rand.NextVector2Circular(maxRandomOffset, maxRandomOffset);
|
||||
velocity = (Main.MouseWorld - position).SafeNormalize(Vector2.UnitY) * ShootSpeed * Main.rand.NextFloat(0.9f, 1.1f);
|
||||
velocity = (mouse - position).SafeNormalize(Vector2.UnitY) * ShootSpeed * Main.rand.NextFloat(0.9f, 1.1f);
|
||||
Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
position = cachedPosition;
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Vector2 spawnPosition = player.RotatedRelativePoint(player.MountedCenter, true);
|
||||
// 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction
|
||||
Projectile.NewProjectile(source, spawnPosition, player.Calamity().mouseWorld - spawnPosition, type, damage, knockback, player.whoAmI);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -59,6 +59,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
}
|
||||
f = Main.rand.NextFloat() * MathHelper.TwoPi;
|
||||
}
|
||||
// 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction
|
||||
Vector2 velocityReal = Main.MouseWorld - source;
|
||||
Vector2 upperVelocityLimit = new Vector2(xVec, yVec).SafeNormalize(Vector2.UnitY) * speed;
|
||||
velocityReal = velocityReal.SafeNormalize(upperVelocityLimit) * speed;
|
||||
|
||||
@@ -41,6 +41,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Vector2 spawnPosition = player.RotatedRelativePoint(player.MountedCenter, true);
|
||||
// 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction
|
||||
Projectile.NewProjectile(source, spawnPosition, player.Calamity().mouseWorld - spawnPosition, type, damage, knockback, player.whoAmI);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -64,6 +64,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
}
|
||||
f = Main.rand.NextFloat() * MathHelper.TwoPi;
|
||||
}
|
||||
// 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction
|
||||
Vector2 velocityReal = Main.MouseWorld - source;
|
||||
Vector2 velocityVariation = new Vector2(xPos, yPos).SafeNormalize(Vector2.UnitY) * speed;
|
||||
velocityReal = velocityReal.SafeNormalize(velocityVariation) * speed;
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
int numOrbs = 12;
|
||||
Vector2 clickPos = Main.MouseWorld;
|
||||
Vector2 clickPos = player.ClampedMouseWorld();
|
||||
float orbDistance = 90f;
|
||||
float orbSpeed = 4f;
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
int numOrbs = 9;
|
||||
Vector2 clickPos = Main.MouseWorld;
|
||||
Vector2 clickPos = player.ClampedMouseWorld();
|
||||
float orbSpeed = 14f;
|
||||
Vector2 vel = Main.rand.NextVector2CircularEdge(orbSpeed, orbSpeed);
|
||||
for (int i = 0; i < numOrbs; i++)
|
||||
|
||||