Added Auralis gun (patron)
This commit is contained in:
1 parent
de46d68336
commit
fea8dfd149
12 files changed
+292
-20
No files matched your search
@@ -233,6 +233,10 @@ namespace CalamityMod.CalPlayer
|
||||
public int danceOfLightCharge = 0;
|
||||
public int shadowPotCooldown = 0;
|
||||
public int dogTextCooldown = 0;
|
||||
public float auralisStealthCounter = 0f;
|
||||
public int auralisAuroraCounter = 0;
|
||||
public int auralisAuroraCooldown = 0;
|
||||
public int auralisAurora = 0;
|
||||
#endregion
|
||||
|
||||
#region Sound
|
||||
@@ -2032,6 +2036,10 @@ namespace CalamityMod.CalPlayer
|
||||
soundCooldown = 0;
|
||||
shadowPotCooldown = 0;
|
||||
dogTextCooldown = 0;
|
||||
auralisStealthCounter = 0f;
|
||||
auralisAuroraCounter = 0;
|
||||
auralisAuroraCooldown = 0;
|
||||
auralisAurora = 0;
|
||||
rage = 0;
|
||||
adrenaline = 0;
|
||||
raiderStack = 0;
|
||||
@@ -6309,6 +6317,15 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
}
|
||||
|
||||
if (auralisAuroraCounter >= 300)
|
||||
{
|
||||
damage -= 100;
|
||||
if (damage < 1)
|
||||
damage = 1;
|
||||
auralisAuroraCounter = 0;
|
||||
auralisAuroraCooldown = CalamityUtils.SecondsToFrames(30f);
|
||||
}
|
||||
|
||||
if (proj.type == ModContent.ProjectileType<BirbAura>())
|
||||
{
|
||||
damage = 0;
|
||||
|
||||
@@ -215,7 +215,8 @@ namespace CalamityMod.CalPlayer
|
||||
currentlyHeldItem.type == ModContent.ItemType<Apotheosis>() ||
|
||||
currentlyHeldItem.type == ModContent.ItemType<CleansingBlaze>() ||
|
||||
currentlyHeldItem.type == ModContent.ItemType<SubsumingVortex>() ||
|
||||
currentlyHeldItem.type == ModContent.ItemType<AuroraBlazer>())
|
||||
currentlyHeldItem.type == ModContent.ItemType<AuroraBlazer>() ||
|
||||
currentlyHeldItem.type == ModContent.ItemType<Auralis>())
|
||||
{
|
||||
Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/DeathwindGlow");
|
||||
int offsetX = 10;
|
||||
@@ -239,6 +240,11 @@ namespace CalamityMod.CalPlayer
|
||||
texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/AuroraBlazerGlow");
|
||||
offsetX = 44;
|
||||
}
|
||||
else if (currentlyHeldItem.type == ModContent.ItemType<Auralis>())
|
||||
{
|
||||
texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/AuralisGlow");
|
||||
offsetX = 62;
|
||||
}
|
||||
|
||||
Vector2 center = Main.itemTexture[currentlyHeldItem.type].Size() * 0.5f;
|
||||
int originOffsetX = (int)center.X - offsetX;
|
||||
@@ -494,6 +500,38 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
});
|
||||
|
||||
public static readonly PlayerLayer AuralisAuroraEffects = new PlayerLayer("CalamityMod", "AuralisAurora", PlayerLayer.Body, drawInfo =>
|
||||
{
|
||||
Player drawPlayer = drawInfo.drawPlayer;
|
||||
CalamityPlayer modPlayer = drawPlayer.Calamity();
|
||||
if (modPlayer.auralisAuroraCounter < 300 || modPlayer.auralisAuroraCooldown > 0)
|
||||
return;
|
||||
float auroraCount = 7;
|
||||
float opacity = 0.4f;
|
||||
|
||||
float time = Main.GlobalTime % 3f / 3f;
|
||||
Texture2D auroraTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/AuroraTexture");
|
||||
for (int i = 0; i < auroraCount; i++)
|
||||
{
|
||||
float incrementOffsetAngle = MathHelper.TwoPi * i / auroraCount;
|
||||
float xOffset = (float)Math.Sin(time * MathHelper.TwoPi + incrementOffsetAngle * 2f) * 20f;
|
||||
float yOffset = (float)Math.Sin(time * MathHelper.TwoPi + incrementOffsetAngle * 2f + MathHelper.ToRadians(60f)) * 6f;
|
||||
float rotation = (float)Math.Sin(incrementOffsetAngle) * MathHelper.Pi / 12f;
|
||||
Color color = CalamityUtils.ColorSwap(Auralis.blueColor, Auralis.greenColor, 3f);
|
||||
Vector2 offset = new Vector2(xOffset, yOffset - 14f);
|
||||
DrawData drawData = new DrawData(auroraTexture,
|
||||
drawPlayer.Top + offset - Main.screenPosition,
|
||||
null,
|
||||
color * opacity,
|
||||
rotation + MathHelper.PiOver2,
|
||||
auroraTexture.Size() * 0.5f,
|
||||
0.135f,
|
||||
SpriteEffects.None,
|
||||
1);
|
||||
Main.playerDrawData.Add(drawData);
|
||||
}
|
||||
});
|
||||
|
||||
public static readonly PlayerLayer IbanDevRobot = new PlayerLayer("CalamityMod", "IbanDevRobot", PlayerLayer.Body, drawInfo =>
|
||||
{
|
||||
Player drawPlayer = drawInfo.drawPlayer;
|
||||
@@ -647,6 +685,7 @@ namespace CalamityMod.CalPlayer
|
||||
list.Add(RoverDriveShield);
|
||||
list.Add(StratusSphereDrawing);
|
||||
list.Add(ProfanedMoonlightDyeEffects);
|
||||
list.Add(AuralisAuroraEffects);
|
||||
list.Add(IbanDevRobot);
|
||||
list.Add(DyeInvisibilityFix);
|
||||
}
|
||||
|
||||
@@ -1014,6 +1014,10 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
else
|
||||
modPlayer.roverDriveTimer = 616; //Doesn't reset to zero to prevent exploits
|
||||
if (modPlayer.auralisAurora > 0)
|
||||
modPlayer.auralisAurora--;
|
||||
if (modPlayer.auralisAuroraCooldown > 0)
|
||||
modPlayer.auralisAuroraCooldown--;
|
||||
|
||||
// Silva invincibility effects
|
||||
if (modPlayer.silvaCountdown > 0 && modPlayer.hasSilvaEffect && modPlayer.silvaSet)
|
||||
@@ -2326,6 +2330,80 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
else
|
||||
modPlayer.modStealth = 1f;
|
||||
|
||||
if (player.ActiveItem().type == ModContent.ItemType<Auralis>() && player.StandingStill(0.1f))
|
||||
{
|
||||
if (modPlayer.auralisStealthCounter < 300f)
|
||||
modPlayer.auralisStealthCounter++;
|
||||
|
||||
bool usingScope = false;
|
||||
if (!Main.gameMenu && Main.netMode != NetmodeID.Server)
|
||||
{
|
||||
if (player.noThrow <= 0 && !player.lastMouseInterface || (Main.zoomX != 0f || Main.zoomY != 0f))
|
||||
{
|
||||
if (PlayerInput.UsingGamepad)
|
||||
{
|
||||
if (PlayerInput.GamepadThumbstickRight.Length() != 0f || !Main.SmartCursorEnabled)
|
||||
{
|
||||
usingScope = true;
|
||||
}
|
||||
}
|
||||
else if (Main.mouseRight)
|
||||
usingScope = true;
|
||||
}
|
||||
}
|
||||
|
||||
int chargeDuration = CalamityUtils.SecondsToFrames(5f);
|
||||
int auroraDuration = CalamityUtils.SecondsToFrames(20f);
|
||||
|
||||
if (usingScope && modPlayer.auralisAuroraCounter < chargeDuration + auroraDuration)
|
||||
modPlayer.auralisAuroraCounter++;
|
||||
|
||||
if (modPlayer.auralisAuroraCounter > chargeDuration + auroraDuration)
|
||||
{
|
||||
modPlayer.auralisAuroraCounter = 0;
|
||||
modPlayer.auralisAuroraCooldown = CalamityUtils.SecondsToFrames(30f);
|
||||
}
|
||||
|
||||
if (modPlayer.auralisAuroraCounter > 0 && modPlayer.auralisAuroraCounter < chargeDuration && !usingScope)
|
||||
modPlayer.auralisAuroraCounter--;
|
||||
|
||||
if (modPlayer.auralisAuroraCounter > chargeDuration && modPlayer.auralisAuroraCounter < chargeDuration + auroraDuration && !usingScope)
|
||||
modPlayer.auralisAuroraCounter = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
modPlayer.auralisStealthCounter = 0f;
|
||||
modPlayer.auralisAuroraCounter = 0;
|
||||
}
|
||||
if (modPlayer.auralisAuroraCooldown > 0)
|
||||
{
|
||||
if (modPlayer.auralisAuroraCooldown == 1)
|
||||
{
|
||||
int dustAmt = 36;
|
||||
for (int d = 0; d < dustAmt; d++)
|
||||
{
|
||||
Vector2 source = Vector2.Normalize(player.velocity) * new Vector2((float)player.width / 2f, (float)player.height) * 1f; //0.75
|
||||
source = source.RotatedBy((double)((float)(d - (dustAmt / 2 - 1)) * MathHelper.TwoPi / (float)dustAmt), default) + player.Center;
|
||||
Vector2 dustVel = source - player.Center;
|
||||
int blue = Dust.NewDust(source + dustVel, 0, 0, 229, dustVel.X, dustVel.Y, 100, default, 1.2f);
|
||||
Main.dust[blue].noGravity = true;
|
||||
Main.dust[blue].noLight = false;
|
||||
Main.dust[blue].velocity = dustVel;
|
||||
}
|
||||
for (int d = 0; d < dustAmt; d++)
|
||||
{
|
||||
Vector2 source = Vector2.Normalize(player.velocity) * new Vector2((float)player.width / 2f, (float)player.height) * 0.75f;
|
||||
source = source.RotatedBy((double)((float)(d - (dustAmt / 2 - 1)) * MathHelper.TwoPi / (float)dustAmt), default) + player.Center;
|
||||
Vector2 dustVel = source - player.Center;
|
||||
int green = Dust.NewDust(source + dustVel, 0, 0, 107, dustVel.X, dustVel.Y, 100, default, 1.2f);
|
||||
Main.dust[green].noGravity = true;
|
||||
Main.dust[green].noLight = false;
|
||||
Main.dust[green].velocity = dustVel;
|
||||
}
|
||||
}
|
||||
modPlayer.auralisAuroraCounter = 0;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -1655,6 +1655,7 @@ namespace CalamityMod
|
||||
scopedWeaponList = new List<int>()
|
||||
{
|
||||
ModContent.ItemType<AMR>(),
|
||||
ModContent.ItemType<Auralis>(),
|
||||
ModContent.ItemType<HalleysInferno>(),
|
||||
ModContent.ItemType<Shroomer>(),
|
||||
ModContent.ItemType<SpectreRifle>(),
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Potions;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
public class Auralis : ModItem
|
||||
{
|
||||
public static readonly Color blueColor = new Color(0, 77, 255);
|
||||
public static readonly Color greenColor = new Color(0, 255, 77);
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Auralis");
|
||||
Tooltip.SetDefault("Fires a high speed glowing bullet that inflicts debilitating debuffs\n" +
|
||||
"Right click to zoom out\n" +
|
||||
"Standing still provides increasing damage bonuses up to 25%\n" +
|
||||
"Standing still for 5 or more seconds while using the scope ability will summon an aurora\n" +
|
||||
"The aurora reduces the damage of the next projectile hit by a flat 100\n" +
|
||||
"This effect lasts up to 20 seconds and has a 30 second cooldown\n" +
|
||||
"50% chance to not consume bullets");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.damage = 650;
|
||||
item.ranged = true;
|
||||
item.useTime = item.useAnimation = 30;
|
||||
item.knockBack = 10f;
|
||||
item.autoReuse = true;
|
||||
item.shoot = ModContent.ProjectileType<AuralisBullet>();
|
||||
item.shootSpeed = 7.5f;
|
||||
item.useAmmo = AmmoID.Bullet;
|
||||
|
||||
item.width = 96;
|
||||
item.height = 34;
|
||||
item.useStyle = ItemUseStyleID.HoldingOut;
|
||||
item.noMelee = true;
|
||||
item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/PlasmaBlast");
|
||||
item.value = CalamityGlobalItem.Rarity13BuyPrice;
|
||||
item.rare = 10;
|
||||
item.Calamity().customRarity = CalamityRarity.Dedicated;
|
||||
}
|
||||
|
||||
public override void ModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat)
|
||||
{
|
||||
float damageMult = MathHelper.Lerp(0f, 0.25f, player.Calamity().auralisStealthCounter / 300f);
|
||||
add += damageMult;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
Projectile.NewProjectile(position, new Vector2(speedX, speedY), item.shoot, damage, knockBack, player.whoAmI);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
|
||||
{
|
||||
Texture2D glowmask = ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/AuralisGlow");
|
||||
Vector2 origin = new Vector2(glowmask.Width / 2f, glowmask.Height / 2f - 2f);
|
||||
spriteBatch.Draw(glowmask, item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
|
||||
}
|
||||
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-10, 0);
|
||||
|
||||
public override bool ConsumeAmmo(Player player) => Main.rand.Next(100) >= 50;
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ModContent.ItemType<UeliaceBar>(), 5);
|
||||
recipe.AddIngredient(ModContent.ItemType<AstralJelly>(), 5);
|
||||
recipe.AddIngredient(ModContent.ItemType<Stardust>(), 50);
|
||||
recipe.AddIngredient(ItemID.SniperRifle);
|
||||
recipe.AddTile(TileID.LunarCraftingStation);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 477 B |
@@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
item.width = 68;
|
||||
item.height = 36;
|
||||
item.useStyle = 5;
|
||||
item.useStyle = ItemUseStyleID.HoldingOut;
|
||||
item.noMelee = true;
|
||||
item.UseSound = SoundID.Item34;
|
||||
item.value = CalamityGlobalItem.Rarity7BuyPrice;
|
||||
|
||||
+1
-1
@@ -318,7 +318,7 @@ namespace CalamityMod.NPCs
|
||||
|
||||
// Despawn
|
||||
bool notOcean = player.position.X > 7680f && player.position.X < (Main.maxTilesX * 16 - 7680);
|
||||
if (player.dead || player.Calamity().ZoneAbyss || (notOcean && !BossRushEvent.BossRushActive && !player.Calamity().ZoneSulphur))\
|
||||
if (player.dead || player.Calamity().ZoneAbyss || (notOcean && !BossRushEvent.BossRushActive && !player.Calamity().ZoneSulphur))
|
||||
{
|
||||
calamityGlobalNPC.newAI[1] = 1f;
|
||||
npc.TargetClosest(false);
|
||||
|
||||
@@ -47,26 +47,12 @@ namespace CalamityMod.Projectiles.Magic
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
Main.PlaySound(SoundID.Item125, projectile.position);
|
||||
Main.PlaySound(SoundID.Item125, projectile.Center);
|
||||
for (int n = 0; n < 5; n++)
|
||||
{
|
||||
float x = projectile.position.X + (float)Main.rand.Next(-200, 200);
|
||||
float y = projectile.position.Y - 1500f;
|
||||
Vector2 vector = new Vector2(x, y);
|
||||
float num13 = projectile.position.X + (float)(projectile.width / 2) - vector.X;
|
||||
float num14 = projectile.position.Y + (float)(projectile.height / 2) - vector.Y;
|
||||
num13 += (float)Main.rand.Next(-100, 101);
|
||||
int num15 = 29;
|
||||
float num16 = (float)Math.Sqrt((double)(num13 * num13 + num14 * num14));
|
||||
num16 = (float)num15 / num16;
|
||||
num13 *= num16;
|
||||
num14 *= num16;
|
||||
Projectile.NewProjectile(x, y, num13, num14, ModContent.ProjectileType<ThunderstormShotSplit>(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
CalamityUtils.ProjectileRain(projectile.Center, 200f, 100f, 1500f, 1500f, 29f, ModContent.ProjectileType<ThunderstormShotSplit>(), projectile.damage, projectile.knockBack, projectile.owner, projectile.owner);
|
||||
}
|
||||
projectile.position = projectile.Center;
|
||||
projectile.width = projectile.height = 36;
|
||||
projectile.position.X = projectile.position.X - (float)(projectile.width / 2);
|
||||
projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2);
|
||||
CalamityGlobalProjectile.ExpandHitboxBy(projectile, 36);
|
||||
int num226 = 36;
|
||||
for (int num227 = 0; num227 < num226; num227++)
|
||||
{
|
||||
@@ -88,6 +74,8 @@ namespace CalamityMod.Projectiles.Magic
|
||||
Main.dust[num228].noLight = true;
|
||||
Main.dust[num228].velocity = vector7;
|
||||
}
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 10;
|
||||
projectile.Damage();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
public class AuralisBullet : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Bullet");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 4;
|
||||
projectile.height = 4;
|
||||
projectile.friendly = true;
|
||||
projectile.ranged = true;
|
||||
projectile.penetrate = 5;
|
||||
projectile.alpha = 255;
|
||||
projectile.timeLeft = 200;
|
||||
projectile.extraUpdates = 10;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 10;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
projectile.ai[0] += 1f;
|
||||
if (projectile.ai[0] > 6f)
|
||||
{
|
||||
for (int d = 0; d < 5; d++)
|
||||
{
|
||||
Dust dust = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 229, projectile.velocity.X, projectile.velocity.Y, 100, CalamityUtils.ColorSwap(Auralis.blueColor, Auralis.greenColor, 1f), 1f)];
|
||||
dust.velocity = Vector2.Zero;
|
||||
dust.position -= projectile.velocity / 5f * d;
|
||||
dust.noGravity = true;
|
||||
dust.scale = 0.65f;
|
||||
dust.noLight = true;
|
||||
dust.color = CalamityUtils.ColorSwap(Auralis.blueColor, Auralis.greenColor, 1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
int duration = 600;
|
||||
target.AddBuff(ModContent.BuffType<MarkedforDeath>(), duration);
|
||||
target.AddBuff(BuffID.Ichor, duration);
|
||||
target.AddBuff(BuffID.CursedInferno, duration);
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player target, int damage, bool crit)
|
||||
{
|
||||
int duration = 600;
|
||||
target.AddBuff(ModContent.BuffType<MarkedforDeath>(), duration);
|
||||
target.AddBuff(BuffID.Ichor, duration);
|
||||
target.AddBuff(BuffID.CursedInferno, duration);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 136 B |
Reference in new issue
Block a user