Leviatitan Progress
This commit is contained in:
1 parent
a5c890ca03
commit
2ee12dbfee
6 files changed
+84
-80
No files matched your search
@@ -21,9 +21,9 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
Item.width = 82;
|
||||
Item.height = 28;
|
||||
Item.damage = 117;
|
||||
Item.damage = 97;
|
||||
Item.DamageType = DamageClass.Ranged;
|
||||
Item.useTime = Item.useAnimation = 18;
|
||||
Item.useTime = Item.useAnimation = 26;
|
||||
Item.noUseGraphic = true;
|
||||
Item.channel = true;
|
||||
Item.noMelee = true;
|
||||
@@ -35,22 +35,17 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.shoot = ModContent.ProjectileType<LeviatitanHoldout>();
|
||||
Item.shootSpeed = 12f;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.Calamity().canFirePointBlankShots = true;
|
||||
Item.useAmmo = AmmoID.Bullet;
|
||||
}
|
||||
|
||||
// Obviously we don't want multiple holdouts existing at the same time.
|
||||
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] == 0;
|
||||
|
||||
// Spawning the holdout won't consume ammo.
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] != 0;
|
||||
|
||||
// Makes the rotation of the mouse around the player sync in multiplayer.
|
||||
public override void HoldItem(Player player) => player.Calamity().mouseWorldListener = true;
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType<LeviatitanHoldout>(), 0, 0f, player.whoAmI);
|
||||
Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType<LeviatitanHoldout>(), damage, knockback, player.whoAmI);
|
||||
|
||||
// We set the rotation to the direction to the mouse so the first frame doesn't appear bugged out.
|
||||
holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero);
|
||||
|
||||
@@ -695,9 +695,9 @@ Leviatitan: {
|
||||
DisplayName: Leviatitan
|
||||
Tooltip:
|
||||
'''
|
||||
Converts musket balls into high velocity aqua blasts
|
||||
Fires homing aberrations that shred enemy defense every 7th shot
|
||||
<right> to vomit a meteor that explodes on hit
|
||||
Fires high velocity aqua blasts
|
||||
Releases homing aberrations that shred enemy defense on every 6th shot
|
||||
<right> while holding <left> to vomit a meteor that explodes on hit
|
||||
'''
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
Projectile.penetrate = 1;
|
||||
Projectile.timeLeft = 600;
|
||||
Projectile.DamageType = DamageClass.Ranged;
|
||||
Projectile.extraUpdates = 1;
|
||||
Projectile.extraUpdates = 2;
|
||||
Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration;
|
||||
}
|
||||
|
||||
@@ -46,31 +46,26 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == 1 ? 0f : MathHelper.Pi) + MathHelper.ToRadians(90) * Projectile.direction;
|
||||
|
||||
|
||||
Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0.75f / 255f);
|
||||
for (int i = 0; i < 2; i++)
|
||||
Lighting.AddLight(Projectile.Center, Color.AliceBlue.ToVector3() * 0.5f);
|
||||
|
||||
if (Projectile.timeLeft <= 580 && Projectile.timeLeft % 5 == 0)
|
||||
{
|
||||
Vector2 dspeed = -Projectile.velocity * Main.rand.NextFloat(0.5f * 0.8f);
|
||||
int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Water, 0f, 0f, 100, default, 1f);
|
||||
Main.dust[dust].noGravity = true;
|
||||
Main.dust[dust].velocity = dspeed;
|
||||
}
|
||||
if (Projectile.timeLeft <= 580 && Projectile.timeLeft % 3 == 0)
|
||||
{
|
||||
Particle spark = new LineParticle(Projectile.Center - Projectile.velocity + Main.rand.NextVector2Circular(20, 20), -Projectile.velocity * Main.rand.NextFloat(0.2f, 1.8f), false, Main.rand.Next(9, 20 + 1), Main.rand.NextFloat(0.8f, 1.2f), Color.Lerp(Color.Cyan, Color.AliceBlue, Main.rand.NextFloat(0.35f)) * Main.rand.NextFloat(0.15f, 0.5f));
|
||||
Particle spark = new LineParticle(Projectile.Center - Projectile.velocity + Main.rand.NextVector2Circular(15, 15), -Projectile.velocity * Main.rand.NextFloat(0.2f, 1.8f), false, Main.rand.Next(9, 20 + 1), Main.rand.NextFloat(0.8f, 1.2f), Color.Lerp(Color.Cyan, Color.AliceBlue, Main.rand.NextFloat(0.35f)) * Main.rand.NextFloat(0.15f, 0.5f));
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
}
|
||||
if (Main.rand.NextBool(6))
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(20, 20), 75, -Projectile.velocity.RotatedByRandom(0.1) * Main.rand.NextFloat(0.1f, 0.3f), 0, default, Main.rand.NextFloat(0.5f, 1.2f));
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(20, 20), 103, -Projectile.velocity.RotatedByRandom(0.1) * Main.rand.NextFloat(0.1f, 0.3f), 0, default, Main.rand.NextFloat(0.5f, 1.2f));
|
||||
dust.noGravity = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnKill(int timeLeft)
|
||||
{
|
||||
for (int lol = 0; lol < 10; lol++)
|
||||
for (int lol = 0; lol < 12; lol++)
|
||||
{
|
||||
Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Water, 0f, 0f, 100, default, 1f);
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center, 103, new Vector2(7, 7).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1f));
|
||||
dust.scale = Main.rand.NextFloat(0.5f, 1.2f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
Projectile.penetrate = 1;
|
||||
Projectile.timeLeft = 600;
|
||||
Projectile.DamageType = DamageClass.Ranged;
|
||||
Projectile.extraUpdates = 1;
|
||||
Projectile.extraUpdates = 2;
|
||||
Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration;
|
||||
}
|
||||
|
||||
@@ -48,35 +48,33 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
Projectile.spriteDirection = Projectile.direction = (Projectile.velocity.X > 0).ToDirectionInt();
|
||||
Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == 1 ? 0f : MathHelper.Pi) + MathHelper.ToRadians(90) * Projectile.direction;
|
||||
|
||||
Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0.35f / 255f, (255 - Projectile.alpha) * 0.4f / 255f);
|
||||
if (Projectile.timeLeft <= 580 && Projectile.timeLeft % 3 == 0)
|
||||
Lighting.AddLight(Projectile.Center, Color.Chartreuse.ToVector3() * 0.5f);
|
||||
|
||||
if (Projectile.timeLeft <= 580 && Projectile.timeLeft % 5 == 0)
|
||||
{
|
||||
Particle spark = new LineParticle(Projectile.Center - Projectile.velocity + Main.rand.NextVector2Circular(20, 20), -Projectile.velocity * Main.rand.NextFloat(0.2f, 1.8f), false, Main.rand.Next(9, 20 + 1), Main.rand.NextFloat(0.8f, 1.2f), Color.Chartreuse * Main.rand.NextFloat(0.15f, 0.5f));
|
||||
Particle spark = new LineParticle(Projectile.Center - Projectile.velocity + Main.rand.NextVector2Circular(15, 15), -Projectile.velocity * Main.rand.NextFloat(0.2f, 1.8f), false, Main.rand.Next(9, 20 + 1), Main.rand.NextFloat(0.8f, 1.2f), Color.Chartreuse * Main.rand.NextFloat(0.15f, 0.5f));
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
}
|
||||
if (Main.rand.NextBool(6))
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(20, 20), 75, -Projectile.velocity.RotatedByRandom(0.1) * Main.rand.NextFloat(0.1f, 0.3f), 0, default, Main.rand.NextFloat(0.5f, 1.2f));
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(20, 20), 102, -Projectile.velocity.RotatedByRandom(0.1) * Main.rand.NextFloat(0.1f, 0.3f), 0, default, Main.rand.NextFloat(0.5f, 1.2f));
|
||||
dust.noGravity = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnKill(int timeLeft)
|
||||
{
|
||||
for (int lol = 0; lol < 10; lol++)
|
||||
for (int lol = 0; lol < 12; lol++)
|
||||
{
|
||||
Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.GemEmerald, 0f, 0f, 100, default, 1f);
|
||||
}
|
||||
for (int i = 0; i <= 3; i++)
|
||||
{
|
||||
Particle skull = new DesertProwlerSkullParticle(Projectile.Center, new Vector2(2.5f, 2.5f).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1f), Main.rand.NextBool() ? Color.LightGreen: Color.Lime, Color.LimeGreen, Main.rand.NextFloat(0.2f, 0.9f), 175);
|
||||
GeneralParticleHandler.SpawnParticle(skull);
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center, 102, new Vector2(7, 7).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1f));
|
||||
dust.scale = Main.rand.NextFloat(0.5f, 1.2f);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
target.AddBuff(BuffID.Venom, 120);
|
||||
// Levi weapons are no longer venom themed
|
||||
//target.AddBuff(BuffID.Venom, 120);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Projectiles.BaseProjectiles;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Mono.Cecil;
|
||||
@@ -35,6 +36,9 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public ref float ShootingTimer => ref Projectile.ai[0];
|
||||
public ref float ShotsFired => ref Projectile.ai[1];
|
||||
public ref float ShootTimer => ref Projectile.ai[2];
|
||||
public int shotColor = 1;
|
||||
public bool HasfiredMeteor = false;
|
||||
public int time = 0;
|
||||
|
||||
public override void HoldoutAI()
|
||||
{
|
||||
@@ -44,75 +48,87 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
// The vector between the player and the mouse.
|
||||
Vector2 ownerToMouse = Owner.Calamity().mouseWorld - mountedCenter;
|
||||
|
||||
|
||||
if (ShootingTimer >= HeldItem.useAnimation)
|
||||
{
|
||||
HasfiredMeteor = false;
|
||||
// We use the velocity of this projectile as its direction vector.
|
||||
Vector2 direction = Projectile.velocity.SafeNormalize(Vector2.Zero);
|
||||
|
||||
Owner.PickAmmo(Owner.ActiveItem(), out _, out float itemShootSpeed, out int itemDamage, out float itemKnockback, out int rocketTypeShot);
|
||||
|
||||
Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * 10;
|
||||
Vector2 smokeVel = Projectile.velocity.SafeNormalize(Vector2.UnitY) * 5;
|
||||
|
||||
if (Main.rand.NextBool(3))
|
||||
Projectile.NewProjectileDirect(
|
||||
Projectile.GetSource_FromThis(),
|
||||
GunTipPosition,
|
||||
direction * itemShootSpeed,
|
||||
ProjectileType<AquaBlastToxic>(),
|
||||
itemDamage,
|
||||
itemKnockback,
|
||||
Projectile.owner,
|
||||
ownerToMouse.Length());
|
||||
else
|
||||
Projectile.NewProjectileDirect(
|
||||
Projectile.GetSource_FromThis(),
|
||||
GunTipPosition,
|
||||
direction * itemShootSpeed,
|
||||
ProjectileType<AquaBlast>(),
|
||||
itemDamage,
|
||||
itemKnockback,
|
||||
Projectile.owner,
|
||||
ownerToMouse.Length());
|
||||
|
||||
// Inside here go all the things that dedicated servers shouldn't spend resources on.
|
||||
// Like visuals and sounds.
|
||||
if (!Main.dedServ)
|
||||
if (Owner.Calamity().mouseRight)
|
||||
{
|
||||
// By decreasing the offset length of the gun from the arms, we give an effect of recoil.
|
||||
OffsetLengthFromArm = 18f;
|
||||
|
||||
int smokeAmount = Main.rand.Next(8, 12 + 1);
|
||||
for (int i = 0; i < smokeAmount; i++)
|
||||
Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity, ProjectileType<CometQuasherMeteor>(), Projectile.damage * 4, Projectile.knockBack * 3, Projectile.owner, ownerToMouse.Length());
|
||||
if (!Main.dedServ)
|
||||
{
|
||||
Particle smoke = new HeavySmokeParticle(GunTipPosition, smokeVel.RotatedByRandom(0.4f) * Main.rand.NextFloat(0.2f, 1f), Color.White, Main.rand.Next(40, 60 + 1), Main.rand.NextFloat(0.2f, 0.4f), 0.5f, Main.rand.NextFloat(-0.2f, 0.2f), Main.rand.NextBool(), required: true);
|
||||
GeneralParticleHandler.SpawnParticle(smoke);
|
||||
// By decreasing the offset length of the gun from the arms, we give an effect of recoil.
|
||||
OffsetLengthFromArm = 9f;
|
||||
|
||||
int smokeAmount = Main.rand.Next(8, 12 + 1);
|
||||
for (int i = 0; i < smokeAmount; i++)
|
||||
{
|
||||
Particle smoke = new HeavySmokeParticle(GunTipPosition, smokeVel.RotatedByRandom(0.4f) * Main.rand.NextFloat(1.2f, 2f), Color.White, Main.rand.Next(40, 60 + 1), Main.rand.NextFloat(0.2f, 0.4f), 0.3f, Main.rand.NextFloat(-0.2f, 0.2f), Main.rand.NextBool(), required: true);
|
||||
GeneralParticleHandler.SpawnParticle(smoke);
|
||||
|
||||
}
|
||||
SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/LeviatitanRoar") { Volume = 0.5f }, GunTipPosition);
|
||||
SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/MagicRockSound") with { Pitch = -0.7f, Volume = 0.8f }, Projectile.Center);
|
||||
}
|
||||
HasfiredMeteor = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Fire the projectiles
|
||||
Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity.RotatedBy(MathHelper.ToRadians(2f * shotColor)), ProjectileType<AquaBlastToxic>(), Projectile.damage, Projectile.knockBack, Projectile.owner, ownerToMouse.Length());
|
||||
Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity.RotatedBy(MathHelper.ToRadians(-2f * shotColor)), ProjectileType<AquaBlast>(), Projectile.damage, Projectile.knockBack, Projectile.owner, ownerToMouse.Length());
|
||||
// Swap which is the top and bottom with every shot
|
||||
shotColor = (shotColor == 1 ? -1 : 1);
|
||||
|
||||
// Inside here go all the things that dedicated servers shouldn't spend resources on.
|
||||
// Like visuals and sounds.
|
||||
if (!Main.dedServ)
|
||||
{
|
||||
// By decreasing the offset length of the gun from the arms, we give an effect of recoil.
|
||||
OffsetLengthFromArm = 25f;
|
||||
|
||||
int smokeAmount = Main.rand.Next(8, 12 + 1);
|
||||
for (int i = 0; i < smokeAmount; i++)
|
||||
{
|
||||
Particle smoke = new HeavySmokeParticle(GunTipPosition, smokeVel.RotatedByRandom(0.4f) * Main.rand.NextFloat(0.2f, 1f), Color.White, Main.rand.Next(40, 60 + 1), Main.rand.NextFloat(0.2f, 0.4f), 0.3f, Main.rand.NextFloat(-0.2f, 0.2f), Main.rand.NextBool(), required: true);
|
||||
GeneralParticleHandler.SpawnParticle(smoke);
|
||||
|
||||
}
|
||||
SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/FlakKrakenShoot") { Pitch = 0.9f, Volume = 0.5f }, GunTipPosition);
|
||||
SoundEngine.PlaySound(SoundID.Item108 with { Pitch = -0.5f, Volume = 0.8f }, Projectile.Center);
|
||||
|
||||
}
|
||||
SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/FlakKrakenShoot") { Pitch = 0.65f, Volume = 0.5f }, GunTipPosition);
|
||||
}
|
||||
|
||||
ShootingTimer = 0f;
|
||||
ShotsFired++;
|
||||
if (ShotsFired == 7)
|
||||
|
||||
if (ShotsFired == 6)
|
||||
{
|
||||
int monsterCount;
|
||||
monsterCount = 2;
|
||||
for (int a = 0; a < monsterCount; a++)
|
||||
{
|
||||
float projSpeed = itemShootSpeed;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Owner.Center + Main.rand.NextVector2Circular(30, 30), (Owner.Calamity().mouseWorld - Owner.MountedCenter).SafeNormalize(Vector2.Zero) * projSpeed, ModContent.ProjectileType<LeviatitanAberration>(), (int)(itemDamage * 1.5f), itemKnockback);
|
||||
SoundEngine.PlaySound(SoundID.Zombie38 with { Volume = SoundID.Zombie38.Volume * 0.5f }, mountedCenter);
|
||||
float projSpeed = 5;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Owner.Center + Main.rand.NextVector2Circular(30, 30), (Owner.Calamity().mouseWorld - Owner.MountedCenter).SafeNormalize(Vector2.Zero) * projSpeed, ModContent.ProjectileType<LeviatitanAberration>(), (int)(Projectile.damage * 1.2f), Projectile.knockBack);
|
||||
}
|
||||
SoundEngine.PlaySound(SoundID.Zombie38 with { Volume = SoundID.Zombie38.Volume * 0.5f }, mountedCenter);
|
||||
}
|
||||
if (ShotsFired >= 8)
|
||||
if (ShotsFired >= 6)
|
||||
ShotsFired = 0;
|
||||
}
|
||||
ShootingTimer++;
|
||||
if (!HasfiredMeteor || time % 3 == 0)
|
||||
ShootingTimer++;
|
||||
time++;
|
||||
}
|
||||
public override void OnSpawn(IEntitySource source)
|
||||
{
|
||||
base.OnSpawn(source);
|
||||
SoundEngine.PlaySound(SoundID.Item108 with { Volume = 0.7f }, Projectile.Center);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Reference in new issue
Block a user