This commit is contained in:
Andrew Marheine committed 2020-04-30 10:55:21 -05:00
commit 8fa8e88909
132 files changed
+844 -1394

No files matched your search

+1 -6
View File
@@ -5403,12 +5403,7 @@ namespace CalamityMod.CalPlayer
}
if (umbraphileSet && proj.Calamity().rogue && (Main.rand.NextBool(4) || proj.Calamity().stealthStrike))
{
int newDamage = (int)(proj.damage * 0.25);
if (newDamage > 50)
{
newDamage = (int)((proj.damage * 0.25 - 50) * 0.1) + 50;
}
Projectile.NewProjectile(proj.Center.X, proj.Center.Y, 0f, 0f, ModContent.ProjectileType<UmbraphileBoom>(), newDamage, 0f, player.whoAmI, 0f, 0f);
Projectile.NewProjectile(proj.Center.X, proj.Center.Y, 0f, 0f, ModContent.ProjectileType<UmbraphileBoom>(), CalamityUtils.DamageSoftCap(proj.damage * 0.25, 50), 0f, player.whoAmI, 0f, 0f);
}
if (bloodflareMelee && isTrueMelee)
{
-1
View File
@@ -1348,7 +1348,6 @@ namespace CalamityMod
ItemID.PhoenixBlaster,
ItemID.DD2BetsyBow,
ItemID.InfluxWaver,
ItemID.LaserMachinegun,
ItemID.Xenopopper,
ItemID.ElectrosphereLauncher
};
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+38
View File
@@ -0,0 +1,38 @@
using CalamityMod.Items.Materials;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Dyes
{
public class ElementalDye : BaseDye
{
public override ArmorShaderData ShaderDataToBind => new ArmorShaderData(new Ref<Effect>(mod.GetEffect("Effects/Dyes/ElementalDyeShader")), "DyePass").UseImage("Images/Misc/Perlin");
public override void SafeSetStaticDefaults()
{
DisplayName.SetDefault("Elemental Dye");
}
public override void SafeSetDefaults()
{
item.rare = 10;
item.Calamity().customRarity = CalamityRarity.Turquoise;
item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.SolarDye);
recipe.AddIngredient(ItemID.VortexDye);
recipe.AddIngredient(ItemID.StardustDye);
recipe.AddIngredient(ItemID.NebulaDye);
recipe.AddIngredient(ModContent.ItemType<GalacticaSingularity>());
recipe.AddTile(TileID.DyeVat);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

+1 -1
View File
@@ -28,7 +28,7 @@ namespace CalamityMod.Items.Dyes
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.BottledWater);
recipe.AddIngredient(ModContent.ItemType<EndothermicDye>(), 5);
recipe.AddIngredient(ModContent.ItemType<EndothermicEnergy>(), 5);
recipe.AddTile(TileID.DyeVat);
recipe.SetResult(this);
recipe.AddRecipe();
+1
View File
@@ -2,6 +2,7 @@ using CalamityMod.Items.Placeables.Ores;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.GameContent.Dyes;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
+1 -1
View File
@@ -10,7 +10,7 @@ namespace CalamityMod.Items.Dyes
{
public class ShadowspecDye : BaseDye
{
public override ArmorShaderData ShaderDataToBind => new ArmorShaderData(new Ref<Effect>(mod.GetEffect("Effects/Dyes/DragonSoulDyeShader")), "DyePass").
public override ArmorShaderData ShaderDataToBind => new ArmorShaderData(new Ref<Effect>(mod.GetEffect("Effects/Dyes/ShadowspecDyeShader")), "DyePass").
UseColor(new Color(46, 27, 60)).UseSecondaryColor(new Color(132, 142, 191)).UseImage("Images/Misc/Perlin");
public override void SafeSetStaticDefaults()
{
@@ -45,7 +45,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0;
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<GatlingLaserProj>(), damage, knockBack, player.whoAmI, 0f, 0f);
return false;
+1 -1
View File
@@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
item.useAmmo = AmmoID.Bullet;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Vector2 velocity = new Vector2(speedX, speedY);
if (velocity.Length() > 5f)
@@ -66,7 +66,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
return base.CanUseItem(player);
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Vector2 velocity = new Vector2(speedX, speedY);
if (velocity.Length() > 5f)
+1 -1
View File
@@ -43,7 +43,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
item.useAmmo = AmmoID.Bullet;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Vector2 velocity = new Vector2(speedX, speedY);
if (velocity.Length() > 5f)
+1 -1
View File
@@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
item.useAmmo = AmmoID.Bullet;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Vector2 velocity = new Vector2(speedX, speedY);
if (velocity.Length() > 5f)
+1 -1
View File
@@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Magic
return new Vector2(15, 15);
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
int num6 = Main.rand.Next(2, 3);
for (int index = 0; index < num6; ++index)
+2 -1
View File
@@ -1,5 +1,6 @@
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Magic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
@@ -42,7 +43,7 @@ namespace CalamityMod.Items.Weapons.Magic
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0;
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<DarkSparkPrism>(), damage, knockBack, player.whoAmI, 0.0f, 0.0f);
return false;
+1 -1
View File
@@ -40,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Magic
return new Vector2(10, 10);
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f);
return false;
+2 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Projectiles.Magic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -34,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Magic
item.Calamity().customRarity = CalamityRarity.Turquoise;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
for (int randomBullets = 0; randomBullets <= 4; randomBullets++)
{
+1 -1
View File
@@ -54,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Magic
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/GhastlyVisageGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<GhastlyVisageProj>(), damage, knockBack, player.whoAmI, 0f, 0f);
return false;
+1 -1
View File
@@ -40,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Magic
return new Vector2(15, 15);
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
position = Main.MouseWorld;
for (int x = 0; x < 10; x++)
+2 -1
View File
@@ -1,5 +1,6 @@
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Magic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -35,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Magic
item.Calamity().customRarity = CalamityRarity.Dedicated;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
int num6 = Main.rand.Next(2, 5);
for (int index = 0; index < num6; ++index)
@@ -1,5 +1,6 @@
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Magic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -55,7 +56,7 @@ namespace CalamityMod.Items.Weapons.Magic
return base.CanUseItem(player);
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
if (player.altFunctionUse == 2)
{
+1 -1
View File
@@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Magic
return new Vector2(15, 15);
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
for (int index = 0; index < 4; ++index)
{
+1 -1
View File
@@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Magic
return new Vector2(15, 15);
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
int num106 = 2 + Main.rand.Next(3);
for (int num107 = 0; num107 < num106; num107++)
+2 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Projectiles.Magic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -47,7 +48,7 @@ namespace CalamityMod.Items.Weapons.Magic
recipe.AddRecipe();
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<PurgeProj>(), damage, knockBack, player.whoAmI, 0f, 0f);
return false;
+2 -1
View File
@@ -1,5 +1,6 @@
using CalamityMod.Projectiles.Magic;
using CalamityMod.Items.Materials;
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ID;
@@ -39,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Magic
item.Calamity().customRarity = CalamityRarity.DarkBlue;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
float spread = 60f * 0.0174f;
double startAngle = Math.Atan2(speedX, speedY) - spread / 2;
+2 -1
View File
@@ -1,5 +1,6 @@
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Magic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -34,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Magic
item.shootSpeed = 16f;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
int num6 = Main.rand.Next(1, 3);
for (int index = 0; index < num6; ++index)
+1 -1
View File
@@ -40,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Magic
return new Vector2(10, 10);
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f);
return false;
+2 -1
View File
@@ -1,6 +1,7 @@
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Magic;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
@@ -49,7 +50,7 @@ namespace CalamityMod.Items.Weapons.Magic
recipe.AddRecipe();
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<T1000Proj>(), damage, knockBack, player.whoAmI, 0.0f, 0.0f);
return false;
+2 -1
View File
@@ -1,5 +1,6 @@
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Magic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -34,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Magic
item.shootSpeed = 5.5f;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
int num6 = Main.rand.Next(2, 3);
for (int index = 0; index < num6; ++index)
+1 -1
View File
@@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Magic
return new Vector2(15, 15);
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
player.statLife -= 5;
if (player.statLife <= 0)
+2 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Projectiles.Magic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -33,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Magic
item.shootSpeed = 12f;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
float SpeedX = speedX + (float)Main.rand.Next(-20, 21) * 0.05f;
float SpeedY = speedY + (float)Main.rand.Next(-20, 21) * 0.05f;
+2 -1
View File
@@ -1,3 +1,4 @@
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -32,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Magic
item.shoot = ProjectileID.LaserMachinegunLaser;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
int beamAmt = 3;
for (int index = 0; index < beamAmt; ++index)
+7
View File
@@ -1,5 +1,6 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Projectiles.Melee;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -33,6 +34,12 @@ namespace CalamityMod.Items.Weapons.Melee
item.shootSpeed = 5f;
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, (int)(damage * 0.6), knockBack, player.whoAmI, 0f, 0f);
return false;
}
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
{
target.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 120);
+1 -1
View File
@@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee
public override void SetDefaults()
{
item.width = 62;
item.damage = 80;
item.damage = 75;
item.melee = true;
item.useAnimation = 20;
item.useTime = 20;
+2 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Projectiles.Hybrid;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -41,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Melee
flat += lifeAmount * 0.2f * player.meleeDamage;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f);
return false;
+2 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Projectiles.Melee;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -38,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Melee
item.Calamity().customRarity = CalamityRarity.ItemSpecific;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
float ai3 = (Main.rand.NextFloat() - 0.75f) * 0.7853982f; //0.5
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, ai3);
+2 -1
View File
@@ -1,6 +1,7 @@
using CalamityMod.Projectiles.Melee;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Ores;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -38,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Melee
item.shoot = ModContent.ProjectileType<CrescentMoonFlail>();
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
float ai3 = (Main.rand.NextFloat() - 0.5f) * 0.7853982f; //0.5
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, ai3);
+2 -1
View File
@@ -1,5 +1,6 @@
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Melee;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -40,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Melee
item.shootSpeed = 24f;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<DevilsSunriseProj>(), damage, knockBack, player.whoAmI, 0f, 0f);
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<DevilsSunriseCyclone>(), damage, knockBack, player.whoAmI, 0f, 0f);
+2 -1
View File
@@ -1,5 +1,6 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Projectiles.Melee.Spears;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -59,7 +60,7 @@ namespace CalamityMod.Items.Weapons.Melee
return base.CanUseItem(player);
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<FulgurationHalberdProj>(), damage, knockBack, player.whoAmI, 0f, 0f);
return false;
+2 -1
View File
@@ -5,6 +5,7 @@ using CalamityMod.Items.Weapons.Magic;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Items.Weapons.Rogue;
using CalamityMod.Projectiles.Hybrid;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -40,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Melee
item.Calamity().customRarity = CalamityRarity.Dedicated;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f);
return false;
+2 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Projectiles.Melee;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -36,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Melee
item.Calamity().customRarity = CalamityRarity.PureGreen;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f);
return false;
+2 -1
View File
@@ -1,6 +1,7 @@
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Melee;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -49,7 +50,7 @@ namespace CalamityMod.Items.Weapons.Melee
recipe.AddRecipe();
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
float ai3 = (Main.rand.NextFloat() - 0.75f) * 0.7853982f; //0.5
float ai3X = (Main.rand.NextFloat() - 0.25f) * 0.7853982f; //0.5
+3 -2
View File
@@ -1,4 +1,5 @@
using CalamityMod.Projectiles.Melee;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -17,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee
{
item.width = 16;
item.height = 16;
item.damage = 54;
item.damage = 60;
item.rare = 7;
item.noMelee = true;
item.noUseGraphic = true;
@@ -34,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Melee
item.shoot = ModContent.ProjectileType<NebulashFlail>();
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
float ai3 = (Main.rand.NextFloat() - 0.5f) * 0.7853982f; //0.5
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, ai3);
+2 -1
View File
@@ -1,5 +1,6 @@
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Melee;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -33,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Melee
item.shootSpeed = 6f;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage / 2, knockBack, player.whoAmI, 0f, 0f);
return false;
+4 -3
View File
@@ -1,5 +1,5 @@
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Melee;
using CalamityMod.Projectiles.Hybrid;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Microsoft.Xna.Framework;
using System;
@@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Melee
item.height = 20;
item.value = Item.buyPrice(5, 0, 0, 0);
item.rare = 10;
item.shoot = ModContent.ProjectileType<RoyalKnifeMelee>();
item.shoot = ModContent.ProjectileType<IllustriousKnife>();
item.shootSpeed = 9f;
item.Calamity().customRarity = CalamityRarity.Developer;
}
@@ -93,7 +93,8 @@ namespace CalamityMod.Items.Weapons.Melee
num149 *= num80;
float x4 = vector2.X;
float y4 = vector2.Y;
Projectile.NewProjectile(x4, y4, num148, num149, ModContent.ProjectileType<RoyalKnifeMelee>(), damage, knockBack, player.whoAmI, 0f, 0f);
int knife = Projectile.NewProjectile(x4, y4, num148, num149, type, damage, knockBack, player.whoAmI, 0f, 0f);
Main.projectile[knife].Calamity().forceMelee = true;
}
return false;
}
+2 -1
View File
@@ -1,5 +1,6 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Projectiles.Melee;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -34,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Melee
item.Calamity().customRarity = CalamityRarity.PureGreen;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
int num6 = Main.rand.Next(2, 4);
for (int index = 0; index < num6; ++index)
+2 -1
View File
@@ -1,5 +1,6 @@
using CalamityMod.Projectiles.Melee;
using CalamityMod.Projectiles.Melee.Spears;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -72,7 +73,7 @@ namespace CalamityMod.Items.Weapons.Melee
return base.CanUseItem(player);
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
if (player.altFunctionUse == 2)
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<YateveoBloomSpear>(), damage, knockBack, player.whoAmI, 0f, 0f);
+2 -1
View File
@@ -1,3 +1,4 @@
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -34,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Ranged
item.Calamity().customRarity = CalamityRarity.RareVariant;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
for (int i = 0; i < 3; i++)
{
+2 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Projectiles.Ranged;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -39,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Ranged
this.SetTag("bow");
}*/
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<BoltArrow>(), damage, knockBack, player.whoAmI, 0f, 0f);
return false;
+2 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Projectiles.Ranged;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -34,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Ranged
item.useAmmo = 40;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<BoltArrow>(), damage, knockBack, player.whoAmI, 0f, 0f);
return false;
+2 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Projectiles.Ranged;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -59,7 +60,7 @@ namespace CalamityMod.Items.Weapons.Ranged
return base.CanUseItem(player);
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
if (player.altFunctionUse == 2)
{
+1 -1
View File
@@ -40,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Ranged
return new Vector2(-10, 0);
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<Chicken>(), damage, knockBack, player.whoAmI, 0f, 0f);
return false;
+2 -1
View File
@@ -1,6 +1,7 @@
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Ranged;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -49,7 +50,7 @@ namespace CalamityMod.Items.Weapons.Ranged
recipe.AddRecipe();
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<ContagionBow>(), damage, knockBack, player.whoAmI, 0.0f, 0.0f);
return false;
+2 -1
View File
@@ -1,5 +1,6 @@
using CalamityMod.Projectiles.Ranged;
using CalamityMod.Items.Materials;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -35,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Ranged
item.useAmmo = 40;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<CorrodedShell>(), damage, knockBack, player.whoAmI, 0f, 0f);
return false;
+2 -1
View File
@@ -1,3 +1,4 @@
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -32,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Ranged
item.useAmmo = 97;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ProjectileID.CursedBullet, damage, knockBack, player.whoAmI, 0f, 0f);
return false;
+1 -1
View File
@@ -67,7 +67,7 @@ namespace CalamityMod.Items.Weapons.Ranged
return base.CanUseItem(player);
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
if (player.altFunctionUse == 2)
{
+2 -1
View File
@@ -1,6 +1,7 @@
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables;
using CalamityMod.Projectiles.Ranged;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -38,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Ranged
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0;
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<FlakKrakenGun>(), damage, knockBack, player.whoAmI, 0f, 0f);
return false;
+1 -1
View File
@@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Ranged
return new Vector2(-5, 0);
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
for (int index = 0; index < 3; ++index)
{
+1 -1
View File
@@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Ranged
return new Vector2(-5, 0);
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
for (int index = 0; index < 2; ++index)
{
+1 -1
View File
@@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Ranged
return new Vector2(-10, 0);
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<OnyxSharkBomb>(), damage, knockBack, player.whoAmI, 0f, 0f);
return false;
+2 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Projectiles.Ranged;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -34,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Ranged
item.useAmmo = 97;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<OpalStrike>(), damage, 0f, player.whoAmI, 0f, 0f);
return false;
+2 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Projectiles.Ranged;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -33,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Ranged
item.useAmmo = 97;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<ProBolt>(), damage, knockBack, player.whoAmI, 0f, 0f);
return false;
+2 -1
View File
@@ -1,3 +1,4 @@
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -34,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Ranged
item.useAmmo = 40;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
int projectile = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ProjectileID.IchorArrow, damage, knockBack, player.whoAmI, 0f, 0f);
Main.projectile[projectile].extraUpdates++;
+1 -1
View File
@@ -60,7 +60,7 @@ namespace CalamityMod.Items.Weapons.Ranged
return base.CanUseItem(player);
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
if (player.altFunctionUse == 2)
{
+2 -1
View File
@@ -1,5 +1,6 @@
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Ranged;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -34,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Ranged
item.useAmmo = 40;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
float SpeedX = speedX + (float)Main.rand.Next(-30, 31) * 0.05f;
float SpeedY = speedY + (float)Main.rand.Next(-30, 31) * 0.05f;
+2 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Projectiles.Ranged;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -34,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Ranged
item.useAmmo = 40;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<Shell>(), damage, knockBack, player.whoAmI, 0.0f, 0.0f);
return false;
+1 -1
View File
@@ -46,7 +46,7 @@ namespace CalamityMod.Items.Weapons.Ranged
return true;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
int num6 = Main.rand.Next(1, 2);
for (int index = 0; index < num6; ++index)
+2 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Projectiles.Hybrid;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -41,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Rogue
flat += lifeAmount * 0.2f * player.Calamity().throwingDamage;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 1f);
return false;
+2 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Projectiles.Rogue;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -33,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Rogue
item.Calamity().rogue = true;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
if (Main.rand.Next(0, 5) == 0)
{
+2 -1
View File
@@ -1,5 +1,6 @@
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Rogue;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -37,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Rogue
item.Calamity().rogue = true;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
if (player.Calamity().StealthStrikeAvailable())
{
+1 -1
View File
@@ -45,7 +45,7 @@ namespace CalamityMod.Items.Weapons.Rogue
item.Calamity().rogue = true;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
counter++;
if (counter >= 7)
+2 -1
View File
@@ -5,6 +5,7 @@ using CalamityMod.Items.Weapons.Magic;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Projectiles.Hybrid;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -40,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Rogue
item.Calamity().customRarity = CalamityRarity.Dedicated;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 1f);
return false;
+1 -1
View File
@@ -43,7 +43,7 @@ namespace CalamityMod.Items.Weapons.Rogue
item.Calamity().rogue = true;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
float num72 = item.shootSpeed;
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
+2 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Projectiles.Rogue;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -59,7 +60,7 @@ namespace CalamityMod.Items.Weapons.Rogue
return base.CanUseItem(player);
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
if (player.altFunctionUse == 2)
{
+1 -1
View File
@@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Rogue
item.Calamity().rogue = true;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
float SpeedX = speedX + (float)Main.rand.Next(-30, 31) * 0.05f;
float SpeedY = speedY + (float)Main.rand.Next(-30, 31) * 0.05f;
+2 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Projectiles.Rogue;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -35,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Rogue
item.Calamity().customRarity = CalamityRarity.DarkBlue;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
int proj = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f);
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
+2 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Projectiles.Rogue;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -35,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Rogue
item.Calamity().customRarity = CalamityRarity.RareVariant;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 1f, 0f);
return false;
+2 -2
View File
@@ -1,5 +1,5 @@
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Rogue;
using CalamityMod.Projectiles.Hybrid;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Microsoft.Xna.Framework;
using System;
@@ -93,7 +93,7 @@ namespace CalamityMod.Items.Weapons.Rogue
num149 *= num80;
float x4 = vector2.X;
float y4 = vector2.Y;
Projectile.NewProjectile(x4, y4, num148, num149, ModContent.ProjectileType<IllustriousKnife>(), damage, knockBack, player.whoAmI, 0f, 0f);
Projectile.NewProjectile(x4, y4, num148, num149, type, damage, knockBack, player.whoAmI, 0f, 0f);
}
return false;
}
@@ -1,6 +1,7 @@
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Hybrid;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -36,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Rogue
item.Calamity().customRarity = CalamityRarity.Violet;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 1f);
return false;
+2 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Projectiles.Rogue;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Rogue
@@ -34,7 +35,7 @@ Does not consume stealth and cannot stealth strike");
item.Calamity().customRarity = CalamityRarity.Turquoise;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f);
return false;
+2 -1
View File
@@ -1,5 +1,6 @@
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Rogue;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -36,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Rogue
item.Calamity().rogue = true;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
int proj = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f);
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
+1 -1
View File
@@ -64,7 +64,7 @@ namespace CalamityMod.Items.Weapons.Summon
return slimeSlots >= 1;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
for (int x = 0; x < Main.projectile.Length; x++)
{
+1 -1
View File
@@ -45,7 +45,7 @@ namespace CalamityMod.Items.Weapons.Summon
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0 && player.maxMinions >= 5;
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
position = Main.MouseWorld;
speedX = 0;
+2 -1
View File
@@ -1,6 +1,7 @@
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables;
using CalamityMod.Projectiles.Summon;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -35,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Summon
item.sentry = true;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
position = Main.MouseWorld;
speedX = 0;
+2 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Projectiles.Summon;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Summon
@@ -31,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Summon
item.Calamity().customRarity = CalamityRarity.Turquoise;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
position = Main.MouseWorld;
speedX = 0;
+2 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Projectiles.Summon;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -31,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Summon
item.summon = true;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
position = Main.MouseWorld;
speedX = 0;
+1 -1
View File
@@ -59,7 +59,7 @@ namespace CalamityMod.Items.Weapons.Summon
return viruliSlots >= 1 && player.ownedProjectileCounts[item.shoot] <= 0;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
for (int x = 0; x < Main.projectile.Length; x++)
{
+1 -1
View File
@@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Summon
item.UseSound = SoundID.Item44;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
position = Main.MouseWorld;
speedX = 0;
+1 -1
View File
@@ -60,7 +60,7 @@ namespace CalamityMod.Items.Weapons.Summon
return siriusSlots >= 1;
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
for (int x = 0; x < Main.projectile.Length; x++)
{
+2 -1
View File
@@ -1,5 +1,6 @@
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Summon;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -44,7 +45,7 @@ namespace CalamityMod.Items.Weapons.Summon
recipe.AddRecipe();
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
position = Main.MouseWorld;
speedX = 0;
+2 -1
View File
@@ -1,5 +1,6 @@
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Summon;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -41,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Summon
recipe.AddRecipe();
}
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
position = Main.MouseWorld;
speedX = 0;
+400 -407
View File
File diff suppressed because it is too large. Load diff
+155 -161
View File
@@ -19,6 +19,7 @@ using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using static Terraria.ModLoader.ModContent;
namespace CalamityMod.Projectiles
{
@@ -60,7 +61,6 @@ namespace CalamityMod.Projectiles
// Counters and Timers
private int counter = 0;
private int counter2 = 0;
public int lineColor = 0; //Note: Although this was intended for fishing line colors, I use this as an AI variable a lot because vanilla only has 4 that sometimes are already in use. ~Ben
public bool extorterBoost = false;
@@ -691,8 +691,8 @@ namespace CalamityMod.Projectiles
if (projectile.owner == Main.myPlayer && player.ownedProjectileCounts[ProjectileID.Mushroom] < 30)
{
//Note: these don't count as true melee anymore but its useful code to keep around
if (projectile.type == ModContent.ProjectileType<NebulashFlail>() || projectile.type == ModContent.ProjectileType<CosmicDischargeFlail>() ||
projectile.type == ModContent.ProjectileType<MourningstarFlail>() || projectile.type == ProjectileID.SolarWhipSword)
if (projectile.type == ProjectileType<NebulashFlail>() || projectile.type == ProjectileType<CosmicDischargeFlail>() ||
projectile.type == ProjectileType<MourningstarFlail>() || projectile.type == ProjectileID.SolarWhipSword)
{
Vector2 vector24 = Main.OffsetsPlayerOnhand[Main.player[projectile.owner].bodyFrame.Y / 56] * 2f;
if (Main.player[projectile.owner].direction != 1)
@@ -717,25 +717,25 @@ namespace CalamityMod.Projectiles
}
}
if (modPlayer.nanotech && rogue && projectile.type != ModContent.ProjectileType<MoonSigil>() && projectile.type != ModContent.ProjectileType<DragonShit>())
if (modPlayer.nanotech && rogue && projectile.type != ProjectileType<MoonSigil>() && projectile.type != ProjectileType<DragonShit>())
{
if (counter % 30 == 0)
{
if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].ownedProjectileCounts[ModContent.ProjectileType<Nanotech>()] < 25)
if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].ownedProjectileCounts[ProjectileType<Nanotech>()] < 25)
{
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<Nanotech>(),
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ProjectileType<Nanotech>(),
(int)(projectile.damage * 0.1), 0f, projectile.owner, 0f, 0f);
}
}
}
if (modPlayer.dragonScales && rogue && projectile.type != ModContent.ProjectileType<MoonSigil>() && projectile.type != ModContent.ProjectileType<DragonShit>())
if (modPlayer.dragonScales && rogue && projectile.type != ProjectileType<MoonSigil>() && projectile.type != ProjectileType<DragonShit>())
{
if (counter % 50 == 0)
{
if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].ownedProjectileCounts[ModContent.ProjectileType<DragonShit>()] < 15)
if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].ownedProjectileCounts[ProjectileType<DragonShit>()] < 15)
{
//spawn a dust that does 1/5th of the original damage
int projectileID = Projectile.NewProjectile(projectile.Center, Vector2.One.RotatedByRandom(MathHelper.TwoPi), ModContent.ProjectileType<DragonShit>(),
int projectileID = Projectile.NewProjectile(projectile.Center, Vector2.One.RotatedByRandom(MathHelper.TwoPi), ProjectileType<DragonShit>(),
(int)(projectile.damage * 0.2), 0f, projectile.owner, 0f, 0f);
}
}
@@ -743,10 +743,8 @@ namespace CalamityMod.Projectiles
if (modPlayer.daedalusSplit && rogue)
{
counter2++;
if (counter2 >= 30)
if (counter % 30 == 0)
{
counter2 = 0;
if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].ownedProjectileCounts[90] < 30)
{
for (int num252 = 0; num252 < 2; num252++)
@@ -904,9 +902,9 @@ namespace CalamityMod.Projectiles
if (modPlayer.moonCrown && !modPlayer.nanotech)
{
//Summon moon sigils infrequently
if (Main.rand.NextBool(300) && projectile.type != ModContent.ProjectileType<MoonSigil>() && projectile.type != ModContent.ProjectileType<DragonShit>())
if (Main.rand.NextBool(300) && projectile.type != ProjectileType<MoonSigil>() && projectile.type != ProjectileType<DragonShit>())
{
Projectile.NewProjectile(projectile.position, Vector2.Zero, ModContent.ProjectileType<MoonSigil>(), (int)(projectile.damage * 0.2), 0, projectile.owner);
Projectile.NewProjectile(projectile.position, Vector2.Zero, ProjectileType<MoonSigil>(), (int)(projectile.damage * 0.2), 0, projectile.owner);
}
}
}
@@ -976,7 +974,7 @@ namespace CalamityMod.Projectiles
if (!projectile.melee && player.meleeEnchant == 7)
Projectile.NewProjectile(target.Center.X, target.Center.Y, target.velocity.X, target.velocity.Y, ProjectileID.ConfettiMelee, 0, 0f, projectile.owner, 0f, 0f);
if (rogue && stealthStrike && modPlayer.dragonScales && CalamityUtils.CountProjectiles(ModContent.ProjectileType<InfernadoFriendly>()) < 2)
if (rogue && stealthStrike && modPlayer.dragonScales && CalamityUtils.CountProjectiles(ProjectileType<InfernadoFriendly>()) < 2)
{
int projTileX = (int)(projectile.Center.X / 16f);
int projTileY = (int)(projectile.Center.Y / 16f);
@@ -1006,7 +1004,7 @@ namespace CalamityMod.Projectiles
break;
}
}
int projectileIndex = Projectile.NewProjectile(projTileX * 16 + 8, projTileY * 16 - 24, 0f, 0f, ModContent.ProjectileType<InfernadoFriendly>(), 420, 15f, Main.myPlayer, 16f, 16f);
int projectileIndex = Projectile.NewProjectile(projTileX * 16 + 8, projTileY * 16 - 24, 0f, 0f, ProjectileType<InfernadoFriendly>(), 420, 15f, Main.myPlayer, 16f, 16f);
Main.projectile[projectileIndex].Calamity().forceRogue = true;
Main.projectile[projectileIndex].netUpdate = true;
Main.projectile[projectileIndex].localNPCHitCooldown = 1;
@@ -1039,7 +1037,7 @@ namespace CalamityMod.Projectiles
}
}
if (Main.player[Main.myPlayer].lifeSteal > 0f && target.canGhostHeal && target.type != NPCID.TargetDummy && target.type != ModContent.NPCType<SuperDummyNPC>())
if (Main.player[Main.myPlayer].lifeSteal > 0f && target.canGhostHeal && target.type != NPCID.TargetDummy && target.type != NPCType<SuperDummyNPC>())
{
// Increases the degree to which Spectre Healing set contributes to the lifesteal cap
if (player.ghostHeal)
@@ -1085,7 +1083,7 @@ namespace CalamityMod.Projectiles
if (!CanSpawnLifeStealProjectile(projectile, healMult, heal))
goto OTHEREFFECTS;
SpawnLifeStealProjectile(projectile, player, heal, ModContent.ProjectileType<AuricOrb>(), 1200f, 1.5f);
SpawnLifeStealProjectile(projectile, player, heal, ProjectileType<AuricOrb>(), 1200f, 1.5f);
}
else if (modPlayer.silvaSet)
{
@@ -1096,7 +1094,7 @@ namespace CalamityMod.Projectiles
if (!CanSpawnLifeStealProjectile(projectile, healMult, heal))
goto OTHEREFFECTS;
SpawnLifeStealProjectile(projectile, player, heal, ModContent.ProjectileType<SilvaOrb>(), 1200f, 1.5f);
SpawnLifeStealProjectile(projectile, player, heal, ProjectileType<SilvaOrb>(), 1200f, 1.5f);
}
else if (projectile.magic)
{
@@ -1109,7 +1107,7 @@ namespace CalamityMod.Projectiles
if (!CanSpawnLifeStealProjectile(projectile, healMult, heal))
goto OTHEREFFECTS;
SpawnLifeStealProjectile(projectile, player, heal, ModContent.ProjectileType<GodSlayerHealOrb>(), 1200f, 1.5f);
SpawnLifeStealProjectile(projectile, player, heal, ProjectileType<GodSlayerHealOrb>(), 1200f, 1.5f);
}
else if (modPlayer.tarraMage)
{
@@ -1142,7 +1140,7 @@ namespace CalamityMod.Projectiles
if (!CanSpawnLifeStealProjectile(projectile, healMult, heal))
goto OTHEREFFECTS;
SpawnLifeStealProjectile(projectile, player, heal, ModContent.ProjectileType<AtaxiaHealOrb>(), 1200f, 1.5f);
SpawnLifeStealProjectile(projectile, player, heal, ProjectileType<AtaxiaHealOrb>(), 1200f, 1.5f);
}
else if (modPlayer.manaOverloader)
{
@@ -1153,7 +1151,7 @@ namespace CalamityMod.Projectiles
if (!CanSpawnLifeStealProjectile(projectile, healMult, heal))
goto OTHEREFFECTS;
SpawnLifeStealProjectile(projectile, player, heal, ModContent.ProjectileType<ManaOverloaderHealOrb>(), 1200f, 1.5f);
SpawnLifeStealProjectile(projectile, player, heal, ProjectileType<ManaOverloaderHealOrb>(), 1200f, 1.5f);
}
}
}
@@ -1162,25 +1160,15 @@ namespace CalamityMod.Projectiles
if (modPlayer.alchFlask &&
(projectile.magic || rogue || projectile.melee || projectile.minion || projectile.ranged || projectile.sentry || CalamityMod.projectileMinionList.Contains(projectile.type) || ProjectileID.Sets.MinionShot[projectile.type] || ProjectileID.Sets.SentryShot[projectile.type]) &&
player.ownedProjectileCounts[ModContent.ProjectileType<PlagueSeeker>()] < 6)
player.ownedProjectileCounts[ProjectileType<PlagueSeeker>()] < 6)
{
int newDamage = (int)(projectile.damage * 0.25);
if (newDamage > 30)
{
newDamage = (int)((projectile.damage * 0.25 - 30) * 0.1) + 30;
}
int plague = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<PlagueSeeker>(), newDamage, 0f, projectile.owner, 0f, 0f);
int plague = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ProjectileType<PlagueSeeker>(), CalamityUtils.DamageSoftCap(projectile.damage * 0.25, 30), 0f, projectile.owner, 0f, 0f);
Main.projectile[plague].Calamity().forceTypeless = false;
}
if (modPlayer.reaverBlast && projectile.melee)
{
int newDamage = (int)(projectile.damage * 0.2);
if (newDamage > 30)
{
newDamage = (int)((projectile.damage * 0.2 - 30) * 0.1) + 30;
}
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<ReaverBlast>(), newDamage, 0f, projectile.owner, 0f, 0f);
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ProjectileType<ReaverBlast>(), CalamityUtils.DamageSoftCap(projectile.damage * 0.2, 30), 0f, projectile.owner, 0f, 0f);
}
if (projectile.magic)
@@ -1223,50 +1211,40 @@ namespace CalamityMod.Projectiles
}
value15.Normalize();
value15 *= Main.rand.Next(70, 101) * 0.1f;
int newDamage = (int)(projectile.damage * 0.15);
if (newDamage > 15)
{
newDamage = (int)((projectile.damage * 0.15 - 15) * 0.1) + 15;
}
int proj = Projectile.NewProjectile(projectile.oldPosition.X + (projectile.width / 2), projectile.oldPosition.Y + (projectile.height / 2), value15.X, value15.Y, 569 + Main.rand.Next(3), newDamage, 0f, projectile.owner, 0f, 0f);
int proj = Projectile.NewProjectile(projectile.oldPosition.X + (projectile.width / 2), projectile.oldPosition.Y + (projectile.height / 2), value15.X, value15.Y, 569 + Main.rand.Next(3), CalamityUtils.DamageSoftCap(projectile.damage * 0.15, 15), 0f, projectile.owner, 0f, 0f);
Main.projectile[proj].usesLocalNPCImmunity = true;
Main.projectile[proj].localNPCHitCooldown = 30;
}
}
else if (modPlayer.ataxiaMage && modPlayer.ataxiaDmg <= 0)
{
SpawnOrb(projectile, 1.25f, ModContent.ProjectileType<AtaxiaOrb>(), 800f, 20f);
SpawnOrb(projectile, 1.25f, ProjectileType<AtaxiaOrb>(), 800f, 20f);
int num = (int)(projectile.damage * 0.5f);
modPlayer.ataxiaDmg += num;
}
else if (modPlayer.godSlayerMage && modPlayer.godSlayerDmg <= 0)
{
SpawnOrb(projectile, modPlayer.auricSet ? 2f : 1.5f, ModContent.ProjectileType<GodSlayerOrb>(), 800f, 20f);
SpawnOrb(projectile, modPlayer.auricSet ? 2f : 1.5f, ProjectileType<GodSlayerOrb>(), 800f, 20f);
int num = (int)(projectile.damage * 0.5f);
modPlayer.godSlayerDmg += num;
}
}
else if (projectile.melee)
{
if (modPlayer.ataxiaGeyser && player.ownedProjectileCounts[ModContent.ProjectileType<ChaosGeyser>()] < 3)
if (modPlayer.ataxiaGeyser && player.ownedProjectileCounts[ProjectileType<ChaosGeyser>()] < 3)
{
int newDamage = (int)(projectile.damage * 0.15);
if (newDamage > 35)
{
newDamage = (int)((projectile.damage * 0.15 - 35) * 0.1) + 35;
}
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<ChaosGeyser>(), newDamage, 0f, projectile.owner, 0f, 0f);
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ProjectileType<ChaosGeyser>(), CalamityUtils.DamageSoftCap(projectile.damage * 0.15, 35), 0f, projectile.owner, 0f, 0f);
}
}
else if (rogue)
{
if (modPlayer.xerocSet && modPlayer.xerocDmg <= 0 && player.ownedProjectileCounts[ModContent.ProjectileType<XerocFire>()] < 3 && player.ownedProjectileCounts[ModContent.ProjectileType<XerocBlast>()] < 3)
if (modPlayer.xerocSet && modPlayer.xerocDmg <= 0 && player.ownedProjectileCounts[ProjectileType<XerocFire>()] < 3 && player.ownedProjectileCounts[ProjectileType<XerocBlast>()] < 3)
{
switch (Main.rand.Next(5))
{
case 0:
SpawnOrb(projectile, 1.6f, ModContent.ProjectileType<XerocStar>(), 800f, Main.rand.Next(15, 30));
SpawnOrb(projectile, 1.6f, ProjectileType<XerocStar>(), 800f, Main.rand.Next(15, 30));
int num = (int)(projectile.damage * 0.5f);
modPlayer.xerocDmg += num;
@@ -1274,7 +1252,7 @@ namespace CalamityMod.Projectiles
case 1:
SpawnOrb(projectile, 1.25f, ModContent.ProjectileType<XerocOrb>(), 800f, 30f);
SpawnOrb(projectile, 1.25f, ProjectileType<XerocOrb>(), 800f, 30f);
int num2 = (int)(projectile.damage * 0.5f);
modPlayer.xerocDmg += num2;
@@ -1287,36 +1265,26 @@ namespace CalamityMod.Projectiles
if (!CanSpawnLifeStealProjectile(projectile, healMult, heal))
goto SKIPXEROC;
SpawnLifeStealProjectile(projectile, player, heal, ModContent.ProjectileType<XerocHealOrb>(), 1200f, 1.5f);
SpawnLifeStealProjectile(projectile, player, heal, ProjectileType<XerocHealOrb>(), 1200f, 1.5f);
}
break;
case 2:
int newDamage = (int)(projectile.damage * 0.15);
if (newDamage > 40)
{
newDamage = (int)((projectile.damage * 0.15 - 40) * 0.1) + 40;
}
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<XerocFire>(), newDamage, 0f, projectile.owner, 0f, 0f);
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ProjectileType<XerocFire>(), CalamityUtils.DamageSoftCap(projectile.damage * 0.15, 40), 0f, projectile.owner, 0f, 0f);
break;
case 3:
int newDamage2 = (int)(projectile.damage * 0.2);
if (newDamage2 > 40)
{
newDamage = (int)((projectile.damage * 0.2 - 40) * 0.1) + 40;
}
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<XerocBlast>(), newDamage2, 0f, projectile.owner, 0f, 0f);
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ProjectileType<XerocBlast>(), CalamityUtils.DamageSoftCap(projectile.damage * 0.2, 40), 0f, projectile.owner, 0f, 0f);
break;
case 4:
SpawnOrb(projectile, 1.2f, ModContent.ProjectileType<XerocBubble>(), 800f, 15f);
SpawnOrb(projectile, 1.2f, ProjectileType<XerocBubble>(), 800f, 15f);
int num3 = (int)(projectile.damage * 0.5f);
modPlayer.xerocDmg += num3;
@@ -1337,7 +1305,7 @@ namespace CalamityMod.Projectiles
float speedX = (target.Center.X - pos.X) / 30f;
float speedY = (target.Center.Y - pos.Y) * 8;
int dmg = (int)(15 + (projectile.damage * 0.05f));
int feather = Projectile.NewProjectile(pos.X, pos.Y, speedX, speedY, ModContent.ProjectileType<StickyFeather>(), dmg, 3, projectile.owner, 0f, Main.rand.Next(15));
int feather = Projectile.NewProjectile(pos.X, pos.Y, speedX, speedY, ProjectileType<StickyFeather>(), dmg, 3, projectile.owner, 0f, Main.rand.Next(15));
Main.projectile[feather].Calamity().forceRogue = true;
modPlayer.featherCrownCooldown = 15;
}
@@ -1364,7 +1332,7 @@ namespace CalamityMod.Projectiles
Vector2 pos = new Vector2(target.Center.X + target.width * 0.5f + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50));
Vector2 velocity = (target.Center - pos) / 40f;
int dmg = (int)(1000 + (projectile.damage * 0.05f));
int flare = Projectile.NewProjectile(pos, velocity, ModContent.ProjectileType<NanoFlare>(),dmg, 3f, projectile.owner, 0f, 0f);
int flare = Projectile.NewProjectile(pos, velocity, ProjectileType<NanoFlare>(),dmg, 3f, projectile.owner, 0f, 0f);
Main.projectile[flare].Calamity().rogue = true;
modPlayer.nanoFlareCooldown = 15;
}
@@ -1379,12 +1347,12 @@ namespace CalamityMod.Projectiles
xVector *= 10f;
yVector *= 10f;
int dmg = (int)(75 + (projectile.damage * 0.05f));
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, xVector, yVector, ModContent.ProjectileType<ForbiddenCircletEater>(), dmg, projectile.knockBack, projectile.owner, 0f, 0f);
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, xVector, yVector, ProjectileType<ForbiddenCircletEater>(), dmg, projectile.knockBack, projectile.owner, 0f, 0f);
modPlayer.forbiddenCooldown = 15;
}
}
if (modPlayer.corrosiveSpine && projectile.type != ModContent.ProjectileType<Corrocloud1>() && projectile.type != ModContent.ProjectileType<Corrocloud2>() && projectile.type != ModContent.ProjectileType<Corrocloud3>())
if (modPlayer.corrosiveSpine && projectile.type != ProjectileType<Corrocloud1>() && projectile.type != ProjectileType<Corrocloud2>() && projectile.type != ProjectileType<Corrocloud3>())
{
for (int i = 0; i < 3; i++)
{
@@ -1394,13 +1362,13 @@ namespace CalamityMod.Projectiles
switch (Main.rand.Next(15))
{
case 0:
type = ModContent.ProjectileType<Corrocloud1>();
type = ProjectileType<Corrocloud1>();
break;
case 1:
type = ModContent.ProjectileType<Corrocloud2>();
type = ProjectileType<Corrocloud2>();
break;
case 2:
type = ModContent.ProjectileType<Corrocloud3>();
type = ProjectileType<Corrocloud3>();
break;
}
// Should never happen, but just in case-
@@ -1419,12 +1387,12 @@ namespace CalamityMod.Projectiles
{
if (modPlayer.profanedCrystalBuffs || (modPlayer.pArtifact && !modPlayer.profanedCrystal))
{
target.AddBuff(ModContent.BuffType<HolyFlames>(), modPlayer.profanedCrystalBuffs ? 600 : 300);
target.AddBuff(BuffType<HolyFlames>(), modPlayer.profanedCrystalBuffs ? 600 : 300);
}
if (modPlayer.tearMinions)
{
target.AddBuff(ModContent.BuffType<TemporalSadness>(), 60);
target.AddBuff(BuffType<TemporalSadness>(), 60);
}
if (modPlayer.shadowMinions)
@@ -1444,8 +1412,8 @@ namespace CalamityMod.Projectiles
if (modPlayer.starTaintedGenerator)
{
target.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 180);
target.AddBuff(ModContent.BuffType<Irradiated>(), 180);
target.AddBuff(BuffType<AstralInfectionDebuff>(), 180);
target.AddBuff(BuffType<Irradiated>(), 180);
}
// Fearmonger set's colossal life regeneration
@@ -1458,7 +1426,7 @@ namespace CalamityMod.Projectiles
if (modPlayer.godSlayerSummon && modPlayer.godSlayerDmg <= 0)
{
SpawnOrb(projectile, 2f, ModContent.ProjectileType<GodSlayerPhantom>(), 800f, 15f, true);
SpawnOrb(projectile, 2f, ProjectileType<GodSlayerPhantom>(), 800f, 15f, true);
int num = (int)(projectile.damage * 0.5f);
modPlayer.godSlayerDmg += num;
}
@@ -1466,11 +1434,11 @@ namespace CalamityMod.Projectiles
//Priorities: Nucleogenesis => Starbuster Core => Nuclear Rod => Jelly-Charged Battery
List<int> summonExceptionList = new List<int>()
{
ModContent.ProjectileType<EnergyOrb>(),
ModContent.ProjectileType<IrradiatedAura>(),
ModContent.ProjectileType<SummonAstralExplosion>(),
ModContent.ProjectileType<ApparatusExplosion>(),
ModContent.ProjectileType<HallowedStarSummon>()
ProjectileType<EnergyOrb>(),
ProjectileType<IrradiatedAura>(),
ProjectileType<SummonAstralExplosion>(),
ProjectileType<ApparatusExplosion>(),
ProjectileType<HallowedStarSummon>()
};
if (summonExceptionList.TrueForAll(x => projectile.type != x))
@@ -1481,12 +1449,7 @@ namespace CalamityMod.Projectiles
{
if (Main.rand.NextBool(4))
{
int newDamage = (int)(projectile.damage * 0.25);
if (newDamage > 100)
{
newDamage = (int)((projectile.damage * 0.25 - 100) * 0.1) + 100;
}
Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType<ApparatusExplosion>(), newDamage, projectile.knockBack * 0.25f, projectile.owner);
Projectile.NewProjectile(projectile.Center, Vector2.Zero, ProjectileType<ApparatusExplosion>(), CalamityUtils.DamageSoftCap(projectile.damage * 0.25, 100), projectile.knockBack * 0.25f, projectile.owner);
modPlayer.jellyDmg = 20f;
}
}
@@ -1495,13 +1458,8 @@ namespace CalamityMod.Projectiles
if (Main.rand.NextBool(3))
{
int cap = modPlayer.starTaintedGenerator ? 75 : 60;
int newDamage = (int)(projectile.damage * 0.5);
if (newDamage > cap)
{
newDamage = (int)((projectile.damage * 0.5 - cap) * 0.1) + cap;
}
int boom = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType<SummonAstralExplosion>(),
newDamage, 3f, projectile.owner);
Projectile.NewProjectile(projectile.Center, Vector2.Zero, ProjectileType<SummonAstralExplosion>(),
CalamityUtils.DamageSoftCap(projectile.damage * 0.5, cap), 3f, projectile.owner);
modPlayer.jellyDmg = 20f;
}
}
@@ -1509,19 +1467,14 @@ namespace CalamityMod.Projectiles
{
if (Main.rand.NextBool(3))
{
int newDamage = (int)(projectile.damage * 0.25);
if (newDamage > 40)
{
newDamage = (int)((projectile.damage * 0.25 - 40) * 0.1) + 40;
}
Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType<IrradiatedAura>(),
newDamage, 0f, projectile.owner);
Projectile.NewProjectile(projectile.Center, Vector2.Zero, ProjectileType<IrradiatedAura>(),
CalamityUtils.DamageSoftCap(projectile.damage * 0.25, 40), 0f, projectile.owner);
modPlayer.jellyDmg = 20f;
}
}
else if (modPlayer.jellyChargedBattery)
{
SpawnOrb(projectile, 1.05f, ModContent.ProjectileType<EnergyOrb>(), 800f, 15f);
SpawnOrb(projectile, 1.05f, ProjectileType<EnergyOrb>(), 800f, 15f);
int num = (int)(projectile.damage * 0.5f);
modPlayer.jellyDmg += num;
}
@@ -1535,7 +1488,7 @@ namespace CalamityMod.Projectiles
Vector2 spawnPosition = target.Center - new Vector2(0f, 920f).RotatedByRandom(0.3f);
float speed = Main.rand.NextFloat(17f, 23f);
Projectile.NewProjectile(spawnPosition, Vector2.Normalize(target.Center - spawnPosition) * speed,
ModContent.ProjectileType<HallowedStarSummon>(), projectile.damage / 3, 3f, projectile.owner);
ProjectileType<HallowedStarSummon>(), projectile.damage / 3, 3f, projectile.owner);
}
}
}
@@ -1543,7 +1496,7 @@ namespace CalamityMod.Projectiles
if (projectile.ranged)
{
if (modPlayer.tarraRanged && Main.rand.Next(0, 100) >= 88 && player.ownedProjectileCounts[ModContent.ProjectileType<TarraEnergy>()] <= 20 && (projectile.timeLeft <= 2 || projectile.penetrate <= 1))
if (modPlayer.tarraRanged && Main.rand.Next(0, 100) >= 88 && player.ownedProjectileCounts[ProjectileType<TarraEnergy>()] <= 20 && (projectile.timeLeft <= 2 || projectile.penetrate <= 1))
{
int num251 = Main.rand.Next(2, 4);
for (int num252 = 0; num252 < num251; num252++)
@@ -1555,12 +1508,7 @@ namespace CalamityMod.Projectiles
}
value15.Normalize();
value15 *= Main.rand.Next(70, 101) * 0.1f;
int newDamage = (int)(projectile.damage * 0.33);
if (newDamage > 65)
{
newDamage = (int)((projectile.damage * 0.33 - 65) * 0.1) + 65;
}
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType<TarraEnergy>(), newDamage, 0f, projectile.owner, 0f, 0f);
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ProjectileType<TarraEnergy>(), CalamityUtils.DamageSoftCap(projectile.damage * 0.33, 65), 0f, projectile.owner, 0f, 0f);
}
}
}
@@ -1739,8 +1687,7 @@ namespace CalamityMod.Projectiles
}
value15.Normalize();
value15 *= Main.rand.Next(70, 101) * 0.1f;
int newDamage = (int)(projectile.damage * 0.33);
int soul = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ProjectileID.LostSoulFriendly, newDamage, 0f, projectile.owner, 0f, 0f);
int soul = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ProjectileID.LostSoulFriendly, (int)(projectile.damage * 0.33), 0f, projectile.owner, 0f, 0f);
Main.projectile[soul].Calamity().forceRogue = true;
Main.projectile[soul].timeLeft = 300;
Main.projectile[soul].tileCollide = false;
@@ -1749,25 +1696,25 @@ namespace CalamityMod.Projectiles
if (modPlayer.scuttlersJewel && CalamityMod.javelinProjList.Contains(projectile.type) && Main.rand.NextBool(3))
{
float dmgMult = 1f;
if (projectile.type == ModContent.ProjectileType<SpearofDestinyProjectile>())
if (projectile.type == ProjectileType<SpearofDestinyProjectile>())
dmgMult = 0.5f;
int spike = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType<JewelSpike>(), (int)(projectile.damage * 0.5f * dmgMult), projectile.knockBack, projectile.owner);
int spike = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ProjectileType<JewelSpike>(), (int)(projectile.damage * 0.5f * dmgMult), projectile.knockBack, projectile.owner);
Main.projectile[spike].frame = 4;
}
}
if (projectile.type == ProjectileID.UnholyWater)
{
Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType<WaterConvertor>(), 0, 0f, projectile.owner, 1f);
Projectile.NewProjectile(projectile.Center, Vector2.Zero, ProjectileType<WaterConvertor>(), 0, 0f, projectile.owner, 1f);
}
if (projectile.type == ProjectileID.BloodWater)
{
Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType<WaterConvertor>(), 0, 0f, projectile.owner, 2f);
Projectile.NewProjectile(projectile.Center, Vector2.Zero, ProjectileType<WaterConvertor>(), 0, 0f, projectile.owner, 2f);
}
if (projectile.type == ProjectileID.HolyWater)
{
Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType<WaterConvertor>(), 0, 0f, projectile.owner, 3f);
Projectile.NewProjectile(projectile.Center, Vector2.Zero, ProjectileType<WaterConvertor>(), 0, 0f, projectile.owner, 3f);
}
}
}
@@ -1946,7 +1893,7 @@ namespace CalamityMod.Projectiles
Vector2 value = projectile.Center + projectile.velocity * 4f;
Vector2 velocity = Vector2.Normalize(Main.npc[randomTarget].Center - value) * homingVelocity;
if (projectile.type == ModContent.ProjectileType<GodsGambitYoyo>())
if (projectile.type == ProjectileType<GodsGambitYoyo>())
{
velocity.Y += Main.rand.Next(-30, 31) * 0.05f;
velocity.X += Main.rand.Next(-30, 31) * 0.05f;
@@ -1956,22 +1903,68 @@ namespace CalamityMod.Projectiles
{
int projectile2 = Projectile.NewProjectile(value.X, value.Y, velocity.X, velocity.Y, spawnedProjectile, (int)(projectile.damage * damageMult), projectile.knockBack, projectile.owner, 0f, 0f);
if (projectile.type == ModContent.ProjectileType<CnidarianYoyo>() || projectile.type == ModContent.ProjectileType<GodsGambitYoyo>() ||
projectile.type == ModContent.ProjectileType<ShimmersparkYoyo>() || projectile.type == ModContent.ProjectileType<VerdantYoyo>() || (projectile.type == ModContent.ProjectileType<EradicatorProjectile>() && projectile.melee))
if (projectile.type == ProjectileType<CnidarianYoyo>() || projectile.type == ProjectileType<GodsGambitYoyo>() ||
projectile.type == ProjectileType<ShimmersparkYoyo>() || projectile.type == ProjectileType<VerdantYoyo>() || (projectile.type == ProjectileType<EradicatorProjectile>() && projectile.melee))
Main.projectile[projectile2].Calamity().forceMelee = true;
if (projectile.type == ModContent.ProjectileType<EradicatorProjectile>() && projectile.Calamity().rogue)
if (projectile.type == ProjectileType<EradicatorProjectile>() && projectile.Calamity().rogue)
Main.projectile[projectile2].Calamity().forceRogue = true;
}
}
}
}
public static void HealingProjectile(Projectile projectile, int healing, int playerToHeal, float homingVelocity, float N, bool autoHomes = true, int timeCheck = 120)
{
int target = playerToHeal;
Player player = Main.player[target];
float homingSpeed = homingVelocity;
if (player.lifeMagnet)
homingSpeed *= 1.5f;
Vector2 projPos = new Vector2(projectile.Center.X, projectile.Center.Y);
float xDist = player.Center.X - projPos.X;
float yDist = player.Center.Y - projPos.Y;
Vector2 playerVector = new Vector2(xDist, yDist);
float playerDist = playerVector.Length();
if (playerDist < 50f && projectile.position.X < player.position.X + player.width && projectile.position.X + projectile.width > player.position.X && projectile.position.Y < player.position.Y + player.height && projectile.position.Y + projectile.height > player.position.Y)
{
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
{
int healAmt = healing;
player.HealEffect(healAmt, false);
player.statLife += healAmt;
if (player.statLife > player.statLifeMax2)
{
player.statLife = player.statLifeMax2;
}
NetMessage.SendData(66, -1, -1, null, target, healAmt, 0f, 0f, 0, 0, 0);
}
projectile.Kill();
}
if (autoHomes)
{
playerDist = homingSpeed / playerDist;
playerVector.X *= playerDist;
playerVector.Y *= playerDist;
projectile.velocity.X = (projectile.velocity.X * N + playerVector.X) / (N + 1f);
projectile.velocity.Y = (projectile.velocity.Y * N + playerVector.Y) / (N + 1f);
}
else if (player.lifeMagnet && projectile.timeLeft < timeCheck)
{
playerDist = homingVelocity / playerDist;
playerVector.X *= playerDist;
playerVector.Y *= playerDist;
projectile.velocity.X = (projectile.velocity.X * N + playerVector.X) / (N + 1f);
projectile.velocity.Y = (projectile.velocity.Y * N + playerVector.Y) / (N + 1f);
}
}
public static void FloatingPetAI(Projectile projectile, bool faceRight, float tiltFloat, bool lightPet = false)
{
Player player = Main.player[projectile.owner];
//anti sticking movement as a backup
//anti sticking movement as a failsafe
float SAImovement = 0.05f;
for (int index = 0; index < Main.projectile.Length; index++)
{
@@ -1998,21 +1991,22 @@ namespace CalamityMod.Projectiles
}
}
float num16 = 0.5f;
float passiveMvtFloat = 0.5f;
projectile.tileCollide = false;
float range = 100f;
Vector2 vector3 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f);
float xDist = player.position.X + (player.width / 2) - vector3.X;
float yDist = player.position.Y + (player.height / 2) - vector3.Y;
yDist += Main.rand.Next(-10, 21);
xDist += Main.rand.Next(-10, 21);
//light pets lead the player, normal pets trail the player
xDist += 60 * (lightPet ? player.direction : -player.direction);
Vector2 projPos = new Vector2(projectile.Center.X, projectile.Center.Y);
float xDist = player.Center.X - projPos.X;
float yDist = player.Center.Y - projPos.Y;
yDist += Main.rand.NextFloat(-10, 20);
xDist += Main.rand.NextFloat(-10, 20);
//Light pets lead the player, normal pets trail the player
xDist += 60f * (lightPet ? (float)player.direction : -(float)player.direction);
yDist -= 60f;
float playerDist = (float)Math.Sqrt(xDist * xDist + yDist * yDist);
float num21 = 18f;
Vector2 playerVector = new Vector2(xDist, yDist);
float playerDist = playerVector.Length();
float returnSpeed = 18f;
//if player is close enough, resume normal
//If player is close enough, resume normal
if (playerDist < range && player.velocity.Y == 0f &&
projectile.position.Y + projectile.height <= player.position.Y + player.height &&
!Collision.SolidCollision(projectile.position, projectile.width, projectile.height))
@@ -2023,11 +2017,11 @@ namespace CalamityMod.Projectiles
}
}
//teleport to player if too far
//Teleport to player if too far
if (playerDist > 2000f)
{
projectile.position.X = player.Center.X - (projectile.width / 2);
projectile.position.Y = player.Center.Y - (projectile.height / 2);
projectile.position.X = player.Center.X - projectile.width / 2;
projectile.position.Y = player.Center.Y - projectile.height / 2;
projectile.netUpdate = true;
}
@@ -2037,52 +2031,52 @@ namespace CalamityMod.Projectiles
{
projectile.velocity *= 0.99f;
}
num16 = 0.01f;
passiveMvtFloat = 0.01f;
}
else
{
if (playerDist < 100f)
{
num16 = 0.1f;
passiveMvtFloat = 0.1f;
}
if (playerDist > 300f)
{
num16 = 1f;
passiveMvtFloat = 1f;
}
playerDist = num21 / playerDist;
xDist *= playerDist;
yDist *= playerDist;
playerDist = returnSpeed / playerDist;
playerVector.X *= playerDist;
playerVector.Y *= playerDist;
}
if (projectile.velocity.X < xDist)
if (projectile.velocity.X < playerVector.X)
{
projectile.velocity.X = projectile.velocity.X + num16;
if (num16 > 0.05f && projectile.velocity.X < 0f)
projectile.velocity.X += passiveMvtFloat;
if (passiveMvtFloat > 0.05f && projectile.velocity.X < 0f)
{
projectile.velocity.X = projectile.velocity.X + num16;
projectile.velocity.X += passiveMvtFloat;
}
}
if (projectile.velocity.X > xDist)
if (projectile.velocity.X > playerVector.X)
{
projectile.velocity.X = projectile.velocity.X - num16;
if (num16 > 0.05f && projectile.velocity.X > 0f)
projectile.velocity.X -= passiveMvtFloat;
if (passiveMvtFloat > 0.05f && projectile.velocity.X > 0f)
{
projectile.velocity.X = projectile.velocity.X - num16;
projectile.velocity.X -= passiveMvtFloat;
}
}
if (projectile.velocity.Y < yDist)
if (projectile.velocity.Y < playerVector.Y)
{
projectile.velocity.Y = projectile.velocity.Y + num16;
if (num16 > 0.05f && projectile.velocity.Y < 0f)
projectile.velocity.Y += passiveMvtFloat;
if (passiveMvtFloat > 0.05f && projectile.velocity.Y < 0f)
{
projectile.velocity.Y = projectile.velocity.Y + num16 * 2f;
projectile.velocity.Y += passiveMvtFloat * 2f;
}
}
if (projectile.velocity.Y > yDist)
if (projectile.velocity.Y > playerVector.Y)
{
projectile.velocity.Y = projectile.velocity.Y - num16;
if (num16 > 0.05f && projectile.velocity.Y > 0f)
projectile.velocity.Y -= passiveMvtFloat;
if (passiveMvtFloat > 0.05f && projectile.velocity.Y > 0f)
{
projectile.velocity.Y = projectile.velocity.Y - num16 * 2f;
projectile.velocity.Y -= passiveMvtFloat * 2f;
}
}
if (projectile.velocity.X >= 0.25f)
+6 -37
View File
@@ -24,43 +24,12 @@ namespace CalamityMod.Projectiles.Healing
public override void AI()
{
int num487 = (int)projectile.ai[0];
float num488 = 5.5f;
if (Main.player[num487].lifeMagnet)
num488 *= 1.5f;
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num489 = Main.player[num487].Center.X - vector36.X;
float num490 = Main.player[num487].Center.Y - vector36.Y;
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
{
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
{
int num492 = (int)projectile.ai[1];
Main.player[num487].HealEffect(num492, false);
Main.player[num487].statLife += num492;
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
{
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
}
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
}
projectile.Kill();
}
num491 = num488 / num491;
num489 *= num491;
num490 *= num491;
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
float num498 = projectile.velocity.X * 0.2f;
float num499 = -(projectile.velocity.Y * 0.2f);
int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 2f);
Main.dust[num500].noGravity = true;
Dust expr_154F9_cp_0 = Main.dust[num500];
expr_154F9_cp_0.position.X -= num498;
Dust expr_15518_cp_0 = Main.dust[num500];
expr_15518_cp_0.position.Y -= num499;
CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 5.5f, 15f);
int dusty = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 2f);
Dust dust = Main.dust[dusty];
dust.noGravity = true;
dust.position.X -= projectile.velocity.X * 0.2f;
dust.position.Y += projectile.velocity.Y * 0.2f;
}
}
}
+3 -31
View File
@@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Healing
if (projectile.localAI[0] == 0f)
{
projectile.scale += 0.05f;
if ((double)projectile.scale > 1.2)
if (projectile.scale > 1.2f)
{
projectile.localAI[0] = 1f;
}
@@ -36,41 +36,13 @@ namespace CalamityMod.Projectiles.Healing
else
{
projectile.scale -= 0.05f;
if ((double)projectile.scale < 0.8)
if (projectile.scale < 0.8f)
{
projectile.localAI[0] = 0f;
}
}
int num487 = (int)projectile.ai[0];
float num488 = 6f;
if (Main.player[num487].lifeMagnet)
num488 *= 1.5f;
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num489 = Main.player[num487].Center.X - vector36.X;
float num490 = Main.player[num487].Center.Y - vector36.Y;
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
{
if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech)
{
int num492 = (int)projectile.ai[1];
Main.player[num487].HealEffect(num492, false);
Main.player[num487].statLife += num492;
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
{
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
}
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
}
projectile.Kill();
}
num491 = num488 / num491;
num489 *= num491;
num490 *= num491;
projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f;
projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f;
CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 6f, 15f);
return;
}
Loaded 100 of 132 files, more files were not shown because too many files have changed in this diff. Show more