Merge branch 'master' of https://github.com/UncleDanny/CalamityMod
No files matched your search
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.8 KiB |
@@ -87,6 +87,8 @@ namespace CalamityMod.CalPlayer
|
||||
public int dashTimeMod;
|
||||
public int hInfernoBoost = 0;
|
||||
public int pissWaterBoost = 0;
|
||||
public int gaelRageCooldown = 0;
|
||||
public int gaelBloodShotCooldown = 0;
|
||||
public int packetTimer = 0;
|
||||
public int bloodflareHeartTimer = 180;
|
||||
public int bloodflareManaTimer = 180;
|
||||
@@ -1186,7 +1188,7 @@ namespace CalamityMod.CalPlayer
|
||||
polarisBoostThree = false;
|
||||
bloodfinBoost = false;
|
||||
|
||||
killSpikyBalls = false;
|
||||
killSpikyBalls = false;
|
||||
|
||||
vodka = false;
|
||||
redWine = false;
|
||||
@@ -1293,6 +1295,8 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
#region Debuffs
|
||||
//distanceFromBoss = -1;
|
||||
gaelRageCooldown = 0;
|
||||
gaelBloodShotCooldown = 0;
|
||||
stress = 0;
|
||||
adrenaline = 0;
|
||||
adrenalineMaxTimer = 300;
|
||||
@@ -1306,6 +1310,7 @@ namespace CalamityMod.CalPlayer
|
||||
bossRushImmunityFrameCurseTimer = 0;
|
||||
aBulwarkRareMeleeBoostTimer = 0;
|
||||
theBeeDamage = 0;
|
||||
reforges = 0;
|
||||
polarisBoostCounter = 0;
|
||||
killSpikyBalls = false;
|
||||
|
||||
@@ -1968,6 +1973,67 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
if (CalamityMod.RageHotKey.JustPressed)
|
||||
{
|
||||
if (gaelRageCooldown == 0 && player.HeldItem.type == ModContent.ItemType<GaelsGreatsword>() &&
|
||||
stress > 0)
|
||||
{
|
||||
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SilvaDispel"), (int)player.position.X, (int)player.position.Y);
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
Dust.NewDust(player.position, 120, 120, 218, 0f, 0f, 100, default, 1.5f);
|
||||
}
|
||||
for (int i = 0; i < 30; i++)
|
||||
{
|
||||
float angle = MathHelper.TwoPi * i / 30f;
|
||||
int dustIndex = Dust.NewDust(player.position, 120, 120, 218, 0f, 0f, 0, default, 2f);
|
||||
Main.dust[dustIndex].noGravity = true;
|
||||
Main.dust[dustIndex].velocity *= 4f;
|
||||
dustIndex = Dust.NewDust(player.position, 120, 120, 218, 0f, 0f, 100, default, 1f);
|
||||
Main.dust[dustIndex].velocity *= 2.25f;
|
||||
Main.dust[dustIndex].noGravity = true;
|
||||
Dust.NewDust(player.Center + angle.ToRotationVector2() * 160f, 0, 0, 218, 0f, 0f, 100, default, 1f);
|
||||
}
|
||||
gaelRageCooldown = 60 * GaelsGreatsword.SkullsplosionCooldownSeconds;
|
||||
int damage2 = 15;
|
||||
if (CalamityWorld.downedYharon)
|
||||
{
|
||||
damage2 = GaelsGreatsword.PostYharonDamage;
|
||||
}
|
||||
else if (NPC.downedMoonlord)
|
||||
{
|
||||
damage2 = GaelsGreatsword.PostMoonLordDamage;
|
||||
}
|
||||
else if (Main.hardMode)
|
||||
{
|
||||
damage2 = GaelsGreatsword.HardmodeDamage;
|
||||
}
|
||||
float rageRatio = (float)stress / stressMax;
|
||||
int damage = (int)((stress == stressMax ? GaelsGreatsword.MaxRageBoost : rageRatio * GaelsGreatsword.RageBoostMultiplier) * damage2);
|
||||
float skullCount = 5f;
|
||||
float skullSpeed = 5f;
|
||||
if (CalamityWorld.downedYharon)
|
||||
{
|
||||
skullCount = 20f;
|
||||
skullSpeed = 16f;
|
||||
}
|
||||
else if (NPC.downedMoonlord)
|
||||
{
|
||||
skullCount = 13f;
|
||||
skullSpeed = 13f;
|
||||
}
|
||||
else if (Main.hardMode)
|
||||
{
|
||||
skullCount = 9f;
|
||||
skullSpeed = 8.75f;
|
||||
}
|
||||
for (float i = 0; i < skullCount; i += 1f)
|
||||
{
|
||||
float angle = MathHelper.TwoPi * i / skullCount;
|
||||
Vector2 initialVelocity = angle.ToRotationVector2() * skullSpeed;
|
||||
int projectileIndex = Projectile.NewProjectile(player.Center + initialVelocity * 3f, initialVelocity, ModContent.ProjectileType<GaelSkull>(), damage, 2f, player.whoAmI);
|
||||
Main.projectile[projectileIndex].tileCollide = false;
|
||||
}
|
||||
stress = 0;
|
||||
}
|
||||
if (stress == stressMax && !rageMode)
|
||||
{
|
||||
Main.PlaySound(29, (int)player.position.X, (int)player.position.Y, 104);
|
||||
@@ -3212,6 +3278,10 @@ namespace CalamityMod.CalPlayer
|
||||
aBulwarkRareMeleeBoostTimer--;
|
||||
if (bossRushImmunityFrameCurseTimer > 0)
|
||||
bossRushImmunityFrameCurseTimer--;
|
||||
if (gaelBloodShotCooldown > 0)
|
||||
gaelBloodShotCooldown--;
|
||||
if (gaelRageCooldown > 0)
|
||||
gaelRageCooldown--;
|
||||
|
||||
if (silvaCountdown > 0 && hasSilvaEffect && silvaSet)
|
||||
{
|
||||
@@ -5437,6 +5507,21 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
add += damageAdd;
|
||||
}
|
||||
if (item.type == ModContent.ItemType<GaelsGreatsword>())
|
||||
{
|
||||
if (CalamityWorld.downedYharon)
|
||||
{
|
||||
add += GaelsGreatsword.PostYharonDamage / (float)GaelsGreatsword.BaseDamage - 1f;
|
||||
}
|
||||
else if (NPC.downedMoonlord)
|
||||
{
|
||||
add += GaelsGreatsword.PostMoonLordDamage / (float)GaelsGreatsword.BaseDamage - 1f;
|
||||
}
|
||||
else if (Main.hardMode)
|
||||
{
|
||||
add += GaelsGreatsword.HardmodeDamage / (float)GaelsGreatsword.BaseDamage - 1f;
|
||||
}
|
||||
}
|
||||
if (flamethrowerBoost && item.ranged && (item.useAmmo == 23 || item.type == ModContent.ItemType<DragoonDrizzlefish>()))
|
||||
{
|
||||
add += 0.25f;
|
||||
@@ -5481,7 +5566,6 @@ namespace CalamityMod.CalPlayer
|
||||
theBeeDamage = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetWeaponKnockback(Item item, ref float knockback)
|
||||
{
|
||||
if (auricBoost)
|
||||
@@ -6986,6 +7070,33 @@ namespace CalamityMod.CalPlayer
|
||||
#region Modify Hit By NPC
|
||||
public override void ModifyHitByNPC(NPC npc, ref int damage, ref bool crit)
|
||||
{
|
||||
if (player.HeldItem.type == ModContent.ItemType<GaelsGreatsword>()
|
||||
&& npc.active && npc.CanBeChasedBy() && player.altFunctionUse == 2 && Main.rand.NextBool(2))
|
||||
{
|
||||
int direction = -1;
|
||||
if (npc.Center.X < player.Center.X)
|
||||
{
|
||||
direction = 1;
|
||||
}
|
||||
int damage2 = 15;
|
||||
if (CalamityWorld.downedYharon)
|
||||
{
|
||||
damage2 = GaelsGreatsword.PostYharonDamage;
|
||||
}
|
||||
else if (NPC.downedMoonlord)
|
||||
{
|
||||
damage2 = GaelsGreatsword.PostMoonLordDamage;
|
||||
}
|
||||
else if (Main.hardMode)
|
||||
{
|
||||
damage2 = GaelsGreatsword.HardmodeDamage;
|
||||
}
|
||||
player.ApplyDamageToNPC(npc, damage2 * 5, 5, -direction, false);
|
||||
player.immune = true;
|
||||
player.immuneNoBlink = true;
|
||||
player.immuneTime = 4;
|
||||
damage = 0;
|
||||
}
|
||||
int bossRushDamage = (Main.expertMode ? 500 : 300) + (CalamityWorld.bossRushStage * 2);
|
||||
if (CalamityWorld.bossRushActive)
|
||||
{
|
||||
@@ -7056,6 +7167,37 @@ namespace CalamityMod.CalPlayer
|
||||
#region Modify Hit By Proj
|
||||
public override void ModifyHitByProjectile(Projectile proj, ref int damage, ref bool crit)
|
||||
{
|
||||
if (player.HeldItem.type == ModContent.ItemType<GaelsGreatsword>()
|
||||
&& proj.active && proj.hostile && player.altFunctionUse == 2 && Main.rand.NextBool(2))
|
||||
{
|
||||
for (int j = 0; j < 3; j++)
|
||||
{
|
||||
int dustIndex = Dust.NewDust(proj.position, proj.width, proj.height, 31, 0f, 0f, 0, default(Color), 1f);
|
||||
Main.dust[dustIndex].velocity *= 0.3f;
|
||||
}
|
||||
int damage2 = 15;
|
||||
if (CalamityWorld.downedYharon)
|
||||
{
|
||||
damage2 = GaelsGreatsword.PostYharonDamage;
|
||||
}
|
||||
else if (NPC.downedMoonlord)
|
||||
{
|
||||
damage2 = GaelsGreatsword.PostMoonLordDamage;
|
||||
}
|
||||
else if (Main.hardMode)
|
||||
{
|
||||
damage2 = GaelsGreatsword.HardmodeDamage;
|
||||
}
|
||||
proj.hostile = false;
|
||||
proj.friendly = true;
|
||||
proj.velocity *= -1f;
|
||||
proj.damage = damage2 * 5;
|
||||
proj.penetrate = 1;
|
||||
player.immune = true;
|
||||
player.immuneNoBlink = true;
|
||||
player.immuneTime = 4;
|
||||
damage = 0;
|
||||
}
|
||||
int bossRushDamage = (Main.expertMode ? 125 : 150) + (CalamityWorld.bossRushStage / 2);
|
||||
if (CalamityWorld.bossRushActive)
|
||||
{
|
||||
|
||||
@@ -1420,6 +1420,318 @@ Grants immunity to fire blocks, and temporary immunity to lava";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.type == ItemID.GrapplingHook)
|
||||
{
|
||||
foreach (TooltipLine line2 in tooltips)
|
||||
{
|
||||
if (line2.mod == "Terraria" && line2.Name == "Equipable")
|
||||
{
|
||||
line2.text = "Equipable\n" +
|
||||
"Reach: 18.75\n" +
|
||||
"Launch Velocity: 11.5\n" +
|
||||
"Pull Velocity: 11";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.type == ItemID.AmethystHook)
|
||||
{
|
||||
foreach (TooltipLine line2 in tooltips)
|
||||
{
|
||||
if (line2.mod == "Terraria" && line2.Name == "Equipable")
|
||||
{
|
||||
line2.text = "Equipable\n" +
|
||||
"Reach: 18.75\n" +
|
||||
"Launch Velocity: 10\n" +
|
||||
"Pull Velocity: 11";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.type == ItemID.TopazHook)
|
||||
{
|
||||
foreach (TooltipLine line2 in tooltips)
|
||||
{
|
||||
if (line2.mod == "Terraria" && line2.Name == "Equipable")
|
||||
{
|
||||
line2.text = "Equipable\n" +
|
||||
"Reach: 20.625\n" +
|
||||
"Launch Velocity: 10.5\n" +
|
||||
"Pull Velocity: 11.75";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.type == ItemID.SapphireHook)
|
||||
{
|
||||
foreach (TooltipLine line2 in tooltips)
|
||||
{
|
||||
if (line2.mod == "Terraria" && line2.Name == "Equipable")
|
||||
{
|
||||
line2.text = "Equipable\n" +
|
||||
"Reach: 22.5\n" +
|
||||
"Launch Velocity: 11\n" +
|
||||
"Pull Velocity: 12.5";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.type == ItemID.EmeraldHook)
|
||||
{
|
||||
foreach (TooltipLine line2 in tooltips)
|
||||
{
|
||||
if (line2.mod == "Terraria" && line2.Name == "Equipable")
|
||||
{
|
||||
line2.text = "Equipable\n" +
|
||||
"Reach: 24.375\n" +
|
||||
"Launch Velocity: 11.5\n" +
|
||||
"Pull Velocity: 13.25";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.type == ItemID.RubyHook)
|
||||
{
|
||||
foreach (TooltipLine line2 in tooltips)
|
||||
{
|
||||
if (line2.mod == "Terraria" && line2.Name == "Equipable")
|
||||
{
|
||||
line2.text = "Equipable\n" +
|
||||
"Reach: 26.25\n" +
|
||||
"Launch Velocity: 12\n" +
|
||||
"Pull Velocity: 14";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.type == ItemID.DiamondHook)
|
||||
{
|
||||
foreach (TooltipLine line2 in tooltips)
|
||||
{
|
||||
if (line2.mod == "Terraria" && line2.Name == "Equipable")
|
||||
{
|
||||
line2.text = "Equipable\n" +
|
||||
"Reach: 28.125\n" +
|
||||
"Launch Velocity: 12.5\n" +
|
||||
"Pull Velocity: 14.75";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.type == ItemID.WebSlinger)
|
||||
{
|
||||
foreach (TooltipLine line2 in tooltips)
|
||||
{
|
||||
if (line2.mod == "Terraria" && line2.Name == "Equipable")
|
||||
{
|
||||
line2.text = "Equipable\n" +
|
||||
"Reach: 15.625\n" +
|
||||
"Launch Velocity: 10\n" +
|
||||
"Pull Velocity: 11";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.type == ItemID.SkeletronHand)
|
||||
{
|
||||
foreach (TooltipLine line2 in tooltips)
|
||||
{
|
||||
if (line2.mod == "Terraria" && line2.Name == "Equipable")
|
||||
{
|
||||
line2.text = "Equipable\n" +
|
||||
"Reach: 21.875\n" +
|
||||
"Launch Velocity: 15\n" +
|
||||
"Pull Velocity: 11";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.type == ItemID.SlimeHook)
|
||||
{
|
||||
foreach (TooltipLine line2 in tooltips)
|
||||
{
|
||||
if (line2.mod == "Terraria" && line2.Name == "Equipable")
|
||||
{
|
||||
line2.text = "Equipable\n" +
|
||||
"Reach: 18.75\n" +
|
||||
"Launch Velocity: 13\n" +
|
||||
"Pull Velocity: 11";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.type == ItemID.FishHook)
|
||||
{
|
||||
foreach (TooltipLine line2 in tooltips)
|
||||
{
|
||||
if (line2.mod == "Terraria" && line2.Name == "Equipable")
|
||||
{
|
||||
line2.text = "Equipable\n" +
|
||||
"Reach: 25\n" +
|
||||
"Launch Velocity: 13\n" +
|
||||
"Pull Velocity: 11";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.type == ItemID.IvyWhip)
|
||||
{
|
||||
foreach (TooltipLine line2 in tooltips)
|
||||
{
|
||||
if (line2.mod == "Terraria" && line2.Name == "Equipable")
|
||||
{
|
||||
line2.text = "Equipable\n" +
|
||||
"Reach: 25\n" +
|
||||
"Launch Velocity: 13\n" +
|
||||
"Pull Velocity: 15";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.type == ItemID.BatHook)
|
||||
{
|
||||
foreach (TooltipLine line2 in tooltips)
|
||||
{
|
||||
if (line2.mod == "Terraria" && line2.Name == "Equipable")
|
||||
{
|
||||
line2.text = "Equipable\n" +
|
||||
"Reach: 31.25\n" +
|
||||
"Launch Velocity: 15.5\n" +
|
||||
"Pull Velocity: 20";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.type == ItemID.CandyCaneHook)
|
||||
{
|
||||
foreach (TooltipLine line2 in tooltips)
|
||||
{
|
||||
if (line2.mod == "Terraria" && line2.Name == "Equipable")
|
||||
{
|
||||
line2.text = "Equipable\n" +
|
||||
"Reach: 25\n" +
|
||||
"Launch Velocity: 11.5\n" +
|
||||
"Pull Velocity: 11";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.type == ItemID.DualHook)
|
||||
{
|
||||
foreach (TooltipLine line2 in tooltips)
|
||||
{
|
||||
if (line2.mod == "Terraria" && line2.Name == "Equipable")
|
||||
{
|
||||
line2.text = "Equipable\n" +
|
||||
"Reach: 27.5\n" +
|
||||
"Launch Velocity: 14\n" +
|
||||
"Pull Velocity: 17";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.type == ItemID.ThornHook)
|
||||
{
|
||||
foreach (TooltipLine line2 in tooltips)
|
||||
{
|
||||
if (line2.mod == "Terraria" && line2.Name == "Equipable")
|
||||
{
|
||||
line2.text = "Equipable\n" +
|
||||
"Reach: 30\n" +
|
||||
"Launch Velocity: 15\n" +
|
||||
"Pull Velocity: 18";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.type == ItemID.WormHook)
|
||||
{
|
||||
foreach (TooltipLine line2 in tooltips)
|
||||
{
|
||||
if (line2.mod == "Terraria" && line2.Name == "Equipable")
|
||||
{
|
||||
line2.text = "Equipable\n" +
|
||||
"Reach: 30\n" +
|
||||
"Launch Velocity: 15\n" +
|
||||
"Pull Velocity: 18";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.type == ItemID.TendonHook)
|
||||
{
|
||||
foreach (TooltipLine line2 in tooltips)
|
||||
{
|
||||
if (line2.mod == "Terraria" && line2.Name == "Equipable")
|
||||
{
|
||||
line2.text = "Equipable\n" +
|
||||
"Reach: 30\n" +
|
||||
"Launch Velocity: 15\n" +
|
||||
"Pull Velocity: 18";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.type == ItemID.IlluminantHook)
|
||||
{
|
||||
foreach (TooltipLine line2 in tooltips)
|
||||
{
|
||||
if (line2.mod == "Terraria" && line2.Name == "Equipable")
|
||||
{
|
||||
line2.text = "Equipable\n" +
|
||||
"Reach: 30\n" +
|
||||
"Launch Velocity: 15\n" +
|
||||
"Pull Velocity: 18";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.type == ItemID.AntiGravityHook)
|
||||
{
|
||||
foreach (TooltipLine line2 in tooltips)
|
||||
{
|
||||
if (line2.mod == "Terraria" && line2.Name == "Equipable")
|
||||
{
|
||||
line2.text = "Equipable\n" +
|
||||
"Reach: 31.25\n" +
|
||||
"Launch Velocity: 14\n" +
|
||||
"Pull Velocity: 20";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.type == ItemID.SpookyHook)
|
||||
{
|
||||
foreach (TooltipLine line2 in tooltips)
|
||||
{
|
||||
if (line2.mod == "Terraria" && line2.Name == "Equipable")
|
||||
{
|
||||
line2.text = "Equipable\n" +
|
||||
"Reach: 34.375\n" +
|
||||
"Launch Velocity: 15.5\n" +
|
||||
"Pull Velocity: 22";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.type == ItemID.ChristmasHook)
|
||||
{
|
||||
foreach (TooltipLine line2 in tooltips)
|
||||
{
|
||||
if (line2.mod == "Terraria" && line2.Name == "Equipable")
|
||||
{
|
||||
line2.text = "Equipable\n" +
|
||||
"Reach: 34.375\n" +
|
||||
"Launch Velocity: 15.5\n" +
|
||||
"Pull Velocity: 17";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.type == ItemID.LunarHook)
|
||||
{
|
||||
foreach (TooltipLine line2 in tooltips)
|
||||
{
|
||||
if (line2.mod == "Terraria" && line2.Name == "Equipable")
|
||||
{
|
||||
line2.text = "Equipable\n" +
|
||||
"Reach: 34.375\n" +
|
||||
"Launch Velocity: 16\n" +
|
||||
"Pull Velocity: 24";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.type == ItemID.StaticHook)
|
||||
{
|
||||
foreach (TooltipLine line2 in tooltips)
|
||||
{
|
||||
if (line2.mod == "Terraria" && line2.Name == "Equipable")
|
||||
{
|
||||
line2.text = "Equipable\n" +
|
||||
"Reach: 37.5\n" +
|
||||
"Launch Velocity: 16\n" +
|
||||
"Pull Velocity: 24";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.accessory)
|
||||
{
|
||||
if (item.prefix == 67)
|
||||
|
||||
@@ -20,12 +20,12 @@ Revenge is a dish best served flaming hot");
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.damage = 30;
|
||||
item.damage = 20;
|
||||
item.ranged = true;
|
||||
item.width = 36;
|
||||
item.height = 30;
|
||||
item.useTime = 15;
|
||||
item.useAnimation = 15;
|
||||
item.useTime = 20;
|
||||
item.useAnimation = 20;
|
||||
item.useStyle = 5;
|
||||
item.noMelee = true;
|
||||
item.knockBack = 2f;
|
||||
|
||||
@@ -13,6 +13,9 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Serpent's Bite");
|
||||
Tooltip.SetDefault(@"Reach: 28.125
|
||||
Launch Velocity: 18
|
||||
Pull Velocity: 14");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
|
||||
@@ -14,7 +14,8 @@ namespace CalamityMod.Items.Tools
|
||||
{
|
||||
DisplayName.SetDefault("Flamebeak Hampick");
|
||||
Tooltip.SetDefault(@"Capable of mining Lihzahrd Bricks
|
||||
Right click to use as hammer");
|
||||
Left click to use as a pickaxe
|
||||
Right click to use as a hammer");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 98;
|
||||
item.width = 94;
|
||||
item.damage = BaseDamage;
|
||||
item.melee = true;
|
||||
item.useAnimation = 19;
|
||||
@@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
item.knockBack = 7.5f;
|
||||
item.UseSound = SoundID.Item1;
|
||||
item.autoReuse = true;
|
||||
item.height = 98;
|
||||
item.height = 100;
|
||||
item.value = Item.buyPrice(0, 80, 0, 0);
|
||||
item.rare = 8;
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.8 KiB |
@@ -0,0 +1,265 @@
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.GameInput;
|
||||
using Terraria.Graphics.Capture;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
public class GaelsGreatsword : ModItem
|
||||
{
|
||||
//Help, they're forcing me to slave away at Calamity until I die! - Dominic
|
||||
|
||||
public int SwingType;
|
||||
|
||||
//Weapon attribute constants
|
||||
|
||||
public static readonly int BaseDamage = 8;
|
||||
|
||||
public static readonly int HardmodeDamage = 24;
|
||||
|
||||
public static readonly int PostMoonLordDamage = 270;
|
||||
|
||||
public static readonly int PostYharonDamage = 10000;
|
||||
|
||||
public static readonly float TrueMeleeBoostPreHardmode = 1.75f;
|
||||
|
||||
public static readonly float TrueMeleeBoostHardmode = 2.5f;
|
||||
|
||||
//Weapon projectile attribute constants
|
||||
|
||||
public static readonly int BaseSearchDistance = 400;
|
||||
|
||||
public static readonly int HardmodeSearchDistance = 660;
|
||||
|
||||
public static readonly int PostMoonLordSearchDistance = 940;
|
||||
|
||||
public static readonly int PostYharonSearchDistance = 1450;
|
||||
|
||||
public static readonly int BaseImmunityFrames = 11;
|
||||
|
||||
public static readonly int HardmodeImmunityFrames = 7;
|
||||
|
||||
public static readonly int PostMoonLordImmunityFrames = 4;
|
||||
|
||||
public static readonly int PostYharonImmunityFrames = 2;
|
||||
|
||||
public static readonly int SkullsplosionCooldownSeconds = 10;
|
||||
|
||||
public static readonly int PreMoonlordPenetrate = 3; //Infinite after Moon lord is dead
|
||||
|
||||
//Skull ring attribute constants
|
||||
|
||||
public static readonly float MaxRageBoost = 2.5f;
|
||||
|
||||
public static readonly float RageBoostMultiplier = 1.5f;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Gael's Greatsword");
|
||||
Tooltip.SetDefault("Raises the player's damage reduction by 10% when wielding this sword\n" +
|
||||
"There are three random attacks that can occur when the blade is swung\n" +
|
||||
"The first attack releases two blood-skulls that home in\n" +
|
||||
"The second attack releases an enormous slow-moving skull\n" +
|
||||
"This slow-moving skull becomes weaker with time and lasts for around 4 seconds seconds\n" +
|
||||
"The second attack causes a true melee strike with increased damage\n" +
|
||||
"If you're below 50% life, swings release blood droplets\n" +
|
||||
"Pressing the Rage Key while holding this weapon resets Rage to 0 and releases a circle of\n" +
|
||||
"Slow-moving blood skulls. If Rage is full, the skulls do way more damage. Otherwise, the skull's damage is\n" +
|
||||
"related to the amount of rage sacrificed\n" +
|
||||
"This effect has a " + SkullsplosionCooldownSeconds + " second cooldown.\n" +
|
||||
"The user can right click with the sword to deflect projectiles and enemy attacks 50% of the time");
|
||||
}
|
||||
//NOTE: GetWeaponDamage is in the CalamityPlayer file
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 88;
|
||||
item.height = 84;
|
||||
item.damage = BaseDamage;
|
||||
item.melee = true;
|
||||
item.useAnimation = 16;
|
||||
item.useTime = 16;
|
||||
item.useTurn = true;
|
||||
item.knockBack = 9;
|
||||
item.UseSound = SoundID.Item1;
|
||||
item.autoReuse = true;
|
||||
item.value = Item.buyPrice(5, 0, 0, 0);
|
||||
item.rare = 10;
|
||||
item.shoot = ModContent.ProjectileType<GaelSkull>();
|
||||
item.shootSpeed = 15f;
|
||||
item.Calamity().postMoonLordRarity = 16;
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
}
|
||||
public override void HoldItem(Player player)
|
||||
{
|
||||
player.endurance += 0.1f; //10% DR boost
|
||||
}
|
||||
public override bool AltFunctionUse(Player player) => true;
|
||||
public override Vector2? HoldoutOffset() => new Vector2(12, 12);
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
if (player.altFunctionUse == 2)
|
||||
{
|
||||
item.useAnimation = 46;
|
||||
item.useTime = 46;
|
||||
}
|
||||
else
|
||||
{
|
||||
item.useAnimation = 12;
|
||||
item.useTime = 12;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public override void MeleeEffects(Player player, Rectangle hitbox)
|
||||
{
|
||||
SwingType = Main.rand.Next(3);
|
||||
|
||||
//Almost entirely Ultimus Cleaver code. Feel free to clean it up if you wish.
|
||||
if (player.whoAmI == Main.myPlayer &&
|
||||
player.statLife < player.statLifeMax * 0.5 &&
|
||||
player.Calamity().gaelBloodShotCooldown == 0)
|
||||
{
|
||||
float velocityY = 0f;
|
||||
float velocityX = 0f;
|
||||
float spawnAdditiveY = 0f;
|
||||
float spawnAdditiveX = 0f;
|
||||
if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.8))
|
||||
{
|
||||
velocityY = -7f;
|
||||
}
|
||||
if (player.direction == -1)
|
||||
{
|
||||
if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.9))
|
||||
{
|
||||
spawnAdditiveX -= 8f;
|
||||
}
|
||||
if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.7))
|
||||
{
|
||||
spawnAdditiveX -= 6f;
|
||||
}
|
||||
}
|
||||
if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.7))
|
||||
{
|
||||
spawnAdditiveX = 26f;
|
||||
}
|
||||
if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.6))
|
||||
{
|
||||
velocityY = -6f;
|
||||
velocityX = 2f;
|
||||
}
|
||||
if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.4))
|
||||
{
|
||||
velocityY = -4f;
|
||||
velocityX = 4f;
|
||||
}
|
||||
if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.3))
|
||||
{
|
||||
spawnAdditiveX -= 4f;
|
||||
spawnAdditiveY -= 20f;
|
||||
}
|
||||
if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.2))
|
||||
{
|
||||
velocityY = -2f;
|
||||
velocityX = 6f;
|
||||
}
|
||||
if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.1))
|
||||
{
|
||||
velocityX = 7f;
|
||||
}
|
||||
if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.1))
|
||||
{
|
||||
spawnAdditiveY += 6f;
|
||||
}
|
||||
velocityY *= 1.35f;
|
||||
velocityX *= 1.35f;
|
||||
spawnAdditiveX *= (float)player.direction * Main.rand.NextFloat(0.9f, 1.1f);
|
||||
spawnAdditiveY *= player.gravDir;
|
||||
Projectile.NewProjectile((float)(hitbox.X + hitbox.Width / 2) + spawnAdditiveX, (float)(hitbox.Y + hitbox.Height / 2) + spawnAdditiveY,
|
||||
(float)player.direction * velocityX, velocityY * player.gravDir, ModContent.ProjectileType<GaelSpark>(), (int)((float)item.damage * 0.35f * player.meleeDamage), 0f, player.whoAmI, 0f, 0f);
|
||||
|
||||
if (player.itemAnimation == (int)((double)player.itemAnimationMax * 0.9))
|
||||
{
|
||||
player.Calamity().gaelBloodShotCooldown = 30;
|
||||
}
|
||||
}
|
||||
}
|
||||
public override void OnHitNPC(Player player, NPC target, int damage, float knockBack, bool crit)
|
||||
{
|
||||
//True melee boost
|
||||
if (SwingType == 2)
|
||||
{
|
||||
damage = (int)((Main.hardMode ? TrueMeleeBoostHardmode : TrueMeleeBoostPreHardmode) * damage);
|
||||
}
|
||||
}
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
//This is mostly from a function in Player.cs which handles the Brand of the Inferno alt click effect
|
||||
//attackCD = The attack countdown. Can reflect attacks from projectiles and hostile npcs while > 0
|
||||
//shield_parry_cooldown = A simple count down variable for effects.
|
||||
if (player.altFunctionUse == 2)
|
||||
{
|
||||
bool shieldRaised = false;
|
||||
if (player.selectedItem != 58 && player.controlUseTile && !player.tileInteractionHappened && player.releaseUseItem && !player.controlUseItem && !player.mouseInterface && !CaptureManager.Instance.Active && !Main.HoveringOverAnNPC && !Main.SmartInteractShowingGenuine
|
||||
&& player.inventory[player.selectedItem].type == ModContent.ItemType<GaelsGreatsword>() && !player.mount.Active && (player.itemAnimation == 0 || PlayerInput.Triggers.JustPressed.MouseRight))
|
||||
{
|
||||
shieldRaised = true;
|
||||
}
|
||||
if (player.shield_parry_cooldown > 0)
|
||||
{
|
||||
player.shield_parry_cooldown--;
|
||||
if (player.shield_parry_cooldown == 1)
|
||||
{
|
||||
Main.PlaySound(25, -1, -1, 1, 1f, 0f);
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
int dustIndex = Dust.NewDust(player.Center + new Vector2((float)(player.direction * 6 + ((player.direction == -1) ? -10 : 0)), -14f), 10, 16, 45, 0f, 0f, 255, new Color(255, 100, 0, 127), (float)Main.rand.NextFloat(1f, 1.6f));
|
||||
Main.dust[dustIndex].noLight = true;
|
||||
Main.dust[dustIndex].noGravity = true;
|
||||
Main.dust[dustIndex].velocity *= 0.5f;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (shieldRaised != player.shieldRaised)
|
||||
{
|
||||
player.shieldRaised = shieldRaised;
|
||||
if (player.shieldRaised)
|
||||
{
|
||||
player.itemAnimation = 0;
|
||||
player.itemTime = 0;
|
||||
player.reuseDelay = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
player.shield_parry_cooldown = 15;
|
||||
if (player.attackCD < 30)
|
||||
{
|
||||
player.attackCD = 30;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
switch (SwingType)
|
||||
{
|
||||
//Two small, quick skulls
|
||||
case 0:
|
||||
int numProj = 2;
|
||||
float rotation = MathHelper.ToRadians(10f);
|
||||
for (int i = 0; i < numProj; i++)
|
||||
{
|
||||
Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1)));
|
||||
Projectile.NewProjectile(position, perturbedSpeed, type, damage, knockBack, player.whoAmI);
|
||||
}
|
||||
break;
|
||||
//Giant, slow, fading skull
|
||||
case 1:
|
||||
int projectileIndex = Projectile.NewProjectile(position, new Vector2(speedX,speedY) * 0.5f, type, damage * 2, knockBack, player.whoAmI, ai1:1f);
|
||||
Main.projectile[projectileIndex].scale = 1.75f;
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 600 B After Width: | Height: | Size: 842 B |
@@ -36,7 +36,6 @@ namespace CalamityMod.NPCs.AcidRain
|
||||
npc.noTileCollide = false;
|
||||
npc.HitSound = SoundID.NPCHit1;
|
||||
npc.DeathSound = SoundID.NPCDeath1;
|
||||
//npc.catchItem = (Main.rand.NextBool(20)) ? (short)ModContent.ItemType<RadiatingCrystal>() : ItemID.None;
|
||||
aiType = NPCID.GlowingSnail;
|
||||
animationType = NPCID.GlowingSnail;
|
||||
//banner = npc.type;
|
||||
@@ -45,6 +44,14 @@ namespace CalamityMod.NPCs.AcidRain
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
/*if (npc.localAI[0] == 0f)
|
||||
{
|
||||
npc.catchItem = (Main.rand.NextBool(20)) ? (short)ModContent.ItemType<RadiatingCrystal>() : ItemID.None;
|
||||
npc.localAI[0] = 1f;
|
||||
npc.velocity.Y = -3f;
|
||||
npc.netUpdate = true;
|
||||
}*/
|
||||
|
||||
Lighting.AddLight(npc.Center, 0.3f, 1.5f, 0.3f);
|
||||
|
||||
int auraSize = 200; //roughly 12 blocks (half the size of Wither Beast aura)
|
||||
|
||||
@@ -2443,6 +2443,10 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
damage = (int)(damage * 0.6);
|
||||
}
|
||||
if (projectile.type == ModContent.ProjectileType<SparklingBeam>())
|
||||
{
|
||||
damage = (int)(damage * 0.7);
|
||||
}
|
||||
}
|
||||
|
||||
if (Main.player[projectile.owner].Calamity().eGauntlet)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables.Banners;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.World;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -268,6 +269,7 @@ namespace CalamityMod.NPCs.Crags
|
||||
{
|
||||
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<EssenceofChaos>());
|
||||
}
|
||||
//DropHelper.DropItemChance(npc, ModContent.ItemType<GaelsGreatsword>(), CalamityWorld.defiled ? 0.05f : 0.02f);
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables.Banners;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.World;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -268,6 +269,7 @@ namespace CalamityMod.NPCs.Crags
|
||||
{
|
||||
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<EssenceofChaos>());
|
||||
}
|
||||
//DropHelper.DropItemChance(npc, ModContent.ItemType<GaelsGreatsword>(), CalamityWorld.defiled ? 0.05f : 0.02f);
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
|
||||
@@ -34,7 +34,6 @@ namespace CalamityMod.NPCs.SunkenSea
|
||||
npc.alpha = 100;
|
||||
npc.HitSound = SoundID.NPCHit25;
|
||||
npc.DeathSound = SoundID.NPCDeath28;
|
||||
npc.catchItem = (Main.rand.NextBool(20)) ? (short)ModContent.ItemType<RustedJingleBell>() : ItemID.None;
|
||||
banner = npc.type;
|
||||
bannerItem = ModContent.ItemType<GhostBellSmallBanner>();
|
||||
}
|
||||
@@ -53,7 +52,14 @@ namespace CalamityMod.NPCs.SunkenSea
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (Main.rand.Next(8) < 1 && npc.catchItem == (short)ModContent.ItemType<RustedJingleBell>())
|
||||
if (npc.localAI[0] == 0f)
|
||||
{
|
||||
npc.catchItem = (Main.rand.NextBool(20)) ? (short)ModContent.ItemType<RustedJingleBell>() : ItemID.None;
|
||||
npc.localAI[0] = 1f;
|
||||
npc.velocity.Y = -3f;
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
if (Main.rand.Next(8) < 1 && npc.catchItem == (short)ModContent.ItemType<RustedJingleBell>())
|
||||
{
|
||||
int dust = Dust.NewDust(npc.position - new Vector2(2f, 2f), npc.width + 4, npc.height + 4, 68, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 200, default, 1f);
|
||||
Main.dust[dust].noGravity = true;
|
||||
@@ -67,12 +73,6 @@ namespace CalamityMod.NPCs.SunkenSea
|
||||
}
|
||||
}
|
||||
Lighting.AddLight(npc.Center, 0f, (255 - npc.alpha) * 1f / 255f, (255 - npc.alpha) * 1f / 255f);
|
||||
if (npc.localAI[0] == 0f)
|
||||
{
|
||||
npc.localAI[0] = 1f;
|
||||
npc.velocity.Y = -3f;
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
if (npc.wet)
|
||||
{
|
||||
npc.noGravity = true;
|
||||
|
||||
@@ -287,7 +287,7 @@ namespace CalamityMod.NPCs.TownNPCs
|
||||
nextSlot++;
|
||||
}
|
||||
//:BearWatchingYou:
|
||||
if (npc.GivenOrTypeName == "Laura")
|
||||
if (npc.modNPC.TownNPCName() == "Laura")
|
||||
{
|
||||
shop.item[nextSlot].SetDefaults(ModContent.ItemType<BearEye>());
|
||||
nextSlot++;
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
public bool IsAtMaxCharge => Charge == MAX_CHARGE;
|
||||
|
||||
private bool playedSound = false;
|
||||
private int manaDrain = 0;
|
||||
//private int manaDrain = 0;
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
projectile.magic = true;
|
||||
projectile.hide = true;
|
||||
projectile.usesIDStaticNPCImmunity = true;
|
||||
projectile.idStaticNPCHitCooldown = 10;
|
||||
projectile.idStaticNPCHitCooldown = 15;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
@@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
if (target.life <= 0)
|
||||
{
|
||||
int shardDamage = SparklingEmpress.BaseDamage / 2;
|
||||
int shardDamage = SparklingEmpress.BaseDamage / 4;
|
||||
int num251 = Main.rand.Next(2, 4);
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
|
||||
@@ -195,7 +195,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
|
||||
private void Waterfalls(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
int type = ModContent.ProjectileType<OceanBeam>();
|
||||
int type = ModContent.ProjectileType<Waterfall>();
|
||||
int numWaterfalls = 12;
|
||||
int waterfallDamage = DragonPow.BaseDamage / 6;
|
||||
float waterfallKB = 0f;
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
int num3;
|
||||
for (int num611 = 0; num611 < 10; num611 = num3 + 1)
|
||||
{
|
||||
Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 42, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default, 1f);
|
||||
Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 64, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default, 1f);
|
||||
num3 = num611;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
public class GaelSkull : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Skull");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 4;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
Main.projFrames[projectile.type] = 5;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 16;
|
||||
projectile.height = 16;
|
||||
projectile.friendly = true;
|
||||
projectile.melee = true;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.penetrate = 2;
|
||||
projectile.timeLeft = 600;
|
||||
projectile.light = 1f;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = GaelsGreatsword.BaseImmunityFrames;
|
||||
|
||||
if (CalamityWorld.downedYharon)
|
||||
{
|
||||
projectile.localNPCHitCooldown = GaelsGreatsword.PostYharonImmunityFrames;
|
||||
}
|
||||
else if (NPC.downedMoonlord)
|
||||
{
|
||||
projectile.localNPCHitCooldown = GaelsGreatsword.PostMoonLordImmunityFrames;
|
||||
}
|
||||
else if (Main.hardMode)
|
||||
{
|
||||
projectile.localNPCHitCooldown = GaelsGreatsword.HardmodeImmunityFrames;
|
||||
}
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
float checkingDistance = GaelsGreatsword.BaseSearchDistance;
|
||||
if (CalamityWorld.downedYharon)
|
||||
{
|
||||
checkingDistance = GaelsGreatsword.PostYharonSearchDistance;
|
||||
}
|
||||
else if (NPC.downedMoonlord)
|
||||
{
|
||||
checkingDistance = GaelsGreatsword.PostMoonLordSearchDistance;
|
||||
}
|
||||
else if (Main.hardMode)
|
||||
{
|
||||
checkingDistance = GaelsGreatsword.HardmodeSearchDistance;
|
||||
}
|
||||
|
||||
//Targeting
|
||||
|
||||
NPC target = projectile.Center.ClosestNPCAt(checkingDistance);
|
||||
projectile.tileCollide = target != null; //Go through walls if we're hunting an NPC
|
||||
if (target != null)
|
||||
{
|
||||
float velocityMagnitude = projectile.velocity.Length();
|
||||
Vector2 distanceNorm = projectile.DirectionTo(target.Center) * velocityMagnitude * (projectile.Distance(target.Center) < 220f ? 1.3f : 1f);
|
||||
float inverseTurnSpeed = (projectile.Distance(target.Center) < 240f ? 4f : 13f);
|
||||
projectile.velocity = (projectile.velocity * inverseTurnSpeed + distanceNorm) / (inverseTurnSpeed + 0.4f);
|
||||
projectile.velocity.Normalize();
|
||||
projectile.velocity *= velocityMagnitude;
|
||||
}
|
||||
|
||||
//Rotation
|
||||
|
||||
if (projectile.velocity.X < 0f)
|
||||
{
|
||||
projectile.spriteDirection = -1;
|
||||
projectile.rotation = (-projectile.velocity).ToRotation();
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.spriteDirection = 1;
|
||||
projectile.rotation = projectile.velocity.ToRotation();
|
||||
}
|
||||
|
||||
//Dust circle
|
||||
|
||||
projectile.ai[0] += 1f;
|
||||
if (projectile.ai[0] % 20 == 0f)
|
||||
{
|
||||
for (int l = 0; l < 24; l++)
|
||||
{
|
||||
Vector2 spawnPositionAdditive = Vector2.UnitX * (float)-(float)projectile.width / 2f;
|
||||
spawnPositionAdditive += -Vector2.UnitY.RotatedBy((double)((float)l * MathHelper.TwoPi / 24f), default) * new Vector2(8f, 16f) * projectile.scale;
|
||||
spawnPositionAdditive = spawnPositionAdditive.RotatedBy((double)(projectile.rotation), default);
|
||||
int dustIndex = Dust.NewDust(projectile.Center, 0, 0, 218, 0f, 0f, 0, default, 1.5f);
|
||||
Main.dust[dustIndex].noGravity = true;
|
||||
Main.dust[dustIndex].position = projectile.Center + spawnPositionAdditive;
|
||||
Main.dust[dustIndex].velocity = projectile.velocity * 0.1f;
|
||||
Main.dust[dustIndex].velocity = Vector2.Normalize(projectile.Center - projectile.velocity * 3f - Main.dust[dustIndex].position) * 1.25f;
|
||||
}
|
||||
}
|
||||
|
||||
//Frame logic
|
||||
|
||||
projectile.frameCounter++;
|
||||
if (projectile.frameCounter % 5 == 0)
|
||||
{
|
||||
projectile.frame++;
|
||||
}
|
||||
if (projectile.frame >= Main.projFrames[projectile.type])
|
||||
{
|
||||
projectile.frame = 0;
|
||||
}
|
||||
|
||||
//Fat skull logic
|
||||
if (projectile.ai[1] == 1f)
|
||||
{
|
||||
if (projectile.localAI[0] == 0f && !NPC.downedMoonlord)
|
||||
{
|
||||
projectile.penetrate = GaelsGreatsword.PreMoonlordPenetrate;
|
||||
projectile.localAI[0] = 1f;
|
||||
}
|
||||
else if (NPC.downedMoonlord)
|
||||
{
|
||||
projectile.penetrate = 5;
|
||||
}
|
||||
projectile.alpha += 1;
|
||||
projectile.damage = (int)Math.Ceiling(projectile.damage * 0.992); //Exponentially decays to a factor of 0.12896 of the original damage
|
||||
if (projectile.alpha >= 255)
|
||||
{
|
||||
projectile.Kill();
|
||||
}
|
||||
}
|
||||
else if (projectile.alpha > 0)
|
||||
{
|
||||
projectile.alpha -= 15;
|
||||
if (projectile.alpha < 0)
|
||||
{
|
||||
projectile.alpha = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
projectile.position = projectile.Center;
|
||||
projectile.width = projectile.height = 240;
|
||||
projectile.position.X = projectile.position.X - (float)(projectile.width / 2);
|
||||
projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2);
|
||||
projectile.maxPenetrate = -1;
|
||||
projectile.penetrate = -1;
|
||||
projectile.Damage();
|
||||
Main.PlaySound((int)SoundType.NPCKilled, (int)projectile.Center.X, (int)projectile.Center.Y, 52, 0.4f);
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 218, 0f, 0f, 100, default, 1.5f);
|
||||
}
|
||||
for (int i = 0; i < 30; i++)
|
||||
{
|
||||
float angle = MathHelper.TwoPi * i / 30f;
|
||||
int dustIndex = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 218, 0f, 0f, 0, default, 2.5f);
|
||||
Main.dust[dustIndex].noGravity = true;
|
||||
Main.dust[dustIndex].velocity *= 3f;
|
||||
dustIndex = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 218, 0f, 0f, 100, default, 1.5f);
|
||||
Main.dust[dustIndex].velocity *= 2f;
|
||||
Main.dust[dustIndex].noGravity = true;
|
||||
Dust.NewDust(projectile.Center + angle.ToRotationVector2() * 160f, 0, 0, 218, 0f, 0f, 100, default, 1.5f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 2.4 KiB |
@@ -0,0 +1,40 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
public class GaelSpark : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Spark");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 6;
|
||||
projectile.height = 6;
|
||||
projectile.friendly = true;
|
||||
projectile.melee = true;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.penetrate = 1;
|
||||
projectile.timeLeft = 180;
|
||||
projectile.alpha = 255;
|
||||
}
|
||||
public override bool OnTileCollide(Vector2 oldVelocity)
|
||||
{
|
||||
projectile.velocity.X = 0f;
|
||||
return false;
|
||||
}
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, 0.7f, 0f, 0f);
|
||||
projectile.velocity.Y += 0.3f;
|
||||
int dustIndex = Dust.NewDust(projectile.Center, 0, 0, DustID.Blood, 0f, 0f, 0, default, 1.4f);
|
||||
Main.dust[dustIndex].noGravity = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 130 B |
@@ -0,0 +1,101 @@
|
||||
using System;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
public class Waterfall : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Beam");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 8;
|
||||
projectile.height = 8;
|
||||
projectile.friendly = true;
|
||||
projectile.alpha = 255;
|
||||
projectile.extraUpdates = 2;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 8;
|
||||
projectile.penetrate = 3;
|
||||
projectile.timeLeft /= 2;
|
||||
projectile.melee = true;
|
||||
projectile.tileCollide = false;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
for (int num92 = 0; num92 < 2; num92++)
|
||||
{
|
||||
float num93 = projectile.velocity.X / 3f * (float)num92;
|
||||
float num94 = projectile.velocity.Y / 3f * (float)num92;
|
||||
int num95 = 4;
|
||||
int num96 = Dust.NewDust(new Vector2(projectile.position.X + (float)num95, projectile.position.Y + (float)num95), projectile.width - num95 * 2, projectile.height - num95 * 2, 56, 0f, 0f, 100, default, 1.2f);
|
||||
Main.dust[num96].noGravity = true;
|
||||
Main.dust[num96].velocity *= 0.25f;
|
||||
Main.dust[num96].velocity += projectile.velocity * 0.1f;
|
||||
Dust expr_47FA_cp_0 = Main.dust[num96];
|
||||
expr_47FA_cp_0.position.X -= num93;
|
||||
Dust expr_4815_cp_0 = Main.dust[num96];
|
||||
expr_4815_cp_0.position.Y -= num94;
|
||||
}
|
||||
for (int num105 = 0; num105 < 2; num105++)
|
||||
{
|
||||
float num99 = projectile.velocity.X / 3f * (float)num105;
|
||||
float num100 = projectile.velocity.Y / 3f * (float)num105;
|
||||
int num101 = 4;
|
||||
int num102 = Dust.NewDust(new Vector2(projectile.position.X + (float)num101, projectile.position.Y + (float)num101), projectile.width - num101 * 2, projectile.height - num101 * 2, 245, 0f, 0f, 100, default, 1.2f);
|
||||
Main.dust[num102].noGravity = true;
|
||||
Main.dust[num102].velocity *= 0.1f;
|
||||
Main.dust[num102].velocity += projectile.velocity * 0.25f;
|
||||
Dust expr_47FA_cp_0 = Main.dust[num102];
|
||||
expr_47FA_cp_0.position.X -= num99;
|
||||
Dust expr_4815_cp_0 = Main.dust[num102];
|
||||
expr_4815_cp_0.position.Y -= num100;
|
||||
}
|
||||
|
||||
projectile.ai[1] += 1f;
|
||||
if (projectile.ai[1] >= 60f)
|
||||
projectile.tileCollide = true;
|
||||
}
|
||||
|
||||
public override bool OnTileCollide(Vector2 oldVelocity)
|
||||
{
|
||||
projectile.penetrate--;
|
||||
if (projectile.penetrate <= 0)
|
||||
{
|
||||
projectile.Kill();
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.ai[0] += 0.1f;
|
||||
if (projectile.velocity.X != oldVelocity.X)
|
||||
{
|
||||
projectile.velocity.X = -oldVelocity.X;
|
||||
}
|
||||
if (projectile.velocity.Y != oldVelocity.Y)
|
||||
{
|
||||
projectile.velocity.Y = -oldVelocity.Y;
|
||||
}
|
||||
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27);
|
||||
for (int k = 0; k < 3; k++)
|
||||
{
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 56, projectile.oldVelocity.X * 0.25f, projectile.oldVelocity.Y * 0.25f);
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 245, projectile.oldVelocity.X * 0.25f, projectile.oldVelocity.Y * 0.25f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 136 B |
@@ -22,11 +22,11 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
projectile.friendly = true;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.ranged = true;
|
||||
projectile.penetrate = -1;
|
||||
projectile.penetrate = 5;
|
||||
projectile.extraUpdates = 1;
|
||||
projectile.timeLeft = 90;
|
||||
projectile.usesIDStaticNPCImmunity = true;
|
||||
projectile.idStaticNPCHitCooldown = 5;
|
||||
projectile.idStaticNPCHitCooldown = 10;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
|
||||
@@ -20,10 +20,10 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
projectile.friendly = true;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.ranged = true;
|
||||
projectile.penetrate = -1;
|
||||
projectile.penetrate = 5;
|
||||
projectile.timeLeft = 90;
|
||||
projectile.usesIDStaticNPCImmunity = true;
|
||||
projectile.idStaticNPCHitCooldown = 8;
|
||||
projectile.idStaticNPCHitCooldown = 15;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
projectile.height = 10;
|
||||
projectile.friendly = true;
|
||||
projectile.ranged = true;
|
||||
projectile.penetrate = 6;
|
||||
projectile.penetrate = 5;
|
||||
projectile.aiStyle = 14;
|
||||
projectile.timeLeft = 300;
|
||||
projectile.usesIDStaticNPCImmunity = true;
|
||||
|
||||
@@ -96,10 +96,11 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
float num227 = 30f; //15
|
||||
float num228 = 30f; //15
|
||||
float num229 = projectile.ai[0];
|
||||
float scale5 = MathHelper.Clamp(num229 / 30f, 0f, 1f);
|
||||
float maxAlpha = 0.3f;
|
||||
float scale5 = MathHelper.Clamp(num229 / 30f, 0f, maxAlpha); //Fade in
|
||||
if (num229 > num226 - 60f)
|
||||
{
|
||||
scale5 = MathHelper.Lerp(1f, 0f, (num229 - (num226 - 60f)) / 60f);
|
||||
scale5 = MathHelper.Lerp(maxAlpha, 0f, (num229 - (num226 - 60f)) / 60f); //Fade out
|
||||
}
|
||||
Point point5 = projectile.Center.ToTileCoordinates();
|
||||
int num230;
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
}
|
||||
}
|
||||
public override bool? CanHitNPC(NPC target) => HomingCooldown == 0 && !target.townNPC
|
||||
&& target.type != NPCID.DD2EterniaCrystal && target.CanBeChasedBy();
|
||||
&& target.type != NPCID.DD2EterniaCrystal && !target.immortal && !target.dontTakeDamage;
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
HomingCooldown = 25;
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
public override bool PreDrawExtras(SpriteBatch spriteBatch)
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, 0.4f, 0f, 0f);
|
||||
CalamityUtils.DrawFishingLine(projectile, ModContent.ItemType<ChaoticSpreadRod>(), new Color(138, 50, 73, 100));
|
||||
CalamityUtils.DrawFishingLine(projectile, ModContent.ItemType<ChaoticSpreadRod>(), new Color(138, 50, 73, 100), 30f);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,14 +5,11 @@ using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Items.Fishing.FishingRods;
|
||||
|
||||
namespace CalamityMod.Projectiles.Typeless
|
||||
{
|
||||
public class DevourerofCodsBobber : ModProjectile
|
||||
{
|
||||
private static int red = 252;
|
||||
private static int green = 109;
|
||||
private static int blue = 202;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Devourer of Cods Bobber");
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
public override bool PreDrawExtras(SpriteBatch spriteBatch)
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0.25f / 255f, (255 - projectile.alpha) * 0.25f / 255f);
|
||||
CalamityUtils.DrawFishingLine(projectile, ModContent.ItemType<NavyFishingRod>(), new Color(36, 61, 111, 100));
|
||||
CalamityUtils.DrawFishingLine(projectile, ModContent.ItemType<NavyFishingRod>(), new Color(36, 61, 111, 100), 33f);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
// Amethyst Hook is 300, Static Hook is 600
|
||||
public override float GrappleRange()
|
||||
{
|
||||
return 450f;
|
||||
return 450f; //28.125 tiles
|
||||
}
|
||||
|
||||
public override void NumGrappleHooks(Player player, ref int numHooks)
|
||||
|
||||
@@ -1258,7 +1258,7 @@ namespace CalamityMod
|
||||
new Rectangle?(frame), Color.White, rotation, center, 1f, SpriteEffects.None, 0f);
|
||||
}
|
||||
|
||||
public static void DrawFishingLine(this Projectile projectile, int fishingRodType, Color poleColor)
|
||||
public static void DrawFishingLine(this Projectile projectile, int fishingRodType, Color poleColor, float yPositionAdditive = 35f)
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, 0.4f, 0f, 0.4f);
|
||||
|
||||
@@ -1278,7 +1278,7 @@ namespace CalamityMod
|
||||
{
|
||||
pPosX -= 13f;
|
||||
}
|
||||
pPosY -= 35f * gravDir;
|
||||
pPosY -= yPositionAdditive * gravDir;
|
||||
}
|
||||
|
||||
if (gravDir == -1f)
|
||||
|
||||