added desert prowler armor
This commit is contained in:
1 parent
59a0495c92
commit
aef328a53d
9 files changed
+560
No files matched your search
@@ -523,6 +523,7 @@ namespace CalamityMod.CalPlayer
|
||||
#endregion
|
||||
|
||||
#region Armor Set
|
||||
public bool desertProwler = false;
|
||||
public bool snowRuffianSet = false;
|
||||
public bool forbiddenCirclet = false;
|
||||
public int forbiddenCooldown = 0;
|
||||
@@ -1526,6 +1527,8 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
astralStarRain = false;
|
||||
|
||||
desertProwler = false;
|
||||
|
||||
snowRuffianSet = false;
|
||||
|
||||
forbiddenCirclet = false;
|
||||
@@ -2108,6 +2111,7 @@ namespace CalamityMod.CalPlayer
|
||||
ataxiaVolley = false;
|
||||
ataxiaBlaze = false;
|
||||
hydrothermalSmoke = false;
|
||||
desertProwler = false;
|
||||
snowRuffianSet = false;
|
||||
forbiddenCirclet = false;
|
||||
eskimoSet = false; //vanilla armor
|
||||
@@ -3903,6 +3907,11 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
acidRoundMultiplier = 1D;
|
||||
}
|
||||
//Prismatic Breaker is a weird hybrid melee-ranged weapon so include it too. Why are you using desert prowler post-Yharon? don't ask me
|
||||
if (desertProwler && (item.ranged/* || item.type == ModContent.ItemType<PrismaticBreaker>()*/))
|
||||
{
|
||||
flat += 2f;
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetWeaponKnockback(Item item, ref float knockback)
|
||||
@@ -4102,6 +4111,19 @@ namespace CalamityMod.CalPlayer
|
||||
#region On Hit NPC
|
||||
public override void OnHitNPC(Item item, NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
if (desertProwler && item.ranged && crit) //for obscure stuff like marnite bayonet
|
||||
{
|
||||
if (player.ownedProjectileCounts[ModContent.ProjectileType<DesertMark>()] < 1 && player.ownedProjectileCounts[ModContent.ProjectileType<DesertTornado>()] < 1)
|
||||
{
|
||||
if (Main.rand.NextBool(15))
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType<DesertMark>(), (int)(item.damage * player.RangedDamage()), knockback, player.whoAmI, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!item.melee && (int) player.meleeEnchant == 7)
|
||||
Projectile.NewProjectile(target.Center.X, target.Center.Y, target.velocity.X, target.velocity.Y, ProjectileID.ConfettiMelee, 0, 0f, player.whoAmI, 0f, 0f);
|
||||
|
||||
@@ -4279,6 +4301,19 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (!proj.npcProj && !proj.trap)
|
||||
{
|
||||
if (desertProwler && proj.ranged && crit)
|
||||
{
|
||||
if (player.ownedProjectileCounts[ModContent.ProjectileType<DesertMark>()] < 1 && player.ownedProjectileCounts[ModContent.ProjectileType<DesertTornado>()] < 1)
|
||||
{
|
||||
if (Main.rand.NextBool(15))
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType<DesertMark>(), proj.damage, proj.knockBack, player.whoAmI, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (proj.Calamity().trueMelee)
|
||||
titanBoost = 600;
|
||||
|
||||
@@ -4436,6 +4471,20 @@ namespace CalamityMod.CalPlayer
|
||||
#region PvP
|
||||
public override void OnHitPvp(Item item, Player target, int damage, bool crit)
|
||||
{
|
||||
if (desertProwler && item.ranged && crit) //for obscure stuff like Marnite Bayonet
|
||||
{
|
||||
if (player.ownedProjectileCounts[ModContent.ProjectileType<DesertMark>()] < 1 && player.ownedProjectileCounts[ModContent.ProjectileType<DesertTornado>()] < 1)
|
||||
{
|
||||
if (Main.rand.NextBool(15))
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType<DesertMark>(), (int)(item.damage * player.RangedDamage()), item.knockBack, player.whoAmI, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!item.melee && (int) player.meleeEnchant == 7)
|
||||
Projectile.NewProjectile(target.Center.X, target.Center.Y, target.velocity.X, target.velocity.Y, ProjectileID.ConfettiMelee, 0, 0f, player.whoAmI, 0f, 0f);
|
||||
|
||||
@@ -4600,6 +4649,20 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (!proj.npcProj && !proj.trap)
|
||||
{
|
||||
if (desertProwler && proj.ranged && crit)
|
||||
{
|
||||
if (player.ownedProjectileCounts[ModContent.ProjectileType<DesertMark>()] < 1 && player.ownedProjectileCounts[ModContent.ProjectileType<DesertTornado>()] < 1)
|
||||
{
|
||||
if (Main.rand.NextBool(15))
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType<DesertMark>(), proj.damage, proj.knockBack, player.whoAmI, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (proj.Calamity().trueMelee)
|
||||
titanBoost = 600;
|
||||
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
using CalamityMod.Buffs.Cooldowns;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Armor
|
||||
{
|
||||
[AutoloadEquip(EquipType.Head)]
|
||||
public class DesertProwlerHat : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Desert Prowler Hat");
|
||||
Tooltip.SetDefault("4% increased ranged critical strike chance and 20% chance to not consume ammo");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 18;
|
||||
item.height = 18;
|
||||
item.value = CalamityGlobalItem.Rarity1BuyPrice;
|
||||
item.rare = 1;
|
||||
item.defense = 1; //6
|
||||
}
|
||||
|
||||
public override bool IsArmorSet(Item head, Item body, Item legs)
|
||||
{
|
||||
return body.type == ModContent.ItemType<DesertProwlerShirt>() && legs.type == ModContent.ItemType<DesertProwlerPants>();
|
||||
}
|
||||
|
||||
public override void UpdateArmorSet(Player player)
|
||||
{
|
||||
player.setBonus = "Ranged attacks deal an extra 2 flat damage\n" +
|
||||
"Ranged crits can rarely whip up a sandstorm";
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.desertProwler = true;
|
||||
}
|
||||
|
||||
public override void UpdateEquip(Player player)
|
||||
{
|
||||
player.rangedCrit += 4;
|
||||
player.ammoCost80 = true;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ModContent.ItemType<DesertFeather>(), 2);
|
||||
recipe.AddIngredient(ItemID.Silk, 8);
|
||||
recipe.AddTile(TileID.Loom);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Armor
|
||||
{
|
||||
[AutoloadEquip(EquipType.Legs)]
|
||||
public class DesertProwlerPants : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Desert Prowler Pants");
|
||||
Tooltip.SetDefault("10% increased movement speed and immunity to the Mighty Wind debuff");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 18;
|
||||
item.height = 18;
|
||||
item.value = CalamityGlobalItem.Rarity1BuyPrice;
|
||||
item.rare = 1;
|
||||
item.defense = 2;
|
||||
}
|
||||
|
||||
public override void UpdateEquip(Player player)
|
||||
{
|
||||
player.buffImmune[BuffID.WindPushed] = true;
|
||||
player.moveSpeed += 0.1f;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ModContent.ItemType<DesertFeather>());
|
||||
recipe.AddIngredient(ItemID.Silk, 5);
|
||||
recipe.AddTile(TileID.Loom);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Armor
|
||||
{
|
||||
[AutoloadEquip(EquipType.Body)]
|
||||
public class DesertProwlerShirt : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Desert Prowler Shirt");
|
||||
Tooltip.SetDefault("5% increased ranged critical strike chance");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 18;
|
||||
item.height = 18;
|
||||
item.value = CalamityGlobalItem.Rarity1BuyPrice;
|
||||
item.rare = 1;
|
||||
item.defense = 3;
|
||||
}
|
||||
|
||||
public override void UpdateEquip(Player player)
|
||||
{
|
||||
player.rangedCrit += 5;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ModContent.ItemType<DesertFeather>(), 3);
|
||||
recipe.AddIngredient(ItemID.Silk, 10);
|
||||
recipe.AddTile(TileID.Loom);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -560,6 +560,10 @@ namespace CalamityMod
|
||||
|
||||
// LATER -- no summon set bonuses are written well. all use two bools, neither of which actually controls the function
|
||||
|
||||
// Desert Prowler
|
||||
if (setBonus == "desertprowler" || setBonus == "desert prowler")
|
||||
return mp.desertProwler;
|
||||
|
||||
// Snow Ruffian
|
||||
if (setBonus == "snowruffian" || setBonus == "snow ruffian")
|
||||
return mp.snowRuffianSet;
|
||||
@@ -841,6 +845,13 @@ namespace CalamityMod
|
||||
CalamityPlayer mp = p.Calamity();
|
||||
setBonus = setBonus.ToLower();
|
||||
|
||||
// Desert Prowler
|
||||
if (setBonus == "desert prowler" || setBonus == "desert prowler")
|
||||
{
|
||||
mp.snowRuffianSet = enabled;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Snow Ruffian
|
||||
if (setBonus == "snowruffian" || setBonus == "snow ruffian")
|
||||
{
|
||||
|
||||
@@ -0,0 +1,160 @@
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
public class DesertMark : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Mark");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 14;
|
||||
projectile.height = 14;
|
||||
projectile.friendly = true;
|
||||
projectile.tileCollide = false;
|
||||
projectile.timeLeft = 900;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.alpha = 255;
|
||||
projectile.ranged = true;
|
||||
projectile.penetrate = -1;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 10;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Color newColor3 = new Color(255, 255, 255);
|
||||
if (projectile.soundDelay == 0)
|
||||
{
|
||||
projectile.soundDelay = -1;
|
||||
Main.PlaySound(2, projectile.Center, 60);
|
||||
}
|
||||
if (projectile.localAI[1] < 30f)
|
||||
{
|
||||
for (int num1134 = 0; num1134 < 1; num1134++)
|
||||
{
|
||||
float value79 = -0.5f;
|
||||
float value80 = 0.9f;
|
||||
float amount4 = Main.rand.NextFloat();
|
||||
Vector2 value81 = new Vector2(MathHelper.Lerp(0.1f, 1f, Main.rand.NextFloat()), MathHelper.Lerp(value79, value80, amount4));
|
||||
value81.X *= MathHelper.Lerp(2.2f, 0.6f, amount4);
|
||||
value81.X *= -1f;
|
||||
Vector2 value82 = new Vector2(2f, 10f);
|
||||
Vector2 position4 = projectile.Center + new Vector2(60f, 200f) * value81 * 0.5f + value82;
|
||||
Dust dust34 = Main.dust[Dust.NewDust(position4, 0, 0, 269, 0f, 0f, 0, default, 0.5f)];
|
||||
dust34.position = position4;
|
||||
dust34.customData = projectile.Center + value82;
|
||||
dust34.fadeIn = 1f;
|
||||
dust34.scale = 0.3f;
|
||||
if (value81.X > -1.2f)
|
||||
{
|
||||
dust34.velocity.X = 1f + Main.rand.NextFloat();
|
||||
}
|
||||
dust34.velocity.Y = Main.rand.NextFloat() * -0.5f - 1f;
|
||||
}
|
||||
}
|
||||
if (projectile.localAI[0] == 0f)
|
||||
{
|
||||
projectile.localAI[0] = 0.8f;
|
||||
projectile.direction = 1;
|
||||
Point point9 = projectile.Center.ToTileCoordinates();
|
||||
projectile.Center = new Vector2((float)(point9.X * 16 + 8), (float)(point9.Y * 16 + 8));
|
||||
}
|
||||
projectile.rotation = projectile.localAI[1] / 40f * 6.28318548f * (float)projectile.direction;
|
||||
if (projectile.localAI[1] < 33f)
|
||||
{
|
||||
if (projectile.alpha > 0)
|
||||
{
|
||||
projectile.alpha -= 8;
|
||||
}
|
||||
if (projectile.alpha < 0)
|
||||
{
|
||||
projectile.alpha = 0;
|
||||
}
|
||||
}
|
||||
if (projectile.localAI[1] > 103f)
|
||||
{
|
||||
if (projectile.alpha < 255)
|
||||
{
|
||||
projectile.alpha += 16;
|
||||
}
|
||||
if (projectile.alpha > 255)
|
||||
{
|
||||
projectile.alpha = 255;
|
||||
}
|
||||
}
|
||||
if (projectile.alpha == 0)
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, newColor3.ToVector3() * 0.5f);
|
||||
}
|
||||
for (int num1135 = 0; num1135 < 2; num1135++)
|
||||
{
|
||||
if (Main.rand.NextBool(10))
|
||||
{
|
||||
Vector2 value83 = Vector2.UnitY.RotatedBy((double)((float)num1135 * 3.14159274f), default).RotatedBy((double)projectile.rotation, default);
|
||||
Dust dust35 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, 269, 0f, 0f, 225, newColor3, 1f)];
|
||||
dust35.noGravity = true;
|
||||
dust35.noLight = true;
|
||||
dust35.scale = projectile.Opacity * projectile.localAI[0];
|
||||
dust35.position = projectile.Center;
|
||||
dust35.velocity = value83 * 2.5f;
|
||||
}
|
||||
}
|
||||
for (int num1136 = 0; num1136 < 2; num1136++)
|
||||
{
|
||||
if (Main.rand.NextBool(10))
|
||||
{
|
||||
Vector2 value84 = Vector2.UnitY.RotatedBy((double)((float)num1136 * 3.14159274f), default);
|
||||
Dust dust36 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, 269, 0f, 0f, 225, newColor3, 1.5f)];
|
||||
dust36.noGravity = true;
|
||||
dust36.noLight = true;
|
||||
dust36.scale = projectile.Opacity * projectile.localAI[0];
|
||||
dust36.position = projectile.Center;
|
||||
dust36.velocity = value84 * 2.5f;
|
||||
}
|
||||
}
|
||||
if (projectile.localAI[1] < 33f || projectile.localAI[1] > 87f)
|
||||
{
|
||||
projectile.scale = projectile.Opacity / 2f * projectile.localAI[0];
|
||||
}
|
||||
projectile.velocity = Vector2.Zero;
|
||||
projectile.localAI[1] += 1f;
|
||||
if (projectile.localAI[1] == 60f && projectile.owner == Main.myPlayer)
|
||||
{
|
||||
Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType<DesertTornado>(), projectile.damage, 2f, projectile.owner, 0f, 0f);
|
||||
}
|
||||
if (projectile.localAI[1] >= 120f)
|
||||
{
|
||||
projectile.Kill();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
Color color25 = Lighting.GetColor((int)((double)projectile.position.X + (double)projectile.width * 0.5) / 16, (int)(((double)projectile.position.Y + (double)projectile.height * 0.5) / 16.0));
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (projectile.spriteDirection == -1)
|
||||
{
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
}
|
||||
Vector2 vector38 = projectile.position + new Vector2((float)projectile.width, (float)projectile.height) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition;
|
||||
Texture2D texture2D27 = Main.projectileTexture[projectile.type];
|
||||
Rectangle rectangle11 = texture2D27.Frame(1, Main.projFrames[projectile.type], 0, projectile.frame);
|
||||
Color alpha5 = projectile.GetAlpha(color25);
|
||||
Vector2 origin7 = rectangle11.Size() / 2f;
|
||||
Color color47 = Main.hslToRgb(0.25f, 1f, 1f).MultiplyRGBA(new Color(255, 255, 255, 0));
|
||||
Main.spriteBatch.Draw(texture2D27, vector38, new Microsoft.Xna.Framework.Rectangle?(rectangle11), color47, 0f, origin7, new Vector2(1f, 5f) * projectile.scale * 2f, spriteEffects, 0f);
|
||||
Main.spriteBatch.Draw(texture2D27, vector38, new Microsoft.Xna.Framework.Rectangle?(rectangle11), alpha5, projectile.rotation, origin7, projectile.scale, spriteEffects, 0f);
|
||||
Main.spriteBatch.Draw(texture2D27, vector38, new Microsoft.Xna.Framework.Rectangle?(rectangle11), alpha5, 0f, origin7, new Vector2(1f, 8f) * projectile.scale, spriteEffects, 0f);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 226 B |
@@ -0,0 +1,182 @@
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
public class DesertTornado : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Tornado");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 10;
|
||||
projectile.height = 10;
|
||||
projectile.friendly = true;
|
||||
projectile.tileCollide = false;
|
||||
projectile.ranged = true;
|
||||
projectile.penetrate = -1;
|
||||
projectile.timeLeft = 1200;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 20;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
//only 1 tornado can exist at a time
|
||||
projectile.localAI[1] += 1f;
|
||||
if (projectile.localAI[1] >= 10f)
|
||||
{
|
||||
projectile.localAI[1] = 0f;
|
||||
int projCount = 0;
|
||||
int oldestTornado = 0;
|
||||
float tornadoAge = 0f;
|
||||
int projType = projectile.type;
|
||||
for (int projIndex = 0; projIndex < Main.maxProjectiles; projIndex++)
|
||||
{
|
||||
Projectile proj = Main.projectile[projIndex];
|
||||
if (proj.active && proj.owner == projectile.owner && proj.type == projType && proj.ai[0] < 900f)
|
||||
{
|
||||
projCount++;
|
||||
if (proj.ai[0] > tornadoAge)
|
||||
{
|
||||
oldestTornado = projIndex;
|
||||
tornadoAge = proj.ai[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (projCount > 1)
|
||||
{
|
||||
Main.projectile[oldestTornado].netUpdate = true;
|
||||
Main.projectile[oldestTornado].ai[0] = 36000f;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
float lifeSpan = 900f;
|
||||
if (projectile.soundDelay == 0)
|
||||
{
|
||||
projectile.soundDelay = -1;
|
||||
Main.PlaySound(2, projectile.Center, 122);
|
||||
}
|
||||
projectile.ai[0] += 1f;
|
||||
if (projectile.ai[0] >= lifeSpan)
|
||||
{
|
||||
projectile.Kill();
|
||||
}
|
||||
if (projectile.localAI[0] >= 30f)
|
||||
{
|
||||
projectile.damage = 0;
|
||||
if (projectile.ai[0] < lifeSpan - 120f)
|
||||
{
|
||||
float num1126 = projectile.ai[0] % 60f;
|
||||
projectile.ai[0] = lifeSpan - 120f + num1126;
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
}
|
||||
float num1127 = 15f;
|
||||
float num1128 = 15f;
|
||||
Point point8 = projectile.Center.ToTileCoordinates();
|
||||
int num1129;
|
||||
int num1130;
|
||||
Collision.ExpandVertically(point8.X, point8.Y, out num1129, out num1130, (int)num1127, (int)num1128);
|
||||
num1129++;
|
||||
num1130--;
|
||||
Vector2 value72 = new Vector2((float)point8.X, (float)num1129) * 16f + new Vector2(8f);
|
||||
Vector2 value73 = new Vector2((float)point8.X, (float)num1130) * 16f + new Vector2(8f);
|
||||
Vector2 vector146 = Vector2.Lerp(value72, value73, 0.5f);
|
||||
Vector2 value74 = new Vector2(0f, value73.Y - value72.Y);
|
||||
value74.X = value74.Y * 0.2f;
|
||||
projectile.width = (int)(value74.X * 0.65f);
|
||||
projectile.height = (int)value74.Y;
|
||||
projectile.Center = vector146;
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
bool flag74 = false;
|
||||
Vector2 center16 = Main.player[projectile.owner].Center;
|
||||
Vector2 top = Main.player[projectile.owner].Top;
|
||||
for (float num1131 = 0f; num1131 < 1f; num1131 += 0.05f)
|
||||
{
|
||||
Vector2 position2 = Vector2.Lerp(value72, value73, num1131);
|
||||
if (Collision.CanHitLine(position2, 0, 0, center16, 0, 0) || Collision.CanHitLine(position2, 0, 0, top, 0, 0))
|
||||
{
|
||||
flag74 = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!flag74 && projectile.ai[0] < lifeSpan - 120f)
|
||||
{
|
||||
float num1132 = projectile.ai[0] % 60f;
|
||||
projectile.ai[0] = lifeSpan - 120f + num1132;
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
}
|
||||
if (projectile.ai[0] < lifeSpan - 120f)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
float num226 = 600f;
|
||||
float num227 = 15f;
|
||||
float num228 = 15f;
|
||||
float num229 = projectile.ai[0];
|
||||
float scale5 = MathHelper.Clamp(num229 / 30f, 0f, 1f);
|
||||
if (num229 > num226 - 60f)
|
||||
{
|
||||
scale5 = MathHelper.Lerp(1f, 0f, (num229 - (num226 - 60f)) / 60f);
|
||||
}
|
||||
Point point5 = projectile.Center.ToTileCoordinates();
|
||||
int num230;
|
||||
int num231;
|
||||
Collision.ExpandVertically(point5.X, point5.Y, out num230, out num231, (int)num227, (int)num228);
|
||||
num230++;
|
||||
num231--;
|
||||
float num232 = 0.2f;
|
||||
Vector2 value32 = new Vector2((float)point5.X, (float)num230) * 16f + new Vector2(8f);
|
||||
Vector2 value33 = new Vector2((float)point5.X, (float)num231) * 16f + new Vector2(8f);
|
||||
Vector2.Lerp(value32, value33, 0.5f);
|
||||
Vector2 vector33 = new Vector2(0f, value33.Y - value32.Y);
|
||||
vector33.X = vector33.Y * num232;
|
||||
new Vector2(value32.X - vector33.X / 2f, value32.Y);
|
||||
Texture2D texture2D23 = Main.projectileTexture[projectile.type];
|
||||
Rectangle rectangle9 = texture2D23.Frame(1, 1, 0, 0);
|
||||
Vector2 origin3 = rectangle9.Size() / 2f;
|
||||
float num233 = -0.06283186f * num229;
|
||||
Vector2 spinningpoint2 = Vector2.UnitY.RotatedBy((double)(num229 * 0.1f), default);
|
||||
float num234 = 0f;
|
||||
float num235 = 5.1f;
|
||||
Color value34 = new Color(225, 225, 100);
|
||||
for (float num236 = (float)(int)value33.Y; num236 > (float)(int)value32.Y; num236 -= num235)
|
||||
{
|
||||
num234 += num235;
|
||||
float num237 = num234 / vector33.Y;
|
||||
float num238 = num234 * 6.28318548f / -20f;
|
||||
float num239 = num237 - 0.15f;
|
||||
Vector2 vector34 = spinningpoint2.RotatedBy((double)num238, default);
|
||||
Vector2 value35 = new Vector2(0f, num237 + 1f);
|
||||
value35.X = value35.Y * num232;
|
||||
Color color39 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Transparent, value34, num237 * 2f);
|
||||
if (num237 > 0.5f)
|
||||
{
|
||||
color39 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Transparent, value34, 2f - num237 * 2f);
|
||||
}
|
||||
color39.A = (byte)((float)color39.A * 0.5f);
|
||||
color39 *= scale5;
|
||||
vector34 *= value35 * 100f;
|
||||
vector34.Y = 0f;
|
||||
vector34.X = 0f;
|
||||
vector34 += new Vector2(value33.X, num236) - Main.screenPosition;
|
||||
Main.spriteBatch.Draw(texture2D23, vector34, new Microsoft.Xna.Framework.Rectangle?(rectangle9), color39, num233 + num238, origin3, 1f + num239, SpriteEffects.None, 0f);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 813 B |
Reference in new issue
Block a user