Merge branch 'master' of https://github.com/UncleDanny/CalamityMod
This commit is contained in:
commit
fe70e380db
533 files changed
+5539
-5034
No files matched your search
@@ -9,6 +9,7 @@ namespace CalamityMod.Buffs.StatBuffs
|
||||
{
|
||||
DisplayName.SetDefault("Afflicted");
|
||||
Description.SetDefault("Empowered by otherworldly spirits");
|
||||
Main.buffNoTimeDisplay[Type] = true;
|
||||
Main.debuff[Type] = false;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
|
||||
+359
-1105
File diff suppressed because it is too large.
Load diff
@@ -94,11 +94,11 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (lava)
|
||||
{
|
||||
CalamityUtils.AddWithCondition<int>(fishList, ItemID.FlarefinKoi, !modPlayer.ZoneCalamity);
|
||||
CalamityUtils.AddWithCondition<int>(fishList, ItemID.Obsidifish, !modPlayer.ZoneCalamity);
|
||||
CalamityUtils.AddWithCondition<int>(fishList, ModContent.ItemType<CoastalDemonfish>(), modPlayer.ZoneCalamity);
|
||||
CalamityUtils.AddWithCondition<int>(fishList, ModContent.ItemType<Shadowfish>(), modPlayer.ZoneCalamity);
|
||||
CalamityUtils.AddWithCondition<int>(fishList, ModContent.ItemType<BrimstoneFish>(), modPlayer.ZoneCalamity);
|
||||
fishList.AddWithCondition<int>(ItemID.FlarefinKoi, !modPlayer.ZoneCalamity);
|
||||
fishList.AddWithCondition<int>(ItemID.Obsidifish, !modPlayer.ZoneCalamity);
|
||||
fishList.AddWithCondition<int>(ModContent.ItemType<CoastalDemonfish>(), modPlayer.ZoneCalamity);
|
||||
fishList.AddWithCondition<int>(ModContent.ItemType<Shadowfish>(), modPlayer.ZoneCalamity);
|
||||
fishList.AddWithCondition<int>(ModContent.ItemType<BrimstoneFish>(), modPlayer.ZoneCalamity);
|
||||
}
|
||||
else if (water)
|
||||
{
|
||||
@@ -107,24 +107,24 @@ namespace CalamityMod.CalPlayer
|
||||
fishList.Add(ItemID.ArmoredCavefish);
|
||||
fishList.Add(ItemID.Stinkfish);
|
||||
fishList.Add(ItemID.SpecularFish);
|
||||
CalamityUtils.AddWithCondition<int>(fishList, ItemID.ChaosFish, player.ZoneHoly);
|
||||
CalamityUtils.AddWithCondition<int>(fishList, ItemID.VariegatedLardfish, player.ZoneJungle);
|
||||
fishList.AddWithCondition<int>(ItemID.ChaosFish, player.ZoneHoly);
|
||||
fishList.AddWithCondition<int>(ItemID.VariegatedLardfish, player.ZoneJungle);
|
||||
}
|
||||
if (player.ZoneOverworldHeight || player.ZoneSkyHeight)
|
||||
{
|
||||
CalamityUtils.AddWithCondition<int>(fishList, ItemID.DoubleCod, player.ZoneJungle);
|
||||
fishList.AddWithCondition<int>(ItemID.DoubleCod, player.ZoneJungle);
|
||||
}
|
||||
CalamityUtils.AddWithCondition<int>(fishList, ItemID.FrostMinnow, player.ZoneSnow);
|
||||
CalamityUtils.AddWithCondition<int>(fishList, ItemID.Ebonkoi, player.ZoneCorrupt);
|
||||
CalamityUtils.AddWithCondition<int>(fishList, ItemID.CrimsonTigerfish, player.ZoneCrimson);
|
||||
CalamityUtils.AddWithCondition<int>(fishList, ItemID.Hemopiranha, player.ZoneCrimson);
|
||||
CalamityUtils.AddWithCondition<int>(fishList, ItemID.PrincessFish, player.ZoneHoly);
|
||||
CalamityUtils.AddWithCondition<int>(fishList, ItemID.Prismite, player.ZoneHoly);
|
||||
CalamityUtils.AddWithCondition<int>(fishList, ItemID.Damselfish, player.ZoneSkyHeight);
|
||||
CalamityUtils.AddWithCondition<int>(fishList, ModContent.ItemType<AldebaranAlewife>(), modPlayer.ZoneAstral);
|
||||
CalamityUtils.AddWithCondition<int>(fishList, ModContent.ItemType<CoralskinFoolfish>(), modPlayer.ZoneSunkenSea);
|
||||
CalamityUtils.AddWithCondition<int>(fishList, ModContent.ItemType<SunkenSailfish>(), modPlayer.ZoneSunkenSea);
|
||||
CalamityUtils.AddWithCondition<int>(fishList, ModContent.ItemType<ScarredAngelfish>(), modPlayer.ZoneSunkenSea);
|
||||
fishList.AddWithCondition<int>(ItemID.FrostMinnow, player.ZoneSnow);
|
||||
fishList.AddWithCondition<int>(ItemID.Ebonkoi, player.ZoneCorrupt);
|
||||
fishList.AddWithCondition<int>(ItemID.CrimsonTigerfish, player.ZoneCrimson);
|
||||
fishList.AddWithCondition<int>(ItemID.Hemopiranha, player.ZoneCrimson);
|
||||
fishList.AddWithCondition<int>(ItemID.PrincessFish, player.ZoneHoly);
|
||||
fishList.AddWithCondition<int>(ItemID.Prismite, player.ZoneHoly);
|
||||
fishList.AddWithCondition<int>(ItemID.Damselfish, player.ZoneSkyHeight);
|
||||
fishList.AddWithCondition<int>(ModContent.ItemType<AldebaranAlewife>(), modPlayer.ZoneAstral);
|
||||
fishList.AddWithCondition<int>(ModContent.ItemType<CoralskinFoolfish>(), modPlayer.ZoneSunkenSea);
|
||||
fishList.AddWithCondition<int>(ModContent.ItemType<SunkenSailfish>(), modPlayer.ZoneSunkenSea);
|
||||
fishList.AddWithCondition<int>(ModContent.ItemType<ScarredAngelfish>(), modPlayer.ZoneSunkenSea);
|
||||
}
|
||||
|
||||
if (fishList.Any())
|
||||
@@ -228,9 +228,9 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
rareItemList.Add(ItemID.ScalyTruffle);
|
||||
}
|
||||
CalamityUtils.AddWithCondition<int>(rareItemList, ItemID.Toxikarp, player.ZoneCorrupt);
|
||||
CalamityUtils.AddWithCondition<int>(rareItemList, ItemID.Bladetongue, player.ZoneCrimson);
|
||||
CalamityUtils.AddWithCondition<int>(rareItemList, ItemID.CrystalSerpent, player.ZoneHoly);
|
||||
rareItemList.AddWithCondition<int>(ItemID.Toxikarp, player.ZoneCorrupt);
|
||||
rareItemList.AddWithCondition<int>(ItemID.Bladetongue, player.ZoneCrimson);
|
||||
rareItemList.AddWithCondition<int>(ItemID.CrystalSerpent, player.ZoneHoly);
|
||||
|
||||
if (rareItemList.Any())
|
||||
{
|
||||
@@ -247,15 +247,15 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
List<int> biomeCrateList = new List<int>();
|
||||
|
||||
CalamityUtils.AddWithCondition<int>(biomeCrateList, ModContent.ItemType<AstralCrate>(), modPlayer.ZoneAstral);
|
||||
CalamityUtils.AddWithCondition<int>(biomeCrateList, ModContent.ItemType<SunkenCrate>(), modPlayer.ZoneSunkenSea);
|
||||
CalamityUtils.AddWithCondition<int>(biomeCrateList, ModContent.ItemType<AbyssalCrate>(), canSulphurFish);
|
||||
CalamityUtils.AddWithCondition<int>(biomeCrateList, ItemID.CorruptFishingCrate, player.ZoneCorrupt);
|
||||
CalamityUtils.AddWithCondition<int>(biomeCrateList, ItemID.CrimsonFishingCrate, player.ZoneCrimson);
|
||||
CalamityUtils.AddWithCondition<int>(biomeCrateList, ItemID.HallowedFishingCrate, player.ZoneHoly);
|
||||
CalamityUtils.AddWithCondition<int>(biomeCrateList, ItemID.DungeonFishingCrate, player.ZoneDungeon);
|
||||
CalamityUtils.AddWithCondition<int>(biomeCrateList, ItemID.JungleFishingCrate, player.ZoneJungle);
|
||||
CalamityUtils.AddWithCondition<int>(biomeCrateList, ItemID.FloatingIslandFishingCrate, player.ZoneSkyHeight);
|
||||
biomeCrateList.AddWithCondition<int>(ModContent.ItemType<AstralCrate>(), modPlayer.ZoneAstral);
|
||||
biomeCrateList.AddWithCondition<int>(ModContent.ItemType<SunkenCrate>(), modPlayer.ZoneSunkenSea);
|
||||
biomeCrateList.AddWithCondition<int>(ModContent.ItemType<AbyssalCrate>(), canSulphurFish);
|
||||
biomeCrateList.AddWithCondition<int>(ItemID.CorruptFishingCrate, player.ZoneCorrupt);
|
||||
biomeCrateList.AddWithCondition<int>(ItemID.CrimsonFishingCrate, player.ZoneCrimson);
|
||||
biomeCrateList.AddWithCondition<int>(ItemID.HallowedFishingCrate, player.ZoneHoly);
|
||||
biomeCrateList.AddWithCondition<int>(ItemID.DungeonFishingCrate, player.ZoneDungeon);
|
||||
biomeCrateList.AddWithCondition<int>(ItemID.JungleFishingCrate, player.ZoneJungle);
|
||||
biomeCrateList.AddWithCondition<int>(ItemID.FloatingIslandFishingCrate, player.ZoneSkyHeight);
|
||||
|
||||
if (biomeCrateList.Any())
|
||||
{
|
||||
|
||||
@@ -354,7 +354,7 @@ namespace CalamityMod.CalPlayer
|
||||
modPlayer.AdrenalinePacket(false);
|
||||
modPlayer.DeathModeUnderworldTimePacket(false);
|
||||
modPlayer.DeathModeBlizzardTimePacket(false);
|
||||
//modPlayer.AquaticBoostPacket(false);
|
||||
modPlayer.AquaticBoostPacket(false);
|
||||
modPlayer.MoveSpeedStatPacket(false);
|
||||
modPlayer.DefenseDamagePacket(false);
|
||||
}
|
||||
@@ -3367,10 +3367,13 @@ namespace CalamityMod.CalPlayer
|
||||
if (Main.rand.NextBool(10))
|
||||
{
|
||||
Vector2 velocity = CalamityUtils.RandomVelocity(50f, 30f, 60f);
|
||||
int spark = Projectile.NewProjectile(npc.Center, velocity, ModContent.ProjectileType<EutrophicSpark>(), damage / 2, 0f, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[spark].Calamity().forceTypeless = true;
|
||||
Main.projectile[spark].localNPCHitCooldown = -2;
|
||||
Main.projectile[spark].penetrate = 5;
|
||||
int spark = Projectile.NewProjectile(npc.Center, velocity, ModContent.ProjectileType<EutrophicSpark>(), damage / 2, 0f, player.whoAmI);
|
||||
if (spark.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[spark].Calamity().forceTypeless = true;
|
||||
Main.projectile[spark].localNPCHitCooldown = -2;
|
||||
Main.projectile[spark].penetrate = 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
+2
-1
@@ -357,7 +357,8 @@ namespace CalamityMod
|
||||
ModContent.ProjectileType<TyphonsGreedStaff>(),
|
||||
ModContent.ProjectileType<UrchinSpearProjectile>(),
|
||||
ModContent.ProjectileType<YateveoBloomSpear>(),
|
||||
ModContent.ProjectileType<HydraulicVoltCrasherProjectile>()
|
||||
ModContent.ProjectileType<HydraulicVoltCrasherProjectile>(),
|
||||
ModContent.ProjectileType<DragonRageStaff>()
|
||||
};
|
||||
|
||||
rangedProjectileExceptionList = new List<int>()
|
||||
|
||||
+2
-2
@@ -138,9 +138,8 @@ namespace CalamityMod
|
||||
|
||||
ILChanges.Load();
|
||||
BossRushEvent.Load();
|
||||
|
||||
BossHealthBarManager.Load(this);
|
||||
|
||||
DraedonStructures.Load();
|
||||
CalamityLists.LoadLists();
|
||||
SetupVanillaDR();
|
||||
SetupBossKillTimes();
|
||||
@@ -267,6 +266,7 @@ namespace CalamityMod
|
||||
BossRushEvent.Unload();
|
||||
SchematicManager.Unload();
|
||||
BossHealthBarManager.Unload();
|
||||
DraedonStructures.Unload();
|
||||
|
||||
TileFraming.Unload();
|
||||
|
||||
|
||||
+1
-1
@@ -267,7 +267,7 @@ namespace CalamityMod
|
||||
StressSync,
|
||||
AdrenalineSync,
|
||||
|
||||
//AquaticBoostSync,
|
||||
AquaticBoostSync,
|
||||
|
||||
TeleportPlayer,
|
||||
BossRushStage,
|
||||
|
||||
+32
-11
@@ -1,4 +1,6 @@
|
||||
using CalamityMod.Tiles.DraedonStructures;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Mono.Cecil.Cil;
|
||||
using MonoMod.Cil;
|
||||
using System;
|
||||
@@ -7,6 +9,7 @@ using System.Reflection;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.World.Generation;
|
||||
|
||||
namespace CalamityMod.ILEditing
|
||||
{
|
||||
@@ -48,7 +51,7 @@ namespace CalamityMod.ILEditing
|
||||
|
||||
ApplyLifeBytesChanges();
|
||||
ApplyBossZenDuringSlimeRain();
|
||||
SlideDungeonOver();
|
||||
PreventDungeonAbyssInteraction();
|
||||
BlockLivingTreesNearOcean();
|
||||
LabDoorFixes();
|
||||
AlterTownNPCSpawnRate();
|
||||
@@ -68,23 +71,41 @@ namespace CalamityMod.ILEditing
|
||||
|
||||
private static void ApplyBossZenDuringSlimeRain() => On.Terraria.NPC.SlimeRainSpawns += PreventBossSlimeRainSpawns;
|
||||
|
||||
private static void SlideDungeonOver()
|
||||
private static void PreventDungeonAbyssInteraction()
|
||||
{
|
||||
IL.Terraria.WorldGen.MakeDungeon += (il) =>
|
||||
// Prevent the Dungeon from appearing near the Sulph sea.
|
||||
IL.Terraria.WorldGen.MakeDungeon += il =>
|
||||
{
|
||||
var cursor = new ILCursor(il);
|
||||
if (!cursor.TryGotoNext(i => i.MatchStsfld("Terraria.WorldGen", "dMaxY")))
|
||||
{
|
||||
CalamityMod.Instance.Logger.Warn("Dungeon movement editing code failed.");
|
||||
return;
|
||||
}
|
||||
cursor.Index++;
|
||||
cursor.GotoNext(MoveType.After, i => i.MatchStsfld<WorldGen>("dungeonY"));
|
||||
|
||||
cursor.EmitDelegate<Action>(() =>
|
||||
{
|
||||
WorldGen.dungeonX += (WorldGen.dungeonX < Main.maxTilesX / 2).ToDirectionInt() * 450;
|
||||
WorldGen.dungeonX = Utils.Clamp(WorldGen.dungeonX, 200, Main.maxTilesX - 200);
|
||||
WorldGen.dungeonX = Utils.Clamp(WorldGen.dungeonX, SulphurousSea.BiomeWidth + 100, Main.maxTilesX - SulphurousSea.BiomeWidth - 100);
|
||||
|
||||
// Adjust the Y position of the dungeon to accomodate for the X shift.
|
||||
WorldUtils.Find(new Point(WorldGen.dungeonX, WorldGen.dungeonY), Searches.Chain(new Searches.Down(9001), new Conditions.IsSolid()), out Point result);
|
||||
WorldGen.dungeonY = result.Y - 10;
|
||||
});
|
||||
};
|
||||
|
||||
// And prevent its halls from getting anywhere near the Abyss.
|
||||
IL.Terraria.WorldGen.DungeonHalls += il =>
|
||||
{
|
||||
var cursor = new ILCursor(il);
|
||||
|
||||
// Forcefully clamp the X position of the new hall end.
|
||||
// This prevents a hall, and as a result, the dungeon, from ever impeding on the Abyss/Sulph Sea.
|
||||
cursor.GotoNext(MoveType.After, i => i.MatchStloc(6));
|
||||
|
||||
cursor.Emit(OpCodes.Ldloc, 6);
|
||||
cursor.EmitDelegate<Func<Vector2, Vector2>>(unclampedValue =>
|
||||
{
|
||||
unclampedValue.X = MathHelper.Clamp(unclampedValue.X, SulphurousSea.BiomeWidth + 25, Main.maxTilesX - SulphurousSea.BiomeWidth - 25);
|
||||
return unclampedValue;
|
||||
});
|
||||
cursor.Emit(OpCodes.Stloc, 6);
|
||||
};
|
||||
}
|
||||
|
||||
private static void BlockLivingTreesNearOcean()
|
||||
|
||||
@@ -38,9 +38,13 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
Projectile rain = CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType<AuraRain>(), (int)(60 * player.AverageDamage()), 2f, player.whoAmI, 6, 1);
|
||||
rain.tileCollide = false;
|
||||
rain.penetrate = 1;
|
||||
Projectile rain = CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType<AuraRain>(), (int)(60 * player.AverageDamage()), 2f, player.whoAmI);
|
||||
if (rain.whoAmI.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
rain.Calamity().forceTypeless = true;
|
||||
rain.tileCollide = false;
|
||||
rain.penetrate = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ namespace CalamityMod.Items.Accessories
|
||||
item.accessory = true;
|
||||
item.expert = true;
|
||||
item.rare = ItemRarityID.Purple;
|
||||
item.Calamity().customRarity = CalamityRarity.Turquoise;
|
||||
item.value = CalamityGlobalItem.Rarity12BuyPrice;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,28 +33,18 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
if (Main.rand.NextBool(15))
|
||||
{
|
||||
for (int i = 0; i < Main.rand.Next(3,7); i++)
|
||||
int cloudCount = Main.rand.Next(2,5);
|
||||
for (int i = 0; i < cloudCount; i++)
|
||||
{
|
||||
int type = -1;
|
||||
switch (Main.rand.Next(3))
|
||||
{
|
||||
case 0:
|
||||
type = ModContent.ProjectileType<Corrocloud1>();
|
||||
break;
|
||||
case 1:
|
||||
type = ModContent.ProjectileType<Corrocloud2>();
|
||||
break;
|
||||
case 2:
|
||||
type = ModContent.ProjectileType<Corrocloud3>();
|
||||
break;
|
||||
}
|
||||
// Should never happen, but just in case-
|
||||
if (type != -1)
|
||||
{
|
||||
float speed = Main.rand.NextFloat(3f, 11f);
|
||||
Projectile.NewProjectile(player.Center, Vector2.One.RotatedByRandom(MathHelper.TwoPi) * speed,
|
||||
type, (int)(100 * player.RogueDamage()), 0f, player.whoAmI);
|
||||
}
|
||||
int type = Utils.SelectRandom(Main.rand, new int[]
|
||||
{
|
||||
ModContent.ProjectileType<Corrocloud1>(),
|
||||
ModContent.ProjectileType<Corrocloud2>(),
|
||||
ModContent.ProjectileType<Corrocloud3>()
|
||||
});
|
||||
float speed = Main.rand.NextFloat(3f, 11f);
|
||||
Projectile.NewProjectile(player.Center, Vector2.One.RotatedByRandom(MathHelper.TwoPi) * speed,
|
||||
type, (int)(100 * player.RogueDamage()), 0f, player.whoAmI);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
item.width = 16;
|
||||
item.height = 14;
|
||||
item.value = CalamityGlobalItem.Rarity13BuyPrice;
|
||||
item.value = CalamityGlobalItem.Rarity14BuyPrice;
|
||||
item.accessory = true;
|
||||
item.expert = true;
|
||||
item.rare = 10;
|
||||
|
||||
@@ -33,9 +33,13 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
Projectile rain = CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType<AuraRain>(), (int)(18 * player.AverageDamage()), 2f, player.whoAmI, 6, 1);
|
||||
rain.tileCollide = false;
|
||||
rain.penetrate = 1;
|
||||
Projectile rain = CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType<AuraRain>(), (int)(18 * player.AverageDamage()), 2f, player.whoAmI);
|
||||
if (rain.whoAmI.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
rain.Calamity().forceTypeless = true;
|
||||
rain.tileCollide = false;
|
||||
rain.penetrate = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,7 +104,13 @@ namespace CalamityMod.Items.Accessories
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
int type = Main.rand.NextBool(2) ? ProjectileType<AuraRain>() : ProjectileType<StandingFire>();
|
||||
Projectile rain = CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 22f, type, (int)(ProjectileDamage * player.AverageDamage()), 5f, player.whoAmI, 6, 1);
|
||||
Projectile rain = CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 22f, type, (int)(ProjectileDamage * player.AverageDamage()), 5f, player.whoAmI);
|
||||
if (rain.whoAmI.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
rain.Calamity().forceTypeless = true;
|
||||
rain.usesLocalNPCImmunity = true;
|
||||
rain.localNPCHitCooldown = 10;
|
||||
}
|
||||
if (type == ProjectileType<AuraRain>())
|
||||
{
|
||||
rain.tileCollide = false;
|
||||
|
||||
@@ -85,7 +85,12 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType<StandingFire>(), (int)(30 * player.AverageDamage()), 5f, player.whoAmI, 0, 1, 60);
|
||||
Projectile fire = CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType<StandingFire>(), (int)(30 * player.AverageDamage()), 5f, player.whoAmI);
|
||||
if (fire.whoAmI.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
fire.usesLocalNPCImmunity = true;
|
||||
fire.localNPCHitCooldown = 60;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,8 +84,11 @@ namespace CalamityMod.Items.Accessories.Wings
|
||||
if (player.controlJump && !player.jumpAgainCloud && player.jump == 0 && player.velocity.Y != 0f && !player.mount.Active && !player.mount.Cart)
|
||||
{
|
||||
int p = Projectile.NewProjectile(player.Center.X, player.Center.Y, player.velocity.X * 0f, 2f, ModContent.ProjectileType<FrostShardFriendly>(), (int)(25 * player.AverageDamage()), 3f, player.whoAmI, 1f);
|
||||
Main.projectile[p].Calamity().forceTypeless = true;
|
||||
Main.projectile[p].frame = Main.rand.Next(5);
|
||||
if (p.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[p].Calamity().forceTypeless = true;
|
||||
Main.projectile[p].frame = Main.rand.Next(5);
|
||||
}
|
||||
modPlayer.icicleCooldown = 10;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
item.width = 20;
|
||||
item.height = 22;
|
||||
item.value = CalamityGlobalItem.Rarity14BuyPrice;
|
||||
item.value = CalamityGlobalItem.Rarity15BuyPrice;
|
||||
item.accessory = true;
|
||||
item.expert = true;
|
||||
item.rare = 10;
|
||||
@@ -33,14 +33,14 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
player.allDamage += 0.15f;
|
||||
player.statDefense += 30;
|
||||
if ((double)player.velocity.X > 0 || (double)player.velocity.Y > 0 || (double)player.velocity.X < -0.1 || (double)player.velocity.Y < -0.1)
|
||||
if (!player.StandingStill())
|
||||
{
|
||||
dragonTimer--;
|
||||
if (dragonTimer <= 0)
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
int projectile1 = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ModContent.ProjectileType<DragonDust>(), (int)(350 * player.AverageDamage()), 5f, player.whoAmI, 0f, 0f);
|
||||
int projectile1 = Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType<DragonDust>(), (int)(350 * player.AverageDamage()), 5f, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[projectile1].timeLeft = 60;
|
||||
}
|
||||
dragonTimer = 60;
|
||||
@@ -56,24 +56,7 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
for (int l = 0; l < 1; l++)
|
||||
{
|
||||
float x = player.position.X + (float)Main.rand.Next(-400, 400);
|
||||
float y = player.position.Y - (float)Main.rand.Next(500, 800);
|
||||
Vector2 vector = new Vector2(x, y);
|
||||
float num15 = player.position.X + (float)(player.width / 2) - vector.X;
|
||||
float num16 = player.position.Y + (float)(player.height / 2) - vector.Y;
|
||||
num15 += (float)Main.rand.Next(-100, 101);
|
||||
int num17 = 22;
|
||||
float num18 = (float)Math.Sqrt((double)(num15 * num15 + num16 * num16));
|
||||
num18 = (float)num17 / num18;
|
||||
num15 *= num18;
|
||||
num16 *= num18;
|
||||
int num19 = Projectile.NewProjectile(x, y, num15, num16, ModContent.ProjectileType<SkyFlareFriendly>(), (int)(750 * player.AverageDamage()), 9f, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[num19].ai[1] = player.position.Y;
|
||||
Main.projectile[num19].hostile = false;
|
||||
Main.projectile[num19].friendly = true;
|
||||
}
|
||||
CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType<SkyFlareFriendly>(), (int)(750 * player.AverageDamage()), 9f, player.whoAmI);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,8 @@ namespace CalamityMod.Items.Armor
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Hydrothermic Mask");
|
||||
Tooltip.SetDefault("12% increased magic damage, reduces mana usage by 15%, and 10% increased magic critical strike chance\n" +
|
||||
"+100 max mana, temporary immunity to lava, and immunity to fire damage");
|
||||
Tooltip.SetDefault("12% increased magic damage, +100 max mana, and 10% increased magic critical strike chance\n" +
|
||||
"Temporary immunity to lava, and immunity to fire damage");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
@@ -55,7 +55,7 @@ namespace CalamityMod.Items.Armor
|
||||
|
||||
public override void UpdateArmorSet(Player player)
|
||||
{
|
||||
player.setBonus = "5% increased magic damage\n" +
|
||||
player.setBonus = "5% increased magic damage and 15% reduced mana usage\n" +
|
||||
"Inferno effect when below 50% life\n" +
|
||||
"Magic attacks summon damaging and healing flare orbs on hit\n" +
|
||||
"You have a 20% chance to emit a blazing explosion when you are hit";
|
||||
@@ -63,11 +63,11 @@ namespace CalamityMod.Items.Armor
|
||||
modPlayer.ataxiaBlaze = true;
|
||||
modPlayer.ataxiaMage = true;
|
||||
player.magicDamage += 0.05f;
|
||||
player.manaCost *= 0.85f;
|
||||
}
|
||||
|
||||
public override void UpdateEquip(Player player)
|
||||
{
|
||||
player.manaCost *= 0.85f;
|
||||
player.statManaMax2 += 100;
|
||||
player.magicDamage += 0.12f;
|
||||
player.magicCrit += 10;
|
||||
|
||||
@@ -79,7 +79,9 @@ namespace CalamityMod.Items.Armor
|
||||
{
|
||||
if (Main.rand.NextBool(10))
|
||||
{
|
||||
CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType<TheSyringeCinder>(), (int)(40 * player.RangedDamage()), 4f, player.whoAmI, 6);
|
||||
Projectile cinder = CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType<TheSyringeCinder>(), (int)(40 * player.RangedDamage()), 4f, player.whoAmI);
|
||||
if (cinder.whoAmI.WithinBounds(Main.maxProjectiles))
|
||||
cinder.Calamity().forceTypeless = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+48
-67
@@ -391,7 +391,8 @@ namespace CalamityMod.Items
|
||||
{
|
||||
Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.ToRadians(i));
|
||||
int rocket = Projectile.NewProjectile(position, perturbedSpeed, ModContent.ProjectileType<MiniRocket>(), CalamityUtils.DamageSoftCap(damage * 0.8, 200), 2f, player.whoAmI);
|
||||
Main.projectile[rocket].Calamity().forceTypeless = true;
|
||||
if (rocket.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[rocket].Calamity().forceTypeless = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -406,9 +407,12 @@ namespace CalamityMod.Items
|
||||
float spreadX = speedX + Main.rand.NextFloat(-0.75f, 0.75f);
|
||||
float spreadY = speedY + Main.rand.NextFloat(-0.75f, 0.75f);
|
||||
int feather = Projectile.NewProjectile(position, new Vector2(spreadX, spreadY) * 1.25f, ModContent.ProjectileType<TradewindsProjectile>(), CalamityUtils.DamageSoftCap(damage * 0.5, 75), 2f, player.whoAmI);
|
||||
Main.projectile[feather].usesLocalNPCImmunity = true;
|
||||
Main.projectile[feather].localNPCHitCooldown = 10;
|
||||
Main.projectile[feather].Calamity().forceTypeless = true;
|
||||
if (feather.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[feather].usesLocalNPCImmunity = true;
|
||||
Main.projectile[feather].localNPCHitCooldown = 10;
|
||||
Main.projectile[feather].Calamity().forceTypeless = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -608,11 +612,13 @@ namespace CalamityMod.Items
|
||||
case 1: //big boomer
|
||||
case 2: //boomer
|
||||
int proj = Projectile.NewProjectile(player.Center, perturbedspeed, ModContent.ProjectileType<ProfanedCrystalRangedHuges>(), dam, 0f, player.whoAmI, projType == 1 ? 1f : 0f);
|
||||
Main.projectile[proj].Calamity().forceMinion = true;
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().forceMinion = true;
|
||||
break;
|
||||
case 3: //bab boomer
|
||||
int proj2 = Projectile.NewProjectile(player.Center, perturbedspeed, ModContent.ProjectileType<ProfanedCrystalRangedSmalls>(), dam, 0f, player.whoAmI, 0f);
|
||||
Main.projectile[proj2].Calamity().forceMinion = true;
|
||||
if (proj2.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj2].Calamity().forceMinion = true;
|
||||
break;
|
||||
}
|
||||
if (projType > 1)
|
||||
@@ -648,7 +654,8 @@ namespace CalamityMod.Items
|
||||
dam -= sickPenalty;
|
||||
}
|
||||
int proj = Projectile.NewProjectile(player.position, correctedVelocity, ModContent.ProjectileType<ProfanedCrystalMageFireball>(), dam, 1f, player.whoAmI, enrage ? 1f : 0f);
|
||||
Main.projectile[proj].Calamity().forceMinion = true;
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().forceMinion = true;
|
||||
player.Calamity().profanedSoulWeaponUsage = enrage ? 20 : 25;
|
||||
}
|
||||
if (player.Calamity().profanedSoulWeaponUsage > 0)
|
||||
@@ -667,7 +674,8 @@ namespace CalamityMod.Items
|
||||
{
|
||||
float angle = MathHelper.TwoPi / crystalCount * i;
|
||||
int proj = Projectile.NewProjectile(player.Center, angle.ToRotationVector2() * 8f, ModContent.ProjectileType<ProfanedCrystalRogueShard>(), (int)((shouldNerf ? 300 : 880) * player.MinionDamage()), 1f, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[proj].Calamity().forceMinion = true;
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().forceMinion = true;
|
||||
Main.PlaySound(SoundID.Item20, player.Center);
|
||||
}
|
||||
player.Calamity().profanedSoulWeaponUsage = 0;
|
||||
@@ -676,7 +684,8 @@ namespace CalamityMod.Items
|
||||
{
|
||||
float angle = MathHelper.TwoPi / (enrage ? 9 : 18) * (player.Calamity().profanedSoulWeaponUsage / (enrage ? 1 : 10));
|
||||
int proj = Projectile.NewProjectile(player.Center, angle.ToRotationVector2() * 8f, ModContent.ProjectileType<ProfanedCrystalRogueShard>(), (int)((shouldNerf ? 400 : 1100) * player.MinionDamage()), 1f, player.whoAmI, 1f, 0f);
|
||||
Main.projectile[proj].Calamity().forceMinion = true;
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().forceMinion = true;
|
||||
Main.PlaySound(SoundID.Item20, player.Center);
|
||||
}
|
||||
player.Calamity().profanedSoulWeaponUsage += enrage ? 1 : 2;
|
||||
@@ -740,26 +749,29 @@ namespace CalamityMod.Items
|
||||
Projectile blade = Projectile.NewProjectileDirect(robot.Center + (robot.spriteDirection > 0).ToDirectionInt() * robot.width / 2 * Vector2.UnitX,
|
||||
Vector2.Zero, ModContent.ProjectileType<AndromedaRegislash>(), damage, 15f, player.whoAmI, Projectile.GetByUUID(robot.owner, robot.whoAmI));
|
||||
|
||||
if (item.Calamity().rogue)
|
||||
{
|
||||
blade.Calamity().forceRogue = true;
|
||||
}
|
||||
if (item.melee)
|
||||
{
|
||||
blade.Calamity().forceMelee = true;
|
||||
}
|
||||
if (item.ranged)
|
||||
{
|
||||
blade.Calamity().forceRanged = true;
|
||||
}
|
||||
if (item.magic)
|
||||
{
|
||||
blade.Calamity().forceMagic = true;
|
||||
}
|
||||
if (item.summon)
|
||||
{
|
||||
blade.Calamity().forceMinion = true;
|
||||
}
|
||||
if (blade.whoAmI.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
if (item.Calamity().rogue)
|
||||
{
|
||||
blade.Calamity().forceRogue = true;
|
||||
}
|
||||
if (item.melee)
|
||||
{
|
||||
blade.Calamity().forceMelee = true;
|
||||
}
|
||||
if (item.ranged)
|
||||
{
|
||||
blade.Calamity().forceRanged = true;
|
||||
}
|
||||
if (item.magic)
|
||||
{
|
||||
blade.Calamity().forceMagic = true;
|
||||
}
|
||||
if (item.summon)
|
||||
{
|
||||
blade.Calamity().forceMinion = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!robotModProjectile.TopIconActive &&
|
||||
@@ -3384,10 +3396,13 @@ Grants immunity to fire blocks, and temporary immunity to lava";
|
||||
{
|
||||
if (player.controlJump && !player.jumpAgainCloud && player.jump == 0 && player.velocity.Y != 0f && !player.mount.Active && !player.mount.Cart)
|
||||
{
|
||||
int p = Projectile.NewProjectile(player.Center.X, player.Center.Y, player.velocity.X * 0f, 2f, ProjectileID.OrnamentFriendly, (int)(100 * player.AverageDamage()), 5f, player.whoAmI);
|
||||
Main.projectile[p].Calamity().forceTypeless = true;
|
||||
Main.projectile[p].Calamity().lineColor = 1;
|
||||
modPlayer.icicleCooldown = 10;
|
||||
int p = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 2f, ProjectileID.OrnamentFriendly, (int)(100 * player.AverageDamage()), 5f, player.whoAmI);
|
||||
if (p.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[p].Calamity().forceTypeless = true;
|
||||
Main.projectile[p].Calamity().lineColor = 1;
|
||||
modPlayer.icicleCooldown = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3593,40 +3608,6 @@ Grants immunity to fire blocks, and temporary immunity to lava";
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region The Horseman's Blade
|
||||
public static void HorsemansBladeOnHit(Player player, int targetIdx, int damage, float knockback, bool hasExtraUpdates)
|
||||
{
|
||||
int x = Main.rand.Next(100, 300);
|
||||
int y = Main.rand.Next(100, 300);
|
||||
|
||||
// Pick a random side: left or right
|
||||
if (Main.rand.NextBool(2))
|
||||
x -= Main.LogicCheckScreenWidth / 2 + x;
|
||||
else
|
||||
x += Main.LogicCheckScreenWidth / 2 - x;
|
||||
|
||||
// Pick a random side: top or bottom
|
||||
if (Main.rand.NextBool(2))
|
||||
y -= Main.LogicCheckScreenHeight / 2 + y;
|
||||
else
|
||||
y += Main.LogicCheckScreenHeight / 2 - y;
|
||||
|
||||
x += (int)player.position.X;
|
||||
y += (int)player.position.Y;
|
||||
float speed = 8f;
|
||||
Vector2 vector = new Vector2((float)x, (float)y);
|
||||
float dx = Main.npc[targetIdx].position.X - vector.X;
|
||||
float dy = Main.npc[targetIdx].position.Y - vector.Y;
|
||||
float dist = (float)Math.Sqrt(dx * dx + dy * dy);
|
||||
dist = speed / dist;
|
||||
dx *= dist;
|
||||
dy *= dist;
|
||||
int projectile = Projectile.NewProjectile(x, y, dx, dy, ProjectileID.FlamingJack, damage, knockback, player.whoAmI, targetIdx, 0f);
|
||||
if (hasExtraUpdates)
|
||||
Main.projectile[projectile].extraUpdates += 1;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Ammo
|
||||
public override bool ConsumeAmmo(Item item, Player player) => Main.rand.NextFloat() <= player.Calamity().rangedAmmoCost;
|
||||
|
||||
|
||||
@@ -47,7 +47,8 @@ namespace CalamityMod.Items.Fishing.AstralCatches
|
||||
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType<GacruxianProj>(), damage, knockBack, player.whoAmI, 0f, 1f);
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -79,7 +79,8 @@ namespace CalamityMod.Items.Mounts
|
||||
int damage = (int)(180 * player.AverageDamage());
|
||||
float kb = 1f;
|
||||
Projectile birb = Projectile.NewProjectileDirect(pos, vel, ModContent.ProjectileType<Minibirb>(), damage, kb, player.whoAmI);
|
||||
birb.Calamity().forceTypeless = true;
|
||||
if (birb.whoAmI.WithinBounds(Main.maxProjectiles))
|
||||
birb.Calamity().forceTypeless = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,8 +43,9 @@ namespace CalamityMod.Items.Potions.Alcohol
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ItemID.CrystalShard);
|
||||
recipe.AddIngredient(ModContent.ItemType<BloodOrb>(), 40);
|
||||
recipe.AddIngredient(ItemID.BottledWater);
|
||||
recipe.AddIngredient(ItemID.Ale);
|
||||
recipe.AddTile(TileID.AlchemyTable);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
|
||||
@@ -45,6 +45,7 @@ namespace CalamityMod.Items.Potions
|
||||
recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ItemID.BottledWater);
|
||||
recipe.AddIngredient(ModContent.ItemType<BloodOrb>(), 20);
|
||||
recipe.AddIngredient(ModContent.ItemType<EssenceofCinder>());
|
||||
recipe.AddTile(TileID.AlchemyTable);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
|
||||
@@ -46,6 +46,7 @@ namespace CalamityMod.Items.Potions
|
||||
recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ItemID.BottledWater);
|
||||
recipe.AddIngredient(ModContent.ItemType<BloodOrb>(), 40);
|
||||
recipe.AddIngredient(ModContent.ItemType<EssenceofCinder>());
|
||||
recipe.AddTile(TileID.AlchemyTable);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
|
||||
@@ -47,6 +47,7 @@ namespace CalamityMod.Items.Potions
|
||||
recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ItemID.BottledWater);
|
||||
recipe.AddIngredient(ModContent.ItemType<BloodOrb>(), 30);
|
||||
recipe.AddIngredient(ItemID.SoulofFlight);
|
||||
recipe.AddTile(TileID.AlchemyTable);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
|
||||
+23
-3
@@ -7,10 +7,13 @@ namespace CalamityMod.Items.Tools
|
||||
{
|
||||
public class Grax : ModItem
|
||||
{
|
||||
private static int HammerPower = 200;
|
||||
private static int AxePower = 50;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Grax");
|
||||
Tooltip.SetDefault("Hitting an enemy will greatly boost your defense and melee stats for a short time");
|
||||
Tooltip.SetDefault("Hitting an enemy will greatly boost your defense and melee stats for a short time\n" +
|
||||
"Right click to use without hammering down walls or chopping down trees");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
@@ -24,8 +27,8 @@ namespace CalamityMod.Items.Tools
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
item.useTime = 4;
|
||||
item.useTurn = true;
|
||||
item.axe = 50;
|
||||
item.hammer = 200;
|
||||
item.axe = AxePower;
|
||||
item.hammer = HammerPower;
|
||||
item.knockBack = 8f;
|
||||
item.UseSound = SoundID.Item1;
|
||||
item.autoReuse = true;
|
||||
@@ -35,6 +38,23 @@ namespace CalamityMod.Items.Tools
|
||||
item.Calamity().customRarity = CalamityRarity.Turquoise;
|
||||
}
|
||||
|
||||
public override bool AltFunctionUse(Player player) => true;
|
||||
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
if (player.altFunctionUse == 2)
|
||||
{
|
||||
item.axe = 0;
|
||||
item.hammer = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
item.axe = AxePower;
|
||||
item.hammer = HammerPower;
|
||||
}
|
||||
return base.CanUseItem(player);
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
|
||||
@@ -117,8 +117,9 @@ namespace CalamityMod.Items.Tools
|
||||
num340 *= 1.5f;
|
||||
num342 *= (float)player.direction;
|
||||
num341 *= player.gravDir;
|
||||
int spark = Projectile.NewProjectile((float)(hitbox.X + hitbox.Width / 2) + num342, (float)(hitbox.Y + hitbox.Height / 2) + num341, (float)player.direction * num340, num339 * player.gravDir, ProjectileID.Spark, (int)(item.damage * 0.2f * player.MeleeDamage()), 0f, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[spark].Calamity().forceMelee = true;
|
||||
int spark = Projectile.NewProjectile((float)(hitbox.X + hitbox.Width / 2) + num342, (float)(hitbox.Y + hitbox.Height / 2) + num341, (float)player.direction * num340, num339 * player.gravDir, ProjectileID.Spark, (int)(item.damage * 0.2f * player.MeleeDamage()), 0f, player.whoAmI);
|
||||
if (spark.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[spark].Calamity().forceMelee = true;
|
||||
}
|
||||
}
|
||||
if (Main.rand.NextBool(4))
|
||||
@@ -131,8 +132,9 @@ namespace CalamityMod.Items.Tools
|
||||
{
|
||||
if (crit)
|
||||
{
|
||||
int boom = Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType<FuckYou>(), (int)(item.damage * player.MeleeDamage()), knockback, player.whoAmI, 0f, 0.85f + Main.rand.NextFloat() * 1.15f);
|
||||
Main.projectile[boom].Calamity().forceMelee = true;
|
||||
int boom = Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType<FuckYou>(), (int)(item.damage * player.MeleeDamage()), knockback, player.whoAmI, 0f, 0.85f + Main.rand.NextFloat() * 1.15f);
|
||||
if (boom.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[boom].Calamity().forceMelee = true;
|
||||
}
|
||||
target.AddBuff(BuffID.OnFire, 300);
|
||||
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 300);
|
||||
|
||||
@@ -43,10 +43,7 @@ namespace CalamityMod.Items.Tools
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool AltFunctionUse(Player player)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public override bool AltFunctionUse(Player player) => true;
|
||||
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace CalamityMod.Items.TreasureBags
|
||||
// Equipment
|
||||
DropHelper.DropItem(player, ModContent.ItemType<AquaticEmblem>());
|
||||
DropHelper.DropItemChance(player, ModContent.ItemType<AeroStone>(), 8);
|
||||
DropHelper.DropItemCondition(player, ModContent.ItemType<CorrosiveSpine>(), CalamityWorld.revenge, 0.25f);
|
||||
DropHelper.DropItemChance(player, ModContent.ItemType<CorrosiveSpine>(), 8);
|
||||
|
||||
// Vanity
|
||||
DropHelper.DropItemChance(player, ModContent.ItemType<AquaticScourgeMask>(), 7);
|
||||
|
||||
@@ -52,7 +52,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
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.NewProjectileDirect(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f).Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -48,8 +48,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
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 grenade = Projectile.NewProjectileDirect(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
grenade.Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
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.NewProjectileDirect(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f).Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
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.NewProjectileDirect(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f).Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
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.NewProjectileDirect(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f).Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,13 +30,13 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
item.useStyle = ItemUseStyleID.HoldingOut;
|
||||
item.noMelee = true;
|
||||
item.knockBack = 1.5f;
|
||||
item.value = Item.buyPrice(2, 50, 0, 0);
|
||||
item.value = CalamityGlobalItem.Rarity14BuyPrice;
|
||||
item.rare = 10;
|
||||
item.UseSound = SoundID.Item33;
|
||||
item.autoReuse = true;
|
||||
item.shootSpeed = 6f;
|
||||
item.shoot = ModContent.ProjectileType<ParticleBeamofDoom>();
|
||||
item.Calamity().customRarity = CalamityRarity.Violet;
|
||||
item.Calamity().customRarity = CalamityRarity.DarkBlue;
|
||||
}
|
||||
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-5, 0);
|
||||
|
||||
@@ -65,9 +65,12 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
ProjectileID.TiedEighthNote
|
||||
});
|
||||
int note = Projectile.NewProjectile(position.X, position.Y, speedX * 0.75f, speedY * 0.75f, noteProj, (int)(damage * 0.75), knockBack, player.whoAmI);
|
||||
Main.projectile[note].Calamity().forceMagic = true; //why are these notes also internally ranged
|
||||
Main.projectile[note].usesLocalNPCImmunity = true;
|
||||
Main.projectile[note].localNPCHitCooldown = 10;
|
||||
if (note.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[note].Calamity().forceMagic = true; //why are these notes also internally ranged
|
||||
Main.projectile[note].usesLocalNPCImmunity = true;
|
||||
Main.projectile[note].localNPCHitCooldown = 10;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -40,8 +40,9 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
for (int i = 0; i < numProj + 1; i++)
|
||||
{
|
||||
Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1)));
|
||||
int proj = Projectile.NewProjectile(position.X, position.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[proj].Calamity().forceMagic = true;
|
||||
int proj = Projectile.NewProjectile(position, perturbedSpeed, type, damage, knockBack, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().forceMagic = true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -83,8 +83,11 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
spawnVec.X += (float)Main.rand.Next(-180, 181) * 0.02f;
|
||||
spawnVec.Y += (float)Main.rand.Next(-180, 181) * 0.02f;
|
||||
int proj = Projectile.NewProjectile(source, spawnVec, type, damage, knockBack, player.whoAmI, 0f, Main.rand.Next(3));
|
||||
Main.projectile[proj].Calamity().forceMagic = true;
|
||||
Main.projectile[proj].timeLeft = CalamityUtils.SecondsToFrames(8f);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[proj].Calamity().forceMagic = true;
|
||||
Main.projectile[proj].timeLeft = CalamityUtils.SecondsToFrames(8f);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -54,17 +54,23 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
{
|
||||
float SpeedX = speedX + (float)Main.rand.Next(-35, 36) * 0.05f;
|
||||
float SpeedY = speedY + (float)Main.rand.Next(-35, 36) * 0.05f;
|
||||
int wasps = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, 0f, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[wasps].penetrate = 1;
|
||||
Main.projectile[wasps].Calamity().forceMagic = true;
|
||||
int wasps = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, 0f, player.whoAmI);
|
||||
if (wasps.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[wasps].penetrate = 1;
|
||||
Main.projectile[wasps].Calamity().forceMagic = true;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i <= 3; i++)
|
||||
{
|
||||
float SpeedX2 = speedX + (float)Main.rand.Next(-35, 36) * 0.05f;
|
||||
float SpeedY2 = speedY + (float)Main.rand.Next(-35, 36) * 0.05f;
|
||||
int bees = Projectile.NewProjectile(position.X, position.Y, SpeedX2, SpeedY2, player.beeType(), player.beeDamage(item.damage), player.beeKB(0f), player.whoAmI, 0f, 0f);
|
||||
Main.projectile[bees].penetrate = 1;
|
||||
Main.projectile[bees].Calamity().forceMagic = true;
|
||||
int bees = Projectile.NewProjectile(position.X, position.Y, SpeedX2, SpeedY2, player.beeType(), player.beeDamage(item.damage), player.beeKB(0f), player.whoAmI);
|
||||
if (bees.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[bees].penetrate = 1;
|
||||
Main.projectile[bees].Calamity().forceMagic = true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,8 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
speed *= 15f;
|
||||
speed.Y -= Math.Abs(speed.X) * 0.2f;
|
||||
int p = Projectile.NewProjectile(position, speed, ModContent.ProjectileType<FrostShardFriendly>(), damage, knockBack, player.whoAmI);
|
||||
Main.projectile[p].Calamity().forceMagic = true;
|
||||
if (p.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[p].Calamity().forceMagic = true;
|
||||
}
|
||||
if (Main.rand.NextBool(4))
|
||||
{
|
||||
|
||||
@@ -91,7 +91,8 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
float speedX4 = num78 + (float)Main.rand.Next(-120, 121) * 0.02f;
|
||||
float speedY5 = num79 + (float)Main.rand.Next(-120, 121) * 0.02f;
|
||||
int proj = Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, ProjectileID.HallowStar, damage / 3, knockBack, player.whoAmI, 0f, (float)Main.rand.Next(5));
|
||||
Main.projectile[proj].Calamity().forceMelee = true;
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().forceMelee = true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -46,13 +47,13 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
|
||||
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
CalamityGlobalItem.HorsemansBladeOnHit(player, target.whoAmI, (int)(item.damage * (player.allDamage + player.meleeDamage - 1f) * 1.5f), knockback, false);
|
||||
CalamityPlayerOnHit.HorsemansBladeOnHit(player, target.whoAmI, (int)(item.damage * player.MeleeDamage() * 1.5f), knockback);
|
||||
target.AddBuff(BuffID.OnFire, 300);
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player player, Player target, int damage, bool crit)
|
||||
{
|
||||
CalamityGlobalItem.HorsemansBladeOnHit(player, target.whoAmI, (int)(item.damage * (player.allDamage + player.meleeDamage - 1f) * 1.5f), item.knockBack, false);
|
||||
CalamityPlayerOnHit.HorsemansBladeOnHit(player, -1, (int)(item.damage * player.MeleeDamage() * 1.5f), item.knockBack);
|
||||
target.AddBuff(BuffID.OnFire, 300);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,11 +8,13 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
public class DepthBlade : ModItem
|
||||
{
|
||||
private static int HammerPower = 50;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Depth Crusher");
|
||||
Tooltip.SetDefault("Hitting enemies will inflict the crush depth debuff\n" +
|
||||
"The lower the enemies' defense, the more damage they take from this debuff");
|
||||
"The lower the enemies' defense, the more damage they take from this debuff\n" +
|
||||
"Right click to use without hammering down walls");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
@@ -30,7 +32,22 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
item.autoReuse = true;
|
||||
item.value = Item.buyPrice(0, 2, 0, 0);
|
||||
item.rare = 2;
|
||||
item.hammer = 50;
|
||||
item.hammer = HammerPower;
|
||||
}
|
||||
|
||||
public override bool AltFunctionUse(Player player) => true;
|
||||
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
if (player.altFunctionUse == 2)
|
||||
{
|
||||
item.hammer = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
item.hammer = HammerPower;
|
||||
}
|
||||
return base.CanUseItem(player);
|
||||
}
|
||||
|
||||
public override void MeleeEffects(Player player, Rectangle hitbox)
|
||||
|
||||
@@ -11,51 +11,30 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Dragon Rage");
|
||||
Tooltip.SetDefault("Fires a spread of five fire waves");
|
||||
Tooltip.SetDefault("Twirls a dual-bladed baton that causes explosions on enemy hits\n" +
|
||||
"Every ten hits will summon a ring of fireballs");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 68;
|
||||
item.damage = 800;
|
||||
item.melee = true;
|
||||
item.useAnimation = 25;
|
||||
item.useTime = 25;
|
||||
item.useTurn = true;
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
item.knockBack = 7.5f;
|
||||
item.UseSound = SoundID.Item1;
|
||||
item.useAnimation = item.useTime = 25;
|
||||
item.melee = true;
|
||||
item.noMelee = true;
|
||||
item.channel = true;
|
||||
item.autoReuse = true;
|
||||
item.height = 82;
|
||||
item.value = CalamityGlobalItem.Rarity15BuyPrice;
|
||||
item.rare = ItemRarityID.Purple;
|
||||
item.Calamity().customRarity = CalamityRarity.Violet;
|
||||
item.shoot = ModContent.ProjectileType<DragonRageProj>();
|
||||
item.shootSpeed = 14f;
|
||||
}
|
||||
item.shoot = ModContent.ProjectileType<DragonRageStaff>();
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
for (int index = 0; index < 5; ++index)
|
||||
{
|
||||
float SpeedX = speedX + (float)Main.rand.Next(-25, 26) * 0.05f;
|
||||
float SpeedY = speedY + (float)Main.rand.Next(-25, 26) * 0.05f;
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, (int)((double)damage * 0.75), knockBack, player.whoAmI, 0.0f, 0.0f);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void MeleeEffects(Player player, Rectangle hitbox)
|
||||
{
|
||||
if (Main.rand.NextBool(3))
|
||||
{
|
||||
int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 244);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(BuffID.Daybreak, 360);
|
||||
item.width = 68;
|
||||
item.height = 82;
|
||||
item.noUseGraphic = true;
|
||||
item.useStyle = ItemUseStyleID.HoldingOut;
|
||||
item.UseSound = SoundID.DD2_SkyDragonsFurySwing;
|
||||
item.value = CalamityGlobalItem.Rarity15BuyPrice;
|
||||
item.rare = ItemRarityID.Purple;
|
||||
item.Calamity().customRarity = CalamityRarity.Violet;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -53,8 +53,9 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
if (target.life <= (target.lifeMax * 0.5f))
|
||||
{
|
||||
int boom = Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType<FuckYou>(), (int)(item.damage * player.MeleeDamage()), knockback, player.whoAmI, 0f, 0.85f + Main.rand.NextFloat() * 1.15f);
|
||||
Main.projectile[boom].Calamity().forceMelee = true;
|
||||
int boom = Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType<FuckYou>(), (int)(item.damage * player.MeleeDamage()), knockback, player.whoAmI, 0f, 0.85f + Main.rand.NextFloat() * 1.15f);
|
||||
if (boom.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[boom].Calamity().forceMelee = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,8 +63,9 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
if (target.statLife <= (target.statLifeMax2 * 0.5f))
|
||||
{
|
||||
int boom = Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType<FuckYou>(), (int)(item.damage * player.MeleeDamage()), item.knockBack, player.whoAmI, 0f, 0.85f + Main.rand.NextFloat() * 1.15f);
|
||||
Main.projectile[boom].Calamity().forceMelee = true;
|
||||
int boom = Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType<FuckYou>(), (int)(item.damage * player.MeleeDamage()), item.knockBack, player.whoAmI, 0f, 0.85f + Main.rand.NextFloat() * 1.15f);
|
||||
if (boom.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[boom].Calamity().forceMelee = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,8 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
float SpeedX = speedX + (float)Main.rand.Next(-20, 21) * 0.05f;
|
||||
float SpeedY = speedY + (float)Main.rand.Next(-20, 21) * 0.05f;
|
||||
int proj = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[proj].Calamity().forceMelee = true;
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().forceMelee = true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -45,8 +45,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
Main.projectile[proj].Calamity().forceMelee = true;
|
||||
Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -79,14 +79,16 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
|
||||
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
int explosion = Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType<PlanarRipperExplosion>(), (int)(item.damage * player.MeleeDamage()), knockback, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[explosion].Calamity().forceMelee = true;
|
||||
int explosion = Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType<PlanarRipperExplosion>(), (int)(item.damage * player.MeleeDamage()), knockback, player.whoAmI);
|
||||
if (explosion.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[explosion].Calamity().forceMelee = true;
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player player, Player target, int damage, bool crit)
|
||||
{
|
||||
int explosion = Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType<PlanarRipperExplosion>(), (int)(item.damage * player.MeleeDamage()), item.knockBack, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[explosion].Calamity().forceMelee = true;
|
||||
int explosion = Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType<PlanarRipperExplosion>(), (int)(item.damage * player.MeleeDamage()), item.knockBack, player.whoAmI);
|
||||
if (explosion.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[explosion].Calamity().forceMelee = true;
|
||||
}
|
||||
|
||||
public override void MeleeEffects(Player player, Rectangle hitbox)
|
||||
|
||||
@@ -38,12 +38,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
if (target.life <= 0)
|
||||
{
|
||||
int boom = Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType<FuckYou>(), (int)(item.damage * (player.allDamage + player.meleeDamage - 1f)), knockback, player.whoAmI, 0f, 0.85f + Main.rand.NextFloat() * 1.15f);
|
||||
Main.projectile[boom].Calamity().forceMelee = true;
|
||||
float randomSpeedX = (float)Main.rand.Next(5);
|
||||
float randomSpeedY = (float)Main.rand.Next(3, 7);
|
||||
Projectile.NewProjectile(target.Center.X, target.Center.Y, -randomSpeedX, -randomSpeedY, ModContent.ProjectileType<PhoenixHeal>(), (int)(item.damage * player.MeleeDamage()), knockback, player.whoAmI);
|
||||
Projectile.NewProjectile(target.Center.X, target.Center.Y, randomSpeedX, -randomSpeedY, ModContent.ProjectileType<PhoenixHeal>(), (int)(item.damage * player.MeleeDamage()), knockback, player.whoAmI);
|
||||
OnHitEffects(player, target.Center, knockback);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,13 +46,19 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
if (target.statLife <= 0)
|
||||
{
|
||||
int boom = Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType<FuckYou>(), (int)(item.damage * (player.allDamage + player.meleeDamage - 1f)), item.knockBack, player.whoAmI, 0f, 0.85f + Main.rand.NextFloat() * 1.15f);
|
||||
Main.projectile[boom].Calamity().forceMelee = true;
|
||||
float randomSpeedX = (float)Main.rand.Next(5);
|
||||
float randomSpeedY = (float)Main.rand.Next(3, 7);
|
||||
Projectile.NewProjectile(target.Center.X, target.Center.Y, -randomSpeedX, -randomSpeedY, ModContent.ProjectileType<PhoenixHeal>(), (int)(item.damage * (player.allDamage + player.meleeDamage - 1f)), item.knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(target.Center.X, target.Center.Y, randomSpeedX, -randomSpeedY, ModContent.ProjectileType<PhoenixHeal>(), (int)(item.damage * (player.allDamage + player.meleeDamage - 1f)), item.knockBack, player.whoAmI);
|
||||
}
|
||||
OnHitEffects(player, target.Center, item.knockBack);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnHitEffects(Player player, Vector2 targetPos, float kBack)
|
||||
{
|
||||
int boom = Projectile.NewProjectile(targetPos, Vector2.Zero, ModContent.ProjectileType<FuckYou>(), (int)(item.damage * player.MeleeDamage()), kBack, player.whoAmI, 0f, 0.85f + Main.rand.NextFloat() * 1.15f);
|
||||
if (boom.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[boom].Calamity().forceMelee = true;
|
||||
float randomSpeedX = (float)Main.rand.Next(5);
|
||||
float randomSpeedY = (float)Main.rand.Next(3, 7);
|
||||
Projectile.NewProjectile(targetPos.X, targetPos.Y, -randomSpeedX, -randomSpeedY, ModContent.ProjectileType<PhoenixHeal>(), (int)(item.damage * player.MeleeDamage()), kBack, player.whoAmI);
|
||||
Projectile.NewProjectile(targetPos.X, targetPos.Y, randomSpeedX, -randomSpeedY, ModContent.ProjectileType<PhoenixHeal>(), (int)(item.damage * player.MeleeDamage()), kBack, player.whoAmI);
|
||||
}
|
||||
|
||||
public override void MeleeEffects(Player player, Rectangle hitbox)
|
||||
|
||||
@@ -53,9 +53,12 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
int bee = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, player.beeType(),
|
||||
player.beeDamage((int)(item.damage * player.MeleeDamage()) / 3), player.beeKB(0f), player.whoAmI, 0f, 0f);
|
||||
Main.projectile[bee].penetrate = 1;
|
||||
Main.projectile[bee].Calamity().forceMelee = true;
|
||||
player.beeDamage((int)(item.damage * player.MeleeDamage()) / 3), player.beeKB(0f), player.whoAmI);
|
||||
if (bee.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[bee].penetrate = 1;
|
||||
Main.projectile[bee].Calamity().forceMelee = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,9 +68,12 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
int bee = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, player.beeType(),
|
||||
player.beeDamage((int)(item.damage * player.MeleeDamage()) / 3), player.beeKB(0f), player.whoAmI, 0f, 0f);
|
||||
Main.projectile[bee].penetrate = 1;
|
||||
Main.projectile[bee].Calamity().forceMelee = true;
|
||||
player.beeDamage((int)(item.damage * player.MeleeDamage()) / 3), player.beeKB(0f), player.whoAmI);
|
||||
if (bee.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[bee].penetrate = 1;
|
||||
Main.projectile[bee].Calamity().forceMelee = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,8 +53,9 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
if (target.life <= 0)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, Main.rand.Next(569, 572), (int)(item.damage * (player.allDamage + player.meleeDamage - 1f)), knockback, Main.myPlayer);
|
||||
Main.projectile[proj].Calamity().forceMelee = true;
|
||||
int proj = Projectile.NewProjectile(target.Center, Vector2.Zero, Main.rand.Next(569, 572), (int)(item.damage * player.MeleeDamage()), knockback, Main.myPlayer);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().forceMelee = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,8 +63,9 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
if (target.statLife <= 0)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, Main.rand.Next(569, 572), (int)(item.damage * (player.allDamage + player.meleeDamage - 1f)), item.knockBack, Main.myPlayer);
|
||||
Main.projectile[proj].Calamity().forceMelee = true;
|
||||
int proj = Projectile.NewProjectile(target.Center, Vector2.Zero, Main.rand.Next(569, 572), (int)(item.damage * player.MeleeDamage()), item.knockBack, Main.myPlayer);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().forceMelee = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +96,8 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
float num114 = num78;
|
||||
float num115 = num79 + (float)Main.rand.Next(-80, 81) * 0.02f;
|
||||
int proj = Projectile.NewProjectile(vector2.X, vector2.Y, num114, num115, ProjectileID.LunarFlare, (int)(item.damage * player.MeleeDamage() * 0.5), knockBack, i, 0f, (float)Main.rand.Next(3));
|
||||
Main.projectile[proj].Calamity().forceMelee = true;
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().forceMelee = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -41,76 +42,14 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
|
||||
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
int logicCheckScreenHeight = Main.LogicCheckScreenHeight;
|
||||
int logicCheckScreenWidth = Main.LogicCheckScreenWidth;
|
||||
int num = Main.rand.Next(100, 300);
|
||||
int num2 = Main.rand.Next(100, 300);
|
||||
switch (Main.rand.Next(4))
|
||||
{
|
||||
case 0:
|
||||
num -= logicCheckScreenWidth / 2 + num;
|
||||
break;
|
||||
case 1:
|
||||
num += logicCheckScreenWidth / 2 - num;
|
||||
break;
|
||||
case 2:
|
||||
num2 -= logicCheckScreenHeight / 2 + num2;
|
||||
break;
|
||||
case 3:
|
||||
num2 += logicCheckScreenHeight / 2 - num2;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
num += (int)player.position.X;
|
||||
num2 += (int)player.position.Y;
|
||||
float speed = 8f;
|
||||
Vector2 vector = new Vector2((float)num, (float)num2);
|
||||
float num3 = target.position.X - vector.X;
|
||||
float num4 = target.position.Y - vector.Y;
|
||||
float num5 = (float)Math.Sqrt((double)(num3 * num3 + num4 * num4));
|
||||
num5 = speed / num5;
|
||||
num3 *= num5;
|
||||
num4 *= num5;
|
||||
Projectile.NewProjectile((float)num, (float)num2, num3, num4, ModContent.ProjectileType<MourningSkull>(), (int)(item.damage * (player.allDamage + player.meleeDamage - 1f) * 1.5f), knockback, player.whoAmI, (float)target.whoAmI, 0f);
|
||||
CalamityGlobalItem.HorsemansBladeOnHit(player, target.whoAmI, (int)(item.damage * (player.allDamage + player.meleeDamage - 1f) * 1.5f), knockback, true);
|
||||
CalamityPlayerOnHit.HorsemansBladeOnHit(player, target.whoAmI, (int)(item.damage * player.MeleeDamage() * 1.5f), knockback, 0, ModContent.ProjectileType<MourningSkull>());
|
||||
CalamityPlayerOnHit.HorsemansBladeOnHit(player, target.whoAmI, (int)(item.damage * player.MeleeDamage() * 1.5f), knockback, 1);
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player player, Player target, int damage, bool crit)
|
||||
{
|
||||
int logicCheckScreenHeight = Main.LogicCheckScreenHeight;
|
||||
int logicCheckScreenWidth = Main.LogicCheckScreenWidth;
|
||||
int num = Main.rand.Next(100, 300);
|
||||
int num2 = Main.rand.Next(100, 300);
|
||||
switch (Main.rand.Next(4))
|
||||
{
|
||||
case 0:
|
||||
num -= logicCheckScreenWidth / 2 + num;
|
||||
break;
|
||||
case 1:
|
||||
num += logicCheckScreenWidth / 2 - num;
|
||||
break;
|
||||
case 2:
|
||||
num2 -= logicCheckScreenHeight / 2 + num2;
|
||||
break;
|
||||
case 3:
|
||||
num2 += logicCheckScreenHeight / 2 - num2;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
num += (int)player.position.X;
|
||||
num2 += (int)player.position.Y;
|
||||
float speed = 8f;
|
||||
Vector2 vector = new Vector2((float)num, (float)num2);
|
||||
float num3 = target.position.X - vector.X;
|
||||
float num4 = target.position.Y - vector.Y;
|
||||
float num5 = (float)Math.Sqrt((double)(num3 * num3 + num4 * num4));
|
||||
num5 = speed / num5;
|
||||
num3 *= num5;
|
||||
num4 *= num5;
|
||||
Projectile.NewProjectile((float)num, (float)num2, num3, num4, ModContent.ProjectileType<MourningSkull>(), (int)(item.damage * (player.allDamage + player.meleeDamage - 1f) * 1.5f), item.knockBack, player.whoAmI, (float)target.whoAmI, 0f);
|
||||
CalamityGlobalItem.HorsemansBladeOnHit(player, target.whoAmI, (int)(item.damage * (player.allDamage + player.meleeDamage - 1f) * 1.5f), item.knockBack, true);
|
||||
CalamityPlayerOnHit.HorsemansBladeOnHit(player, -1, (int)(item.damage * player.MeleeDamage() * 1.5f), item.knockBack, 0, ModContent.ProjectileType<MourningSkull>());
|
||||
CalamityPlayerOnHit.HorsemansBladeOnHit(player, -1, (int)(item.damage * player.MeleeDamage() * 1.5f), item.knockBack, 1);
|
||||
}
|
||||
|
||||
public override void MeleeEffects(Player player, Rectangle hitbox)
|
||||
|
||||
@@ -35,26 +35,19 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
switch (Main.rand.Next(3))
|
||||
{
|
||||
case 0:
|
||||
type = ProjectileID.RubyBolt;
|
||||
break;
|
||||
case 1:
|
||||
type = ProjectileID.SapphireBolt;
|
||||
break;
|
||||
case 2:
|
||||
type = ProjectileID.AmethystBolt;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
type = Utils.SelectRandom(Main.rand, new int[]
|
||||
{
|
||||
ProjectileID.RubyBolt,
|
||||
ProjectileID.SapphireBolt,
|
||||
ProjectileID.AmethystBolt
|
||||
});
|
||||
for (int projectiles = 0; projectiles <= 3; projectiles++)
|
||||
{
|
||||
float SpeedX = speedX + (float)Main.rand.Next(-30, 31) * 0.05f;
|
||||
float SpeedY = speedY + (float)Main.rand.Next(-30, 31) * 0.05f;
|
||||
int proj = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, (int)((double)damage * 0.6), knockBack, Main.myPlayer, 0f, 0f);
|
||||
Main.projectile[proj].Calamity().forceMelee = true;
|
||||
int proj = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, (int)(damage * 0.6), knockBack, Main.myPlayer, 0f, 0f);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().forceMelee = true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -38,15 +38,11 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
switch (Main.rand.Next(2))
|
||||
{
|
||||
case 0:
|
||||
type = ModContent.ProjectileType<EonBeam>();
|
||||
break;
|
||||
case 1:
|
||||
type = ModContent.ProjectileType<EonBeamV2>();
|
||||
break;
|
||||
}
|
||||
type = Utils.SelectRandom(Main.rand, new int[]
|
||||
{
|
||||
ModContent.ProjectileType<EonBeam>(),
|
||||
ModContent.ProjectileType<EonBeamV2>()
|
||||
});
|
||||
int beam = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, (int)(damage * 0.75), knockBack, Main.myPlayer, 1f);
|
||||
Main.projectile[beam].localNPCHitCooldown = 14;
|
||||
int i = Main.myPlayer;
|
||||
@@ -98,7 +94,8 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
float speedX2 = num78 + (float)Main.rand.Next(-160, 161) * 0.02f;
|
||||
float speedY2 = num79 + (float)Main.rand.Next(-160, 161) * 0.02f;
|
||||
int proj = Projectile.NewProjectile(vector2.X, vector2.Y, speedX2, speedY2, ProjectileID.HallowStar, damage / 3, num74, i, 0f, (float)Main.rand.Next(10));
|
||||
Main.projectile[proj].Calamity().forceMelee = true;
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().forceMelee = true;
|
||||
|
||||
speedX2 = num78 + (float)Main.rand.Next(-80, 81) * 0.02f;
|
||||
speedY2 = num79 + (float)Main.rand.Next(-80, 81) * 0.02f;
|
||||
|
||||
@@ -53,20 +53,19 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
|
||||
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
if (target.type == NPCID.TargetDummy || player.moonLeech)
|
||||
if (target.type != NPCID.TargetDummy)
|
||||
{
|
||||
return;
|
||||
}
|
||||
int healAmount = Main.rand.Next(6) + 1;
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
player.statLife += healAmount;
|
||||
player.HealEffect(healAmount);
|
||||
OnHitEffects(player);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player player, Player target, int damage, bool crit)
|
||||
{
|
||||
OnHitEffects(player);
|
||||
}
|
||||
|
||||
private void OnHitEffects(Player player)
|
||||
{
|
||||
if (player.moonLeech)
|
||||
return;
|
||||
int healAmount = Main.rand.Next(6) + 1;
|
||||
@@ -75,6 +74,6 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
player.statLife += healAmount;
|
||||
player.HealEffect(healAmount);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -72,14 +72,17 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
type = ModContent.ProjectileType<TyphoonArrow>();
|
||||
}
|
||||
int proj = Projectile.NewProjectile(source.X + offset.X, source.Y + offset.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[proj].Calamity().forceRanged = true;
|
||||
Main.projectile[proj].noDropItem = true;
|
||||
Main.projectile[proj].arrow = true;
|
||||
int proj = Projectile.NewProjectile(source.X + offset.X, source.Y + offset.Y, speedX, speedY, type, damage, knockBack, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[proj].Calamity().forceRanged = true;
|
||||
Main.projectile[proj].noDropItem = true;
|
||||
Main.projectile[proj].arrow = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int proj = Projectile.NewProjectile(source.X + offset.X, source.Y + offset.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
int proj = Projectile.NewProjectile(source.X + offset.X, source.Y + offset.Y, speedX, speedY, type, damage, knockBack, player.whoAmI);
|
||||
Main.projectile[proj].noDropItem = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,8 +64,9 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
value9 -= vector7;
|
||||
}
|
||||
int projectile = Projectile.NewProjectile(vector2.X + value9.X, vector2.Y + value9.Y, speedX, speedY, ProjectileID.Leaf, damage / 2, 0f, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[projectile].Calamity().forceRanged = true;
|
||||
int projectile = Projectile.NewProjectile(vector2.X + value9.X, vector2.Y + value9.Y, speedX, speedY, ProjectileID.Leaf, damage / 2, 0f, player.whoAmI);
|
||||
if (projectile.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[projectile].Calamity().forceRanged = true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -35,27 +35,11 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
item.useAmmo = AmmoID.Flare;
|
||||
}
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(-10, 0);
|
||||
}
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-10, 0);
|
||||
|
||||
public override bool ConsumeAmmo(Player player)
|
||||
{
|
||||
if (Main.rand.Next(0, 100) < 70)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public override bool ConsumeAmmo(Player player) => Main.rand.Next(100) >= 70;
|
||||
|
||||
public override bool AltFunctionUse(Player player)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
return base.CanUseItem(player);
|
||||
}
|
||||
public override bool AltFunctionUse(Player player) => true;
|
||||
|
||||
public override float UseTimeMultiplier (Player player)
|
||||
{
|
||||
@@ -73,10 +57,13 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
float SpeedX = speedX + (float)Main.rand.Next(-50, 51) * 0.05f;
|
||||
float SpeedY = speedY + (float)Main.rand.Next(-50, 51) * 0.05f;
|
||||
int flare = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, (int)((double)damage * 1.4), knockBack, player.whoAmI, 0.0f, 0.0f);
|
||||
Main.projectile[flare].penetrate = 1;
|
||||
Main.projectile[flare].timeLeft = 600;
|
||||
Main.projectile[flare].Calamity().forceRanged = true;
|
||||
int flare = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, (int)((double)damage * 1.4), knockBack, player.whoAmI);
|
||||
if (flare.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[flare].penetrate = 1;
|
||||
Main.projectile[flare].timeLeft = 600;
|
||||
Main.projectile[flare].Calamity().forceRanged = true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -87,10 +74,13 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
float SpeedX = speedX + (float)Main.rand.Next(-40, 41) * 0.05f;
|
||||
float SpeedY = speedY + (float)Main.rand.Next(-40, 41) * 0.05f;
|
||||
int projectile = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f);
|
||||
Main.projectile[projectile].Calamity().forceRanged = true;
|
||||
Main.projectile[projectile].timeLeft = 200;
|
||||
Main.projectile[projectile].penetrate = 3;
|
||||
int flare = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI);
|
||||
if (flare.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[flare].Calamity().forceRanged = true;
|
||||
Main.projectile[flare].timeLeft = 200;
|
||||
Main.projectile[flare].penetrate = 3;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -53,9 +53,12 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
offset -= velocity;
|
||||
}
|
||||
int index = Projectile.NewProjectile(source + offset, new Vector2(speedX, speedY) * 0.6f, ProjectileID.SlimeGun, damage / 4, 0f, player.whoAmI);
|
||||
Main.projectile[index].Calamity().forceRanged = true;
|
||||
Main.projectile[index].usesLocalNPCImmunity = true;
|
||||
Main.projectile[index].localNPCHitCooldown = 10;
|
||||
if (index.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[index].Calamity().forceRanged = true;
|
||||
Main.projectile[index].usesLocalNPCImmunity = true;
|
||||
Main.projectile[index].localNPCHitCooldown = 10;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -65,14 +65,17 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
type = ModContent.ProjectileType<TyphoonArrow>();
|
||||
}
|
||||
int arrow = Projectile.NewProjectile(source.X + offset.X, source.Y + offset.Y, speedX, speedY, type, (int)(damage * 1.1f), knockBack, player.whoAmI);
|
||||
Main.projectile[arrow].Calamity().forceRanged = true;
|
||||
Main.projectile[arrow].noDropItem = true;
|
||||
Main.projectile[arrow].arrow = true;
|
||||
Main.projectile[arrow].extraUpdates += 1;
|
||||
if (arrow.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[arrow].Calamity().forceRanged = true;
|
||||
Main.projectile[arrow].noDropItem = true;
|
||||
Main.projectile[arrow].arrow = true;
|
||||
Main.projectile[arrow].extraUpdates += 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int arrow = Projectile.NewProjectile(source.X + offset.X, source.Y + offset.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
int arrow = Projectile.NewProjectile(source.X + offset.X, source.Y + offset.Y, speedX, speedY, type, damage, knockBack, player.whoAmI);
|
||||
Main.projectile[arrow].noDropItem = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
item.rare = ItemRarityID.Purple;
|
||||
item.UseSound = SoundID.Item36;
|
||||
item.autoReuse = true;
|
||||
item.shoot = ProjectileID.PurificationPowder;
|
||||
item.shoot = ProjectileID.BlackBolt;
|
||||
item.shootSpeed = 24f;
|
||||
item.useAmmo = AmmoID.Bullet;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
item.Calamity().customRarity = CalamityRarity.DarkBlue;
|
||||
item.UseSound = SoundID.Item36;
|
||||
item.autoReuse = true;
|
||||
item.shoot = ProjectileID.PurificationPowder; // wait why
|
||||
item.shoot = ProjectileID.BlackBolt;
|
||||
item.shootSpeed = 28f;
|
||||
item.useAmmo = AmmoID.Bullet;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
item.shootSpeed = 12f;
|
||||
item.useAmmo = AmmoID.Bullet;
|
||||
|
||||
item.value = CalamityGlobalItem.Rarity15BuyPrice;
|
||||
item.value = CalamityGlobalItem.Rarity14BuyPrice;
|
||||
item.rare = 10;
|
||||
item.Calamity().customRarity = CalamityRarity.Dedicated;
|
||||
}
|
||||
|
||||
@@ -49,15 +49,21 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
float SpeedX = speedX + (float)Main.rand.Next(-40, 41) * 0.05f;
|
||||
float SpeedY = speedY + (float)Main.rand.Next(-40, 41) * 0.05f;
|
||||
int flare = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI);
|
||||
Main.projectile[flare].timeLeft = 200;
|
||||
Main.projectile[flare].Calamity().forceRanged = true;
|
||||
if (flare.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[flare].timeLeft = 200;
|
||||
Main.projectile[flare].Calamity().forceRanged = true;
|
||||
}
|
||||
|
||||
float SpeedX2 = speedX + (float)Main.rand.Next(-20, 21) * 0.05f;
|
||||
float SpeedY2 = speedY + (float)Main.rand.Next(-20, 21) * 0.05f;
|
||||
int soul = Projectile.NewProjectile(position.X, position.Y, SpeedX2, SpeedY2, ModContent.ProjectileType<LostSoulFriendly>(), damage, knockBack, player.whoAmI);
|
||||
Main.projectile[soul].timeLeft = 600;
|
||||
Main.projectile[soul].Calamity().forceRanged = true;
|
||||
Main.projectile[soul].frame = Main.rand.Next(4);
|
||||
if (soul.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[soul].timeLeft = 600;
|
||||
Main.projectile[soul].Calamity().forceRanged = true;
|
||||
Main.projectile[soul].frame = Main.rand.Next(4);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -42,7 +43,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ProjectileID.LostSoulFriendly, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
int proj = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<LostSoulFriendly>(), damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[proj].Calamity().forceRanged = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -37,10 +37,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
item.useAmmo = AmmoID.FallenStar;
|
||||
}
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(-5, 0);
|
||||
}
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-5, 0);
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
@@ -49,20 +46,15 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
float SpeedX = speedX + (float)Main.rand.Next(-15, 16) * 0.05f;
|
||||
float SpeedY = speedY + (float)Main.rand.Next(-15, 16) * 0.05f;
|
||||
switch (Main.rand.Next(3))
|
||||
{
|
||||
case 0:
|
||||
type = ModContent.ProjectileType<FallenStarProj>();
|
||||
break;
|
||||
case 1:
|
||||
type = ProjectileID.Starfury;
|
||||
break;
|
||||
case 2:
|
||||
type = ModContent.ProjectileType<AstralStar>();
|
||||
break;
|
||||
}
|
||||
int star = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[star].Calamity().forceRanged = true;
|
||||
type = Utils.SelectRandom(Main.rand, new int[]
|
||||
{
|
||||
ModContent.ProjectileType<AstralStar>(),
|
||||
ProjectileID.Starfury,
|
||||
ModContent.ProjectileType<FallenStarProj>()
|
||||
});
|
||||
int star = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI);
|
||||
if (star.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[star].Calamity().forceRanged = true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
item.useStyle = ItemUseStyleID.HoldingOut;
|
||||
item.noMelee = true;
|
||||
item.knockBack = 2f;
|
||||
item.value = CalamityGlobalItem.RarityVioletBuyPrice;
|
||||
item.value = CalamityGlobalItem.Rarity14BuyPrice;
|
||||
item.rare = 10;
|
||||
item.UseSound = SoundID.Item33;
|
||||
item.autoReuse = true;
|
||||
|
||||
@@ -43,9 +43,12 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
speedX *= 0.7f;
|
||||
speedY *= 0.7f;
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
Main.projectile[proj].Calamity().stealthStrike = true;
|
||||
Main.projectile[proj].timeLeft *= 3;
|
||||
Main.projectile[proj].localNPCHitCooldown *= 2;
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[proj].Calamity().stealthStrike = true;
|
||||
Main.projectile[proj].timeLeft *= 3;
|
||||
Main.projectile[proj].localNPCHitCooldown *= 2;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -41,7 +41,8 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
Vector2 initialVelocity = new Vector2(speedX, speedY);
|
||||
|
||||
int p = Projectile.NewProjectile(position - Vector2.UnitY * 12f, initialVelocity, type, damage, knockBack, player.whoAmI);
|
||||
Main.projectile[p].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
if (p.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[p].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
}
|
||||
public override void AddRecipes()
|
||||
|
||||
@@ -39,9 +39,12 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
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].usesLocalNPCImmunity = true;
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
Main.projectile[stealth].usesLocalNPCImmunity = true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -43,7 +43,8 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int p = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, item.shootSpeed, 0f);
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
if (p.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -46,7 +46,8 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int p = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI);
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
if (p.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -45,7 +45,8 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
float stealthDamageMult = 1.15f;
|
||||
float stealthKnockbackMult = 2.5f;
|
||||
int p = Projectile.NewProjectile(position.X, position.Y, speedX * stealthSpeedMult, speedY * stealthSpeedMult, stealthType, (int)(damage * stealthDamageMult), (int)(knockBack * stealthKnockbackMult), player.whoAmI, 0f, 1f);
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
if (p.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -39,8 +39,9 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
int star = Projectile.NewProjectile(player.Center, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[star].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
int star = Projectile.NewProjectile(player.Center, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
if (star.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[star].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,8 +45,9 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
Vector2 perturbedspeed = new Vector2(speedX + Main.rand.Next(-3,4), speedY + Main.rand.Next(-3,4)).RotatedBy(MathHelper.ToRadians(spread));
|
||||
int proj = Projectile.NewProjectile(position.X, position.Y, perturbedspeed.X, perturbedspeed.Y, type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[proj].Calamity().stealthStrike = true;
|
||||
int proj = Projectile.NewProjectile(position, perturbedspeed, type, damage, knockBack, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = true;
|
||||
spread -= Main.rand.Next(2,6);
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
|
||||
//unitY additive is do it doesn't exploe initially
|
||||
int p = Projectile.NewProjectile(position - Vector2.UnitY * 12f, initialVelocity, type, damage, knockBack, player.whoAmI);
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
if (player.Calamity().StealthStrikeAvailable() && p.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -48,11 +48,16 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
for (int i = 0; i < item.stack; i++)
|
||||
{
|
||||
Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.Lerp(-MathHelper.ToRadians(8f), MathHelper.ToRadians(8f), i / (float)(item.stack - 1)));
|
||||
Projectile.NewProjectileDirect(position, perturbedSpeed, type, damage, knockBack, player.whoAmI, 0f, 0f).Calamity().stealthStrike = true;
|
||||
Projectile proj = Projectile.NewProjectileDirect(position, perturbedSpeed, type, damage, knockBack, player.whoAmI);
|
||||
if (proj.whoAmI.WithinBounds(Main.maxProjectiles))
|
||||
proj.Calamity().stealthStrike = true;
|
||||
|
||||
Projectile projectile = Projectile.NewProjectileDirect(position, perturbedSpeed, type, damage, knockBack, player.whoAmI, 0f);
|
||||
projectile.penetrate = -1;
|
||||
projectile.Calamity().stealthStrike = true;
|
||||
Projectile projectile = Projectile.NewProjectileDirect(position, perturbedSpeed, type, damage, knockBack, player.whoAmI);
|
||||
if (projectile.whoAmI.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
projectile.penetrate = -1;
|
||||
projectile.Calamity().stealthStrike = true;
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -41,7 +41,8 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); //setting the stealth strike
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); //setting the stealth strike
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
Vector2 velocity = new Vector2(speedX, speedY);
|
||||
int projectileIndex = Projectile.NewProjectile(position, velocity, type, damage, knockBack, player.whoAmI);
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
if (player.Calamity().StealthStrikeAvailable() && projectileIndex.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[projectileIndex].Calamity().stealthStrike = true;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,8 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
initialVelocity *= 2f;
|
||||
int p = Projectile.NewProjectile(position, initialVelocity, ModContent.ProjectileType<BouncingEyeballProjectileStealthStrike>(), damage, knockBack, player.whoAmI);
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
if (p.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -42,8 +42,9 @@ Stealth strikes provide a bigger boost after richocheting");
|
||||
{
|
||||
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;
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -39,8 +39,9 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
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;
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -41,14 +41,16 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int blade = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[blade].Calamity().stealthStrike = true;
|
||||
int blade = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
if (blade.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[blade].Calamity().stealthStrike = true;
|
||||
|
||||
for (int i = -6; i <= 6; i += 4)
|
||||
{
|
||||
Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.ToRadians(i));
|
||||
int dart = Projectile.NewProjectile(position, perturbedSpeed, ModContent.ProjectileType<SeethingDischargeBrimstoneBarrage>(), damage, knockBack * 0.5f, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[dart].Calamity().forceRogue = true;
|
||||
int dart = Projectile.NewProjectile(position, perturbedSpeed, ModContent.ProjectileType<SeethingDischargeBrimstoneBarrage>(), damage, knockBack * 0.5f, player.whoAmI);
|
||||
if (dart.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[dart].Calamity().forceRogue = true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -45,8 +45,8 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
speedMult = 1.25f;
|
||||
}
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX * speedMult, speedY * speedMult), ModContent.ProjectileType<BurningStrifeProj>(), damage, knockBack, player.whoAmI);
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX * speedMult, speedY * speedMult), type, damage, knockBack, player.whoAmI);
|
||||
if (player.Calamity().StealthStrikeAvailable() && proj.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[proj].Calamity().stealthStrike = true;
|
||||
Main.projectile[proj].penetrate = 5;
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
Vector2 velocity = new Vector2(speedX, speedY);
|
||||
float strikeValue = player.Calamity().StealthStrikeAvailable().ToInt(); //0 if false, 1 if true
|
||||
int p = Projectile.NewProjectile(position, velocity, ModContent.ProjectileType<CelestialReaperProjectile>(), damage, knockBack, player.whoAmI, strikeValue);
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
if (player.Calamity().StealthStrikeAvailable() && p.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,8 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,8 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int p = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType<CinquedeaProj>(), damage, knockBack, player.whoAmI, 0f, 1f);
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
if (p.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -42,7 +42,9 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
for (int i = -6; i <= 6; i += 6)
|
||||
{
|
||||
Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.ToRadians(i));
|
||||
Projectile.NewProjectile(position.X, position.Y, perturbedSpeed.X, perturbedSpeed.Y, ModContent.ProjectileType<CobaltEnergy>(), damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
int stealth = Projectile.NewProjectile(position, perturbedSpeed, ModContent.ProjectileType<CobaltEnergy>(), damage, knockBack, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
Vector2 velocity = new Vector2(speedX, speedY);
|
||||
float strikeValue = player.Calamity().StealthStrikeAvailable().ToInt(); //0 if false, 1 if true
|
||||
int p = Projectile.NewProjectile(position, velocity, ModContent.ProjectileType<ConsecratedWaterProjectile>(), damage, knockBack, player.whoAmI, ai1: strikeValue);
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
if (player.Calamity().StealthStrikeAvailable() && p.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,8 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
Vector2 velocity = new Vector2(speedX, speedY);
|
||||
int p = Projectile.NewProjectile(position, velocity, type, damage, knockBack, player.whoAmI);
|
||||
Main.projectile[p].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
if (p.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[p].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
}
|
||||
public override void AddRecipes()
|
||||
|
||||
@@ -52,7 +52,8 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int dagger = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType<CorpusAvertorStealth>(), damage * 2, knockBack * 2f, player.whoAmI);
|
||||
Main.projectile[dagger].Calamity().stealthStrike = true;
|
||||
if (dagger.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[dagger].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
if (player.Calamity().StealthStrikeAvailable() && player.ownedProjectileCounts[ModContent.ProjectileType<CosmicScythe>()] < 10 && counter == 0)
|
||||
if (player.Calamity().StealthStrikeAvailable() && player.ownedProjectileCounts[ModContent.ProjectileType<CosmicScythe>()] < 10 && counter == 0 && stealth.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
Main.PlaySound(SoundID.Item73, player.position);
|
||||
|
||||
@@ -50,8 +50,9 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
type = ModContent.ProjectileType<CraniumSmasherProj>();
|
||||
}
|
||||
int proj = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
int proj = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,10 +42,13 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
Vector2 perturbedspeed = new Vector2(speedX + Main.rand.Next(-3,4), speedY + Main.rand.Next(-3,4)).RotatedBy(MathHelper.ToRadians(spread));
|
||||
int proj = Projectile.NewProjectile(position.X, position.Y, perturbedspeed.X, perturbedspeed.Y, type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[proj].Calamity().stealthStrike = true;
|
||||
Main.projectile[proj].usesLocalNPCImmunity = true;
|
||||
Main.projectile[proj].localNPCHitCooldown = 10;
|
||||
int proj = Projectile.NewProjectile(position, perturbedspeed, type, damage, knockBack, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[proj].Calamity().stealthStrike = true;
|
||||
Main.projectile[proj].usesLocalNPCImmunity = true;
|
||||
Main.projectile[proj].localNPCHitCooldown = 10;
|
||||
}
|
||||
spread -= Main.rand.Next(1,4);
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -42,11 +42,14 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
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].aiStyle = -1;
|
||||
Main.projectile[stealth].tileCollide = false;
|
||||
Main.projectile[stealth].usesLocalNPCImmunity = true;
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
Main.projectile[stealth].aiStyle = -1;
|
||||
Main.projectile[stealth].tileCollide = false;
|
||||
Main.projectile[stealth].usesLocalNPCImmunity = true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -51,8 +51,9 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[proj].Calamity().stealthStrike = true;
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -39,9 +39,12 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
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].usesLocalNPCImmunity = true;
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
Main.projectile[stealth].usesLocalNPCImmunity = true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
Loaded 100 of 533 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user