MERGE: Num death with Flamethrower Reworks

This commit is contained in:
Ozzatron committed 2023-10-28 22:01:16 -04:00
commit 522d4eec8b
794 files changed
+21731 -21896

No files matched your search

+2 -2
View File
@@ -12,8 +12,8 @@ namespace CalamityMod.Items.Accessories
public new string LocalizationCategory => "Items.Accessories";
public override void SetDefaults()
{
Item.width = 26;
Item.height = 26;
Item.width = 30;
Item.height = 38;
Item.value = CalamityGlobalItem.Rarity3BuyPrice;
Item.rare = ItemRarityID.Orange;
Item.accessory = true;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 550 B

After

Width:  |  Height:  |  Size: 545 B

+1 -1
View File
@@ -25,7 +25,7 @@ namespace CalamityMod.Items.Accessories
modPlayer.stealthGenStandstill += 0.15f;
modPlayer.stealthGenMoving += 0.15f;
player.GetDamage<RogueDamageClass>() -= 0.10f;
player.GetCritChance<RogueDamageClass>() -= 10;
player.GetCritChance<RogueDamageClass>() -= 5;
player.GetAttackSpeed<RogueDamageClass>() += 0.15f;
}
}
+1 -1
View File
@@ -9,7 +9,7 @@ namespace CalamityMod.Items.Accessories
public class TrinketofChi : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
internal const int ChiBuffTimerMax = 900;
internal const int ChiBuffTimerMax = 300;
public override void SetDefaults()
{
+58
View File
@@ -1128,6 +1128,64 @@ namespace CalamityMod.Items
AddGrappleStats(37.5f, 16f, 24f, 0f);
#endregion
#region Herbs and Seeds Tooltips
void AddHerbTooltips(string text)
{
int materialIndex = 0;
for (int i = 0; i < tooltips.Count; ++i)
if (tooltips[i].Name == "Material")
{
materialIndex = i;
break;
}
tooltips.Insert(materialIndex + 1, new TooltipLine(CalamityMod.Instance, "Tooltip0", text));
}
if (item.type == ItemID.Daybloom)
AddHerbTooltips(CalamityUtils.GetTextValue("Vanilla.HerbTooltips.Daybloom"));
if (item.type == ItemID.Moonglow)
AddHerbTooltips(CalamityUtils.GetTextValue("Vanilla.HerbTooltips.Moonglow"));
if (item.type == ItemID.Waterleaf)
AddHerbTooltips(CalamityUtils.GetTextValue("Vanilla.HerbTooltips.Waterleaf"));
if (item.type == ItemID.Blinkroot)
AddHerbTooltips(CalamityUtils.GetTextValue("Vanilla.HerbTooltips.Blinkroot"));
if (item.type == ItemID.Shiverthorn)
AddHerbTooltips(CalamityUtils.GetTextValue("Vanilla.HerbTooltips.Shiverthorn"));
if (item.type == ItemID.Deathweed)
AddHerbTooltips(CalamityUtils.GetTextValue("Vanilla.HerbTooltips.Deathweed"));
if (item.type == ItemID.Fireblossom)
AddHerbTooltips(CalamityUtils.GetTextValue("Vanilla.HerbTooltips.Fireblossom"));
void AddSeedTooltips(string text)
{
int materialIndex = 0;
for (int i = 0; i < tooltips.Count; ++i)
if (tooltips[i].Name == "Placeable")
{
materialIndex = i;
break;
}
tooltips.Insert(materialIndex + 1, new TooltipLine(CalamityMod.Instance, "Tooltip0", text));
}
if (item.type == ItemID.DaybloomSeeds)
AddSeedTooltips(CalamityUtils.GetTextValue("Vanilla.SeedTooltips.Daybloom"));
if (item.type == ItemID.MoonglowSeeds)
AddSeedTooltips(CalamityUtils.GetTextValue("Vanilla.SeedTooltips.Moonglow"));
if (item.type == ItemID.WaterleafSeeds)
AddSeedTooltips(CalamityUtils.GetTextValue("Vanilla.SeedTooltips.Waterleaf"));
if (item.type == ItemID.BlinkrootSeeds)
AddSeedTooltips(CalamityUtils.GetTextValue("Vanilla.SeedTooltips.Blinkroot"));
if (item.type == ItemID.ShiverthornSeeds)
AddSeedTooltips(CalamityUtils.GetTextValue("Vanilla.SeedTooltips.Shiverthorn"));
if (item.type == ItemID.DeathweedSeeds)
AddSeedTooltips(CalamityUtils.GetTextValue("Vanilla.SeedTooltips.Deathweed"));
if (item.type == ItemID.FireblossomSeeds)
AddSeedTooltips(CalamityUtils.GetTextValue("Vanilla.SeedTooltips.Fireblossom"));
#endregion
// Beyond this point all code only applies to accessories. Skip it all if the item is not an accessory.
if (!item.accessory)
return;
+6 -6
View File
@@ -14,7 +14,7 @@ namespace CalamityMod.Items.SummonItems
public new string LocalizationCategory => "Items.SummonItems";
public override void SetStaticDefaults()
{
ItemID.Sets.SortingPriorityBossSpawns[Type] = 14; // Frost Moon
ItemID.Sets.SortingPriorityBossSpawns[Type] = 14; // Frost Moon
}
public override void SetDefaults()
@@ -28,10 +28,10 @@ namespace CalamityMod.Items.SummonItems
Item.consumable = false;
}
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
{
itemGroup = ContentSamples.CreativeHelper.ItemGroup.BossItem;
}
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
{
itemGroup = ContentSamples.CreativeHelper.ItemGroup.BossItem;
}
public override bool CanUseItem(Player player)
{
@@ -58,7 +58,7 @@ namespace CalamityMod.Items.SummonItems
CreateRecipe().
AddIngredient<Stardust>(30).
AddIngredient(ItemID.FallenStar, 20).
AddTile(TileID.MythrilAnvil).
AddTile(TileID.Anvils).
Register();
}
}
+1 -1
View File
@@ -15,7 +15,7 @@ namespace CalamityMod.Items.Tools
Item.knockBack = 2.5f;
Item.useTime = 9;
Item.useAnimation = 16;
Item.pick = 75;
Item.pick = 100;
Item.tileBoost += 1;
Item.DamageType = DamageClass.Melee;
+1 -1
View File
@@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Magic
for (int i = 0; i < 8; i++)
{
Vector2 ringVelocity = ((MathHelper.TwoPi * i / 8f) + velocity.ToRotation()).ToRotationVector2() * velocity.Length() * 0.5f;
Projectile.NewProjectile(source, position, ringVelocity, type, damage, knockback, Main.myPlayer);
Projectile.NewProjectile(source, position, ringVelocity, type, damage, knockback, Main.myPlayer, 0f, 0f);
}
return false;
}
+2 -2
View File
@@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Magic
public class VoidVortex : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Magic";
public const int OrbFireRate = 20;
public const int OrbFireRate = 15;
public override void SetStaticDefaults()
{
@@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic
public override void SetDefaults()
{
Item.damage = 106;
Item.damage = 110;
Item.DamageType = DamageClass.Magic;
Item.mana = 60;
Item.width = 130;
+1 -1
View File
@@ -43,7 +43,7 @@ namespace CalamityMod.Items.Weapons.Melee
public override void SetDefaults()
{
Item.width = Item.height = 60;
Item.damage = 60;
Item.damage = 35;
Item.DamageType = DamageClass.MeleeNoSpeed;
Item.noUseGraphic = true;
Item.noMelee = true;
+1 -1
View File
@@ -10,7 +10,7 @@ namespace CalamityMod.Items.Weapons.Melee
public override void SetDefaults()
{
Item.width = 78;
Item.damage = 48;
Item.damage = 40;
Item.DamageType = DamageClass.Melee;
Item.useAnimation = 18;
Item.useStyle = ItemUseStyleID.Swing;
+53 -286
View File
@@ -1,303 +1,70 @@
using Terraria.DataStructures;
using System.Collections.Generic;
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Melee;
using Microsoft.Xna.Framework;
using System.Collections.Generic;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
namespace CalamityMod.Items.Weapons.Melee
{
public class Roxcalibur : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Melee";
private int Roxcooldown = 901;
private int RoxCanUse = 0;
private int RoxCanAlt = 0;
private bool RoxAlt = false;
private bool Didrefresh = false;
public class Roxcalibur : ModItem, ILocalizedModType
{
public override void SetStaticDefaults()
{
ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true;
}
public string LocalizationCategory => "Items.Weapons.Melee";
public override void SetDefaults()
{
Item.damage = 150;
Item.knockBack = 13;
public static int BaseUseTime = 40;
public override void SetDefaults()
{
Item.damage = 180;
Item.knockBack = 13f;
Item.DamageType = DamageClass.Melee;
Item.useStyle = ItemUseStyleID.Swing;
Item.UseSound = SoundID.NPCHit42;
Item.width = 100;
Item.height = 100;
Item.autoReuse = true;
Item.useAnimation = Item.useTime = 64;
Item.shoot = ModContent.ProjectileType<Rox1>();
Item.shootSpeed = 10f;
Item.value = CalamityGlobalItem.Rarity4BuyPrice;
Item.rare = ItemRarityID.LightRed;
Item.useStyle = ItemUseStyleID.Shoot;
Item.UseSound = SoundID.NPCHit42;
Item.width = 100;
Item.height = 100;
Item.useAnimation = Item.useTime = BaseUseTime;
Item.reuseDelay = 10;
Item.shoot = ModContent.ProjectileType<RoxcaliburProj>();
Item.shootSpeed = 4f;
Item.value = CalamityGlobalItem.Rarity4BuyPrice;
Item.rare = ItemRarityID.LightRed;
Item.Calamity().donorItem = true;
Item.noUseGraphic = true;
Item.noMelee = true;
Item.autoReuse = false;
Item.channel = true;
}
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 8;
public override void ModifyWeaponCrit(Player player, ref float crit)
{
crit += 8f;
}
public override bool CanUseItem(Player player) => Main.hardMode && player.ownedProjectileCounts[Item.shoot] < 1;
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
Projectile.NewProjectile(source, position, velocity, type, damage, knockback, ai2: player.itemTimeMax); //needed to set ai2
return false;
}
public override void ModifyTooltips(List<TooltipLine> list)
{
list.FindAndReplace("[WOF]", Main.hardMode ? string.Empty : this.GetLocalizedValue("LockedInfo") + "\n");
}
public override void UpdateInventory(Player player)
{
//Timers for the cooldown and usage of the weapon
Roxcooldown++;
RoxCanUse++;
RoxCanAlt++;
if (Roxcooldown == 600)
{
for (int i = 0; i < 50; i++)
{
int d = Dust.NewDust(player.Center, player.width, player.height, 191, Main.rand.Next(-8, 9), Main.rand.Next(-8, 9), 100, default, 1);
Main.dust[d].noGravity = true;
Main.dust[d].position = player.Center;
}
SoundEngine.PlaySound(SoundID.Item70, player.Center);
}
// Resets the weapon usage if the alt fire collides with the ground
if (RoxAlt && player.ownedProjectileCounts[ModContent.ProjectileType<RoxSlam>()] <= 0)
{
player.itemAnimation = 0;
player.itemTime = 0;
RoxCanUse = 0;
RoxAlt = false;
Didrefresh = false;
}
// Controls what happens when the alt fire is active
if (RoxAlt && player.ownedProjectileCounts[ModContent.ProjectileType<RoxSlam>()] > 0)
{
if (player.mount.Active)
{
player.mount.Dismount(player);
}
player.maxFallSpeed = 22f;
player.controlJump = false;
player.controlUp = false;
player.dashDelay = 60;
}
}
public override bool CanUseItem(Player player)
{
//Only useable in hardmode and if a second has passed after the alt fire ended
return Main.hardMode && RoxCanUse >= 60;
}
public override bool AltFunctionUse(Player player)
{
return RoxCanAlt >= Item.useAnimation + 5 && player.position.Y != player.oldPosition.Y && !player.mount.Active && player.gravDir != -1;
}
public override void UseStyle(Player player, Rectangle heldItemFrame)
{
//Modifies the altfire use style and the location of the sprite of the weapon
if (player.altFunctionUse == 2)
{
player.itemLocation.X -= 32f * player.direction;
player.itemLocation.Y -= 60f;
Item.useStyle = ItemUseStyleID.HoldUp;
RoxAlt = true;
}
//Modifies to use style and hold out of the main fire mode
else
{
player.itemLocation += new Vector2(-7.5f * player.direction, 8.5f * player.gravDir).RotatedBy(player.itemRotation);
Item.useStyle = ItemUseStyleID.Swing;
RoxAlt = false;
}
}
//Makes the alt fire only spawn the projectile once
// TODO -- Fix this, because tmod removed this function
//public override bool OnlyShootOnSwing => RoxAlt;
public override void UseItemHitbox(Player player, ref Rectangle hitbox, ref bool noHitbox)
{
//Changes the hitbox of the alt fire to fit the sprite
if (player.altFunctionUse == 2)
{
if (player.direction == 1)
{
hitbox.X = (int)player.position.X - 9;
}
else
{
hitbox.X = (int)player.position.X - 22;
}
hitbox.Y = (int)player.position.Y + 20;
hitbox.Width = 52;
}
//Why did i need to fix this hitbox i have no clue
else
{
if (player.direction == -1)
{
hitbox.X += 16;
}
hitbox.Width -= 15;
}
}
public override float UseSpeedMultiplier(Player player)
{
//If you use alt fire it can hold the sword for way longer
if (player.altFunctionUse == 2)
{
//Use animation 40/0.1 = 400
return 0.1f;
}
else
{
return 1f;
}
}
public override void MeleeEffects(Player player, Rectangle hitbox)
{
if (player.altFunctionUse == 2)
{
//Prevents the player from getting stuck on tiles like platforms
if (player.position.Y == player.oldPosition.Y)
{
player.itemAnimation = 0;
player.itemTime = 0;
RoxAlt = false;
RoxCanUse = 0;
if (Didrefresh)
{
Roxcooldown = 600;
Didrefresh = false;
}
}
// Makes the player forcefully dive down
if (CalamityUtils.CountHookProj() <= 0)
player.velocity.Y = player.maxFallSpeed;
//Rotates the sprite of the item on alt fire to have it point downwards
player.itemRotation = player.direction * MathHelper.ToRadians(135f);
//Dust trail
int dusty = hitbox.Y + (hitbox.Height / 2);
Dust.NewDust(new Vector2(hitbox.X, dusty), hitbox.Width, hitbox.Height / 2, 191, player.velocity.X * 0.25f, player.velocity.Y * 0.25f, 160, default, 0.7f);
}
else
{
Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 191, 0f, 0f, 160, default, 0.7f);
}
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
if (Item.useStyle == ItemUseStyleID.HoldUp)
{
//Spawns a projectile on the tip of the sword in the alt fire
float positionx;
float positiony = position.Y + (Item.height / 2) + 23;
int cooldown = 0;
//Check if the entire cooldown has passed
if (Roxcooldown >= 600)
{
cooldown = 1;
}
// Makes the projectile spawn in the proper position on the X axis
if (player.direction == 1)
{
positionx = position.X + 6;
}
else
{
positionx = position.X - 8;
}
Projectile.NewProjectile(source, positionx, positiony - (player.height / 10f), player.velocity.X, player.velocity.Y, ModContent.ProjectileType<RoxSlam>(), 0, 0, player.whoAmI, cooldown);
//Resets the cooldown after shooting
if (Roxcooldown >= 600)
{
Roxcooldown = 0;
//"Why yes i did refresh the cooldown whatcha gonna do about it?" -continues on OnHitNPC
Didrefresh = true;
}
return false;
}
else
{
for (int i = 0; i < 2; i++)
{
Vector2 pertubedspeed = new Vector2(velocity.X / 2, -10f * player.gravDir).RotatedByRandom(MathHelper.ToRadians(10f));
Projectile.NewProjectile(source, position.X, position.Y, pertubedspeed.X, pertubedspeed.Y, ModContent.ProjectileType<Rox1>(), (int)(damage * 0.5), 1f, player.whoAmI, Main.rand.Next(3));
}
RoxCanAlt = 0;
return false;
}
}
public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone)
{
if (Item.useStyle == ItemUseStyleID.HoldUp)
{
if (player.whoAmI == Main.myPlayer)
{
//"Well you did refresh the cooldown but like i dont want it to be wasted on an enemy hit so imma ask you for a refund"
if (Didrefresh)
{
Roxcooldown = 600;
Didrefresh = false;
}
//End the alt attack
player.itemAnimation = 0;
player.itemTime = 0;
RoxAlt = false;
RoxCanUse = 0;
player.velocity.Y = -16f;
player.fallStart = (int)(player.position.Y / 16f);
}
}
}
public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo)
{
if (Item.useStyle == ItemUseStyleID.HoldUp)
{
if (player.whoAmI == Main.myPlayer)
{
//"Well you did refresh the cooldown but like i dont want it to be wasted on a player hit so imma ask you for a refund"
if (Didrefresh)
{
Roxcooldown = 600;
Didrefresh = false;
}
//End the alt attack
player.itemAnimation = 0;
player.itemTime = 0;
RoxAlt = false;
RoxCanUse = 0;
player.velocity.Y = -16f;
player.fallStart = (int)(player.position.Y / 16f);
}
}
}
public override void ModifyTooltips(List<TooltipLine> list) => list.FindAndReplace("[WOF]", Main.hardMode ? string.Empty : this.GetLocalizedValue("LockedInfo") + "\n");
public override void AddRecipes()
{
CreateRecipe().
AddIngredient(ItemID.HellstoneBar, 25).
AddIngredient(ItemID.SoulofNight, 10).
AddIngredient<EssenceofHavoc>(5).
AddIngredient(ItemID.Obsidian, 10).
AddIngredient(ItemID.StoneBlock, 100).
AddIngredient(ItemID.Amethyst, 2).
AddTile(TileID.Anvils).
Register();
}
}
public override void AddRecipes()
{
CreateRecipe()
.AddIngredient(ItemID.HellstoneBar, 25)
.AddIngredient(ItemID.SoulofNight, 10)
.AddIngredient<EssenceofHavoc>(5)
.AddIngredient(ItemID.Obsidian, 10)
.AddIngredient(ItemID.StoneBlock, 100)
.AddIngredient(ItemID.Amethyst, 2)
.AddTile(TileID.Anvils)
.Register();
}
}
}
+3 -3
View File
@@ -25,8 +25,8 @@ namespace CalamityMod.Items.Weapons.Ranged
Item.useAmmo = AmmoID.Bullet;
Item.autoReuse = true;
Item.width = 94;
Item.height = 32;
Item.width = 150;
Item.height = 48;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
Item.UseSound = CommonCalamitySounds.LargeWeaponFireSound;
@@ -40,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Ranged
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 35;
public override Vector2? HoldoutOffset() => new Vector2(-10, 0);
public override Vector2? HoldoutOffset() => new Vector2(-28, 0);
public override void AddRecipes()
{
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

+2 -2
View File
@@ -17,8 +17,8 @@ namespace CalamityMod.Items.Weapons.Rogue
Item.damage = 145;
Item.knockBack = 8f;
Item.width = 102;
Item.height = 98;
Item.width = 108;
Item.height = 114;
Item.useStyle = ItemUseStyleID.Swing;
Item.noMelee = true;
Item.noUseGraphic = true;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

+2 -2
View File
@@ -32,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Rogue
Item.rare = ModContent.RarityType<PureGreen>();
}
public override float StealthDamageMultiplier => 0.45f;
//public override float StealthDamageMultiplier => 0.45f;
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
@@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Rogue
for (int i = 0; i < 3; i++)
{
Vector2 perturbedspeed = new Vector2(velocity.X + Main.rand.Next(-2,3), velocity.Y + Main.rand.Next(-2,3)).RotatedBy(MathHelper.ToRadians(spread));
int proj = Projectile.NewProjectile(source, position, perturbedspeed, type, damage, knockback, player.whoAmI);
int proj = Projectile.NewProjectile(source, position, perturbedspeed, type, (int)(damage*0.45), knockback, player.whoAmI);
if (proj.WithinBounds(Main.maxProjectiles))
{
Main.projectile[proj].Calamity().stealthStrike = true;
+2 -2
View File
@@ -25,8 +25,8 @@ namespace CalamityMod.Items.Weapons.Summon
Item.mana = 50;
Item.DamageType = DamageClass.Summon;
Item.sentry = true;
Item.width = 48;
Item.height = 48;
Item.width = 56;
Item.height = 56;
Item.useTime = 30;
Item.useAnimation = 30;
Item.useStyle = 1;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 408 B

After

Width:  |  Height:  |  Size: 1.3 KiB