Merge branch 'master' of https://github.com/UncleDanny/CalamityMod
This commit is contained in:
commit
2a126763b4
33 files changed
+437
-35
No files matched your search
+37
-1
@@ -15,6 +15,7 @@ using CalamityMod.Items.Fishing.AstralCatches;
|
||||
using CalamityMod.Items.Fishing.SunkenSeaCatches;
|
||||
using CalamityMod.Items.Fishing.FishingRods;
|
||||
using CalamityMod.Localization;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.NPCs.Abyss;
|
||||
using CalamityMod.NPCs.AquaticScourge;
|
||||
using CalamityMod.NPCs.Astral;
|
||||
@@ -3268,6 +3269,32 @@ namespace CalamityMod
|
||||
case CalamityModMessageType.DeathCountSync:
|
||||
Main.player[reader.ReadInt32()].Calamity().HandleDeathCount(reader);
|
||||
break;
|
||||
case CalamityModMessageType.RevengeanceBoolSync:
|
||||
bool revActive = reader.ReadBoolean();
|
||||
CalamityWorld.revenge = revActive;
|
||||
break;
|
||||
case CalamityModMessageType.DeathBoolSync:
|
||||
bool revActive2 = reader.ReadBoolean();
|
||||
CalamityWorld.revenge = revActive2;
|
||||
bool deathActive = reader.ReadBoolean();
|
||||
CalamityWorld.death = deathActive;
|
||||
break;
|
||||
case CalamityModMessageType.DefiledBoolSync:
|
||||
bool defiledActive = reader.ReadBoolean();
|
||||
CalamityWorld.defiled = defiledActive;
|
||||
break;
|
||||
case CalamityModMessageType.IronHeartBoolSync:
|
||||
bool ironHeartActive = reader.ReadBoolean();
|
||||
CalamityWorld.ironHeart = ironHeartActive;
|
||||
break;
|
||||
case CalamityModMessageType.ArmageddonBoolSync:
|
||||
bool armaActive = reader.ReadBoolean();
|
||||
CalamityWorld.armageddon = armaActive;
|
||||
break;
|
||||
case CalamityModMessageType.NPCRegenerationSync:
|
||||
byte npcIndex = reader.ReadByte();
|
||||
Main.npc[npcIndex].lifeRegen = reader.ReadInt32();
|
||||
break;
|
||||
default:
|
||||
Logger.Warn("Unknown Message type: " + msgType);
|
||||
break;
|
||||
@@ -3289,7 +3316,9 @@ namespace CalamityMod
|
||||
public static void UpdateServerBoolean()
|
||||
{
|
||||
if (Main.netMode == NetmodeID.Server)
|
||||
{
|
||||
NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
@@ -3321,7 +3350,14 @@ namespace CalamityMod
|
||||
DoGCountdownSync,
|
||||
BossSpawnCountdownSync,
|
||||
BossTypeSync,
|
||||
DeathCountSync
|
||||
DeathCountSync,
|
||||
RevengeanceBoolSync,
|
||||
DeathBoolSync,
|
||||
DefiledBoolSync,
|
||||
IronHeartBoolSync,
|
||||
ArmageddonBoolSync,
|
||||
DemonTrophyBoolSync,
|
||||
NPCRegenerationSync
|
||||
//DistanceFromBossSync
|
||||
}
|
||||
}
|
||||
@@ -35,15 +35,7 @@ namespace CalamityMod.Items.Accessories
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ItemID.DemoniteBar, 8);
|
||||
recipe.AddIngredient(ItemID.Silk, 10);
|
||||
recipe.AddIngredient(ItemID.ShadowScale, 3);
|
||||
recipe.AddTile(TileID.TinkerersWorkbench);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
|
||||
recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ItemID.CrimtaneBar, 8);
|
||||
recipe.AddIngredient(ItemID.Silk, 10);
|
||||
recipe.AddIngredient(ItemID.TissueSample, 3);
|
||||
recipe.AddRecipeGroup("Boss2Material", 3);
|
||||
recipe.AddTile(TileID.TinkerersWorkbench);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
|
||||
@@ -72,6 +72,14 @@ namespace CalamityMod.Items.DifficultyItems
|
||||
}
|
||||
|
||||
CalamityMod.UpdateServerBoolean();
|
||||
|
||||
if (Main.netMode == NetmodeID.Server)
|
||||
{
|
||||
var netMessage = mod.GetPacket();
|
||||
netMessage.Write((uint)CalamityModMessageType.ArmageddonBoolSync);
|
||||
netMessage.Write(CalamityWorld.armageddon);
|
||||
netMessage.Send();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -86,6 +86,14 @@ namespace CalamityMod.Items.DifficultyItems
|
||||
}
|
||||
|
||||
CalamityMod.UpdateServerBoolean();
|
||||
|
||||
if (Main.netMode == NetmodeID.Server)
|
||||
{
|
||||
var netMessage = mod.GetPacket();
|
||||
netMessage.Write((byte)CalamityModMessageType.DeathBoolSync);
|
||||
netMessage.Write(CalamityWorld.death);
|
||||
netMessage.Send();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -83,6 +83,16 @@ namespace CalamityMod.Items.DifficultyItems
|
||||
}
|
||||
|
||||
CalamityMod.UpdateServerBoolean();
|
||||
|
||||
if (Main.netMode == NetmodeID.Server)
|
||||
{
|
||||
var netMessage = mod.GetPacket();
|
||||
netMessage.Write((byte)CalamityModMessageType.RevengeanceBoolSync);
|
||||
netMessage.Write(CalamityWorld.revenge);
|
||||
netMessage.Write((byte)CalamityModMessageType.DefiledBoolSync);
|
||||
netMessage.Write(CalamityWorld.defiled);
|
||||
netMessage.Send();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -83,6 +83,14 @@ namespace CalamityMod.Items.DifficultyItems
|
||||
}
|
||||
}
|
||||
CalamityMod.UpdateServerBoolean();
|
||||
|
||||
if (Main.netMode == NetmodeID.Server)
|
||||
{
|
||||
var netMessage = mod.GetPacket();
|
||||
netMessage.Write((byte)CalamityModMessageType.IronHeartBoolSync);
|
||||
netMessage.Write(CalamityWorld.ironHeart);
|
||||
netMessage.Send();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,13 @@ namespace CalamityMod.Items.DifficultyItems
|
||||
{
|
||||
CalamityWorld.demonMode = true;
|
||||
CalamityMod.UpdateServerBoolean();
|
||||
if (Main.netMode == NetmodeID.Server)
|
||||
{
|
||||
var netMessage = mod.GetPacket();
|
||||
netMessage.Write((byte)CalamityModMessageType.DemonTrophyBoolSync);
|
||||
netMessage.Write(CalamityWorld.demonMode);
|
||||
netMessage.Send();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,6 +128,13 @@ namespace CalamityMod.Items.DifficultyItems
|
||||
}
|
||||
|
||||
CalamityMod.UpdateServerBoolean();
|
||||
if (Main.netMode == NetmodeID.Server)
|
||||
{
|
||||
var netMessage = mod.GetPacket();
|
||||
netMessage.Write((byte)CalamityModMessageType.RevengeanceBoolSync);
|
||||
netMessage.Write(CalamityWorld.revenge);
|
||||
netMessage.Send();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -53,10 +53,11 @@ Stealth strikes release more souls and leave behind souls as they travel");
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ModContent.ItemType<SolarVeil>());
|
||||
recipe.AddIngredient(ItemID.Ectoplasm);
|
||||
recipe.AddIngredient(ModContent.ItemType<SolarVeil>(), 2);
|
||||
recipe.AddIngredient(ItemID.Silk, 3);
|
||||
recipe.AddIngredient(ItemID.Ectoplasm, 5);
|
||||
recipe.AddTile(TileID.MythrilAnvil);
|
||||
recipe.SetResult(this, 5);
|
||||
recipe.SetResult(this, 100);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
public class HardenedHoneycomb : RogueWeapon
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Hardened Honeycomb");
|
||||
Tooltip.SetDefault(@"Fires a honeycomb that shatters into fragments
|
||||
Grants the honey buff to players it touches
|
||||
Stealth strikes can bounce off walls and enemies");
|
||||
}
|
||||
|
||||
public override void SafeSetDefaults()
|
||||
{
|
||||
item.width = 30;
|
||||
item.damage = 25;
|
||||
item.noMelee = true;
|
||||
item.consumable = true;
|
||||
item.noUseGraphic = true;
|
||||
item.useAnimation = 21;
|
||||
item.useTime = 21;
|
||||
item.useStyle = 1;
|
||||
item.knockBack = 3f;
|
||||
item.UseSound = SoundID.Item1;
|
||||
item.autoReuse = true;
|
||||
item.height = 32;
|
||||
item.maxStack = 999;
|
||||
item.value = 300;
|
||||
item.rare = 3;
|
||||
item.shoot = ModContent.ProjectileType<Honeycomb>();
|
||||
item.shootSpeed = 10f;
|
||||
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 stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
Main.projectile[stealth].penetrate = 3;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/*public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ItemID.Hive);
|
||||
recipe.AddIngredient(ItemID.CrispyHoneyBlock);
|
||||
recipe.AddIngredient(ItemID.BeeWax);
|
||||
recipe.AddTile(TileID.Anvils);
|
||||
recipe.SetResult(this, 5);
|
||||
recipe.AddRecipe();
|
||||
}*/
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 546 B |
@@ -29,8 +29,8 @@ Stealth strikes summon ghost clones instead of lost souls");
|
||||
item.noUseGraphic = true;
|
||||
|
||||
item.value = Item.buyPrice(1, 40, 0, 0);
|
||||
item.useTime = 15;
|
||||
item.useAnimation = 15;
|
||||
item.useTime = 25;
|
||||
item.useAnimation = 25;
|
||||
item.UseSound = SoundID.Item1;
|
||||
item.rare = 10;
|
||||
item.Calamity().postMoonLordRarity = 13;
|
||||
|
||||
@@ -9222,9 +9222,6 @@ namespace CalamityMod.NPCs
|
||||
bool phase3 = lifeRatio < 0.4f || golemLifeRatio < 0.7f || CalamityWorld.death || CalamityWorld.bossRushActive;
|
||||
bool phase4 = lifeRatio < 0.1f || golemLifeRatio < 0.55f || CalamityWorld.death || CalamityWorld.bossRushActive;
|
||||
|
||||
// Target
|
||||
npc.TargetClosest(true);
|
||||
|
||||
// Float through tiles or not
|
||||
bool flag44 = false;
|
||||
if (!Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1) || phase3)
|
||||
@@ -9252,6 +9249,10 @@ namespace CalamityMod.NPCs
|
||||
// Move to new location
|
||||
if (npc.ai[3] <= 0f)
|
||||
{
|
||||
// Target
|
||||
npc.TargetClosest(true);
|
||||
npc.netSpam = 5;
|
||||
|
||||
npc.ai[3] = 300f;
|
||||
|
||||
float maxDistance = 300f;
|
||||
@@ -9315,7 +9316,7 @@ namespace CalamityMod.NPCs
|
||||
calamityGlobalNPC.newAI[1] = -maxDistance;
|
||||
}
|
||||
|
||||
npc.netUpdate = true;
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
|
||||
npc.ai[3] -= 1f +
|
||||
@@ -9470,6 +9471,7 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
}
|
||||
}
|
||||
NetMessage.SendData(23, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0);
|
||||
|
||||
if (ModLoader.GetMod("FargowiltasSouls") != null)
|
||||
ModLoader.GetMod("FargowiltasSouls").Call("FargoSoulsAI", npc.whoAmI);
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace CalamityMod.NPCs
|
||||
// private int ironHeartDamage = 0;
|
||||
|
||||
// NewAI
|
||||
private const int maxAIMod = 4;
|
||||
internal const int maxAIMod = 4;
|
||||
public float[] newAI = new float[maxAIMod];
|
||||
|
||||
// Town NPC Patreon
|
||||
|
||||
@@ -1629,7 +1629,7 @@ namespace CalamityMod.NPCs
|
||||
|
||||
case NPCID.Reaper:
|
||||
case NPCID.Psycho:
|
||||
DropHelper.DropItemCondition(npc, ModContent.ItemType<SolarVeil>(), (CalamityWorld.downedCalamitas || NPC.downedPlantBoss), Main.expertMode ? 0.1f : 0.05f, 1, 3);
|
||||
DropHelper.DropItemCondition(npc, ModContent.ItemType<SolarVeil>(), (CalamityWorld.downedCalamitas || NPC.downedPlantBoss), Main.expertMode ? 0.75f : 0.5f, 1, 4);
|
||||
DropHelper.DropItemCondition(npc, ModContent.ItemType<DarksunFragment>(), CalamityWorld.downedBuffedMothron, Main.expertMode ? 0.06f : 0.04f, 1, 1);
|
||||
break;
|
||||
|
||||
|
||||
@@ -226,7 +226,6 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
npc.ai[0] = (float)num596;
|
||||
npc.ai[1] = 0f;
|
||||
npc.ai[2] = 0f;
|
||||
@@ -349,7 +348,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
|
||||
if (npc.netSpam > 10)
|
||||
npc.netSpam = 10;
|
||||
}
|
||||
}
|
||||
|
||||
// Slow down after charge
|
||||
else
|
||||
@@ -860,6 +859,11 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
npc.netSpam = 10;
|
||||
}
|
||||
}
|
||||
|
||||
if (Main.netMode == NetmodeID.Server)
|
||||
{
|
||||
NetMessage.SendData(23, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
private void Movement(float xPos, float yPos, float yPos2)
|
||||
|
||||
@@ -573,6 +573,11 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (Main.netMode == NetmodeID.Server)
|
||||
{
|
||||
NetMessage.SendData(23, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Skull");
|
||||
DisplayName.SetDefault("Ark of the Cosmos' Superior Cousin");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 4;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
Main.projFrames[projectile.type] = 5;
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Skull");
|
||||
DisplayName.SetDefault("Ark of the Cosmos' Superior Cousin");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 4;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
Main.projFrames[projectile.type] = 5;
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
projectile.alpha = 0;
|
||||
projectile.penetrate = 1;
|
||||
projectile.tileCollide = true;
|
||||
projectile.timeLeft = 150;
|
||||
projectile.timeLeft = 120;
|
||||
projectile.Calamity().rogue = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
projectile.alpha = 0;
|
||||
projectile.penetrate = 3;
|
||||
projectile.tileCollide = true;
|
||||
projectile.timeLeft = 150;
|
||||
projectile.timeLeft = 120;
|
||||
projectile.Calamity().rogue = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,15 +41,15 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
|
||||
if (recall)
|
||||
{
|
||||
if (Main.rand.Next(0, 7) == 0)
|
||||
if (Main.rand.Next(0, 10) == 0)
|
||||
{
|
||||
Vector2 shardVelocity = new Vector2(Main.rand.NextFloat(-1f, 1f), Main.rand.NextFloat(-1f, 1f));
|
||||
shardVelocity.Normalize();
|
||||
shardVelocity *= 5f;
|
||||
Projectile.NewProjectile(projectile.Center, shardVelocity, ModContent.ProjectileType<EquanimityDarkShard>(), (int)(projectile.damage * 0.5f), 0f, projectile.owner);
|
||||
Projectile.NewProjectile(projectile.Center, shardVelocity, ModContent.ProjectileType<EquanimityDarkShard>(), (int)(projectile.damage * 0.15f), 0f, projectile.owner);
|
||||
if (projectile.Calamity().stealthStrike)
|
||||
{
|
||||
Projectile.NewProjectile(projectile.Center, -shardVelocity, ModContent.ProjectileType<EquanimityLightShard>(), (int)(projectile.damage * 0.5f), 0f, projectile.owner);
|
||||
Projectile.NewProjectile(projectile.Center, -shardVelocity, ModContent.ProjectileType<EquanimityLightShard>(), (int)(projectile.damage * 0.15f), 0f, projectile.owner);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,10 +80,10 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
Vector2 shardVelocity = new Vector2(Main.rand.NextFloat(-1f, 1f), Main.rand.NextFloat(-1f, 1f));
|
||||
shardVelocity.Normalize();
|
||||
shardVelocity *= 5f;
|
||||
Projectile.NewProjectile(projectile.Center, shardVelocity, ModContent.ProjectileType<EquanimityLightShard>(), (int)(projectile.damage * 0.25f), 0f, projectile.owner);
|
||||
Projectile.NewProjectile(projectile.Center, shardVelocity, ModContent.ProjectileType<EquanimityLightShard>(), (int)(projectile.damage * 0.1f), 0f, projectile.owner);
|
||||
if (projectile.Calamity().stealthStrike)
|
||||
{
|
||||
Projectile.NewProjectile(projectile.Center, -shardVelocity, ModContent.ProjectileType<EquanimityDarkShard>(), (int)(projectile.damage * 0.25f), 0f, projectile.owner);
|
||||
Projectile.NewProjectile(projectile.Center, -shardVelocity, ModContent.ProjectileType<EquanimityDarkShard>(), (int)(projectile.damage * 0.1f), 0f, projectile.owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class Honeycomb : ModProjectile
|
||||
{
|
||||
private const float radius = 15f;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Honeycomb");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 30;
|
||||
projectile.height = 30;
|
||||
projectile.friendly = true;
|
||||
projectile.penetrate = 1;
|
||||
projectile.aiStyle = 2;
|
||||
projectile.timeLeft = 300;
|
||||
aiType = 48;
|
||||
projectile.Calamity().rogue = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Player player = Main.player[Main.myPlayer];
|
||||
Vector2 posDiff = player.Center - projectile.Center;
|
||||
if (posDiff.Length() <= radius)
|
||||
{
|
||||
player.AddBuff(BuffID.Honey, 300);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnTileCollide(Vector2 oldVelocity)
|
||||
{
|
||||
int split = 0;
|
||||
while (split < 3)
|
||||
{
|
||||
//Calculate the velocity of the projectile
|
||||
float shardspeedX = -projectile.velocity.X * Main.rand.NextFloat(.5f, .7f) + Main.rand.NextFloat(-3f, 3f);
|
||||
float shardspeedY = -projectile.velocity.Y * Main.rand.Next(50, 70) * 0.01f + Main.rand.Next(-8, 9) * 0.2f;
|
||||
//Prevents the projectile speed from being too low
|
||||
if (shardspeedX < 2f && shardspeedX > -2f)
|
||||
{
|
||||
shardspeedX += -projectile.velocity.X;
|
||||
}
|
||||
if (shardspeedY > 2f && shardspeedY < 2f)
|
||||
{
|
||||
shardspeedY += -projectile.velocity.Y;
|
||||
}
|
||||
|
||||
//Spawn the projectile
|
||||
Projectile.NewProjectile(projectile.position.X + shardspeedX, projectile.position.Y + shardspeedY, shardspeedX, shardspeedY, ModContent.ProjectileType<HoneycombFragment>(), (int)(projectile.damage * 0.3), 2f, projectile.owner, Main.rand.Next(3), 0f);
|
||||
split += 1;
|
||||
}
|
||||
projectile.penetrate--;
|
||||
if (projectile.penetrate <= 0)
|
||||
{
|
||||
projectile.Kill();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (projectile.velocity.X != oldVelocity.X)
|
||||
{
|
||||
projectile.velocity.X = -oldVelocity.X;
|
||||
}
|
||||
if (projectile.velocity.Y != oldVelocity.Y)
|
||||
{
|
||||
projectile.velocity.Y = -oldVelocity.Y;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
projectile.velocity.X = -projectile.velocity.X;
|
||||
projectile.velocity.Y = -projectile.velocity.Y;
|
||||
int split = 0;
|
||||
while (split < 3)
|
||||
{
|
||||
//Calculate the velocity of the projectile
|
||||
float shardspeedX = -projectile.velocity.X * Main.rand.NextFloat(.5f, .7f) + Main.rand.NextFloat(-3f, 3f);
|
||||
float shardspeedY = -projectile.velocity.Y * Main.rand.Next(50, 70) * 0.01f + Main.rand.Next(-8, 9) * 0.2f;
|
||||
//Prevents the projectile speed from being too low
|
||||
if (shardspeedX < 2f && shardspeedX > -2f)
|
||||
{
|
||||
shardspeedX += -projectile.velocity.X;
|
||||
}
|
||||
if (shardspeedY > 2f && shardspeedY < 2f)
|
||||
{
|
||||
shardspeedY += -projectile.velocity.Y;
|
||||
}
|
||||
|
||||
//Spawn the projectile
|
||||
Projectile.NewProjectile(projectile.position.X + shardspeedX, projectile.position.Y + shardspeedY, shardspeedX, shardspeedY, ModContent.ProjectileType<HoneycombFragment>(), (int)(projectile.damage * 0.3), 2f, projectile.owner, Main.rand.Next(3), 0f);
|
||||
split += 1;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
Texture2D tex = Main.projectileTexture[projectile.type];
|
||||
spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 1);
|
||||
//Dust on impact
|
||||
int dust_splash = 0;
|
||||
while (dust_splash < 9)
|
||||
{
|
||||
Dust.NewDust(projectile.position, projectile.width, projectile.height, 9, -projectile.velocity.X * 0.15f, -projectile.velocity.Y * 0.15f, 159, default, 1.5f);
|
||||
dust_splash += 1;
|
||||
}
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
Item.NewItem((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height, ModContent.ItemType<HardenedHoneycomb>());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 546 B |
@@ -0,0 +1,64 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class HoneycombFragment : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Honeycomb Fragment");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.friendly = true;
|
||||
projectile.width = 14;
|
||||
projectile.height = 14;
|
||||
projectile.Calamity().rogue = true;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
//Changes the texture of the projectile
|
||||
if (projectile.ai[0] == 1f)
|
||||
{
|
||||
Texture2D texture = ModContent.GetTexture("CalamityMod/Projectiles/Rogue/HoneycombFragment2");
|
||||
Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition, new Rectangle?(new Rectangle(0, 0, 12, 14)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture.Width / 2f, 20 / 2f), projectile.scale, SpriteEffects.None, 0f);
|
||||
return false;
|
||||
}
|
||||
if (projectile.ai[0] == 2f)
|
||||
{
|
||||
Texture2D texture = ModContent.GetTexture("CalamityMod/Projectiles/Rogue/HoneycombFragment3");
|
||||
Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition, new Rectangle?(new Rectangle(0, 0, 16, 14)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture.Width / 2f, 20 / 2f), projectile.scale, SpriteEffects.None, 0f);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
//Rotation and gravity
|
||||
projectile.rotation += 0.6f * projectile.direction;
|
||||
projectile.velocity.Y = projectile.velocity.Y + 0.27f;
|
||||
if (projectile.velocity.Y > 16f)
|
||||
{
|
||||
projectile.velocity.Y = 16f;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
//Dust effect
|
||||
int splash = 0;
|
||||
while (splash < 4)
|
||||
{
|
||||
Dust.NewDust(projectile.position, projectile.width, projectile.height, 9, -projectile.velocity.X * 0.15f, -projectile.velocity.Y * 0.10f, 159, default, 0.9f);
|
||||
splash += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 343 B |
Binary file not shown.
|
After Width: | Height: | Size: 268 B |
Binary file not shown.
|
After Width: | Height: | Size: 362 B |
@@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
if (projectile.Calamity().stealthStrike == true)
|
||||
{
|
||||
stealthCounter++;
|
||||
if (stealthCounter == 8 && projectile.owner == Main.myPlayer)
|
||||
if (stealthCounter == 15 && projectile.owner == Main.myPlayer)
|
||||
{
|
||||
Vector2 vector62 = Main.player[projectile.owner].Center - projectile.Center;
|
||||
stealthCounter = 0;
|
||||
@@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
vector63.Normalize();
|
||||
vector63 *= (float)Main.rand.Next(45, 65) * 0.1f;
|
||||
vector63 = vector63.RotatedBy((Main.rand.NextDouble() - 0.5) * 1.5707963705062866, default);
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vector63.X, vector63.Y, ModContent.ProjectileType<ShroomerangSpore>(), (int)((double)projectile.damage * 0.6), projectile.knockBack * 0.2f, projectile.owner, -10f, 0f);
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vector63.X, vector63.Y, ModContent.ProjectileType<ShroomerangSpore>(), (int)((double)projectile.damage * 0.1), projectile.knockBack * 0.2f, projectile.owner, -10f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,6 +79,23 @@ namespace CalamityMod.Projectiles.Summon
|
||||
float scaleFactor18;
|
||||
if (chase >= 0 && Main.projectile[chase].active)
|
||||
{
|
||||
//Delete the player's mechworm if it's attaching to something weird
|
||||
if (Main.projectile[chase].type != ModContent.ProjectileType<MechwormBody2>() &&
|
||||
Main.projectile[chase].type != ModContent.ProjectileType<MechwormBody>() &&
|
||||
Main.projectile[chase].type != ModContent.ProjectileType<MechwormHead>())
|
||||
{
|
||||
for (int i = 0; i < Main.projectile.Length; i++)
|
||||
{
|
||||
if (Main.projectile[i].active && Main.projectile[i].owner == projectile.owner &&
|
||||
(Main.projectile[chase].type == ModContent.ProjectileType<MechwormBody2>() ||
|
||||
Main.projectile[chase].type == ModContent.ProjectileType<MechwormBody>() ||
|
||||
Main.projectile[chase].type == ModContent.ProjectileType<MechwormHead>() ||
|
||||
Main.projectile[chase].type == ModContent.ProjectileType<MechwormTail>()))
|
||||
{
|
||||
Main.projectile[i].Kill();
|
||||
}
|
||||
}
|
||||
}
|
||||
value68 = Main.projectile[chase].Center;
|
||||
Vector2 arg_2DE6A_0 = Main.projectile[chase].velocity;
|
||||
num1064 = Main.projectile[chase].rotation;
|
||||
@@ -113,6 +130,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
projectile.Center = value68 - Vector2.Normalize(vector134) * scaleFactor17 * scaleFactor18;
|
||||
}
|
||||
projectile.spriteDirection = (vector134.X > 0f) ? 1 : -1;
|
||||
projectile.netSpam = 5;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
|
||||
@@ -79,6 +79,23 @@ namespace CalamityMod.Projectiles.Summon
|
||||
float scaleFactor18;
|
||||
if (chase >= 0 && Main.projectile[chase].active)
|
||||
{
|
||||
//Delete the player's mechworm if it's attaching to something weird
|
||||
if (Main.projectile[chase].type != ModContent.ProjectileType<MechwormBody2>() &&
|
||||
Main.projectile[chase].type != ModContent.ProjectileType<MechwormBody>() &&
|
||||
Main.projectile[chase].type != ModContent.ProjectileType<MechwormHead>())
|
||||
{
|
||||
for (int i = 0; i < Main.projectile.Length; i++)
|
||||
{
|
||||
if (Main.projectile[i].active && Main.projectile[i].owner == projectile.owner &&
|
||||
(Main.projectile[chase].type == ModContent.ProjectileType<MechwormBody2>() ||
|
||||
Main.projectile[chase].type == ModContent.ProjectileType<MechwormBody>() ||
|
||||
Main.projectile[chase].type == ModContent.ProjectileType<MechwormHead>() ||
|
||||
Main.projectile[chase].type == ModContent.ProjectileType<MechwormTail>()))
|
||||
{
|
||||
Main.projectile[i].Kill();
|
||||
}
|
||||
}
|
||||
}
|
||||
value68 = Main.projectile[chase].Center;
|
||||
Vector2 arg_2DE6A_0 = Main.projectile[chase].velocity;
|
||||
num1064 = Main.projectile[chase].rotation;
|
||||
@@ -112,6 +129,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
projectile.Center = value68 - Vector2.Normalize(vector134) * scaleFactor17 * scaleFactor18;
|
||||
}
|
||||
projectile.spriteDirection = (vector134.X > 0f) ? 1 : -1;
|
||||
projectile.netSpam = 5;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -208,6 +208,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
projectile.alpha = 0;
|
||||
}
|
||||
}
|
||||
projectile.netSpam = 5;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
|
||||
@@ -79,11 +79,27 @@ namespace CalamityMod.Projectiles.Summon
|
||||
float scaleFactor18;
|
||||
if (chase >= 0 && Main.projectile[chase].active)
|
||||
{
|
||||
//Delete the player's mechworm if it's attaching to something weird
|
||||
if (Main.projectile[chase].type != ModContent.ProjectileType<MechwormBody2>() &&
|
||||
Main.projectile[chase].type != ModContent.ProjectileType<MechwormBody>())
|
||||
{
|
||||
for (int i = 0; i < Main.projectile.Length; i++)
|
||||
{
|
||||
if (Main.projectile[i].active && Main.projectile[i].owner == projectile.owner &&
|
||||
(Main.projectile[chase].type == ModContent.ProjectileType<MechwormBody2>() ||
|
||||
Main.projectile[chase].type == ModContent.ProjectileType<MechwormBody>() ||
|
||||
Main.projectile[chase].type == ModContent.ProjectileType<MechwormHead>() ||
|
||||
Main.projectile[chase].type == ModContent.ProjectileType<MechwormTail>()))
|
||||
{
|
||||
Main.projectile[i].Kill();
|
||||
}
|
||||
}
|
||||
}
|
||||
value68 = Main.projectile[chase].Center;
|
||||
Vector2 arg_2DE6A_0 = Main.projectile[chase].velocity;
|
||||
num1064 = Main.projectile[chase].rotation;
|
||||
scaleFactor18 = MathHelper.Clamp(Main.projectile[chase].scale, 0f, 50f);
|
||||
scaleFactor17 = 16f;
|
||||
scaleFactor17 = 6f;
|
||||
Main.projectile[chase].localAI[0] = projectile.localAI[0] + 1f;
|
||||
}
|
||||
else
|
||||
@@ -113,6 +129,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
projectile.Center = value68 - Vector2.Normalize(vector134) * scaleFactor17 * scaleFactor18;
|
||||
}
|
||||
projectile.spriteDirection = (vector134.X > 0f) ? 1 : -1;
|
||||
projectile.netSpam = 5;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user