added sylvan slasher (unobtainable)

This commit is contained in:
termigator1359 committed 2019-12-09 23:49:53 -05:00
1 parent ac9a96467c
commit 809d144ced
7 files changed
+249 -4

No files matched your search

+2 -4
View File
@@ -3472,10 +3472,8 @@ namespace CalamityMod.CalPlayer
for (int j = 0; j < 2; j++)
{
int num = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 157, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 2f);
Dust expr_A4_cp_0 = Main.dust[num];
expr_A4_cp_0.position.X += (float)Main.rand.Next(-20, 21);
Dust expr_CB_cp_0 = Main.dust[num];
expr_CB_cp_0.position.Y += (float)Main.rand.Next(-20, 21);
Main.dust[num].position.X += (float)Main.rand.Next(-20, 21);
Main.dust[num].position.Y += (float)Main.rand.Next(-20, 21);
Main.dust[num].velocity *= 0.9f;
Main.dust[num].noGravity = true;
Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f;
+42
View File
@@ -0,0 +1,42 @@
using CalamityMod.Projectiles.Rogue;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Rogue
{
public class SylvanSlasher : RogueWeapon
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Sylvan Slasher");
Tooltip.SetDefault(@"Summons sword waves and builds stealth on enemy hits
Does not consume stealth and cannot stealth strike");
}
public override void SafeSetDefaults()
{
item.width = 72;
item.damage = 300;
item.Calamity().rogue = true;
item.noMelee = true;
item.noUseGraphic = true;
item.channel = true;
item.useAnimation = 25;
item.useStyle = 5;
item.useTime = 5;
item.knockBack = 3f;
item.autoReuse = false;
item.height = 78;
item.value = Item.buyPrice(1, 20, 0, 0);
item.rare = 10;
item.shoot = ModContent.ProjectileType<SylvanSlashAttack>();
item.shootSpeed = 24f;
item.Calamity().postMoonLordRarity = 12;
}
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)
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f);
return false;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 762 B

+78
View File
@@ -0,0 +1,78 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Rogue
{
public class SylvanSlash : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Slash");
}
public override void SetDefaults()
{
projectile.width = 30;
projectile.height = 30;
aiType = 348;
projectile.friendly = true;
projectile.ignoreWater = true;
projectile.Calamity().rogue = true;
projectile.penetrate = 2;
projectile.alpha = 120;
projectile.timeLeft = 200;
ProjectileID.Sets.TrailCacheLength[projectile.type] = 10;
ProjectileID.Sets.TrailingMode[projectile.type] = 1;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 10;
projectile.tileCollide = false;
}
public override void AI()
{
if (projectile.localAI[0] == 0f)
{
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 92);
projectile.localAI[0] += 1f;
}
Lighting.AddLight(projectile.Center, 0f, 0.2f, 0.4f);
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f;
projectile.velocity.Y += projectile.ai[0];
if (Main.rand.NextBool(2))
{
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 111, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
}
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
if (projectile.timeLeft > 195)
return false;
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2);
return false;
}
public override Color? GetAlpha(Color lightColor)
{
return new Color(200, 200, 200, projectile.alpha);
}
public override void Kill(int timeLeft)
{
for (int k = 0; k < 3; k++)
{
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 111, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f);
}
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
projectile.velocity *= 0.5f;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

+127
View File
@@ -0,0 +1,127 @@
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.CalPlayer;
namespace CalamityMod.Projectiles.Rogue
{
public class SylvanSlashAttack : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Sylvan Slash");
Main.projFrames[projectile.type] = 28;
}
public override void SetDefaults()
{
projectile.width = 68;
projectile.height = 68;
projectile.friendly = true;
projectile.penetrate = -1;
projectile.tileCollide = false;
projectile.Calamity().rogue = true;
projectile.ownerHitCheck = true;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 4;
}
public override void AI()
{
Player player = Main.player[projectile.owner];
float num = 0f;
Vector2 vector = player.RotatedRelativePoint(player.MountedCenter, true);
if (projectile.spriteDirection == -1)
{
num = 3.14159274f;
}
if (++projectile.frame >= Main.projFrames[projectile.type])
{
projectile.frame = 0;
}
projectile.soundDelay--;
if (projectile.soundDelay <= 0)
{
Main.PlaySound(SoundID.Item15, projectile.Center);
projectile.soundDelay = 24;
}
if (Main.myPlayer == projectile.owner)
{
if (player.channel && !player.noItems && !player.CCed)
{
float scaleFactor6 = 1f;
if (player.inventory[player.selectedItem].shoot == projectile.type)
{
scaleFactor6 = player.inventory[player.selectedItem].shootSpeed * projectile.scale;
}
Vector2 vector13 = Main.MouseWorld - vector;
vector13.Normalize();
if (vector13.HasNaNs())
{
vector13 = Vector2.UnitX * (float)player.direction;
}
vector13 *= scaleFactor6;
if (vector13.X != projectile.velocity.X || vector13.Y != projectile.velocity.Y)
{
projectile.netUpdate = true;
}
projectile.velocity = vector13;
}
else
{
projectile.Kill();
}
}
Vector2 vector14 = projectile.Center + projectile.velocity * 3f;
Lighting.AddLight(vector14, 3f, 0.2f, 0.2f);
if (Main.rand.NextBool(3))
{
int num30 = Dust.NewDust(vector14 - projectile.Size / 2f, projectile.width, projectile.height, 111, projectile.velocity.X, projectile.velocity.Y, 100, default, 2f);
Main.dust[num30].noGravity = true;
Main.dust[num30].position -= projectile.velocity;
}
projectile.position = player.RotatedRelativePoint(player.MountedCenter, true) - projectile.Size / 2f;
projectile.rotation = projectile.velocity.ToRotation() + num;
projectile.spriteDirection = projectile.direction;
projectile.timeLeft = 2;
player.ChangeDir(projectile.direction);
player.heldProj = projectile.whoAmI;
player.itemTime = 2;
player.itemAnimation = 2;
player.itemRotation = (float)Math.Atan2((double)(projectile.velocity.Y * (float)projectile.direction), (double)(projectile.velocity.X * (float)projectile.direction));
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
CalamityPlayer modPlayer = Main.player[Main.myPlayer].Calamity();
if (projectile.owner == Main.myPlayer)
{
if ((target.damage > 5 || target.boss) && !target.SpawnedFromStatue)
{
if (modPlayer.wearingRogueArmor && modPlayer.rogueStealthMax != 0)
{
if (modPlayer.rogueStealth < modPlayer.rogueStealthMax)
modPlayer.rogueStealth += 0.01f;
}
}
if (Main.rand.NextBool(8))
{
if (Main.rand.NextBool(3))
{
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, Main.rand.Next(-3,-1), ModContent.ProjectileType<SylvanSlash>(), (int)((double)projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f);
}
else if (Main.rand.NextBool(2))
{
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, Main.rand.Next(2,4), 0f, ModContent.ProjectileType<SylvanSlash>(), (int)((double)projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f);
}
else
{
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, Main.rand.Next(-3,-1), 0f, ModContent.ProjectileType<SylvanSlash>(), (int)((double)projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f);
}
}
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB