added web balls (unobtainable)

This commit is contained in:
termigator1359 committed 2019-11-29 11:52:22 -05:00
1 parent 5a0b79222e
commit 5b44ae8706
6 files changed
+138 -1

No files matched your search

+11
View File
@@ -47,6 +47,17 @@ namespace CalamityMod.Buffs
}
}
public override void Update(int type, NPC npc, ref int buffIndex)
{
if (type == BuffID.Webbed)
{
if (npc.Calamity().webbed < npc.buffTime[buffIndex])
npc.Calamity().webbed = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
}
}
public override void ModifyBuffTip(int type, ref string tip, ref int rare)
{
if (type == BuffID.NebulaUpDmg1)
+59
View File
@@ -0,0 +1,59 @@
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Rogue;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Rogue
{
public class WebBall : RogueWeapon
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Web Ball");
Tooltip.SetDefault(@"Throws a web-covered ball that covers enemies in cobwebs to slow them down
Stealth strikes slow enemies down longer");
}
public override void SafeSetDefaults()
{
item.width = 20;
item.damage = 12;
item.noMelee = true;
item.noUseGraphic = true;
item.maxStack = 999;
item.consumable = true;
item.useAnimation = 20;
item.useStyle = 1;
item.useTime = 20;
item.knockBack = 3f;
item.UseSound = SoundID.Item1;
item.height = 18;
item.value = Item.buyPrice(0, 0, 0, 30);
item.rare = 0;
item.shoot = ModContent.ProjectileType<WebBallBol>();
item.shootSpeed = 4f;
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()) //setting the stealth strike
{
int proj = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, item.damage, item.knockBack, player.whoAmI, 0f, 0f);
Main.projectile[proj].Calamity().stealthStrike = true;
return false;
}
return true;
}
/*public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.Cobweb, 3);
recipe.SetResult(this);
recipe.AddRecipe();
}*/
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 526 B

+20 -1
View File
@@ -95,6 +95,7 @@ namespace CalamityMod.NPCs
public int tSad = 0;
public int eFreeze = 0;
public int silvaStun = 0;
public int webbed = 0;
public int yellowCandle = 0;
public int pearlAura = 0;
public int wCleave = 0;
@@ -605,6 +606,7 @@ namespace CalamityMod.NPCs
npc.buffImmune[ModContent.BuffType<GlacialState>()] = true;
npc.buffImmune[ModContent.BuffType<TemporalSadness>()] = true;
npc.buffImmune[ModContent.BuffType<TimeSlow>()] = true;
npc.buffImmune[BuffID.Webbed] = true;
}
if (DestroyerIDs.Contains(npc.type) || npc.type == NPCID.DD2EterniaCrystal || npc.townNPC)
@@ -2111,6 +2113,8 @@ namespace CalamityMod.NPCs
eFreeze--;
if (silvaStun > 0)
silvaStun--;
if (webbed > 0)
webbed--;
if (yellowCandle > 0)
yellowCandle--;
if (pearlAura > 0)
@@ -2167,7 +2171,7 @@ namespace CalamityMod.NPCs
{
if (silvaStun > 0)
npc.velocity = Vector2.Zero;
else if (timeSlow > 0)
else if (timeSlow > 0 || webbed > 0)
npc.velocity *= 0.85f;
}
}
@@ -3089,6 +3093,21 @@ namespace CalamityMod.NPCs
}
}
}
if (webbed > 0)
{
if (Main.rand.Next(5) < 4)
{
int dust = Dust.NewDust(npc.position - new Vector2(2f, 2f), npc.width + 4, npc.height + 4, 30, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 1.5f);
Main.dust[dust].noGravity = true;
Main.dust[dust].velocity *= 1.1f;
Main.dust[dust].velocity.Y += 0.25f;
if (Main.rand.NextBool(2))
{
Main.dust[dust].noGravity = false;
Main.dust[dust].scale *= 0.5f;
}
}
}
if (gState > 0 || eFreeze > 0)
{
+48
View File
@@ -0,0 +1,48 @@
using CalamityMod.Projectiles.Typeless;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Rogue
{
public class WebBallBol : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Web Ball");
}
public override void SetDefaults()
{
projectile.width = 18;
projectile.height = 18;
projectile.friendly = true;
projectile.penetrate = 3;
projectile.timeLeft = 300;
projectile.Calamity().rogue = true;
projectile.aiStyle = 14;
}
public override void AI()
{
if (Main.rand.NextBool(12))
{
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 30, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
}
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
if (projectile.Calamity().stealthStrike == true)
{
target.AddBuff(BuffID.Webbed, 180);
}
else
{
target.AddBuff(BuffID.Webbed, 30);
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 526 B