Merge branch 'master' of https://github.com/UncleDanny/CalamityMod
This commit is contained in:
commit
3da2e19fa5
12 files changed
+326
-1
No files matched your search
@@ -0,0 +1,55 @@
|
||||
using CalamityMod.Projectiles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ID;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
public class TheSyringe : RogueWeapon
|
||||
{
|
||||
public static int BaseDamage = 50;
|
||||
public static float Knockback = 5f;
|
||||
public static float Speed = 15f;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("The Syringe");
|
||||
Tooltip.SetDefault("Throws a high velocity syringe that increases damage as it travels\n" +
|
||||
"Shatters into glass and plague cinders on impact\n" +
|
||||
"Stealth strikes also shatter into plague bees");
|
||||
}
|
||||
|
||||
public override void SafeSetDefaults()
|
||||
{
|
||||
item.damage = BaseDamage;
|
||||
item.knockBack = Knockback;
|
||||
item.autoReuse = true;
|
||||
item.useTime = 15;
|
||||
item.useAnimation = 15;
|
||||
item.useStyle = 1;
|
||||
item.width = 14;
|
||||
item.height = 50;
|
||||
item.UseSound = SoundID.Item106;
|
||||
item.noMelee = true;
|
||||
item.noUseGraphic = true;
|
||||
item.shoot = ModContent.ProjectileType<TheSyringeProj>();
|
||||
item.shootSpeed = Speed;
|
||||
item.value = Item.buyPrice(0, 80, 0, 0);
|
||||
item.rare = 8;
|
||||
item.Calamity().rogue = true;
|
||||
}
|
||||
|
||||
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())
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType<TheSyringeProj>(), damage, knockBack, player.whoAmI, 0f, 1f);
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 521 B |
@@ -222,6 +222,12 @@ namespace CalamityMod.NPCs.TownNPCs
|
||||
shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 25, 0, 0);
|
||||
nextSlot++;
|
||||
}
|
||||
if (NPC.downedPirates)
|
||||
{
|
||||
shop.item[nextSlot].SetDefaults(ModContent.ItemType<ThiefsDime>());
|
||||
shop.item[nextSlot].shopCustomPrice = Item.buyPrice(1, 0, 0, 0);
|
||||
nextSlot++;
|
||||
}
|
||||
if (NPC.downedMechBoss1 && NPC.downedMechBoss2 && NPC.downedMechBoss3)
|
||||
{
|
||||
shop.item[nextSlot].SetDefaults(ModContent.ItemType<MomentumCapacitor>());
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
}
|
||||
if (Main.player[num487].statLife < 0 || CalamityWorld.armageddon)
|
||||
{
|
||||
Main.player[num487].KillMe(PlayerDeathReason.ByCustomReason(Main.player[Main.myPlayer].name + " was burst into sinless ash."), 1000.0, 0, false);
|
||||
Main.player[num487].KillMe(PlayerDeathReason.ByCustomReason(Main.player[Main.myPlayer].name + " burst into sinless ash."), 1000.0, 0, false);
|
||||
}
|
||||
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
|
||||
projectile.Kill();
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class TheSyringeCinder : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Syringe Cinder");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 6;
|
||||
projectile.height = 12;
|
||||
projectile.friendly = true;
|
||||
projectile.penetrate = -1;
|
||||
projectile.timeLeft = 120;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 10;
|
||||
projectile.melee = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (projectile.velocity.X != projectile.velocity.X)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X * -0.1f;
|
||||
}
|
||||
if (projectile.velocity.X != projectile.velocity.X)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X * -0.5f;
|
||||
}
|
||||
if (projectile.velocity.Y != projectile.velocity.Y && projectile.velocity.Y > 1f)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y * -0.5f;
|
||||
}
|
||||
projectile.ai[0] += 1f;
|
||||
if (projectile.ai[0] > 5f)
|
||||
{
|
||||
projectile.ai[0] = 5f;
|
||||
if (projectile.velocity.Y == 0f && projectile.velocity.X != 0f)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X * 0.97f;
|
||||
if ((double)projectile.velocity.X > -0.01 && (double)projectile.velocity.X < 0.01)
|
||||
{
|
||||
projectile.velocity.X = 0f;
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
}
|
||||
projectile.velocity.Y = projectile.velocity.Y + 0.2f;
|
||||
}
|
||||
projectile.rotation += projectile.velocity.X * 0.1f;
|
||||
if (Main.rand.NextBool(4))
|
||||
{
|
||||
int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 89, 0f, 0f, 100, default, 1f);
|
||||
Dust expr_8976_cp_0 = Main.dust[num199];
|
||||
expr_8976_cp_0.position.X -= 2f;
|
||||
Dust expr_8994_cp_0 = Main.dust[num199];
|
||||
expr_8994_cp_0.position.Y += 2f;
|
||||
Main.dust[num199].scale += (float)Main.rand.Next(50) * 0.01f;
|
||||
Main.dust[num199].noGravity = true;
|
||||
Dust expr_89E7_cp_0 = Main.dust[num199];
|
||||
expr_89E7_cp_0.velocity.Y -= 2f;
|
||||
}
|
||||
if (Main.rand.NextBool(10))
|
||||
{
|
||||
int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 89, 0f, 0f, 100, default, 1f);
|
||||
Dust expr_8A4E_cp_0 = Main.dust[num200];
|
||||
expr_8A4E_cp_0.position.X -= 2f;
|
||||
Dust expr_8A6C_cp_0 = Main.dust[num200];
|
||||
expr_8A6C_cp_0.position.Y += 2f;
|
||||
Main.dust[num200].scale += 0.3f + (float)Main.rand.Next(50) * 0.01f;
|
||||
Main.dust[num200].noGravity = true;
|
||||
Main.dust[num200].velocity *= 0.1f;
|
||||
}
|
||||
if ((double)projectile.velocity.Y < 0.25 && (double)projectile.velocity.Y > 0.15)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X * 0.8f;
|
||||
}
|
||||
projectile.rotation = -projectile.velocity.X * 0.05f;
|
||||
if (projectile.velocity.Y > 16f)
|
||||
{
|
||||
projectile.velocity.Y = 16f;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnTileCollide(Vector2 oldVelocity)
|
||||
{
|
||||
if (projectile.penetrate == 0)
|
||||
{
|
||||
projectile.Kill();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<Plague>(), 120);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 208 B |
@@ -0,0 +1,103 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class TheSyringeProj : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Syringe");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 10;
|
||||
projectile.height = 10;
|
||||
projectile.light = 0.5f;
|
||||
projectile.extraUpdates = 1;
|
||||
projectile.friendly = true;
|
||||
projectile.Calamity().rogue = true;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.aiStyle = 1;
|
||||
aiType = 242;
|
||||
projectile.penetrate = 1;
|
||||
projectile.timeLeft = 600;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (Main.rand.Next(8) == 0)
|
||||
{
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, Main.rand.Next(2) == 1 ? 107 : 89, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
|
||||
}
|
||||
projectile.damage += projectile.Calamity().defDamage / 200;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<Plague>(), 600);
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
projectile.position = projectile.Center;
|
||||
projectile.width = projectile.height = 100;
|
||||
projectile.position.X = projectile.position.X - (float)(projectile.width / 2);
|
||||
projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2);
|
||||
projectile.maxPenetrate = -1;
|
||||
projectile.penetrate = -1;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 10;
|
||||
projectile.Damage();
|
||||
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 107);
|
||||
for (int k = 0; k < 7; k++)
|
||||
{
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 89, projectile.oldVelocity.X, projectile.oldVelocity.Y);
|
||||
}
|
||||
int num251 = Main.rand.Next(1, 3);
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
for (int num252 = 0; num252 < num251; num252++)
|
||||
{
|
||||
Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
|
||||
while (value15.X == 0f && value15.Y == 0f)
|
||||
{
|
||||
value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
|
||||
}
|
||||
value15.Normalize();
|
||||
value15 *= (float)Main.rand.Next(70, 101) * 0.1f;
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType<TheSyringeCinder>(), (int)((double)projectile.damage * 0.5), 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
for (int index = 0; index < 2; ++index)
|
||||
{
|
||||
float SpeedX = -projectile.velocity.X * Main.rand.Next(40, 70) * 0.01f + Main.rand.Next(-20, 21) * 0.4f;
|
||||
float SpeedY = -projectile.velocity.Y * Main.rand.Next(40, 70) * 0.01f + Main.rand.Next(-20, 21) * 0.4f;
|
||||
Projectile.NewProjectile(projectile.Center.X + SpeedX, projectile.Center.Y + SpeedY, SpeedX, SpeedY, ModContent.ProjectileType<TheSyringeS1>(), (int)((double)projectile.damage * 0.25), 0f, Main.myPlayer, Main.rand.Next(3), 0f);
|
||||
}
|
||||
}
|
||||
if (projectile.owner == Main.myPlayer && projectile.ai[1] == 1)
|
||||
{
|
||||
int num3;
|
||||
for (int num639 = 0; num639 < 5; num639 = num3 + 1)
|
||||
{
|
||||
float speedX = (float)Main.rand.Next(-35, 36) * 0.02f;
|
||||
float speedY = (float)Main.rand.Next(-35, 36) * 0.02f;
|
||||
int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, speedX, speedY, ModContent.ProjectileType<PlaguenadeBee>(), (int)((double)projectile.damage * 0.5), 0f, Main.myPlayer, 0f, 0f);
|
||||
Main.projectile[proj].penetrate = 1;
|
||||
num3 = num639;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 521 B |
@@ -0,0 +1,56 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ID;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class TheSyringeS1 : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Shrapnel");
|
||||
Main.projFrames[projectile.type] = 3;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 6;
|
||||
projectile.height = 6;
|
||||
projectile.aiStyle = 24;
|
||||
projectile.friendly = true;
|
||||
projectile.penetrate = 1;
|
||||
projectile.light = 0.5f;
|
||||
projectile.alpha = 50;
|
||||
projectile.scale = 1.2f;
|
||||
projectile.timeLeft = 600;
|
||||
projectile.tileCollide = false;
|
||||
projectile.Calamity().rogue = true;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
//Changes the texture of the projectile
|
||||
if (projectile.ai[0] == 1f)
|
||||
{
|
||||
Texture2D texture = ModContent.GetTexture("CalamityMod/Projectiles/Rogue/TheSyringeS2");
|
||||
Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition, new Rectangle?(new Rectangle(0, 0, texture.Width, 6)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture.Width / 2f, 20 / 2f), projectile.scale, SpriteEffects.None, 0f);
|
||||
return false;
|
||||
}
|
||||
if (projectile.ai[0] == 2f)
|
||||
{
|
||||
Texture2D texture = ModContent.GetTexture("CalamityMod/Projectiles/Rogue/TheSyringeS3");
|
||||
Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition, new Rectangle?(new Rectangle(0, 0, texture.Width, 6)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture.Width / 2f, 20 / 2f), projectile.scale, SpriteEffects.None, 0f);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<Plague>(), 120);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 152 B |
Binary file not shown.
|
After Width: | Height: | Size: 145 B |
Binary file not shown.
|
After Width: | Height: | Size: 143 B |
Reference in new issue
Block a user