Rip Mad Cock (Mad Alchemist's Cocktail Glove)

This commit is contained in:
Ozzatron committed 2021-02-09 19:42:51 -05:00
1 parent 6a3f20bdb3
commit d982ca06f9
7 files changed
+93 -122

No files matched your search

@@ -9,79 +9,71 @@ namespace CalamityMod.Items.Weapons.Magic
{
public class MadAlchemistsCocktailGlove : ModItem
{
private int FlaskType = 0;
private int BaseDamage = 150;
private const int BaseDamage = 146;
private int flaskIndex = 0;
private static int[] flaskIDs;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Mad Alchemist's Cocktail Glove");
Tooltip.SetDefault("Fires a variety of high-velocity flasks that have various effects\n" +
"Right click to throw a flask that inflicts a variety of debuffs");
Tooltip.SetDefault("Fires a variety of high-velocity flasks\n" +
"Right click to throw a prismatic flask that inflicts many debuffs\n" +
"Red flasks explode violently, blue flasks contain poison gas,\n" +
"green flasks summon lunar flares and purple flasks explode into homing shrapnel");
flaskIDs = new int[]
{
ModContent.ProjectileType<MadAlchemistsCocktailRed>(),
ModContent.ProjectileType<MadAlchemistsCocktailBlue>(),
ModContent.ProjectileType<MadAlchemistsCocktailGreen>(),
ModContent.ProjectileType<MadAlchemistsCocktailPurple>(),
ModContent.ProjectileType<MadAlchemistsCocktailAlt>()
};
}
// Rest in peace Mad Cock, you will not be missed.
// Ozzatron 09FEB2021
public override void SetDefaults()
{
item.width = 26;
item.height = 36;
item.damage = BaseDamage;
item.magic = true;
item.noUseGraphic = true;
item.mana = 12;
item.width = 26;
item.height = 36;
item.useTime = 15;
item.useAnimation = 15;
item.useStyle = ItemUseStyleID.SwingThrow;
item.noMelee = true;
item.knockBack = 2f;
item.value = CalamityGlobalItem.Rarity11BuyPrice;
item.rare = ItemRarityID.Purple;
item.Calamity().donorItem = true;
item.UseSound = SoundID.Item106;
item.autoReuse = true;
item.shoot = ModContent.ProjectileType<MadAlchemistsCocktailRed>();
item.shootSpeed = 12f;
item.value = CalamityGlobalItem.Rarity11BuyPrice;
item.rare = ItemRarityID.Purple;
item.Calamity().donorItem = true;
}
public override bool AltFunctionUse(Player player) => true;
public override bool CanUseItem(Player player) => base.CanUseItem(player);
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)
{
type = ModContent.ProjectileType<MadAlchemistsCocktailAlt>();
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, (int)(damage * 1.15f), knockBack, player.whoAmI, 0f, 0f);
}
else
{
switch (FlaskType)
{
case 0:
type = ModContent.ProjectileType<MadAlchemistsCocktailRed>();
break;
case 1:
type = ModContent.ProjectileType<MadAlchemistsCocktailBlue>();
break;
case 2:
type = ModContent.ProjectileType<MadAlchemistsCocktailGreen>();
break;
case 3:
type = ModContent.ProjectileType<MadAlchemistsCocktailPurple>();
break;
default:
break;
}
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f);
FlaskType++;
if (FlaskType > 3)
FlaskType = 0;
type = flaskIDs[4];
return true;
}
return false;
// Cycle through the flask types in a circle.
type = flaskIDs[flaskIndex++];
if (flaskIndex > 3)
flaskIndex = 0;
return true;
}
public override void AddRecipes()
@@ -91,10 +83,8 @@ namespace CalamityMod.Items.Weapons.Magic
recipe.AddIngredient(ItemID.BottledWater, 15);
recipe.AddIngredient(ItemID.Leather, 5);
recipe.AddIngredient(ModContent.ItemType<EffulgentFeather>(), 5);
recipe.AddIngredient(ModContent.ItemType<CoreofEleum>(), 5);
recipe.AddIngredient(ModContent.ItemType<CoreofCinder>(), 5);
recipe.AddIngredient(ModContent.ItemType<CoreofChaos>(), 5);
recipe.AddIngredient(ModContent.ItemType<CoreofCalamity>());
// the recipe previously also used the individual cores for some reason
recipe.AddIngredient(ModContent.ItemType<CoreofCalamity>(), 2);
recipe.AddTile(TileID.AlchemyTable);
recipe.SetResult(this);
recipe.AddRecipe();
+16 -12
View File
@@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Magic
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Mad Alchemist's Cocktail");
DisplayName.SetDefault("Mad Alchemist's Prismatic Cocktail");
}
public override void SetDefaults()
@@ -41,8 +41,8 @@ namespace CalamityMod.Projectiles.Magic
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
target.AddBuff(ModContent.BuffType<CrushDepth>(), 300);
target.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 300);
target.AddBuff(ModContent.BuffType<HolyFlames>(), 300);
target.AddBuff(ModContent.BuffType<Nightwither>(), 300);
target.AddBuff(BuffID.Poisoned, 300);
target.AddBuff(BuffID.OnFire, 300);
target.AddBuff(BuffID.CursedInferno, 180);
@@ -53,24 +53,28 @@ namespace CalamityMod.Projectiles.Magic
public override void Kill(int timeLeft)
{
Main.PlaySound(SoundID.Item107, projectile.position);
Main.PlaySound(SoundID.Item20, projectile.Center);
Main.PlaySound(SoundID.Item107, projectile.Center);
Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 704, 1f);
Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 705, 1f);
int height = 120;
float num51 = 1.8f;
float num52 = 2.5f;
Vector2 value3 = (0f - 1.57079637f).ToRotationVector2();
Vector2 value4 = value3 * projectile.velocity.Length() * (float)projectile.MaxUpdates;
Main.PlaySound(SoundID.Item20, projectile.Center);
// This previously did double damage. It now does half damage.
int blastWidth = 120;
projectile.position = projectile.Center;
projectile.width = projectile.height = height;
projectile.width = projectile.height = blastWidth;
projectile.Center = projectile.position;
projectile.maxPenetrate = -1;
projectile.penetrate = -1;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 10;
projectile.damage *= 2;
projectile.localNPCHitCooldown = -1;
projectile.damage /= 2;
projectile.Damage();
// I don't even know what this dust code does
float num51 = 1.8f;
float num52 = 2.5f;
Vector2 value3 = (0f - 1.57079637f).ToRotationVector2();
Vector2 value4 = value3 * projectile.velocity.Length() * (float)projectile.MaxUpdates;
int num3;
for (int num53 = 0; num53 < 40; num53 = num3 + 1)
{
@@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Magic
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Mad Alchemist's Cocktail Blue");
DisplayName.SetDefault("Mad Alchemist's Blue Cocktail");
}
public override void SetDefaults()
@@ -43,15 +43,17 @@ namespace CalamityMod.Projectiles.Magic
Main.PlaySound(SoundID.Item107, projectile.position);
Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 704, 1f);
Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 705, 1f);
int num220 = Main.rand.Next(20, 31);
int numClouds = 9;
int cloudDamage = projectile.damage / 2;
if (projectile.owner == Main.myPlayer)
{
for (int num221 = 0; num221 < num220; num221++)
for (int i = 0; i < numClouds; i++)
{
Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
value17.Normalize();
value17 *= (float)Main.rand.Next(10, 201) * 0.01f;
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value17.X, value17.Y, ModContent.ProjectileType<MadAlchemistsCocktailGasCloud>(), projectile.damage / 4, 0f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1));
Vector2 v = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
v.Normalize();
v *= (float)Main.rand.Next(10, 201) * 0.01f;
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, v.X, v.Y, ModContent.ProjectileType<MadAlchemistsCocktailGasCloud>(), cloudDamage, 0f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1));
}
}
}
@@ -7,7 +7,7 @@ namespace CalamityMod.Projectiles.Magic
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Mad Alchemist's Cocktail Gas Cloud");
DisplayName.SetDefault("Mad Alchemist's Gas");
}
public override void SetDefaults()
@@ -19,8 +19,10 @@ namespace CalamityMod.Projectiles.Magic
projectile.ignoreWater = true;
projectile.tileCollide = false;
projectile.penetrate = -1;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 30;
// Only one gas cloud can hit at once.
projectile.usesIDStaticNPCImmunity = true;
projectile.idStaticNPCHitCooldown = 9;
}
public override void AI()
@@ -39,41 +41,6 @@ namespace CalamityMod.Projectiles.Magic
projectile.rotation += projectile.velocity.X * 0.1f;
projectile.rotation += (float)projectile.direction * 0.003f;
projectile.velocity *= 0.96f;
Rectangle cloudHitbox = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height);
for (int i = 0; i < Main.maxProjectiles; i++)
{
Projectile otherProj = Main.projectile[i];
// Short circuits to make the loop as fast as possible
if (!otherProj.active || otherProj.owner != projectile.owner || !otherProj.minion || i == projectile.whoAmI)
continue;
if (otherProj.type == projectile.type)
{
Rectangle otherProjHitbox = new Rectangle((int)otherProj.position.X, (int)otherProj.position.Y, otherProj.width, otherProj.height);
if (cloudHitbox.Intersects(otherProjHitbox))
{
Vector2 projDistance = otherProj.Center - projectile.Center;
if (projDistance.X == 0f && projDistance.Y == 0f)
{
if (i < projectile.whoAmI)
{
projDistance.X = -1f;
projDistance.Y = 1f;
}
else
{
projDistance.X = 1f;
projDistance.Y = -1f;
}
}
projDistance.Normalize();
projDistance *= 0.005f;
projectile.velocity -= projDistance;
otherProj.velocity += projDistance;
}
}
}
}
}
}
@@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Magic
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Mad Alchemist's Cocktail Green");
DisplayName.SetDefault("Mad Alchemist's Green Cocktail");
}
public override void SetDefaults()
@@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Magic
Main.PlaySound(SoundID.Item88, projectile.position);
Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 704, 1f);
Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 705, 1f);
for (int num118 = 0; num118 < 3; num118++)
for (int i = 0; i < 3; i++)
{
float x = projectile.position.X + (float)Main.rand.Next(-100, 100);
float y = projectile.position.Y - (float)Main.rand.Next(500, 600);
@@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Magic
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Mad Alchemist's Cocktail Purple");
DisplayName.SetDefault("Mad Alchemist's Purple Cocktail");
}
public override void SetDefaults()
@@ -43,14 +43,17 @@ namespace CalamityMod.Projectiles.Magic
Main.PlaySound(SoundID.Item107, projectile.position);
Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 704, 1f);
Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 705, 1f);
int numShrapnel = 4;
int shrapnelDamage = projectile.damage / 3;
if (projectile.owner == Main.myPlayer)
{
for (int num221 = 0; num221 < 4; num221++)
for (int i = 0; i < numShrapnel; i++)
{
Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
value17.Normalize();
value17 *= (float)Main.rand.Next(10, 201) * 0.01f;
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value17.X, value17.Y, ModContent.ProjectileType<MadAlchemistsCocktailShrapnel>(), projectile.damage / 3, 0f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1));
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value17.X, value17.Y, ModContent.ProjectileType<MadAlchemistsCocktailShrapnel>(), shrapnelDamage, 0f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1));
}
}
}
+20 -15
View File
@@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Magic
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Mad Alchemist's Cocktail Red");
DisplayName.SetDefault("Mad Alchemist's Red Cocktail");
}
public override void SetDefaults()
@@ -40,25 +40,30 @@ namespace CalamityMod.Projectiles.Magic
public override void Kill(int timeLeft)
{
int height = 480;
Main.PlaySound(SoundID.Item20, projectile.Center);
Main.PlaySound(SoundID.Item107, projectile.Center);
Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 704, 1f);
Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 705, 1f);
// This previously had a width of 480 pixels and did triple damage.
// It now has a width of 110 pixels and deals 1/2 damage.
int blastWidth = 110;
projectile.position = projectile.Center;
projectile.width = projectile.height = blastWidth;
projectile.Center = projectile.position;
projectile.maxPenetrate = -1;
projectile.penetrate = -1;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = -1;
projectile.damage /= 2;
projectile.Damage();
// I don't even know what this dust code does
float num50 = 3f;
float num51 = 2.4f;
float num52 = 3.8f;
Vector2 value3 = (0f - 1.57079637f).ToRotationVector2();
Vector2 value4 = value3 * projectile.velocity.Length() * (float)projectile.MaxUpdates;
Main.PlaySound(SoundID.Item, (int)projectile.Center.X, (int)projectile.Center.Y, 20, 2f, 0f);
Main.PlaySound(SoundID.Item107, projectile.position);
Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 704, 1f);
Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 705, 1f);
projectile.position = projectile.Center;
projectile.width = projectile.height = height;
projectile.Center = projectile.position;
projectile.maxPenetrate = -1;
projectile.penetrate = -1;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 10;
projectile.damage *= 3;
projectile.Damage();
int num3;
for (int num53 = 0; num53 < 60; num53 = num3 + 1)
{