Added Ice Barrage and Burning strife changes

This commit is contained in:
Shucks committed 2020-01-10 18:22:05 -06:00
1 parent 60b3c4b09a
commit d6f933ea56
19 files changed
+460 -2

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
using CalamityMod.Projectiles.Magic;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Items.Ammo
{
public class BloodRune : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Blood Rune");
Tooltip.SetDefault("Used with the Ice Barrage \n" +
"Found in some sort of runic landscape");
}
public override void SetDefaults()
{
item.damage = 1;
item.width = 22;
item.height = 24;
item.maxStack = 999;
item.consumable = true;
item.knockBack = 10f;
item.value = Item.buyPrice(0, 1, 0, 0);
item.Calamity().postMoonLordRarity = 21;
item.shoot = ModContent.ProjectileType<IceBarrageMain>();
item.shootSpeed = 0f;
item.ammo = item.type; // CONSIDER -- Would item.type work here instead of a self reference?
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 525 B

+85
View File
@@ -0,0 +1,85 @@
using CalamityMod.Items.Ammo;
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Magic;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Magic
{
public class IceBarrage : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Ice Barrage");
Tooltip.SetDefault("Casts a deadly and powerful ice spell in the location of the cursor \n" +
"Consumes 2 Blood Runes every time its used \n" +
"Oh dear, you are dead!");
}
public override void SetDefaults()
{
item.width = 60;
item.height = 60;
item.Calamity().postMoonLordRarity = 21;
item.value = Item.buyPrice(1, 80, 0, 0);
item.useStyle = ItemUseStyleID.HoldingUp;
item.magic = true;
item.mana = 530;
item.noMelee = true;
item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/IceBarrageCast");
item.damage = 9000;
item.knockBack = 6f;
item.useTime = 300;
item.useAnimation = 300;
item.reuseDelay = 60;
item.shoot = ModContent.ProjectileType<IceBarrageMain>();
item.shootSpeed = 2f;
item.useAmmo = ModContent.ItemType<BloodRune>();
}
public override bool CanUseItem(Player player)
{
return CalamityGlobalItem.HasEnoughAmmo(player, item, 2);
}
public override bool ConsumeAmmo(Player player)
{
return false;
}
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 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
vector2.X = Main.mouseX + Main.screenPosition.X;
vector2.Y = Main.mouseY + Main.screenPosition.Y;
Projectile.NewProjectile(vector2, Vector2.Zero, type, damage, knockBack, player.whoAmI, 0f, 0f);
CalamityGlobalItem.ConsumeAdditionalAmmo(player, item, 2);
return false;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.BlizzardStaff);
recipe.AddIngredient(ItemID.IceRod);
recipe.AddIngredient(ModContent.ItemType<IcicleStaff>());
recipe.AddIngredient(ModContent.ItemType<EndothermicEnergy>(), 23);
recipe.AddIngredient(ModContent.ItemType<CryoBar>(), 18);
recipe.AddTile(ModContent.TileType<DraedonsForge>());
recipe.SetResult(this);
recipe.AddRecipe();
}
public override void UseStyle(Player player)
{
player.itemLocation.X -= 8f * player.direction;
player.itemRotation = player.direction * MathHelper.ToRadians(-45f);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

+1 -1
View File
@@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Rogue
item.useAnimation = 25;
item.useTime = 25;
item.damage = 60;
item.damage = 80;
item.crit = 8;
item.shootSpeed = 8f;
item.shoot = ModContent.ProjectileType<BurningStrifeProj>();
+5
View File
@@ -175,6 +175,11 @@ namespace CalamityMod.NPCs.TownNPCs
shop.item[nextSlot].SetDefaults(ModContent.ItemType<CryoKey>());
shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 15, 0, 0);
nextSlot++;
if (Main.LocalPlayer.HasItem(ModContent.ItemType<IceBarrage>()))
{
shop.item[nextSlot].SetDefaults(ModContent.ItemType<BloodRune>());
nextSlot++;
}
}
// Make this Town NPC teleport to the King statue when triggered.
+171
View File
@@ -0,0 +1,171 @@
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;
using CalamityMod.Buffs.StatDebuffs;
namespace CalamityMod.Projectiles.Magic
{
public class IceBarrageMain : ModProjectile
{
private int pwidth = 58;
private int pheight = 58;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Ice Barrage");
}
public override void SetDefaults()
{
projectile.width = pwidth;
projectile.height = pheight;
projectile.friendly = true;
projectile.tileCollide = false;
projectile.ignoreWater = true;
projectile.magic = true;
projectile.timeLeft = 280;
projectile.penetrate = -1;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 10;
}
public override void AI()
{
projectile.ai[0]++;
projectile.ai[1]++;
for (int j = 0; j < 3; j++)
{
int num297 = Main.rand.NextBool(2) ? 68 : 67;
if (Main.rand.NextBool(4))
{
num297 = 80;
}
if (projectile.ai[0] < 140f)
{
Vector2 direction = new Vector2(Main.rand.NextFloat(-4f, 4f), Main.rand.NextFloat(-4f, 4f));
int dust = Dust.NewDust(projectile.Center, 1, 1, num297, direction.X, direction.Y, 50, default, 1.3f);
Main.dust[dust].noGravity = true;
}
else
{
int direct = Main.rand.NextBool(2) ? 1 : -1;
Vector2 dir1 = new Vector2(0f, 10f) * direct;
int dust1 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num297, dir1.X, dir1.Y, 50, default, 1.3f);
Main.dust[dust1].noGravity = true;
Main.dust[dust1].velocity = dir1;
int direct2 = Main.rand.NextBool(2) ? 1 : -1;
Vector2 dir2 = new Vector2(10f, 0f) * direct2;
int dust2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num297, dir2.X, dir2.Y, 50, default, 1.3f);
Main.dust[dust2].noGravity = true;
Main.dust[dust2].velocity = dir2;
}
}
if (projectile.ai[0] < 55)
{
for (int i = 0; i < 10; i++)
{
int dtype1 = Main.rand.NextBool(2) ? 68 : 67;
if (Main.rand.NextBool(4))
{
dtype1 = 80;
}
Vector2 Dpos = projectile.Center + new Vector2(Main.rand.NextFloat(250f, 270f), Main.rand.NextFloat(250f, 270f)).RotatedBy(MathHelper.ToRadians(Main.rand.Next(1, 360)));
Vector2 Dspeed = projectile.Center - Dpos;
Dspeed.Normalize();
Dspeed *= 0.5f;
float Dscale = Main.rand.NextFloat(1.5f, 2f);
int d1 = Dust.NewDust(Dpos, 1, 1, dtype1, Dspeed.X, Dspeed.Y, 0, default, Dscale);
Main.dust[d1].velocity = Dspeed;
Main.dust[d1].noGravity = true;
}
}
else if (projectile.ai[0] == 55f)
{
for (int i = 0; i < 270; i++)
{
int dtype2 = Main.rand.NextBool(2) ? 68 : 67;
if (Main.rand.NextBool(4))
{
dtype2 = 80;
}
Vector2 Dpos = projectile.Center + new Vector2(Main.rand.NextFloat(250f, 270f), Main.rand.NextFloat(250f, 270f)).RotatedBy(MathHelper.ToRadians(Main.rand.Next(1, 360)));
Vector2 Dspeed = projectile.Center - Dpos;
Dspeed.Normalize();
Dspeed *= Main.rand.NextFloat(8f,34f);
float Dscale = Main.rand.NextFloat(1.5f, 2f);
int d1 = Dust.NewDust(Dpos, 1, 1, dtype2, Dspeed.X, Dspeed.Y, 0, default, Dscale);
Main.dust[d1].velocity = Dspeed;
Main.dust[d1].noGravity = true;
}
}
else if (projectile.ai[0] == 140f)
{
Vector2 projcenter = projectile.Center;
projectile.width = 200;
projectile.height = 200;
projectile.Center = projcenter;
projectile.Damage();
for (int i = 0; i < 180; i++)
{
int dtype3 = Main.rand.NextBool(2) ? 68 : 67;
if (Main.rand.NextBool(4))
{
dtype3 = 80;
}
Vector2 explosiondir = new Vector2(Main.rand.NextFloat(-18f, 18f), Main.rand.NextFloat(-18f, 18f));
int d2 = Dust.NewDust(projectile.Center, 1, 1, dtype3, explosiondir.X, explosiondir.Y, 50, default, 1.5f);
Main.dust[d2].noGravity = true;
}
for (int k = 0; k < 45; k++)
{
Vector2 projspeed = new Vector2(Main.rand.NextFloat(-8f, 8f), Main.rand.NextFloat(-8f, 8f));
int ice = Projectile.NewProjectile(projectile.Center, projspeed, ProjectileID.NorthPoleSnowflake, (int)(projectile.damage * 0.05f), 2f, projectile.owner, 0f, (float)Main.rand.Next(3));
Main.projectile[ice].timeLeft = 600;
Main.projectile[ice].melee = false;
Main.projectile[ice].Calamity().forceMagic = true;
}
projectile.width = pwidth;
projectile.height = pheight;
projectile.Center = projcenter;
Vector2 pos1 = new Vector2(projectile.Center.X, projectile.Center.Y - (projectile.height * 0.5f) - 44f);
int block1 = Projectile.NewProjectile(pos1, Vector2.Zero, ModContent.ProjectileType<IceBlock>(), (int)(projectile.damage * 0.3f), 5f, projectile.owner, 0f, 0f);
Main.projectile[block1].Center = pos1;
Vector2 pos2 = new Vector2(projectile.Center.X + (projectile.width * 0.5f) + 48f, projectile.Center.Y);
int block2 = Projectile.NewProjectile(pos2, Vector2.Zero, ModContent.ProjectileType<IceBlock>(), (int)(projectile.damage * 0.3f), 5f, projectile.owner, 1f, 0f);
Main.projectile[block2].Center = pos2;
Vector2 pos3 = new Vector2(projectile.Center.X, projectile.Center.Y + (projectile.height * 0.5f) + 44f);
int block3 = Projectile.NewProjectile(pos3, Vector2.Zero, ModContent.ProjectileType<IceBlock>(), (int)(projectile.damage * 0.3f), 5f, projectile.owner, 2f, 0f);
Main.projectile[block3].Center = pos3;
Vector2 pos4 = new Vector2(projectile.Center.X - (projectile.width * 0.5f) - 49f, projectile.Center.Y);
int block4 = Projectile.NewProjectile(pos4, Vector2.Zero, ModContent.ProjectileType<IceBlock>(), (int)(projectile.damage * 0.3f), 5f, projectile.owner, 3f, 0f);
Main.projectile[block4].Center = pos4;
}
if (projectile.ai[0] > 90)
{
if (projectile.ai[1] >= 5f)
{
Vector2 projspeed = new Vector2(Main.rand.NextFloat(-5f, 5f), Main.rand.NextFloat(-5f, 5f));
int ice = Projectile.NewProjectile(projectile.Center, projspeed, ProjectileID.NorthPoleSnowflake, (int)(projectile.damage * 0.05f), 2f, projectile.owner, 0f, (float)Main.rand.Next(3));
Main.projectile[ice].timeLeft = 600;
Main.projectile[ice].melee = false;
Main.projectile[ice].Calamity().forceMagic = true;
projectile.ai[1] = 0f;
}
}
}
public override bool CanDamage()
{
if (projectile.ai[0] == 140f)
return true;
return false;
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
target.AddBuff(ModContent.BuffType<ExoFreeze>(), 900);
target.AddBuff(ModContent.BuffType<GlacialState>(), 900);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 148 B

+74
View File
@@ -0,0 +1,74 @@
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;
using Microsoft.Xna.Framework;
namespace CalamityMod.Projectiles.Magic
{
public class IceBlock : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Ice Barrage");
}
public override void SetDefaults()
{
projectile.width = 58;
projectile.height = 58;
projectile.friendly = true;
projectile.tileCollide = false;
projectile.ignoreWater = true;
projectile.magic = true;
projectile.timeLeft = 140;
projectile.alpha = 255;
projectile.penetrate = -1;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 60;
}
public override void AI()
{
if (projectile.alpha > 20)
{
projectile.alpha -= 12;
}
if(projectile.alpha < 20)
{
projectile.alpha = 20;
}
switch(projectile.ai[0])
{
case 1: projectile.rotation = (MathHelper.Pi * 0.5f);
break;
case 2: projectile.rotation = MathHelper.Pi;
break;
case 3: projectile.rotation = (MathHelper.Pi * 1.5f);
break;
default: break;
}
}
public override void Kill(int timeLeft)
{
for (int i = 0; i < 40; i++)
{
int num297 = Main.rand.NextBool(2) ? 68 : 67;
if (Main.rand.NextBool(4))
{
num297 = 80;
}
Vector2 direction = new Vector2(Main.rand.NextFloat(-4f, 4f), Main.rand.NextFloat(-4f, 4f));
int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, num297, direction.X, direction.Y, 50, default, 1.5f);
Main.dust[dust].noGravity = true;
}
Main.PlaySound(SoundID.NPCHit5, projectile.Center);
for (int i = 0; i< 8; i++)
{
Vector2 projdir = new Vector2(Main.rand.NextFloat(-10f, 10f), Main.rand.NextFloat(-10f, 10f));
Vector2 projpos = projectile.Center + new Vector2(Main.rand.NextFloat(-50f, 50f), Main.rand.NextFloat(-50f, 50f));
Projectile.NewProjectile(projpos, projdir, ModContent.ProjectileType<IceBlockIcicle>(), (int)(projectile.damage * 0.2f), 4f, projectile.owner, Main.rand.Next(0, 2), 0f);
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

+64
View File
@@ -0,0 +1,64 @@
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace CalamityMod.Projectiles.Magic
{
public class IceBlockIcicle : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Ice Barrage");
}
public override void SetDefaults()
{
projectile.width = 18;
projectile.height = 18;
projectile.friendly = true;
projectile.ignoreWater = true;
projectile.magic = true;
projectile.timeLeft = 600;
}
public override void AI()
{
projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt();
projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi) + (MathHelper.Pi * 0.5f * projectile.direction);
projectile.velocity.Y += 0.25f;
if(projectile.velocity.Y > 16f)
{
projectile.velocity.Y = 16f;
}
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
if (projectile.ai[0] == 1f)
{
Texture2D texture = ModContent.GetTexture("CalamityMod/Projectiles/Magic/IceBlockIcicle2");
Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition, new Rectangle?(new Rectangle(0, 0, texture.Width, texture.Height)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture.Width / 2f, texture.Height / 2f), projectile.scale, SpriteEffects.None, 0f);
return false;
}
return true;
}
public override void Kill(int timeLeft)
{
for (int i = 0; i < 20; i++)
{
int num297 = Main.rand.NextBool(2) ? 68 : 67;
if (Main.rand.NextBool(4))
{
num297 = 80;
}
Vector2 direction = new Vector2(Main.rand.NextFloat(-4f, 4f), Main.rand.NextFloat(-4f, 4f));
int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, num297, direction.X, direction.Y, 50, default, 1.1f);
Main.dust[dust].noGravity = true;
}
Main.PlaySound(SoundID.NPCHit5, projectile.Center);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 542 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 594 B

+1
View File
@@ -96,6 +96,7 @@ namespace CalamityMod.Projectiles.Summon
Main.dust[dust].noGravity = true;
}
}
projectile.localAI[1] = AttackMode;
//Damage Update
if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue)
+2 -1
View File
@@ -73,11 +73,12 @@ namespace CalamityMod.Projectiles.Summon
SpawnDust();
}
AttackMode = (int)body.localAI[1];
//Rotation
if (AttackMode == 3)
{
projectile.rotation += 0.02f;
projectile.rotation += 0.015f;
}
else
{
@@ -39,6 +39,10 @@ namespace CalamityMod.Projectiles.Typeless
}
projectile.ai[1] = 0f;
}
if (projectile.timeLeft < 25)
{
projectile.damage = 0;
}
}
@@ -42,6 +42,10 @@ namespace CalamityMod.Projectiles.Typeless
}
projectile.ai[1] = 0f;
}
if (projectile.timeLeft < 25)
{
projectile.damage = 0;
}
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
+18
View File
@@ -0,0 +1,18 @@
using Terraria;
using Terraria.ModLoader;
using Microsoft.Xna.Framework.Audio;
namespace CalamityMod.Sounds.Item
{
public class IceBarrageCast : ModSound
{
public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type)
{
soundInstance = sound.CreateInstance();
soundInstance.Volume = volume * 1f;
soundInstance.Pan = pan;
Main.PlaySoundInstance(soundInstance);
return soundInstance;
}
}
}
Binary file not shown.