added Scab Ripper
This commit is contained in:
1 parent
58a2f0e8bb
commit
e231f01bc8
9 files changed
+297
No files matched your search
@@ -0,0 +1,35 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Projectiles.Summon;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Buffs.Summon
|
||||
{
|
||||
public class ScabRipperBuff : ModBuff
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Baby Blood Crawler");
|
||||
Description.SetDefault("The baby blood crawler will protect you");
|
||||
Main.buffNoTimeDisplay[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
if (player.ownedProjectileCounts[ModContent.ProjectileType<BabyBloodCrawler>()] > 0)
|
||||
{
|
||||
modPlayer.scabRipper = true;
|
||||
}
|
||||
if (!modPlayer.scabRipper)
|
||||
{
|
||||
player.DelBuff(buffIndex);
|
||||
buffIndex--;
|
||||
}
|
||||
else
|
||||
{
|
||||
player.buffTime[buffIndex] = 18000;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 614 B |
@@ -0,0 +1,61 @@
|
||||
using CalamityMod.Projectiles.Summon;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Summon
|
||||
{
|
||||
public class ScabRipper : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Scab Ripper");
|
||||
Tooltip.SetDefault("Summons a baby blood crawler to protect you");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.damage = 15;
|
||||
item.mana = 10;
|
||||
item.width = 66;
|
||||
item.height = 70;
|
||||
item.useTime = item.useAnimation = 35;
|
||||
item.useStyle = 1;
|
||||
item.noMelee = true;
|
||||
item.knockBack = 0.5f;
|
||||
item.value = Item.buyPrice(0, 2, 0, 0);
|
||||
item.rare = 2;
|
||||
item.UseSound = SoundID.Item83;
|
||||
item.autoReuse = true;
|
||||
item.shoot = ModContent.ProjectileType<BabyBloodCrawler>();
|
||||
item.shootSpeed = 10f;
|
||||
item.summon = 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.altFunctionUse != 2)
|
||||
{
|
||||
position = Main.MouseWorld;
|
||||
speedX = 0;
|
||||
speedY = 0;
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ItemID.CrimtaneBar, 5);
|
||||
recipe.AddIngredient(ItemID.TissueSample, 9);
|
||||
recipe.AddIngredient(ItemID.Shadewood, 20);
|
||||
recipe.AddTile(TileID.Anvils);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 747 B |
@@ -726,6 +726,7 @@ namespace CalamityMod
|
||||
sAssociation.Call("AddMinionInfo", ItemType<SeaboundStaff>(), BuffType<BrittleStar>(), ProjectileType<BrittleStarMinion>());
|
||||
sAssociation.Call("AddMinionInfo", ItemType<MagicalConch>(), BuffType<HermitCrab>(), ProjectileType<HermitCrabMinion>());
|
||||
sAssociation.Call("AddMinionInfo", ItemType<VileFeeder>(), BuffType<VileFeederBuff>(), ProjectileType<VileFeederSummon>());
|
||||
sAssociation.Call("AddMinionInfo", ItemType<ScabRipper>(), BuffType<ScabRipperBuff>(), ProjectileType<BabyBloodCrawler>());
|
||||
sAssociation.Call("AddMinionInfo", ItemType<CinderBlossomStaff>(), BuffType<CinderBlossomBuff>(), ProjectileType<CinderBlossom>());
|
||||
sAssociation.Call("AddMinionInfo", ItemType<BloodClotStaff>(), BuffType<BloodClot>(), ProjectileType<BloodClotMinion>());
|
||||
sAssociation.Call("AddMinionInfo", ItemType<DankStaff>(), BuffType<DankCreeperBuff>(), ProjectileType<DankCreeperMinion>());
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
using CalamityMod.Buffs.Summon;
|
||||
using CalamityMod.CalPlayer;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
public class BabyBloodCrawler : ModProjectile
|
||||
{
|
||||
public float dust = 0f;
|
||||
public int spiderCount = 0;
|
||||
public bool countedAlready = false;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Baby Blood Crawler");
|
||||
Main.projFrames[projectile.type] = 11;
|
||||
ProjectileID.Sets.MinionSacrificable[projectile.type] = true;
|
||||
ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 26;
|
||||
projectile.height = 26;
|
||||
projectile.netImportant = true;
|
||||
projectile.friendly = true;
|
||||
projectile.minionSlots = 1f;
|
||||
projectile.aiStyle = 26;
|
||||
projectile.timeLeft = 18000;
|
||||
projectile.penetrate = -1;
|
||||
projectile.timeLeft *= 5;
|
||||
projectile.minion = true;
|
||||
aiType = ProjectileID.VenomSpider;
|
||||
projectile.tileCollide = false;
|
||||
}
|
||||
|
||||
public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough)
|
||||
{
|
||||
fallThrough = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Player player = Main.player[projectile.owner];
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
|
||||
for (int j = 0; j < Main.maxProjectiles; j++)
|
||||
{
|
||||
Projectile proj = Main.projectile[j];
|
||||
if (proj.active && proj.owner == projectile.owner && proj.type == ModContent.ProjectileType<BabyBloodCrawler>() && proj.Calamity().lineColor == 0)
|
||||
{
|
||||
spiderCount += (int)proj.minionSlots;
|
||||
proj.Calamity().lineColor = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (dust == 0f)
|
||||
{
|
||||
projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage();
|
||||
projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage;
|
||||
int num226 = 16;
|
||||
for (int num227 = 0; num227 < num226; num227++)
|
||||
{
|
||||
Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f;
|
||||
vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center;
|
||||
Vector2 vector7 = vector6 - projectile.Center;
|
||||
int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 5, vector7.X * 1f, vector7.Y * 1f, 100, default, 1.1f);
|
||||
Main.dust[num228].noGravity = true;
|
||||
Main.dust[num228].noLight = true;
|
||||
Main.dust[num228].velocity = vector7;
|
||||
}
|
||||
dust += 1f;
|
||||
}
|
||||
if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue)
|
||||
{
|
||||
int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue /
|
||||
projectile.Calamity().spawnedPlayerMinionDamageValue *
|
||||
player.MinionDamage());
|
||||
projectile.damage = damage2;
|
||||
}
|
||||
bool flag64 = projectile.type == ModContent.ProjectileType<BabyBloodCrawler>();
|
||||
player.AddBuff(ModContent.BuffType<ScabRipperBuff>(), 3600);
|
||||
if (flag64)
|
||||
{
|
||||
if (player.dead)
|
||||
{
|
||||
modPlayer.scabRipper = false;
|
||||
}
|
||||
if (modPlayer.scabRipper)
|
||||
{
|
||||
projectile.timeLeft = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnTileCollide(Vector2 oldVelocity)
|
||||
{
|
||||
if (projectile.penetrate == 0)
|
||||
{
|
||||
projectile.Kill();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
//1 spider = 15 frames, 5 spiders, 10 frames
|
||||
int immuneTime = 16 - spiderCount;
|
||||
if (immuneTime < 5)
|
||||
immuneTime = 5; //cap to prevent potential insanity
|
||||
target.immune[projectile.owner] = immuneTime;
|
||||
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
for (int n = 0; n < Main.rand.Next(1, 3); n++)
|
||||
{
|
||||
float x = target.position.X + (float)Main.rand.Next(-400, 400);
|
||||
float y = target.position.Y - (float)Main.rand.Next(500, 800);
|
||||
Vector2 vector = new Vector2(x, y);
|
||||
float num13 = target.position.X + (float)(target.width / 2) - vector.X;
|
||||
float num14 = target.position.Y + (float)(target.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<BloodRain>(), (int)((float)projectile.damage * Main.rand.NextFloat(0.7f, 1f)), projectile.knockBack * Main.rand.NextFloat(0.7f, 1f), projectile.owner, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player target, int damage, bool crit)
|
||||
{
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
for (int n = 0; n < Main.rand.Next(1, 3); n++)
|
||||
{
|
||||
float x = target.position.X + (float)Main.rand.Next(-400, 400);
|
||||
float y = target.position.Y - (float)Main.rand.Next(500, 800);
|
||||
Vector2 vector = new Vector2(x, y);
|
||||
float num13 = target.position.X + (float)(target.width / 2) - vector.X;
|
||||
float num14 = target.position.Y + (float)(target.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<BloodRain>(), (int)((float)projectile.damage * Main.rand.NextFloat(0.7f, 1f)), projectile.knockBack * Main.rand.NextFloat(0.7f, 1f), projectile.owner, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
@@ -0,0 +1,41 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
public class BloodRain : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Blood Rain");
|
||||
ProjectileID.Sets.MinionShot[projectile.type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 2;
|
||||
projectile.height = 2;
|
||||
projectile.aiStyle = 45;
|
||||
projectile.friendly = true;
|
||||
projectile.penetrate = 1;
|
||||
projectile.tileCollide = true;
|
||||
projectile.timeLeft = 300;
|
||||
projectile.alpha = 255;
|
||||
projectile.scale = 1.1f;
|
||||
projectile.minion = true;
|
||||
aiType = ProjectileID.RainFriendly;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
int blood = Dust.NewDust(projectile.position, projectile.width, projectile.height, 5, projectile.velocity.X, projectile.velocity.Y, 100, default, 1f);
|
||||
Dust dust = Main.dust[blood];
|
||||
dust.velocity = Vector2.Zero;
|
||||
dust.position -= projectile.velocity / 5f;
|
||||
dust.noGravity = true;
|
||||
dust.scale = 2f;
|
||||
dust.noLight = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 136 B |
Reference in new issue
Block a user