Merge branch 'master' into new-funny-sprites-branch

This commit is contained in:
termigator1359 committed 2020-07-27 19:27:00 -04:00
commit b3eeec63d0
150 files changed
+3821 -1558

No files matched your search

+1 -1
View File
@@ -8,7 +8,7 @@ namespace CalamityMod.Buffs.Pets
{
public override void SetDefaults()
{
DisplayName.SetDefault("Young Siren");
DisplayName.SetDefault("Ocean Spirit");
Description.SetDefault("Small and cute");
Main.buffNoTimeDisplay[Type] = true;
Main.lightPet[Type] = true;
+1 -1
View File
@@ -996,7 +996,7 @@ namespace CalamityMod.CalPlayer
modPlayer.roverDriveTimer = 0;
}
else
modPlayer.roverDriveTimer = CalamityUtils.SecondsToFrames(10f) + 1; //Doesn't reset to zero to prevent exploits
modPlayer.roverDriveTimer = 616; //Doesn't reset to zero to prevent exploits
// Silva invincibility effects
if (modPlayer.silvaCountdown > 0 && modPlayer.hasSilvaEffect && modPlayer.silvaSet)
+37 -11
View File
@@ -20,6 +20,7 @@ using CalamityMod.Items.Placeables;
using CalamityMod.Items.Placeables.Furniture.Trophies;
using CalamityMod.Items.Tools;
using CalamityMod.Items.TreasureBags;
using CalamityMod.Items.Weapons.DraedonsArsenal;
using CalamityMod.Items.Weapons.Magic;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Items.Weapons.Ranged;
@@ -59,6 +60,7 @@ using CalamityMod.NPCs.SunkenSea;
using CalamityMod.NPCs.SupremeCalamitas;
using CalamityMod.NPCs.Yharon;
using CalamityMod.Projectiles.Boss;
using CalamityMod.Projectiles.DraedonsArsenal;
using CalamityMod.Projectiles.Enemy;
using CalamityMod.Projectiles.Hybrid;
using CalamityMod.Projectiles.Magic;
@@ -67,8 +69,11 @@ using CalamityMod.Projectiles.Melee.Spears;
using CalamityMod.Projectiles.Ranged;
using CalamityMod.Projectiles.Rogue;
using CalamityMod.Projectiles.Summon;
using CalamityMod.Tiles.LivingFire;
using CalamityMod.Schematics;
using CalamityMod.Skies;
using CalamityMod.TileEntities;
using CalamityMod.Tiles;
using CalamityMod.Tiles.LivingFire;
using CalamityMod.UI;
using CalamityMod.World;
using Microsoft.Xna.Framework;
@@ -86,9 +91,6 @@ using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ModLoader.Config;
using Terraria.UI;
using CalamityMod.Schematics;
using CalamityMod.Tiles;
using CalamityMod.TileEntities;
namespace CalamityMod
{
@@ -125,6 +127,7 @@ namespace CalamityMod
public static Effect CustomShader;
public static Effect LightShader;
public static Effect TentacleShader;
public static Effect LightDistortionShader;
// DR data structure
public static SortedDictionary<int, float> DRValues;
@@ -296,6 +299,7 @@ namespace CalamityMod
CustomShader = GetEffect("Effects/CustomShader");
LightShader = GetEffect("Effects/LightBurstShader");
TentacleShader = GetEffect("Effects/TentacleShader");
LightDistortionShader = GetEffect("Effects/DistortionShader");
Filters.Scene["CalamityMod:DevourerofGodsHead"] = new Filter(new DoGScreenShaderData("FilterMiniTower").UseColor(0.4f, 0.1f, 1.0f).UseOpacity(0.5f), EffectPriority.VeryHigh);
SkyManager.Instance["CalamityMod:DevourerofGodsHead"] = new DoGSky();
@@ -331,8 +335,9 @@ namespace CalamityMod
Filters.Scene["CalamityMod:LightBurst"].Load();
GameShaders.Misc["CalamityMod:SubsumingTentacle"] = new MiscShaderData(new Ref<Effect>(TentacleShader), "BurstPass");
GameShaders.Misc["CalamityMod:LightDistortion"] = new MiscShaderData(new Ref<Effect>(LightDistortionShader), "DistortionPass");
RipperUI.Reset();
RipperUI.Reset();
AstralArcanumUI.Load(this);
GameShaders.Hair.BindShader(ModContent.ItemType<AdrenalineHairDye>(), new LegacyHairShaderData().UseLegacyMethod((Player player, Color newColor, ref bool lighting) => Color.Lerp(player.hairColor, new Color(0, 255, 171), ((float)player.Calamity().adrenaline / (float)player.Calamity().adrenalineMax))));
@@ -778,6 +783,7 @@ namespace CalamityMod
ModContent.ProjectileType<SylvanSlashAttack>(),
ModContent.ProjectileType<InfernadoFriendly>(),
ModContent.ProjectileType<MurasamaSlash>(),
ModContent.ProjectileType<PhaseslayerProjectile>(),
//Some hostile boss projectiles
ModContent.ProjectileType<BrimstoneMonster>(),
@@ -1178,7 +1184,8 @@ namespace CalamityMod
ModContent.ItemType<DazzlingStabberStaff>(),
ModContent.ItemType<PristineFury>(),
ModContent.ItemType<SarosPossession>(),
ModContent.ItemType<CinderBlossomStaff>()
ModContent.ItemType<CinderBlossomStaff>(),
ModContent.ItemType<FinalDawn>()
};
iceWeaponList = new List<int>()
@@ -1354,7 +1361,13 @@ namespace CalamityMod
ModContent.ItemType<YateveoBloom>(),
ModContent.ItemType<TerraDisk>(),
ModContent.ItemType<TerraDiskMelee>(),
ModContent.ItemType<BelladonnaSpiritStaff>()
ModContent.ItemType<BelladonnaSpiritStaff>(),
ModContent.ItemType<TenebreusTides>(),
ModContent.ItemType<Greentide>(),
ModContent.ItemType<Leviatitan>(),
ModContent.ItemType<BrackishFlask>(),
ModContent.ItemType<LeviathanTeeth>(),
ModContent.ItemType<GastricBelcherStaff>()
};
alcoholList = new List<int>()
@@ -2242,7 +2255,8 @@ namespace CalamityMod
ModContent.ItemType<AcidicRainBarrel>(),
ModContent.ItemType<SkyfinBombers>(),
ModContent.ItemType<SpentFuelContainer>(),
ModContent.ItemType<SealedSingularity>()
ModContent.ItemType<SealedSingularity>(),
ModContent.ItemType<PlasmaGrenade>()
};
flaskBombProjList = new List<int>()
@@ -2272,7 +2286,8 @@ namespace CalamityMod
ModContent.ProjectileType<GreenDonkeyKongReference>(),
ModContent.ProjectileType<SkyfinNuke>(),
ModContent.ProjectileType<SpentFuelContainerProjectile>(),
ModContent.ProjectileType<SealedSingularityProj>()
ModContent.ProjectileType<SealedSingularityProj>(),
ModContent.ProjectileType<PlasmaGrenadeProjectile>()
};
spikyBallList = new List<int>()
@@ -2415,6 +2430,7 @@ namespace CalamityMod
ModContent.ItemType<SirensSong>(),
ModContent.ItemType<BrackishFlask>(),
ModContent.ItemType<LeviathanTeeth>(),
ModContent.ItemType<GastricBelcherStaff>(),
ModContent.ItemType<LureofEnthrallment>(),
ModContent.ItemType<AquaticScourgeBag>(),
ModContent.ItemType<OldDukeBag>(),
@@ -4000,9 +4016,17 @@ namespace CalamityMod
int countdown2 = reader.ReadInt32();
CalamityWorld.bossSpawnCountdown = countdown2;
break;
case CalamityModMessageType.DeathBossSpawnCountdownSync:
case CalamityModMessageType.BRHostileProjKillSync:
int countdown3 = reader.ReadInt32();
CalamityWorld.deathBossSpawnCooldown = countdown3;
CalamityWorld.bossRushHostileProjKillCounter = countdown3;
break;
case CalamityModMessageType.DeathBossSpawnCountdownSync:
int countdown4 = reader.ReadInt32();
CalamityWorld.deathBossSpawnCooldown = countdown4;
break;
case CalamityModMessageType.ArmoredDiggerCountdownSync:
int countdown5 = reader.ReadInt32();
CalamityWorld.ArmoredDiggerSpawnCooldown = countdown5;
break;
case CalamityModMessageType.BossTypeSync:
int type = reader.ReadInt32();
@@ -4167,6 +4191,8 @@ namespace CalamityMod
BossRushStage,
DoGCountdownSync,
BossSpawnCountdownSync,
BRHostileProjKillSync,
ArmoredDiggerCountdownSync,
BossTypeSync,
DeathCountSync,
RevengeanceBoolSync,
Binary file not shown.
+2 -2
View File
@@ -143,11 +143,11 @@ namespace CalamityMod.Events
}
}
/// <summary>
/// Attempts to start the Acid Rain event. Will fail if there is another invasion going on or the EoC has not been killed yet (unless you're in hardmode).
/// Attempts to start the Acid Rain event. Will fail if there is another invasion or boss rush going on. It will also fail if the EoC, WoF, or AS has not been killed yet.
/// </summary>
public static void TryStartEvent(bool forceRain = false)
{
if (CalamityWorld.rainingAcid || (!NPC.downedBoss1 && !Main.hardMode) || CalamityWorld.bossRushActive)
if (CalamityWorld.rainingAcid || (!NPC.downedBoss1 && !Main.hardMode && !CalamityWorld.downedAquaticScourge) || CalamityWorld.bossRushActive)
return;
int playerCount = 0;
for (int i = 0; i < Main.player.Length; i++)
+1 -1
View File
@@ -54,7 +54,7 @@ namespace CalamityMod.Items.Armor
}
if (player.ownedProjectileCounts[ModContent.ProjectileType<Valkyrie>()] < 1)
{
Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType<Valkyrie>(), (int)(25f * (player.allDamage + player.minionDamage - 1f)), 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType<Valkyrie>(), (int)(20 * player.MinionDamage()), 0f, Main.myPlayer, 0f, 0f);
}
}
player.minionDamage += 0.16f;
+1 -2
View File
@@ -57,8 +57,7 @@ namespace CalamityMod.Items.Armor
}
if (player.ownedProjectileCounts[ModContent.ProjectileType<Shellfish>()] < 2)
{
int shellfish = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType<Shellfish>(), (int)(200f * player.MinionDamage()), 0f, Main.myPlayer, 0f, 0f);
Main.projectile[shellfish].Calamity().lineColor = 1;
Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType<Shellfish>(), (int)(140 * player.MinionDamage()), 0f, player.whoAmI);
}
}
player.Calamity().wearingRogueArmor = true;
+6 -2
View File
@@ -61,9 +61,9 @@ namespace CalamityMod.Items
public int timesUsed = 0;
// The damage modifications for the item are handled in player files.
public int CurrentCharge = ChargeMax;
public int CurrentCharge;
public bool Chargeable = false;
public const int ChargeMax = 150;
public int ChargeMax;
public const float ChargeDamageMinMultiplier = 0.75f;
public const float ChargeDamageReductionThreshold = 0.75f;
@@ -99,6 +99,7 @@ namespace CalamityMod.Items
#region SetDefaults
public override void SetDefaults(Item item)
{
item.Calamity().ChargeMax = ChargeMax;
if (customRarity.IsPostML() && item.rare != 10)
item.rare = 10;
@@ -1067,6 +1068,9 @@ namespace CalamityMod.Items
case CalamityRarity.Rainbow:
tt2.overrideColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB);
break;
case CalamityRarity.DraedonRust:
tt2.overrideColor = new Color(204, 71, 35);
break;
case CalamityRarity.RareVariant:
tt2.overrideColor = new Color(255, 140, 0);
break;
+2 -1
View File
@@ -17,7 +17,8 @@ namespace CalamityMod.Items
{
item.width = 40;
item.height = 40;
item.rare = 11;
item.rare = ItemRarityID.Red;
item.Calamity().customRarity = CalamityRarity.DraedonRust;
item.useAnimation = item.useTime = 20;
item.useStyle = ItemUseStyleID.HoldingUp;
}
@@ -11,11 +11,11 @@ namespace CalamityMod.Items.LoreItems
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Leviathan and Siren");
DisplayName.SetDefault("Leviathan and Anahita");
Tooltip.SetDefault("An odd pair of creatures; one seeking companionship and the other seeking sustenance.\n" +
"Perhaps two genetic misfits outcast from their homes that found comfort in assisting one another.\n" +
"Favorite this item to gain increased max health while wearing the siren heart and treasure detect while wearing the strange orb.\n" +
"Allows the young siren pet to move normally while outside of liquids.\n" +
"Favorite this item to gain increased max health while wearing the aquatic heart and treasure detect while wearing the strange orb.\n" +
"Allows the young Ocean Spirit light pet to move normally while outside of liquids.\n" +
"However, if you're not submerged in liquid you will have decreased defense and damage reduction.");
}
+4 -2
View File
@@ -1,4 +1,5 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Materials
@@ -15,8 +16,9 @@ namespace CalamityMod.Items.Materials
item.width = 30;
item.height = 24;
item.maxStack = 999;
item.value = Item.sellPrice(silver: 3);
item.rare = 1;
item.rare = ItemRarityID.Red;
item.Calamity().customRarity = CalamityRarity.DraedonRust;
item.value = Item.sellPrice(silver: 6);
}
}
}
+4 -2
View File
@@ -1,4 +1,5 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Materials
@@ -15,8 +16,9 @@ namespace CalamityMod.Items.Materials
item.width = 30;
item.height = 24;
item.maxStack = 999;
item.value = Item.sellPrice(silver: 3);
item.rare = 1;
item.rare = ItemRarityID.Red;
item.Calamity().customRarity = CalamityRarity.DraedonRust;
item.value = Item.sellPrice(silver: 6);
}
}
}
+1 -1
View File
@@ -11,7 +11,7 @@ namespace CalamityMod.Items.Pets
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Strange Orb");
Tooltip.SetDefault("Summons a young Siren light pet\n" +
Tooltip.SetDefault("Summons a miniature Ocean Spirit light pet\n" +
"Provides a large amount of light while underwater");
}
+7 -4
View File
@@ -1,8 +1,7 @@
using CalamityMod.Items.Placeables.Walls;
using CalamityMod.Items.Materials;
using CalamityMod.Tiles;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Tiles;
namespace CalamityMod.Items.Placeables
{
@@ -11,11 +10,11 @@ namespace CalamityMod.Items.Placeables
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Draedon's Charging Station");
Tooltip.SetDefault("Charges Draedon's weaponry using Power Cells");
}
public override void SetDefaults()
{
item.rare = 10;
item.width = 26;
item.height = 26;
item.maxStack = 999;
@@ -25,6 +24,10 @@ namespace CalamityMod.Items.Placeables
item.useStyle = ItemUseStyleID.SwingThrow;
item.consumable = true;
item.createTile = ModContent.TileType<DraedonItemCharger>();
item.rare = ItemRarityID.Red;
item.Calamity().customRarity = CalamityRarity.DraedonRust;
item.value = Item.buyPrice(gold: 50);
}
}
}
+7 -2
View File
@@ -1,6 +1,7 @@
using CalamityMod.Tiles;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Tiles;
namespace CalamityMod.Items.Placeables
{
@@ -9,11 +10,11 @@ namespace CalamityMod.Items.Placeables
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Draedon's Fuel Factory");
Tooltip.SetDefault("Produces Draedon Power Cells over time");
}
public override void SetDefaults()
{
item.rare = 10;
item.width = 26;
item.height = 26;
item.maxStack = 999;
@@ -23,6 +24,10 @@ namespace CalamityMod.Items.Placeables
item.useStyle = ItemUseStyleID.SwingThrow;
item.consumable = true;
item.createTile = ModContent.TileType<DraedonFuelFactory>();
item.rare = ItemRarityID.Red;
item.Calamity().customRarity = CalamityRarity.DraedonRust;
item.value = Item.buyPrice(gold: 50);
}
}
}
+35 -3
View File
@@ -1,4 +1,4 @@
using CalamityMod.UI;
using CalamityMod.Items.Materials;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -10,15 +10,47 @@ namespace CalamityMod.Items
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Draedon Power Cell");
Tooltip.SetDefault("Used at a charger to charge special weapons");
Tooltip.SetDefault("Used to charge Draedon's weaponry at a charger\n" +
"Also can be processed by the Extractinator for spare parts");
}
public override void SetDefaults()
{
item.width = 26;
item.height = 14;
item.rare = 10;
item.rare = ItemRarityID.Red;
item.Calamity().customRarity = CalamityRarity.DraedonRust;
item.maxStack = 999;
ItemID.Sets.ExtractinatorMode[item.type] = item.type;
item.consumable = true;
item.useStyle = ItemUseStyleID.SwingThrow;
item.useAnimation = 15;
item.useTime = 10;
item.autoReuse = true;
item.useTurn = true;
}
public override void ExtractinatorUse(ref int resultType, ref int resultStack)
{
float dropRand = Main.rand.NextFloat();
resultStack = 1;
// 2.5% chance for Mysterious Circuitry
// 2.5% chance for Dubious Plating
// 85% chance for 65-99 Copper Coins
// 10% chance for 1 Silver Coin
if (dropRand < 0.025f)
resultType = ModContent.ItemType<MysteriousCircuitry>();
else if (dropRand < 0.05f)
resultType = ModContent.ItemType<DubiousPlating>();
else if (dropRand < 0.9f)
{
resultType = ItemID.CopperCoin;
resultStack = Main.rand.Next(65, 100);
}
else
resultType = ItemID.SilverCoin;
}
}
}
+13 -15
View File
@@ -1,5 +1,4 @@
using CalamityMod.Items.Materials;
using CalamityMod.Items.Weapons.Magic;
using CalamityMod.Projectiles.DraedonsArsenal;
using Microsoft.Xna.Framework;
using Terraria;
@@ -8,15 +7,13 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.DraedonsArsenal
{
public class GatlingLaser : ModItem
public class GatlingLaser : ModItem
{
private int BaseDamage = 600;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Gatling Laser");
Tooltip.SetDefault("Large laser cannon used primarily by Yharim's fleet and base defense force\n" +
"Highly accurate, but lacks the power to punch through defensive targets");
"Highly accurate, but lacks the power to punch through defensive targets");
}
public override void SetDefaults()
@@ -24,7 +21,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
item.width = 58;
item.height = 24;
item.magic = true;
item.damage = BaseDamage;
item.damage = 54;
item.knockBack = 1f;
item.useTime = 2;
item.useAnimation = 2;
@@ -36,17 +33,18 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/GatlingLaserFireStart");
item.noMelee = true;
item.value = Item.buyPrice(1, 80, 0, 0);
item.rare = 10;
item.Calamity().customRarity = CalamityRarity.RareVariant;
item.value = CalamityGlobalItem.Rarity8BuyPrice;
item.rare = ItemRarityID.Red;
item.Calamity().customRarity = CalamityRarity.DraedonRust;
item.shoot = ModContent.ProjectileType<GatlingLaserProj>();
item.shootSpeed = 24f;
item.Calamity().Chargeable = true;
item.Calamity().ChargeMax = 135;
}
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0;
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 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)
{
@@ -68,11 +66,11 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 15);
recipe.AddIngredient(ModContent.ItemType<DubiousPlating>(), 15);
recipe.AddIngredient(ModContent.ItemType<AuricBar>(), 5);
recipe.AddIngredient(ModContent.ItemType<LaserRifle>());
recipe.AddIngredient(ModContent.ItemType<T1000>());
recipe.AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 10);
recipe.AddIngredient(ModContent.ItemType<DubiousPlating>(), 20);
recipe.AddIngredient(ModContent.ItemType<BarofLife>(), 5);
recipe.AddIngredient(ModContent.ItemType<InfectedArmorPlating>(), 5);
recipe.AddIngredient(ItemID.LaserMachinegun);
recipe.AddTile(TileID.LunarCraftingStation);
recipe.SetResult(this);
recipe.AddRecipe();
@@ -0,0 +1,66 @@
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.DraedonsArsenal;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.DraedonsArsenal
{
public class GaussDagger : ModItem
{
public const int HitsRequiredForFlux = 3;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Gauss Dagger");
Tooltip.SetDefault("Repeat strikes envelop foes in magnetic flux");
}
public override void SetDefaults()
{
item.damage = 30;
item.melee = true;
item.width = 26;
item.height = 26;
item.useTime = 24;
item.useAnimation = 24;
item.useStyle = ItemUseStyleID.SwingThrow;
item.useTurn = false;
item.knockBack = 7f;
item.value = CalamityGlobalItem.Rarity3BuyPrice;
item.rare = ItemRarityID.Red;
item.Calamity().customRarity = CalamityRarity.DraedonRust;
item.UseSound = SoundID.Item1;
item.autoReuse = true;
item.Calamity().Chargeable = true;
item.Calamity().ChargeMax = 50;
}
public override void OnHitNPC(Player player, NPC target, int damage, float knockBack, bool crit)
{
target.Calamity().GaussFluxTimer += 50;
if (target.Calamity().GaussFluxTimer >= 30 * HitsRequiredForFlux)
{
target.Calamity().GaussFluxTimer = 0;
if (player.whoAmI == Main.myPlayer)
{
Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType<GaussFlux>(), damage, 0f, player.whoAmI, 0f, target.whoAmI);
}
}
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 5);
recipe.AddIngredient(ModContent.ItemType<DubiousPlating>(), 7);
recipe.AddIngredient(ModContent.ItemType<AerialiteBar>(), 4);
recipe.AddIngredient(ItemID.MeteoriteBar, 4);
recipe.AddTile(TileID.Anvils);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 500 B

+11 -7
View File
@@ -10,6 +10,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Gauss Pistol");
Tooltip.SetDefault("Fires a devastating high velocity blast with extreme knockback");
}
public override void SetDefaults()
@@ -18,7 +19,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
item.height = 22;
item.magic = true;
item.mana = 6;
item.damage = 25;
item.damage = 70;
item.knockBack = 11f;
item.useTime = item.useAnimation = 20;
item.autoReuse = true;
@@ -27,22 +28,25 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/GaussWeaponFire");
item.noMelee = true;
item.value = CalamityGlobalItem.Rarity3BuyPrice;
item.rare = 3;
item.value = CalamityGlobalItem.Rarity5BuyPrice;
item.rare = ItemRarityID.Red;
item.Calamity().customRarity = CalamityRarity.DraedonRust;
item.shoot = ModContent.ProjectileType<GaussPistolShot>();
item.shootSpeed = 14f;
item.Calamity().ChargeMax = 85;
item.Calamity().Chargeable = true;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 7);
recipe.AddIngredient(ModContent.ItemType<DubiousPlating>(), 5);
recipe.AddIngredient(ModContent.ItemType<AerialiteBar>(), 10);
recipe.AddTile(TileID.Anvils);
recipe.AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 12);
recipe.AddIngredient(ModContent.ItemType<DubiousPlating>(), 8);
recipe.AddIngredient(ItemID.HallowedBar, 10);
recipe.AddIngredient(ItemID.SpaceGun);
recipe.AddTile(TileID.MythrilAnvil);
recipe.SetResult(this);
recipe.AddRecipe();
}
+13 -11
View File
@@ -1,6 +1,6 @@
using CalamityMod.Items.Materials;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Projectiles.DraedonsArsenal;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
@@ -8,12 +8,12 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.DraedonsArsenal
{
public class GaussRifle : ModItem
public class GaussRifle : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Gauss Rifle");
Tooltip.SetDefault("Fires an enormous pulse of energy");
Tooltip.SetDefault("Fires a devastating high velocity blast with absurd knockback");
}
public override void SetDefaults()
@@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
item.width = 112;
item.height = 36;
item.ranged = true;
item.damage = 8000;
item.damage = 170;
item.knockBack = 30f;
item.useTime = item.useAnimation = 28;
item.autoReuse = true;
@@ -30,14 +30,15 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/GaussWeaponFire");
item.noMelee = true;
item.value = CalamityGlobalItem.RarityVioletBuyPrice;
item.value = CalamityGlobalItem.Rarity8BuyPrice;
item.rare = ItemRarityID.Red;
item.Calamity().customRarity = CalamityRarity.RareVariant; // In accordance with the other post-ML Arsenal weapons that Fabsol made.
item.Calamity().customRarity = CalamityRarity.DraedonRust;
item.shoot = ModContent.ProjectileType<GaussRifleBlast>();
item.shootSpeed = 27f;
item.Calamity().Chargeable = true;
item.Calamity().ChargeMax = 135;
}
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,11 +50,12 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 20);
recipe.AddIngredient(ModContent.ItemType<DubiousPlating>(), 10);
recipe.AddIngredient(ModContent.ItemType<AuricBar>(), 5);
recipe.AddIngredient(ItemID.LaserRifle);
recipe.AddTile(ModContent.TileType<DraedonsForge>());
recipe.AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 18);
recipe.AddIngredient(ModContent.ItemType<DubiousPlating>(), 12);
recipe.AddIngredient(ModContent.ItemType<BarofLife>(), 5);
recipe.AddIngredient(ModContent.ItemType<InfectedArmorPlating>(), 5);
recipe.AddIngredient(ModContent.ItemType<SpectreRifle>());
recipe.AddTile(TileID.MythrilAnvil);
recipe.SetResult(this);
recipe.AddRecipe();
}
@@ -10,7 +10,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Hydraulic Volt Crasher");
Tooltip.SetDefault("Zaps nearby enemies on hit");
Tooltip.SetDefault("An electrically charged jackhammer which shocks all nearby foes on hit");
}
public override void SetDefaults()
@@ -25,25 +25,29 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
item.damage = 99;
item.hammer = 230;
item.UseSound = SoundID.Item23;
item.shoot = ModContent.ProjectileType<HydraulicVoltCrasherProjectile>();
item.rare = 10;
item.Calamity().customRarity = CalamityRarity.RareVariant;
item.value = CalamityGlobalItem.Rarity10BuyPrice;
item.value = CalamityGlobalItem.Rarity5BuyPrice;
item.rare = ItemRarityID.Red;
item.Calamity().customRarity = CalamityRarity.DraedonRust;
item.noMelee = true;
item.noUseGraphic = true;
item.melee = true;
item.channel = true;
item.Calamity().Chargeable = true;
item.Calamity().ChargeMax = 85;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 10);
recipe.AddIngredient(ModContent.ItemType<DubiousPlating>(), 10);
recipe.AddIngredient(ModContent.ItemType<MeldiateBar>(), 5);
recipe.AddTile(TileID.LunarCraftingStation);
recipe.AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 8);
recipe.AddIngredient(ModContent.ItemType<DubiousPlating>(), 12);
recipe.AddIngredient(ItemID.HallowedBar, 10);
recipe.AddIngredient(ItemID.SoulofMight, 20);
recipe.AddTile(TileID.MythrilAnvil);
recipe.SetResult(this);
recipe.AddRecipe();
}
+8 -20
View File
@@ -9,8 +9,6 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
{
public class LaserRifle : ModItem
{
private int BaseDamage = 100;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Heavy Laser Rifle");
@@ -23,7 +21,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
item.width = 84;
item.height = 28;
item.ranged = true;
item.damage = BaseDamage;
item.damage = 270;
item.knockBack = 4f;
item.useTime = 25;
item.useAnimation = 25;
@@ -33,14 +31,15 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserRifleFire");
item.noMelee = true;
item.value = CalamityGlobalItem.Rarity10BuyPrice;
item.rare = 10;
item.Calamity().customRarity = CalamityRarity.RareVariant;
item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice;
item.rare = ItemRarityID.Red;
item.Calamity().customRarity = CalamityRarity.DraedonRust;
item.shoot = ModContent.ProjectileType<LaserRifleShot>();
item.shootSpeed = 5f;
item.Calamity().Chargeable = true;
item.Calamity().ChargeMax = 190;
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
@@ -51,23 +50,12 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
velocity.Normalize();
velocity *= 5f;
}
for (int i = 0; i < 2; i++)
{
float SpeedX = velocity.X + Main.rand.Next(-1, 2) * 0.05f;
float SpeedY = velocity.Y + Main.rand.Next(-1, 2) * 0.05f;
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<LaserRifleShot>(), damage, knockBack, player.whoAmI, i, 0f);
}
// Consume 4 ammo per shot
CalamityGlobalItem.ConsumeAdditionalAmmo(player, item, 4);
return false;
}
// Disable vanilla ammo consumption
public override bool ConsumeAmmo(Player player)
{
return false;
}
@@ -76,14 +64,14 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
return new Vector2(-20, 0);
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 15);
recipe.AddIngredient(ModContent.ItemType<DubiousPlating>(), 15);
recipe.AddIngredient(ModContent.ItemType<MeldiateBar>(), 5);
recipe.AddIngredient(ItemID.LaserRifle);
recipe.AddIngredient(ModContent.ItemType<UeliaceBar>(), 8);
recipe.AddIngredient(ItemID.LunarBar, 4);
recipe.AddIngredient(ItemID.SniperRifle);
recipe.AddTile(TileID.LunarCraftingStation);
recipe.SetResult(this);
recipe.AddRecipe();
@@ -20,8 +20,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
item.width = 26;
item.height = 26;
item.summon = true;
item.damage = 15;
item.damage = 19;
item.knockBack = 2f;
item.mana = 10;
item.useTime = item.useAnimation = 25;
item.autoReuse = true;
@@ -29,8 +30,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
item.UseSound = SoundID.Item15;
item.noMelee = true;
item.value = CalamityGlobalItem.Rarity4BuyPrice;
item.rare = 4;
item.value = CalamityGlobalItem.Rarity5BuyPrice;
item.rare = ItemRarityID.Red;
item.Calamity().customRarity = CalamityRarity.DraedonRust;
item.shoot = ModContent.ProjectileType<MountedScannerSummon>();
item.shootSpeed = 1f;
@@ -78,10 +80,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 15);
recipe.AddIngredient(ModContent.ItemType<DubiousPlating>(), 5);
recipe.AddIngredient(ModContent.ItemType<EssenceofEleum>(), 3);
recipe.AddIngredient(ModContent.ItemType<EssenceofCinder>(), 3);
recipe.AddIngredient(ModContent.ItemType<EssenceofChaos>(), 3);
recipe.AddTile(TileID.Anvils);
recipe.AddIngredient(ItemID.HallowedBar, 10);
recipe.AddIngredient(ItemID.SoulofFright, 20);
recipe.AddTile(TileID.MythrilAnvil);
recipe.SetResult(this);
recipe.AddRecipe();
}
@@ -0,0 +1,81 @@
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.DraedonsArsenal;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.DraedonsArsenal
{
public class Phaseslayer : ModItem
{
public const int Damage = 19000;
// When below this percentage of charge, the sword is small instead of big.
public const float SizeChargeThreshold = 0.33f;
public const float SmallDamageMultiplier = 0.66f;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Phaseslayer");
Tooltip.SetDefault("Wield a colossal laser blade which is controlled by the cursor\n" +
"Faster swings deal more damage and release sword beams\n" +
"When at low charge, the blade is smaller and weaker");
}
public override void SetDefaults()
{
item.damage = Damage;
item.melee = true;
item.width = 26;
item.height = 26;
item.useTime = 24;
item.useAnimation = 24;
item.useStyle = ItemUseStyleID.HoldingOut;
item.useTurn = false;
item.knockBack = 7f;
item.noUseGraphic = true;
item.value = CalamityGlobalItem.RarityVioletBuyPrice;
item.rare = ItemRarityID.Red;
item.Calamity().customRarity = CalamityRarity.DraedonRust;
item.UseSound = SoundID.Item1;
item.autoReuse = true;
item.Calamity().Chargeable = true;
item.Calamity().ChargeMax = 250;
item.shoot = ModContent.ProjectileType<PhaseslayerProjectile>();
item.channel = true;
}
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 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)
{
Projectile blade = Projectile.NewProjectileDirect(position, Vector2.Zero, type, damage, knockBack, player.whoAmI);
blade.rotation = blade.AngleTo(Main.MouseWorld);
return false;
}
public override void AddRecipes()
{
void AddIndividualRecipe(int saberID)
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 15);
recipe.AddIngredient(ModContent.ItemType<DubiousPlating>(), 25);
recipe.AddIngredient(ModContent.ItemType<AuricBar>(), 4);
recipe.AddIngredient(saberID);
recipe.AddTile(ModContent.TileType<DraedonsForge>());
recipe.SetResult(this);
recipe.AddRecipe();
}
int[] phasesabers = { ItemID.WhitePhasesaber, ItemID.RedPhasesaber, ItemID.GreenPhasesaber, ItemID.BluePhasesaber, ItemID.PurplePhasesaber, ItemID.YellowPhasesaber };
foreach (int id in phasesabers)
AddIndividualRecipe(id);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 922 B

+21 -29
View File
@@ -1,3 +1,5 @@
using CalamityMod.Items.Materials;
using CalamityMod.Items.Weapons.Magic;
using CalamityMod.Projectiles.DraedonsArsenal;
using Microsoft.Xna.Framework;
using Terraria;
@@ -6,10 +8,9 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.DraedonsArsenal
{
public class PlasmaCaster : ModItem
public class PlasmaCaster : ModItem
{
private int BaseDamage = 2800;
public const int BaseDamage = 1100;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Plasma Caster");
@@ -33,14 +34,15 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/PlasmaCasterFire");
item.noMelee = true;
item.value = Item.buyPrice(1, 80, 0, 0);
item.rare = 10;
item.Calamity().customRarity = CalamityRarity.RareVariant;
item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice;
item.rare = ItemRarityID.Red;
item.Calamity().customRarity = CalamityRarity.DraedonRust;
item.shoot = ModContent.ProjectileType<PlasmaCasterShot>();
item.shootSpeed = 5f;
item.Calamity().Chargeable = true;
item.Calamity().ChargeMax = 190;
}
public override bool AltFunctionUse(Player player) => true;
@@ -61,31 +63,19 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
velocity *= 5f;
}
int ammoConsumed = 20;
float SpeedX = velocity.X + (float)Main.rand.Next(-3, 4) * 0.05f;
float SpeedY = velocity.Y + (float)Main.rand.Next(-3, 4) * 0.05f;
float damageMult = 1f;
float kbMult = 1f;
if (player.altFunctionUse == 2)
{
ammoConsumed = 5;
SpeedX = velocity.X + (float)Main.rand.Next(-15, 16) * 0.05f;
SpeedY = velocity.Y + (float)Main.rand.Next(-15, 16) * 0.05f;
damageMult = 0.3333f;
kbMult = 3f/7f;
kbMult = 3f / 7f;
}
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<PlasmaCasterShot>(), (int)(damage * damageMult), knockBack * kbMult, player.whoAmI, 0f, 0f);
// Consume 20 or 5 ammo per shot
CalamityGlobalItem.ConsumeAdditionalAmmo(player, item, ammoConsumed);
return false;
}
// Disable vanilla ammo consumption
public override bool ConsumeAmmo(Player player)
{
return false;
}
@@ -94,16 +84,18 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
return new Vector2(-10, 0);
}
/*public override void AddRecipes()
public override void AddRecipes()
{
ModRecipe r = new ModRecipe(mod);
r.AddIngredient(null, "CrownJewel");
r.AddIngredient(null, "GalacticaSingularity", 5);
r.AddIngredient(null, "BarofLife", 10);
r.AddIngredient(null, "CosmiliteBar", 15);
r.AddTile(TileID.LunarCraftingStation);
r.SetResult(this);
r.AddRecipe();
}*/
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 15);
recipe.AddIngredient(ModContent.ItemType<DubiousPlating>(), 15);
recipe.AddIngredient(ModContent.ItemType<UeliaceBar>(), 8);
recipe.AddIngredient(ItemID.LunarBar, 4);
// still awkward that the item called Plasma Rifle is the same class and exact same tier as this item
recipe.AddIngredient(ModContent.ItemType<Wingman>());
recipe.AddTile(TileID.LunarCraftingStation);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
+12 -7
View File
@@ -1,6 +1,7 @@
using CalamityMod.Items.Materials;
using CalamityMod.Items.Weapons.Rogue;
using CalamityMod.Projectiles.DraedonsArsenal;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
@@ -21,7 +22,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
{
item.width = 22;
item.height = 28;
item.damage = 50;
item.damage = 7143;
item.noMelee = true;
item.noUseGraphic = true;
item.consumable = true;
@@ -31,12 +32,16 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
item.knockBack = 3f;
item.UseSound = SoundID.Item1;
item.autoReuse = true;
item.value = CalamityGlobalItem.Rarity5BuyPrice;
item.rare = 5;
item.value = Item.sellPrice(silver: 80);
item.rare = ItemRarityID.Red;
item.Calamity().customRarity = CalamityRarity.DraedonRust;
item.shoot = ModContent.ProjectileType<PlasmaGrenadeProjectile>();
item.shootSpeed = 10f;
item.shootSpeed = 19f;
item.Calamity().rogue = true;
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile grenade = Projectile.NewProjectileDirect(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
@@ -49,9 +54,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 1);
recipe.AddIngredient(ModContent.ItemType<DubiousPlating>(), 1);
recipe.AddIngredient(ItemID.HallowedBar, 2);
recipe.AddTile(TileID.MythrilAnvil);
recipe.SetResult(this, 200);
recipe.AddIngredient(ModContent.ItemType<AuricBar>(), 1);
recipe.AddTile(ModContent.TileType<DraedonsForge>());
recipe.SetResult(this, 999);
recipe.AddRecipe();
}
}
+16 -12
View File
@@ -1,5 +1,7 @@
using CalamityMod.Items.Materials;
using CalamityMod.Items.Weapons.Summon;
using CalamityMod.Projectiles.DraedonsArsenal;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
@@ -7,27 +9,30 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.DraedonsArsenal
{
public class PoleWarper : ModItem
public class PoleWarper : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Pole Warper");
Tooltip.SetDefault("Summons two floating magnets which repel each other");
Tooltip.SetDefault("Summons two floating magnets that repel each other");
}
public override void SetDefaults()
{
item.shootSpeed = 10f;
item.damage = 33;
item.damage = 700;
item.mana = 12;
item.width = 38;
item.height = 24;
item.useTime = item.useAnimation = 30;
item.useTime = item.useAnimation = 10;
item.useStyle = ItemUseStyleID.HoldingUp;
item.noMelee = true;
item.knockBack = 8f;
item.value = CalamityGlobalItem.Rarity4BuyPrice;
item.rare = 4;
item.value = CalamityGlobalItem.RarityVioletBuyPrice;
item.rare = ItemRarityID.Red;
item.Calamity().customRarity = CalamityRarity.DraedonRust;
item.UseSound = SoundID.Item15;
item.autoReuse = true;
item.shoot = ModContent.ProjectileType<PoleWarperSummon>();
@@ -71,12 +76,11 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 6);
recipe.AddIngredient(ModContent.ItemType<DubiousPlating>(), 6);
recipe.AddIngredient(ModContent.ItemType<EssenceofEleum>(), 3);
recipe.AddIngredient(ModContent.ItemType<EssenceofCinder>(), 3);
recipe.AddIngredient(ModContent.ItemType<EssenceofChaos>(), 3);
recipe.AddTile(TileID.Anvils);
recipe.AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 25);
recipe.AddIngredient(ModContent.ItemType<DubiousPlating>(), 15);
recipe.AddIngredient(ModContent.ItemType<AuricBar>(), 4);
recipe.AddIngredient(ModContent.ItemType<DazzlingStabberStaff>());
recipe.AddTile(ModContent.TileType<DraedonsForge>());
recipe.SetResult(this);
recipe.AddRecipe();
}
+8 -11
View File
@@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
{
item.width = 62;
item.height = 22;
item.ranged = true;
item.magic = true;
item.damage = 22;
item.knockBack = 0f;
item.useTime = item.useAnimation = 20;
@@ -31,35 +31,32 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
item.noMelee = true;
item.value = CalamityGlobalItem.Rarity3BuyPrice;
item.rare = 3;
item.rare = ItemRarityID.Red;
item.Calamity().customRarity = CalamityRarity.DraedonRust;
item.shoot = ModContent.ProjectileType<PulseRifleShot>();
item.shootSpeed = 5.2f; // Keep in mind that the shot has extra updates.
item.shootSpeed = 5.2f; // This may seem low but the shot has 10 extra updates.
item.Calamity().Chargeable = true;
item.Calamity().ChargeMax = 50;
}
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.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType<PulsePistolShot>(), damage, knockBack, player.whoAmI, 0f, 0f);
// Consume 6 ammo per shot
CalamityGlobalItem.ConsumeAdditionalAmmo(player, item, 6);
return false;
}
public override Vector2? HoldoutOffset() => new Vector2(10f, 0f);
// Disable vanilla ammo consumption
public override bool ConsumeAmmo(Player player) => false;
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 5);
recipe.AddIngredient(ModContent.ItemType<DubiousPlating>(), 7);
recipe.AddIngredient(ModContent.ItemType<AerialiteBar>(), 10);
recipe.AddIngredient(ModContent.ItemType<AerialiteBar>(), 4);
recipe.AddIngredient(ItemID.MeteoriteBar, 4);
recipe.AddIngredient(ItemID.FlintlockPistol);
recipe.AddTile(TileID.Anvils);
recipe.SetResult(this);
recipe.AddRecipe();
+11 -23
View File
@@ -10,11 +10,11 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
{
public class PulseRifle : ModItem
{
private int BaseDamage = 2500;
private int BaseDamage = 4500;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Draedon's Pulse Rifle");
DisplayName.SetDefault("Pulse Rifle");
Tooltip.SetDefault("Draedon's high-efficiency electromagnetic pulse rifle\n" +
"Incredibly accurate pulse weapon, crafted and wielded by Draedon to defend against his own creations\n" +
"When the pulse hits a target it will arc to another nearby target\n" +
@@ -36,14 +36,15 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/PulseRifleFire");
item.noMelee = true;
item.value = Item.buyPrice(1, 80, 0, 0);
item.rare = 10;
item.Calamity().customRarity = CalamityRarity.RareVariant;
item.value = CalamityGlobalItem.RarityVioletBuyPrice;
item.rare = ItemRarityID.Red;
item.Calamity().customRarity = CalamityRarity.DraedonRust;
item.shoot = ModContent.ProjectileType<PulseRifleShot>();
item.shootSpeed = 5f;
item.Calamity().Chargeable = true;
item.Calamity().ChargeMax = 250;
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
@@ -59,32 +60,19 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
float SpeedY = velocity.Y + (float)Main.rand.Next(-1, 2) * 0.05f;
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<PulseRifleShot>(), damage, knockBack, player.whoAmI, 0f, 0f);
// Consume 6 ammo per shot
CalamityGlobalItem.ConsumeAdditionalAmmo(player, item, 6);
return false;
}
// Disable vanilla ammo consumption
public override bool ConsumeAmmo(Player player)
{
return false;
}
public override Vector2? HoldoutOffset()
{
return new Vector2(-10, 0);
}
public override Vector2? HoldoutOffset() => new Vector2(-10, 0);
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 15);
recipe.AddIngredient(ModContent.ItemType<DubiousPlating>(), 15);
recipe.AddIngredient(ModContent.ItemType<AuricBar>(), 5);
recipe.AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 16);
recipe.AddIngredient(ModContent.ItemType<DubiousPlating>(), 24);
recipe.AddIngredient(ModContent.ItemType<AuricBar>(), 4);
// The only arsenal weapon that is an upgrade of another arsenal weapon (and it makes sense).
recipe.AddIngredient(ModContent.ItemType<PulsePistol>());
recipe.AddIngredient(ItemID.LaserRifle);
recipe.AddTile(ModContent.TileType<DraedonsForge>());
recipe.SetResult(this);
recipe.AddRecipe();
@@ -7,29 +7,34 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.DraedonsArsenal
{
public class PulseTurretRemote : ModItem
public class PulseTurretRemote : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Pulse Turret Remote");
Tooltip.SetDefault("Summons a pulse turret which eradicates nearby foes with focused energy blasts\n" +
"Especially effective against inorganic targets");
}
public override void SetDefaults()
{
item.width = 28;
item.height = 26;
item.summon = true;
item.sentry = true;
item.damage = 21;
item.damage = 100;
item.knockBack = 0f;
item.useTime = item.useAnimation = 35;
item.mana = 10;
item.useTime = item.useAnimation = 25;
item.autoReuse = true;
item.useStyle = ItemUseStyleID.HoldingUp;
item.UseSound = SoundID.Item15;
item.noMelee = true;
item.value = CalamityGlobalItem.Rarity4BuyPrice;
item.rare = 4;
item.value = CalamityGlobalItem.Rarity5BuyPrice;
item.rare = ItemRarityID.Red;
item.Calamity().customRarity = CalamityRarity.DraedonRust;
item.shoot = ModContent.ProjectileType<PulseTurret>();
item.shootSpeed = 1f;
@@ -55,6 +60,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
}
}
Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, damage, knockBack, player.whoAmI);
//player.UpdateMaxTurrets();
}
return false;
}
@@ -62,12 +68,11 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 10);
recipe.AddIngredient(ModContent.ItemType<DubiousPlating>(), 10);
recipe.AddIngredient(ModContent.ItemType<EssenceofEleum>(), 3);
recipe.AddIngredient(ModContent.ItemType<EssenceofCinder>(), 3);
recipe.AddIngredient(ModContent.ItemType<EssenceofChaos>(), 3);
recipe.AddTile(TileID.Anvils);
recipe.AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 12);
recipe.AddIngredient(ModContent.ItemType<DubiousPlating>(), 18);
recipe.AddIngredient(ModContent.ItemType<InfectedArmorPlating>(), 5);
recipe.AddIngredient(ModContent.ItemType<BarofLife>(), 5);
recipe.AddTile(TileID.MythrilAnvil);
recipe.SetResult(this);
recipe.AddRecipe();
}
+15 -9
View File
@@ -1,4 +1,5 @@
using CalamityMod.Items.Materials;
using CalamityMod.Items.Weapons.Summon;
using CalamityMod.Projectiles.DraedonsArsenal;
using Microsoft.Xna.Framework;
using Terraria;
@@ -7,7 +8,7 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.DraedonsArsenal
{
public class SnakeEyes : ModItem
public class SnakeEyes : ModItem
{
public override void SetStaticDefaults()
{
@@ -18,16 +19,19 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
public override void SetDefaults()
{
item.shootSpeed = 10f;
item.damage = 9;
item.damage = 75;
item.mana = 12;
item.width = 38;
item.height = 24;
item.useTime = item.useAnimation = 30;
item.useTime = item.useAnimation = 15;
item.useStyle = ItemUseStyleID.HoldingUp;
item.noMelee = true;
item.knockBack = 3f;
item.value = CalamityGlobalItem.Rarity3BuyPrice;
item.rare = ItemRarityID.Orange;
item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice;
item.rare = ItemRarityID.Red;
item.Calamity().customRarity = CalamityRarity.DraedonRust;
item.UseSound = SoundID.Item15;
item.autoReuse = true;
item.shoot = ModContent.ProjectileType<SnakeEyesSummon>();
@@ -44,10 +48,12 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 7);
recipe.AddIngredient(ModContent.ItemType<DubiousPlating>(), 7);
recipe.AddIngredient(ModContent.ItemType<AerialiteBar>(), 7);
recipe.AddTile(TileID.Anvils);
recipe.AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 15);
recipe.AddIngredient(ModContent.ItemType<DubiousPlating>(), 15);
recipe.AddIngredient(ModContent.ItemType<UeliaceBar>(), 8);
recipe.AddIngredient(ItemID.LunarBar, 4);
recipe.AddIngredient(ModContent.ItemType<GodspawnHelixStaff>());
recipe.AddTile(TileID.LunarCraftingStation);
recipe.SetResult(this);
recipe.AddRecipe();
}
@@ -12,13 +12,13 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Star Swallower Containment Unit");
Tooltip.SetDefault("Summons a mechanical frog that vomits plasma onto enemies");
Tooltip.SetDefault("Summons a biomechanical frog that vomits plasma onto enemies");
}
public override void SetDefaults()
{
item.shootSpeed = 10f;
item.damage = 20;
item.damage = 24;
item.mana = 10;
item.width = 18;
item.height = 28;
@@ -27,7 +27,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
item.noMelee = true;
item.knockBack = 2.25f;
item.value = CalamityGlobalItem.Rarity3BuyPrice;
item.rare = 3;
item.rare = ItemRarityID.Red;
item.Calamity().customRarity = CalamityRarity.DraedonRust;
item.UseSound = SoundID.Item15;
item.autoReuse = true;
item.shoot = ModContent.ProjectileType<StarSwallowerSummon>();
@@ -48,9 +49,11 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 6);
recipe.AddIngredient(ModContent.ItemType<DubiousPlating>(), 6);
recipe.AddIngredient(ModContent.ItemType<AerialiteBar>(), 8);
recipe.AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 8);
recipe.AddIngredient(ModContent.ItemType<DubiousPlating>(), 4);
recipe.AddIngredient(ModContent.ItemType<AerialiteBar>(), 4);
recipe.AddIngredient(ItemID.MeteoriteBar, 4);
recipe.AddIngredient(ItemID.Frog);
recipe.AddTile(TileID.Anvils);
recipe.SetResult(this);
recipe.AddRecipe();
+8 -20
View File
@@ -10,7 +10,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
{
public class TeslaCannon : ModItem
{
private int BaseDamage = 9000;
private int BaseDamage = 10000;
public override void SetStaticDefaults()
{
@@ -35,14 +35,15 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/TeslaCannonFire");
item.noMelee = true;
item.value = Item.buyPrice(1, 80, 0, 0);
item.rare = 10;
item.Calamity().customRarity = CalamityRarity.RareVariant;
item.value = CalamityGlobalItem.RarityVioletBuyPrice;
item.rare = ItemRarityID.Red;
item.Calamity().customRarity = CalamityRarity.DraedonRust;
item.shoot = ModContent.ProjectileType<TeslaCannonShot>();
item.shootSpeed = 5f;
item.Calamity().Chargeable = true;
item.Calamity().ChargeMax = 250;
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
@@ -58,30 +59,17 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
float SpeedY = velocity.Y + (float)Main.rand.Next(-1, 2) * 0.02f;
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<TeslaCannonShot>(), damage, knockBack, player.whoAmI, 0f, 0f);
// Consume 30 ammo per shot
CalamityGlobalItem.ConsumeAdditionalAmmo(player, item, 30);
return false;
}
// Disable vanilla ammo consumption
public override bool ConsumeAmmo(Player player)
{
return false;
}
public override Vector2? HoldoutOffset()
{
return new Vector2(-20, 0);
}
public override Vector2? HoldoutOffset() => new Vector2(-20, 0);
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 15);
recipe.AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 25);
recipe.AddIngredient(ModContent.ItemType<DubiousPlating>(), 15);
recipe.AddIngredient(ModContent.ItemType<AuricBar>(), 5);
recipe.AddIngredient(ModContent.ItemType<AuricBar>(), 4);
recipe.AddIngredient(ItemID.ChargedBlasterCannon);
recipe.AddTile(ModContent.TileType<DraedonsForge>());
recipe.SetResult(this);
+4
View File
@@ -33,6 +33,9 @@ namespace CalamityMod.Items.Weapons.Magic
item.shootSpeed = 14f;
item.shoot = ModContent.ProjectileType<AcidGunStream>();
}
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)
{
for (int i = 0; i < 3; i++)
@@ -42,6 +45,7 @@ namespace CalamityMod.Items.Weapons.Magic
}
return false;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
+50 -50
View File
@@ -6,60 +6,60 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Magic
{
public class ApoctosisArray : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Apoctosis Array");
Tooltip.SetDefault("Fires ion blasts that speed up and then explode\n" +
"The higher your mana the more damage they will do\n" +
public class ApoctosisArray : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Apoctosis Array");
Tooltip.SetDefault("Fires ion blasts that speed up and then explode\n" +
"The higher your mana the more damage they will do\n" +
"Astral steroids can inhibit the potential of this weapon");
}
}
public override void SetDefaults()
{
item.width = 98;
item.damage = 55;
item.magic = true;
item.mana = 12;
item.useAnimation = 7;
item.useTime = 7;
item.useStyle = ItemUseStyleID.HoldingOut;
item.knockBack = 6.75f;
item.UseSound = SoundID.Item91;
item.autoReuse = true;
item.noMelee = true;
item.height = 34;
item.value = Item.buyPrice(1, 20, 0, 0);
item.rare = 10;
item.shoot = ModContent.ProjectileType<IonBlast>();
item.shootSpeed = 8f;
item.Calamity().customRarity = CalamityRarity.Turquoise;
}
public override void SetDefaults()
{
item.width = 98;
item.damage = 55;
item.magic = true;
item.mana = 12;
item.useAnimation = 7;
item.useTime = 7;
item.useStyle = ItemUseStyleID.HoldingOut;
item.knockBack = 6.75f;
item.UseSound = SoundID.Item91;
item.autoReuse = true;
item.noMelee = true;
item.height = 34;
item.value = Item.buyPrice(1, 20, 0, 0);
item.rare = 10;
item.shoot = ModContent.ProjectileType<IonBlast>();
item.shootSpeed = 8f;
item.Calamity().customRarity = CalamityRarity.Turquoise;
}
public override Vector2? HoldoutOffset()
{
return new Vector2(-25, 0);
}
public override Vector2? HoldoutOffset()
{
return new Vector2(-25, 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)
{
float manaAmount = (float)player.statMana * 0.01f;
float damageMult = manaAmount;
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
float manaAmount = (float)player.statMana * 0.01f;
float damageMult = manaAmount;
float injectionNerf = player.Calamity().astralInjection ? 0.6f : 1f;
int projectile = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, (int)(damage * damageMult * injectionNerf), knockBack, player.whoAmI, 0f, 0f);
Main.projectile[projectile].scale = manaAmount * 0.375f;
return false;
}
int projectile = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * damageMult * injectionNerf), knockBack, player.whoAmI);
Main.projectile[projectile].scale = manaAmount * 0.375f;
return false;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<IonBlaster>());
recipe.AddIngredient(ItemID.LunarBar, 5);
recipe.AddTile(TileID.LunarCraftingStation);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<IonBlaster>());
recipe.AddIngredient(ItemID.LunarBar, 5);
recipe.AddTile(TileID.LunarCraftingStation);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
+2
View File
@@ -35,6 +35,8 @@ namespace CalamityMod.Items.Weapons.Magic
item.Calamity().customRarity = CalamityRarity.Turquoise;
}
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)
{
for (int randomBullets = 0; randomBullets <= 4; randomBullets++)
+1 -4
View File
@@ -37,9 +37,6 @@ namespace CalamityMod.Items.Weapons.Magic
item.Calamity().customRarity = CalamityRarity.PureGreen;
}
public override Vector2? HoldoutOffset()
{
return new Vector2(-5, 0);
}
public override Vector2? HoldoutOffset() => new Vector2(-5, 0);
}
}
+51 -49
View File
@@ -6,57 +6,59 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Magic
{
public class IonBlaster : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Ion Blaster");
Tooltip.SetDefault("Fires ion blasts that speed up and then explode\n" +
"The higher your mana the more damage they will do");
}
public class IonBlaster : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Ion Blaster");
Tooltip.SetDefault("Fires ion blasts that speed up and then explode\n" +
"The higher your mana the more damage they will do\n" +
"Astral steroids can inhibit the potential of this weapon");
}
public override void SetDefaults()
{
item.width = 44;
item.damage = 30;
item.magic = true;
item.mana = 6;
item.useAnimation = 10;
item.useTime = 10;
item.useStyle = ItemUseStyleID.HoldingOut;
item.knockBack = 5.5f;
item.UseSound = SoundID.Item91;
item.autoReuse = true;
item.noMelee = true;
item.height = 28;
item.value = Item.buyPrice(0, 36, 0, 0);
item.rare = 5;
item.shoot = ModContent.ProjectileType<IonBlast>();
item.shootSpeed = 3f;
}
public override void SetDefaults()
{
item.width = 44;
item.damage = 30;
item.magic = true;
item.mana = 6;
item.useAnimation = 10;
item.useTime = 10;
item.useStyle = ItemUseStyleID.HoldingOut;
item.knockBack = 5.5f;
item.UseSound = SoundID.Item91;
item.autoReuse = true;
item.noMelee = true;
item.height = 28;
item.value = Item.buyPrice(0, 36, 0, 0);
item.rare = 5;
item.shoot = ModContent.ProjectileType<IonBlast>();
item.shootSpeed = 3f;
}
public override Vector2? HoldoutOffset()
{
return new Vector2(-5, 0);
}
public override Vector2? HoldoutOffset()
{
return 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)
{
float manaAmount = (float)player.statMana * 0.01f;
float damageMult = manaAmount * 0.75f;
int projectile = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, (int)((double)damage * damageMult), knockBack, player.whoAmI, 0.0f, 0.0f);
Main.projectile[projectile].scale = manaAmount;
return false;
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
float manaAmount = (float)player.statMana * 0.01f;
float damageMult = manaAmount * 0.75f;
float injectionNerf = player.Calamity().astralInjection ? 0.6f : 1f;
int projectile = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * damageMult * injectionNerf), knockBack, player.whoAmI);
Main.projectile[projectile].scale = manaAmount;
return false;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.SoulofFright, 10);
recipe.AddRecipeGroup("AnyAdamantiteBar", 7);
recipe.AddTile(TileID.MythrilAnvil);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.SoulofFright, 10);
recipe.AddRecipeGroup("AnyAdamantiteBar", 7);
recipe.AddTile(TileID.MythrilAnvil);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
+2
View File
@@ -34,6 +34,8 @@ namespace CalamityMod.Items.Weapons.Magic
item.shoot = ModContent.ProjectileType<SolarBeam2>();
}
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)
{
float SpeedX = speedX + (float)Main.rand.Next(-15, 16) * 0.05f;
+1 -27
View File
@@ -35,33 +35,7 @@ namespace CalamityMod.Items.Weapons.Magic
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 i = Main.myPlayer;
float num72 = item.shootSpeed;
int num73 = damage;
float num74 = knockBack;
num74 = player.GetWeaponKnockback(item, num74);
player.itemTime = item.useTime;
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
if (player.gravDir == -1f)
{
num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y;
}
float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f))
{
num78 = (float)player.direction;
}
else
{
num80 = num72 / num80;
}
num78 = 0f;
num79 = 0f;
vector2.X = (float)Main.mouseX + Main.screenPosition.X;
vector2.Y = (float)Main.mouseY + Main.screenPosition.Y;
Projectile.NewProjectile(vector2.X, vector2.Y, num78, num79, ModContent.ProjectileType<GranitePulse>(), num73, num74, i, 0f, 0f);
Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, damage, knockBack, player.whoAmI, 0f, 0f);
return false;
}
}
+4 -16
View File
@@ -13,14 +13,14 @@ namespace CalamityMod.Items.Weapons.Rogue
DisplayName.SetDefault("Toxicant Twister");
Tooltip.SetDefault("Throws a slow moving boomerang\n" +
"After a few moments, the boomerang chooses a target and rapidly homes in\n" +
"Stealth strikes fire three boomerangs that home in faster and rapidly release sand");
"Stealth strikes home in faster and rapidly release sand");
}
public override void SafeSetDefaults()
{
item.width = 42;
item.height = 46;
item.damage = 750;
item.damage = 650;
item.noMelee = true;
item.noUseGraphic = true;
item.useAnimation = item.useTime = 20;
@@ -38,20 +38,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)
{
if (player.Calamity().StealthStrikeAvailable())
{
for (int i = 0; i < 3; i++)
{
float SpeedX = speedX + (float)Main.rand.Next(-20, 21) * 0.05f;
float SpeedY = speedY + (float)Main.rand.Next(-20, 21) * 0.05f;
int stealth = Projectile.NewProjectile(position, new Vector2(SpeedX, SpeedY), type, damage, knockBack, player.whoAmI);
Main.projectile[stealth].Calamity().stealthStrike = true;
}
}
else
{
Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f);
}
int boomer = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f);
Main.projectile[boomer].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
return false;
}
}
+3 -4
View File
@@ -37,11 +37,10 @@ namespace CalamityMod.Items.Weapons.Summon
{
if (player.altFunctionUse != 2)
{
position = Main.MouseWorld;
Point mouseTileCoords = position.ToTileCoordinates();
if (WorldGen.SolidTile(mouseTileCoords.X, mouseTileCoords.Y))
Point mouseTileCoords = Main.MouseWorld.ToTileCoordinates();
if (CalamityUtils.ParanoidTileRetrieval(mouseTileCoords.X, mouseTileCoords.Y).active())
return false;
Projectile.NewProjectile(position, Vector2.Zero, type, damage, knockBack, player.whoAmI);
Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, damage, knockBack, player.whoAmI);
player.UpdateMaxTurrets();
}
return false;
+1 -23
View File
@@ -47,29 +47,7 @@ namespace CalamityMod.Items.Weapons.Summon
{
CalamityPlayer modPlayer = player.Calamity();
bool hasSummonerSet = modPlayer.tarraSummon || modPlayer.bloodflareSummon || modPlayer.godSlayerSummon || modPlayer.silvaSummon || modPlayer.dsSetBonus || modPlayer.omegaBlueSet || modPlayer.fearmongerSet; //demonshade included so summoner isn't forced to use auric for BR
player.itemTime = item.useTime;
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
if (player.gravDir == -1f)
{
num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y;
}
float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f))
{
num78 = (float)player.direction;
num80 = item.shootSpeed;
}
else
{
num80 = item.shootSpeed / num80;
}
num78 = 0f;
num79 = 0f;
vector2.X = (float)Main.mouseX + Main.screenPosition.X;
vector2.Y = (float)Main.mouseY + Main.screenPosition.Y;
Projectile.NewProjectile(vector2.X, vector2.Y, num78, num79, type, (int)((double)damage * (hasSummonerSet ? 1.0 : 0.66)), knockBack, player.whoAmI, 0f, 0f);
Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, (int)(damage * (hasSummonerSet ? 1 : 0.66)), knockBack, player.whoAmI, 0f, 0f);
return false;
}
+1 -4
View File
@@ -36,10 +36,7 @@ namespace CalamityMod.Items.Weapons.Summon
{
if (player.altFunctionUse != 2)
{
position = Main.MouseWorld;
speedX = 0;
speedY = 0;
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI);
Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, damage, knockBack, player.whoAmI);
player.UpdateMaxTurrets();
}
return false;
+1 -4
View File
@@ -38,10 +38,7 @@ namespace CalamityMod.Items.Weapons.Summon
{
if (player.altFunctionUse != 2)
{
position = Main.MouseWorld;
speedX = 0;
speedY = 0;
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI);
Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, damage, knockBack, player.whoAmI);
}
return false;
}
+4 -4
View File
@@ -38,10 +38,10 @@ namespace CalamityMod.Items.Weapons.Summon
{
if (player.altFunctionUse != 2)
{
position = Main.MouseWorld;
speedX = 0;
speedY = 0;
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 120f, 0f);
Point mouseTileCoords = Main.MouseWorld.ToTileCoordinates();
if (CalamityUtils.ParanoidTileRetrieval(mouseTileCoords.X, mouseTileCoords.Y).active())
return false;
Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, damage, knockBack, player.whoAmI, 120f, 0f);
player.UpdateMaxTurrets();
}
return false;
+65 -53
View File
@@ -21,6 +21,7 @@ using CalamityMod.Items.SummonItems.Invasion;
using CalamityMod.Items.Tools;
using CalamityMod.Items.Tools.ClimateChange;
using CalamityMod.Items.TreasureBags;
using CalamityMod.Items.Weapons.DraedonsArsenal;
using CalamityMod.Items.Weapons.Magic;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Items.Weapons.Ranged;
@@ -56,6 +57,7 @@ using CalamityMod.NPCs.SunkenSea;
using CalamityMod.NPCs.SupremeCalamitas;
using CalamityMod.NPCs.TownNPCs;
using CalamityMod.NPCs.Yharon;
using CalamityMod.Projectiles.DraedonsArsenal;
using CalamityMod.Projectiles.Summon;
using CalamityMod.World;
using Microsoft.Xna.Framework;
@@ -811,61 +813,71 @@ namespace CalamityMod
private static void SummonersAssociationSupport()
{
Mod sAssociation = ModLoader.GetMod("SummonersAssociation");
if(sAssociation != null)
if (sAssociation is null)
return;
void RegisterSummon(int summonItem, int summonBuff, int summonProjectile)
{
sAssociation.Call("AddMinionInfo", ItemType<SquirrelSquireStaff>(), BuffType<SquirrelSquireBuff>(), ProjectileType<SquirrelSquireMinion>());
sAssociation.Call("AddMinionInfo", ItemType<WulfrumController>(), BuffType<WulfrumDroidBuff>(), ProjectileType<WulfrumDroid>());
sAssociation.Call("AddMinionInfo", ItemType<SunSpiritStaff>(), BuffType<SolarSpirit>(), ProjectileType<SolarPixie>());
sAssociation.Call("AddMinionInfo", ItemType<FrostBlossomStaff>(), BuffType<FrostBlossomBuff>(), ProjectileType<FrostBlossom>());
sAssociation.Call("AddMinionInfo", ItemType<BelladonnaSpiritStaff>(), BuffType<BelladonnaSpiritBuff>(), ProjectileType<BelladonnaSpirit>());
sAssociation.Call("AddMinionInfo", ItemType<StormjawStaff>(), BuffType<StormjawBuff>(), ProjectileType<StormjawBaby>());
sAssociation.Call("AddMinionInfo", ItemType<SeaboundStaff>(), BuffType<BrittleStar>(), ProjectileType<BrittleStarMinion>());
sAssociation.Call("AddMinionInfo", ItemType<MagicalConch>(), BuffType<HermitCrab>(), ProjectileType<HermitCrabMinion>());
sAssociation.Call("AddMinionInfo", ItemType<VileFeeder>(), BuffType<VileFeederBuff>(), ProjectileType<VileFeederSummon>());
sAssociation.Call("AddMinionInfo", ItemType<ScabRipper>(), BuffType<ScabRipperBuff>(), ProjectileType<BabyBloodCrawler>());
sAssociation.Call("AddMinionInfo", ItemType<CinderBlossomStaff>(), BuffType<CinderBlossomBuff>(), ProjectileType<CinderBlossom>());
sAssociation.Call("AddMinionInfo", ItemType<BloodClotStaff>(), BuffType<BloodClot>(), ProjectileType<BloodClotMinion>());
sAssociation.Call("AddMinionInfo", ItemType<DankStaff>(), BuffType<DankCreeperBuff>(), ProjectileType<DankCreeperMinion>());
sAssociation.Call("AddMinionInfo", ItemType<HerringStaff>(), BuffType<Herring>(), ProjectileType<HerringMinion>());
sAssociation.Call("AddMinionInfo", ItemType<CorroslimeStaff>(), BuffType<Corroslime>(), ProjectileType<CorroslimeMinion>());
sAssociation.Call("AddMinionInfo", ItemType<CrimslimeStaff>(), BuffType<Crimslime>(), ProjectileType<CrimslimeMinion>());
sAssociation.Call("AddMinionInfo", ItemType<BlackHawkRemote>(), BuffType<BlackHawkBuff>(), ProjectileType<BlackHawkSummon>());
sAssociation.Call("AddMinionInfo", ItemType<CausticStaff>(), BuffType<CausticStaffBuff>(), ProjectileType<CausticStaffSummon>());
sAssociation.Call("AddMinionInfo", ItemType<AncientIceChunk>(), BuffType<IceClasper>(), ProjectileType<IceClasperMinion>());
sAssociation.Call("AddMinionInfo", ItemType<ShellfishStaff>(), BuffType<ShellfishBuff>(), ProjectileType<Shellfish>());
sAssociation.Call("AddMinionInfo", ItemType<HauntedScroll>(), BuffType<HauntedDishesBuff>(), ProjectileType<HauntedDishes>());
sAssociation.Call("AddMinionInfo", ItemType<ForgottenApexWand>(), BuffType<ApexSharkBuff>(), ProjectileType<ApexShark>());
sAssociation.Call("AddMinionInfo", ItemType<DeepseaStaff>(), BuffType<AquaticStar>(), ProjectileType<AquaticStarMinion>());
sAssociation.Call("AddMinionInfo", ItemType<SunGodStaff>(), BuffType<SolarSpiritGod>(), ProjectileType<SolarGod>());
sAssociation.Call("AddMinionInfo", ItemType<TundraFlameBlossomsStaff>(), BuffType<TundraFlameBlossomsBuff>(), ProjectileType<TundraFlameBlossom>());
sAssociation.Call("AddMinionInfo", ItemType<DormantBrimseeker>(), BuffType<DormantBrimseekerBuff>(), ProjectileType<DormantBrimseekerBab>());
sAssociation.Call("AddMinionInfo", ItemType<IgneousExaltation>(), BuffType<IgneousExaltationBuff>(), ProjectileType<IgneousBlade>());
sAssociation.Call("AddMinionInfo", ItemType<BlightedEyeStaff>(), BuffType<CalamitasEyes>(), new List<int>() { ProjectileType<Calamitamini>(), ProjectileType<Cataclymini>(), ProjectileType<Catastromini>()}, new List<float>() {1-(1f/3f), 2f/3f, 2f/3f});
//Entropy's Vigil is a bruh moment
sAssociation.Call("AddMinionInfo", ItemType<PlantationStaff>(), BuffType<PlantationBuff>(), ProjectileType<PlantSummon>());
sAssociation.Call("AddMinionInfo", ItemType<SandSharknadoStaff>(), BuffType<Sandnado>(), ProjectileType<SandnadoMinion>());
sAssociation.Call("AddMinionInfo", ItemType<GastricBelcherStaff>(), BuffType<GastricBelcherBuff>(), ProjectileType<GastricBelcher>());
sAssociation.Call("AddMinionInfo", ItemType<ResurrectionButterfly>(), BuffType<ResurrectionButterflyBuff>(), new List<int>() { ProjectileType<PinkButterfly>(), ProjectileType<PurpleButterfly>()});
sAssociation.Call("AddMinionInfo", ItemType<FuelCellBundle>(), BuffType<FuelCellBundleBuff>(), ProjectileType<PlaguebringerMK2>());
sAssociation.Call("AddMinionInfo", ItemType<GodspawnHelixStaff>(), BuffType<AstralProbeBuff>(), ProjectileType<AstralProbeSummon>());
sAssociation.Call("AddMinionInfo", ItemType<TacticalPlagueEngine>(), BuffType<TacticalPlagueEngineBuff>(), ProjectileType<TacticalPlagueEngineSummon>());
sAssociation.Call("AddMinionInfo", ItemType<ElementalAxe>(), BuffType<ElementalAxeBuff>(), ProjectileType<ElementalAxeMinion>());
sAssociation.Call("AddMinionInfo", ItemType<DazzlingStabberStaff>(), BuffType<DazzlingStabberBuff>(), ProjectileType<DazzlingStabber>());
sAssociation.Call("AddMinionInfo", ItemType<DragonbloodDisgorger>(), BuffType<BloodDragonsBuff>(), ProjectileType<SkeletalDragonMother>());
sAssociation.Call("AddMinionInfo", ItemType<Cosmilamp>(), BuffType<CosmilampBuff>(), ProjectileType<CosmilampMinion>());
sAssociation.Call("AddMinionInfo", ItemType<EtherealSubjugator>(), BuffType<Phantom>(), ProjectileType<PhantomGuy>());
sAssociation.Call("AddMinionInfo", ItemType<CalamarisLament>(), BuffType<Calamari>(), ProjectileType<CalamariMinion>());
sAssociation.Call("AddMinionInfo", ItemType<GammaHeart>(), BuffType<GammaHeadBuff>(), ProjectileType<GammaHead>());
sAssociation.Call("AddMinionInfo", ItemType<StaffoftheMechworm>(), BuffType<Mechworm>(), ProjectileType<MechwormBody>(), 1f);
sAssociation.Call("AddMinionInfo", ItemType<CorvidHarbringerStaff>(), BuffType<CorvidHarbringerBuff>(), ProjectileType<PowerfulRaven>());
sAssociation.Call("AddMinionInfo", ItemType<EndoHydraStaff>(), BuffType<EndoHydraBuff>(), ProjectileType<EndoHydraHead>());
sAssociation.Call("AddMinionInfo", ItemType<CosmicViperEngine>(), BuffType<CosmicViperEngineBuff>(), ProjectileType<CosmicViperSummon>());
sAssociation.Call("AddMinionInfo", ItemType<AngryChickenStaff>(), BuffType<YharonKindleBuff>(), ProjectileType<SonOfYharon>());
sAssociation.Call("AddMinionInfo", ItemType<MidnightSunBeacon>(), BuffType<MidnightSunBuff>(), ProjectileType<MidnightSunUFO>());
sAssociation.Call("AddMinionInfo", ItemType<CosmicImmaterializer>(), BuffType<CosmicEnergy>(), ProjectileType<CosmicEnergySpiral>());
sAssociation.Call("AddMinionInfo", ItemType<BensUmbrella>(), BuffType<MagicHatBuff>(), ProjectileType<MagicHat>());
sAssociation.Call("AddMinionInfo", ItemType<Endogenesis>(), BuffType<EndoCooperBuff>(), ProjectileType<EndoCooperBody>());
sAssociation.Call("AddMinionInfo", summonItem, summonBuff, summonProjectile);
}
RegisterSummon(ItemType<SquirrelSquireStaff>(), BuffType<SquirrelSquireBuff>(), ProjectileType<SquirrelSquireMinion>());
RegisterSummon(ItemType<WulfrumController>(), BuffType<WulfrumDroidBuff>(), ProjectileType<WulfrumDroid>());
RegisterSummon(ItemType<SunSpiritStaff>(), BuffType<SolarSpirit>(), ProjectileType<SolarPixie>());
RegisterSummon(ItemType<FrostBlossomStaff>(), BuffType<FrostBlossomBuff>(), ProjectileType<FrostBlossom>());
RegisterSummon(ItemType<BelladonnaSpiritStaff>(), BuffType<BelladonnaSpiritBuff>(), ProjectileType<BelladonnaSpirit>());
RegisterSummon(ItemType<StormjawStaff>(), BuffType<StormjawBuff>(), ProjectileType<StormjawBaby>());
RegisterSummon(ItemType<RustyBeaconPrototype>(), BuffType<RustyDroneBuff>(), ProjectileType<RustyDrone>());
RegisterSummon(ItemType<SeaboundStaff>(), BuffType<BrittleStar>(), ProjectileType<BrittleStarMinion>());
RegisterSummon(ItemType<MagicalConch>(), BuffType<HermitCrab>(), ProjectileType<HermitCrabMinion>());
RegisterSummon(ItemType<VileFeeder>(), BuffType<VileFeederBuff>(), ProjectileType<VileFeederSummon>());
RegisterSummon(ItemType<ScabRipper>(), BuffType<ScabRipperBuff>(), ProjectileType<BabyBloodCrawler>());
RegisterSummon(ItemType<CinderBlossomStaff>(), BuffType<CinderBlossomBuff>(), ProjectileType<CinderBlossom>());
RegisterSummon(ItemType<BloodClotStaff>(), BuffType<BloodClot>(), ProjectileType<BloodClotMinion>());
RegisterSummon(ItemType<DankStaff>(), BuffType<DankCreeperBuff>(), ProjectileType<DankCreeperMinion>());
RegisterSummon(ItemType<StarSwallowerContainmentUnit>(), BuffType<StarSwallowerBuff>(), ProjectileType<StarSwallowerSummon>());
RegisterSummon(ItemType<HerringStaff>(), BuffType<Herring>(), ProjectileType<HerringMinion>());
RegisterSummon(ItemType<CorroslimeStaff>(), BuffType<Corroslime>(), ProjectileType<CorroslimeMinion>());
RegisterSummon(ItemType<CrimslimeStaff>(), BuffType<Crimslime>(), ProjectileType<CrimslimeMinion>());
RegisterSummon(ItemType<BlackHawkRemote>(), BuffType<BlackHawkBuff>(), ProjectileType<BlackHawkSummon>());
RegisterSummon(ItemType<CausticStaff>(), BuffType<CausticStaffBuff>(), ProjectileType<CausticStaffSummon>());
RegisterSummon(ItemType<AncientIceChunk>(), BuffType<IceClasper>(), ProjectileType<IceClasperMinion>());
RegisterSummon(ItemType<ShellfishStaff>(), BuffType<ShellfishBuff>(), ProjectileType<Shellfish>());
RegisterSummon(ItemType<HauntedScroll>(), BuffType<HauntedDishesBuff>(), ProjectileType<HauntedDishes>());
RegisterSummon(ItemType<ForgottenApexWand>(), BuffType<ApexSharkBuff>(), ProjectileType<ApexShark>());
RegisterSummon(ItemType<MountedScanner>(), BuffType<MountedScannerBuff>(), ProjectileType<MountedScannerSummon>());
RegisterSummon(ItemType<DeepseaStaff>(), BuffType<AquaticStar>(), ProjectileType<AquaticStarMinion>());
RegisterSummon(ItemType<SunGodStaff>(), BuffType<SolarSpiritGod>(), ProjectileType<SolarGod>());
RegisterSummon(ItemType<TundraFlameBlossomsStaff>(), BuffType<TundraFlameBlossomsBuff>(), ProjectileType<TundraFlameBlossom>());
RegisterSummon(ItemType<DormantBrimseeker>(), BuffType<DormantBrimseekerBuff>(), ProjectileType<DormantBrimseekerBab>());
RegisterSummon(ItemType<IgneousExaltation>(), BuffType<IgneousExaltationBuff>(), ProjectileType<IgneousBlade>());
RegisterSummon(ItemType<PlantationStaff>(), BuffType<PlantationBuff>(), ProjectileType<PlantSummon>());
RegisterSummon(ItemType<SandSharknadoStaff>(), BuffType<Sandnado>(), ProjectileType<SandnadoMinion>());
RegisterSummon(ItemType<GastricBelcherStaff>(), BuffType<GastricBelcherBuff>(), ProjectileType<GastricBelcher>());
RegisterSummon(ItemType<FuelCellBundle>(), BuffType<FuelCellBundleBuff>(), ProjectileType<PlaguebringerMK2>());
RegisterSummon(ItemType<GodspawnHelixStaff>(), BuffType<AstralProbeBuff>(), ProjectileType<AstralProbeSummon>());
RegisterSummon(ItemType<TacticalPlagueEngine>(), BuffType<TacticalPlagueEngineBuff>(), ProjectileType<TacticalPlagueEngineSummon>());
RegisterSummon(ItemType<ElementalAxe>(), BuffType<ElementalAxeBuff>(), ProjectileType<ElementalAxeMinion>());
RegisterSummon(ItemType<SnakeEyes>(), BuffType<SnakeEyesBuff>(), ProjectileType<SnakeEyesSummon>());
RegisterSummon(ItemType<DazzlingStabberStaff>(), BuffType<DazzlingStabberBuff>(), ProjectileType<DazzlingStabber>());
RegisterSummon(ItemType<DragonbloodDisgorger>(), BuffType<BloodDragonsBuff>(), ProjectileType<SkeletalDragonMother>());
RegisterSummon(ItemType<Cosmilamp>(), BuffType<CosmilampBuff>(), ProjectileType<CosmilampMinion>());
RegisterSummon(ItemType<EtherealSubjugator>(), BuffType<Phantom>(), ProjectileType<PhantomGuy>());
RegisterSummon(ItemType<CalamarisLament>(), BuffType<Calamari>(), ProjectileType<CalamariMinion>());
RegisterSummon(ItemType<GammaHeart>(), BuffType<GammaHeadBuff>(), ProjectileType<GammaHead>());
RegisterSummon(ItemType<CorvidHarbringerStaff>(), BuffType<CorvidHarbringerBuff>(), ProjectileType<PowerfulRaven>());
RegisterSummon(ItemType<EndoHydraStaff>(), BuffType<EndoHydraBuff>(), ProjectileType<EndoHydraHead>());
RegisterSummon(ItemType<CosmicViperEngine>(), BuffType<CosmicViperEngineBuff>(), ProjectileType<CosmicViperSummon>());
RegisterSummon(ItemType<AngryChickenStaff>(), BuffType<YharonKindleBuff>(), ProjectileType<SonOfYharon>());
RegisterSummon(ItemType<MidnightSunBeacon>(), BuffType<MidnightSunBuff>(), ProjectileType<MidnightSunUFO>());
RegisterSummon(ItemType<PoleWarper>(), BuffType<PoleWarperBuff>(), ProjectileType<PoleWarperSummon>());
RegisterSummon(ItemType<CosmicImmaterializer>(), BuffType<CosmicEnergy>(), ProjectileType<CosmicEnergySpiral>());
RegisterSummon(ItemType<BensUmbrella>(), BuffType<MagicHatBuff>(), ProjectileType<MagicHat>());
RegisterSummon(ItemType<Endogenesis>(), BuffType<EndoCooperBuff>(), ProjectileType<EndoCooperBody>());
sAssociation.Call("AddMinionInfo", ItemType<BlightedEyeStaff>(), BuffType<CalamitasEyes>(), new List<int>() { ProjectileType<Calamitamini>(), ProjectileType<Cataclymini>(), ProjectileType<Catastromini>()}, new List<float>() {1-(1f/3f), 2f/3f, 2f/3f});
//Entropy's Vigil is a bruh moment
sAssociation.Call("AddMinionInfo", ItemType<ResurrectionButterfly>(), BuffType<ResurrectionButterflyBuff>(), new List<int>() { ProjectileType<PinkButterfly>(), ProjectileType<PurpleButterfly>()});
sAssociation.Call("AddMinionInfo", ItemType<StaffoftheMechworm>(), BuffType<Mechworm>(), ProjectileType<MechwormBody>(), 1f);
}
}
}
+20 -7
View File
@@ -76,7 +76,7 @@ namespace CalamityMod.NPCs.Abyss
public override void AI()
{
if (npc.justHit || npc.life <= npc.lifeMax * 0.98 || Main.player[npc.target].chaosState)
if (npc.justHit || detectsPlayer || Main.player[npc.target].chaosState)
{
detectsPlayer = true;
npc.damage = Main.expertMode ? 340 : 170;
@@ -221,16 +221,29 @@ namespace CalamityMod.NPCs.Abyss
{
npc.spriteDirection = 1;
}
if (Main.player[npc.target].dead)
{
npc.TargetClosest(false);
}
npc.alpha -= 42;
if (Main.player[npc.target].dead)
{
npc.TargetClosest(false);
npc.velocity.Y += 3f;
if (npc.position.Y > Main.worldSurface * 16.0)
npc.velocity.Y += 3f;
if (npc.position.Y > (Main.maxTilesY - 200) * 16.0)
{
for (int a = 0; a < Main.maxNPCs; a++)
{
if (Main.npc[a].type == npc.type || Main.npc[a].type == ModContent.NPCType<EidolonWyrmBodyAlt>() || Main.npc[a].type == ModContent.NPCType<EidolonWyrmBody>() || Main.npc[a].type == ModContent.NPCType<EidolonWyrmTail>())
Main.npc[a].active = false;
}
}
}
npc.alpha -= 42;
if (npc.alpha < 0)
{
npc.alpha = 0;
}
if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 6400f || !NPC.AnyNPCs(ModContent.NPCType<EidolonWyrmTail>()) || !Main.player[npc.target].Calamity().ZoneAbyss)
if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 6400f || !NPC.AnyNPCs(ModContent.NPCType<EidolonWyrmTail>()))
{
npc.active = false;
}
+20 -3
View File
@@ -78,7 +78,7 @@ namespace CalamityMod.NPCs.Abyss
{
npc.TargetClosest(true);
}
if (npc.justHit || npc.life <= npc.lifeMax * 0.98 || Main.player[npc.target].chaosState)
if (npc.justHit || detectsPlayer || Main.player[npc.target].chaosState)
{
if (!detectsPlayer)
{
@@ -216,6 +216,7 @@ namespace CalamityMod.NPCs.Abyss
}
}
}
if (npc.velocity.X < 0f)
{
npc.spriteDirection = -1;
@@ -224,16 +225,32 @@ namespace CalamityMod.NPCs.Abyss
{
npc.spriteDirection = 1;
}
if (Main.player[npc.target].dead)
{
npc.TargetClosest(false);
}
npc.velocity.Y += 3f;
if (npc.position.Y > Main.worldSurface * 16.0)
npc.velocity.Y += 3f;
if (npc.position.Y > (Main.maxTilesY - 200) * 16.0)
{
for (int a = 0; a < Main.maxNPCs; a++)
{
if (Main.npc[a].type == npc.type || Main.npc[a].type == ModContent.NPCType<EidolonWyrmBodyAltHuge>() || Main.npc[a].type == ModContent.NPCType<EidolonWyrmBodyHuge>() || Main.npc[a].type == ModContent.NPCType<EidolonWyrmTailHuge>())
Main.npc[a].active = false;
}
}
}
npc.alpha -= 42;
if (npc.alpha < 0)
{
npc.alpha = 0;
}
if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 6400f || !NPC.AnyNPCs(ModContent.NPCType<EidolonWyrmTailHuge>()))
if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 6400f || !NPC.AnyNPCs(ModContent.NPCType<EidolonWyrmTailHuge>()))
{
npc.active = false;
}
+1 -1
View File
@@ -42,7 +42,7 @@ namespace CalamityMod.NPCs.AcidRain
else if (CalamityWorld.downedAquaticScourge)
{
npc.damage = 80;
npc.lifeMax = 705;
npc.lifeMax = 420;
}
npc.value = Item.buyPrice(0, 0, 3, 32);
+1 -1
View File
@@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.AcidRain
npc.aiStyle = aiType = -1;
npc.damage = 66;
npc.lifeMax = 6000;
npc.lifeMax = 4000;
npc.defense = 25;
if (CalamityWorld.downedPolterghast)
+1 -1
View File
@@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.AcidRain
npc.height = 70;
npc.damage = 0;
npc.lifeMax = 700;
npc.lifeMax = 600;
npc.aiStyle = aiType = -1;
+1 -1
View File
@@ -25,7 +25,7 @@ namespace CalamityMod.NPCs.AcidRain
npc.height = 30;
npc.damage = 75;
npc.lifeMax = 640;
npc.lifeMax = 425;
npc.defense = 5;
npc.knockBackResist = 0f;
+1 -1
View File
@@ -39,7 +39,7 @@ namespace CalamityMod.NPCs.AcidRain
else if (CalamityWorld.downedAquaticScourge)
{
npc.damage = 80;
npc.lifeMax = 420;
npc.lifeMax = 380;
}
npc.knockBackResist = 0.7f;
+1 -1
View File
@@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.AcidRain
npc.aiStyle = aiType = -1;
npc.damage = 75;
npc.lifeMax = 605;
npc.lifeMax = 520;
npc.defense = 15;
npc.DR_NERD(0.075f);
+2 -2
View File
@@ -25,7 +25,7 @@ namespace CalamityMod.NPCs.AcidRain
npc.width = 24;
npc.height = 24;
npc.defense = 5;
npc.lifeMax = 100;
npc.lifeMax = 50;
if (CalamityWorld.downedPolterghast)
{
@@ -36,7 +36,7 @@ namespace CalamityMod.NPCs.AcidRain
else if (CalamityWorld.downedAquaticScourge)
{
npc.damage = 75;
npc.lifeMax = 640;
npc.lifeMax = 130;
npc.defense = 10;
}
+2 -2
View File
@@ -31,7 +31,7 @@ namespace CalamityMod.NPCs.AcidRain
npc.aiStyle = aiType = -1;
npc.damage = 12;
npc.lifeMax = 150;
npc.lifeMax = 70;
npc.defense = 6;
npc.knockBackResist = 1f;
@@ -46,7 +46,7 @@ namespace CalamityMod.NPCs.AcidRain
else if (CalamityWorld.downedAquaticScourge)
{
npc.damage = 85;
npc.lifeMax = 700;
npc.lifeMax = 400;
npc.DR_NERD(0.05f);
}
+1 -1
View File
@@ -39,7 +39,7 @@ namespace CalamityMod.NPCs.AcidRain
npc.height = 48;
npc.damage = 70;
npc.lifeMax = 660;
npc.lifeMax = 520;
npc.defense = 3;
if (CalamityWorld.downedPolterghast)
+1 -1
View File
@@ -32,7 +32,7 @@ namespace CalamityMod.NPCs.AcidRain
npc.aiStyle = aiType = -1;
npc.damage = 66;
npc.lifeMax = 850;
npc.lifeMax = 600;
npc.defense = 15;
npc.DR_NERD(0.25f);
+2 -2
View File
@@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.AcidRain
npc.height = 14;
npc.damage = 20;
npc.lifeMax = 80;
npc.lifeMax = 60;
npc.defense = 0;
if (CalamityWorld.downedPolterghast)
@@ -39,7 +39,7 @@ namespace CalamityMod.NPCs.AcidRain
else if (CalamityWorld.downedAquaticScourge)
{
npc.damage = 80;
npc.lifeMax = 320;
npc.lifeMax = 150;
}
npc.value = Item.buyPrice(0, 0, 2, 5);
+9 -4
View File
@@ -3529,10 +3529,13 @@ namespace CalamityMod.NPCs
// Increase projectile fire rate based on number of nearby active tiles
float projectileFireRateMultiplier = MathHelper.Lerp(1f, 4f, 1f - ((tileEnrageMult - 1f) / 0.8f));
// Decrease projectile time left based on number of nearby active tiles
int baseProjectileTimeLeft = (int)(333.4f * tileEnrageMult);
// Increase damage of projectiles and contact damage based on number of nearby active tiles
int damageIncrease = 0;
if (nearbyActiveTiles < 400)
damageIncrease += (400 - nearbyActiveTiles) / 20; // Ranges from 0 to 20
damageIncrease += (400 - nearbyActiveTiles) / 40; // Ranges from 0 to 10
npc.damage = npc.defDamage + damageIncrease * 4;
@@ -3615,7 +3618,7 @@ namespace CalamityMod.NPCs
vector104.X += num942 * 5f;
vector104.Y += num943 * 5f;
int num947 = Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, num946, damage, 0f, Main.myPlayer, tileEnrageMult, 0f);
Main.projectile[num947].timeLeft = 300;
Main.projectile[num947].timeLeft = baseProjectileTimeLeft / 2;
npc.netUpdate = true;
}
@@ -3626,7 +3629,8 @@ namespace CalamityMod.NPCs
for (int i = 0; i < 12; i++)
{
float ai1 = player.ZoneDungeon ? 0f : 1f;
Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0f, 0f, ModContent.ProjectileType<DarkEnergyBall2>(), damage, 0f, Main.myPlayer, i * 30, ai1);
int proj = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0f, 0f, ModContent.ProjectileType<DarkEnergyBall2>(), damage, 0f, Main.myPlayer, i * 30, ai1);
Main.projectile[proj].timeLeft = baseProjectileTimeLeft;
}
}
else
@@ -3641,7 +3645,8 @@ namespace CalamityMod.NPCs
for (i = 0; i < 4; i++)
{
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
Projectile.NewProjectile(npc.Center.X, npc.Center.Y, (float)(Math.Sin(offsetAngle) * 3f), (float)(Math.Cos(offsetAngle) * 3f), ModContent.ProjectileType<DarkEnergyBall>(), damage, 0f, Main.myPlayer, passedVar, 0f);
int proj = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, (float)(Math.Sin(offsetAngle) * 3f), (float)(Math.Cos(offsetAngle) * 3f), ModContent.ProjectileType<DarkEnergyBall>(), damage, 0f, Main.myPlayer, passedVar, 0f);
Main.projectile[proj].timeLeft = baseProjectileTimeLeft;
passedVar += 1f;
}
}
+3 -3
View File
@@ -8695,7 +8695,7 @@ namespace CalamityMod.NPCs
float radians = MathHelper.TwoPi / totalTentacles;
for (int i = 0; i < totalTentacles; i++)
{
Vector2 vector255 = new Vector2(0f, -60f * totalTentacles).RotatedBy(radians * i);
Vector2 vector255 = new Vector2(0f, -65f * totalTentacles).RotatedBy(radians * i);
NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI, vector255.X, vector255.Y, 1f, 0f, 255);
}
}
@@ -8821,7 +8821,7 @@ namespace CalamityMod.NPCs
float radians = MathHelper.TwoPi / totalTentacles;
for (int i = 0; i < totalTentacles; i++)
{
Vector2 vector255 = new Vector2(0f, -60f * totalTentacles).RotatedBy(radians * i);
Vector2 vector255 = new Vector2(0f, -65f * totalTentacles).RotatedBy(radians * i);
NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI, vector255.X, vector255.Y, 2f, 0f, 255);
}
}
@@ -10160,7 +10160,7 @@ namespace CalamityMod.NPCs
if (!Collision.CanHit(Main.npc[NPC.golemBoss].Center, 1, 1, Main.player[npc.target].Center, 1, 1))
npc.ai[2] += 8f;
if (npc.ai[2] >= 150f && Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 160f)
if (npc.ai[2] >= 240f && Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 160f)
{
npc.ai[2] = 0f;
+165 -52
View File
@@ -149,6 +149,7 @@ namespace CalamityMod.NPCs
public int kamiFlu = 0;
public int relicOfResilienceCooldown = 0;
public int relicOfResilienceWeakness = 0;
public int GaussFluxTimer = 0;
// whoAmI Variables
public static int[] bobbitWormBottom = new int[5];
@@ -470,6 +471,33 @@ namespace CalamityMod.NPCs
ResetSavedIndex(ref SCalCatastrophe, NPCType<SupremeCatastrophe>());
ResetSavedIndex(ref SCal, NPCType<SupremeCalamitas.SupremeCalamitas>());
ResetSavedIndex(ref SCalWorm, NPCType<SCalWormHead>());
if (NPC.FindFirstNPC(NPCID.Guide) == -1)
CalamityWorld.guideName = false;
if (NPC.FindFirstNPC(NPCID.Wizard) == -1)
CalamityWorld.wizardName = false;
if (NPC.FindFirstNPC(NPCID.Steampunker) == -1)
CalamityWorld.steampunkerName = false;
if (NPC.FindFirstNPC(NPCID.Stylist) == -1)
CalamityWorld.stylistName = false;
if (NPC.FindFirstNPC(NPCID.WitchDoctor) == -1)
CalamityWorld.witchDoctorName = false;
if (NPC.FindFirstNPC(NPCID.TaxCollector) == -1)
CalamityWorld.taxCollectorName = false;
if (NPC.FindFirstNPC(NPCID.Pirate) == -1)
CalamityWorld.pirateName = false;
if (NPC.FindFirstNPC(NPCID.Mechanic) == -1)
CalamityWorld.mechanicName = false;
if (NPC.FindFirstNPC(NPCID.ArmsDealer) == -1)
CalamityWorld.armsDealerName = false;
if (NPC.FindFirstNPC(NPCID.Dryad) == -1)
CalamityWorld.dryadName = false;
if (NPC.FindFirstNPC(NPCID.Nurse) == -1)
CalamityWorld.nurseName = false;
if (NPC.FindFirstNPC(NPCID.Angler) == -1)
CalamityWorld.anglerName = false;
if (NPC.FindFirstNPC(NPCID.Clothier) == -1)
CalamityWorld.clothierName = false;
}
#endregion
@@ -2452,205 +2480,266 @@ namespace CalamityMod.NPCs
switch (npc.type)
{
case NPCID.Guide:
if (CalamityWorld.guideName)
break;
switch (Main.rand.Next(38)) // 34 guide names
{
case 0:
npc.GivenName = "Lapp";
CalamityWorld.guideName = true;
break;
case 1:
npc.GivenName = "Ben Shapiro";
CalamityWorld.guideName = true;
break;
case 2:
npc.GivenName = "StreakistYT";
CalamityWorld.guideName = true;
break;
case 3:
npc.GivenName = "Neoplasmatic";
CalamityWorld.guideName = true;
break;
default:
CalamityWorld.guideName = true;
break;
}
break;
case NPCID.Wizard:
if (CalamityWorld.wizardName)
break;
switch (Main.rand.Next(26)) // 23 wizard names
{
case 0:
npc.GivenName = "Mage One-Trick";
CalamityWorld.wizardName = true;
break;
case 1:
npc.GivenName = "Inorim, son of Ivukey";
CalamityWorld.wizardName = true;
break;
case 2:
npc.GivenName = "Jensen";
CalamityWorld.wizardName = true;
break;
default:
CalamityWorld.wizardName = true;
break;
}
break;
case NPCID.Steampunker:
if (CalamityWorld.steampunkerName)
break;
switch (Main.rand.Next(23)) // 21 steampunker names
{
case 0:
npc.GivenName = "Vorbis";
CalamityWorld.steampunkerName = true;
break;
case 1:
npc.GivenName = "Angel";
CalamityWorld.steampunkerName = true;
break;
default:
CalamityWorld.steampunkerName = true;
break;
}
break;
case NPCID.Stylist:
if (CalamityWorld.stylistName)
break;
switch (Main.rand.Next(21)) // 20 stylist names
{
case 0:
npc.GivenName = "Amber";
CalamityWorld.stylistName = true;
break;
default:
CalamityWorld.stylistName = true;
break;
}
break;
case NPCID.WitchDoctor:
if (CalamityWorld.witchDoctorName)
break;
switch (Main.rand.Next(11)) // 10 witch doctor names
{
case 0:
npc.GivenName = "Sok'ar";
CalamityWorld.witchDoctorName = true;
break;
default:
CalamityWorld.witchDoctorName = true;
break;
}
break;
case NPCID.TaxCollector:
if (CalamityWorld.taxCollectorName)
break;
switch (Main.rand.Next(21)) // 20 tax collector names
{
case 0:
npc.GivenName = "Emmett";
CalamityWorld.taxCollectorName = true;
break;
default:
CalamityWorld.taxCollectorName = true;
break;
}
break;
case NPCID.Pirate:
if (CalamityWorld.pirateName)
break;
switch (Main.rand.Next(12)) // 11 pirate names
{
case 0:
npc.GivenName = "Tyler Van Hook";
CalamityWorld.pirateName = true;
break;
default:
CalamityWorld.pirateName = true;
break;
}
break;
case NPCID.Mechanic:
if (CalamityWorld.mechanicName)
break;
switch (Main.rand.Next(26)) // 24 mechanic names
{
case 0:
npc.GivenName = "Lilly";
CalamityWorld.mechanicName = true;
break;
case 1:
npc.GivenName = "Daawn";
CalamityWorld.mechanicName = true;
break;
default:
CalamityWorld.mechanicName = true;
break;
}
break;
case NPCID.ArmsDealer:
if (CalamityWorld.armsDealerName)
break;
switch (Main.rand.Next(26)) // 24 arms dealer names
{
case 0:
npc.GivenName = "Drifter";
CalamityWorld.armsDealerName = true;
break;
case 1:
npc.GivenName = "Finchi";
CalamityWorld.armsDealerName = true;
break;
default:
CalamityWorld.armsDealerName = true;
break;
}
break;
case NPCID.Dryad:
if (CalamityWorld.dryadName)
break;
switch (Main.rand.Next(23)) // 21 Dryad names
{
case 0:
npc.GivenName = "Rythmi";
CalamityWorld.dryadName = true;
break;
case 1:
npc.GivenName = "Izuna";
npc.GivenName = "Izuna";
CalamityWorld.dryadName = true;
break;
default:
CalamityWorld.dryadName = true;
break;
}
break;
case NPCID.Nurse:
if (CalamityWorld.nurseName)
break;
switch (Main.rand.Next(25)) // 24 nurse names
{
case 0:
npc.GivenName = "Farsni";
CalamityWorld.nurseName = true;
break;
default:
CalamityWorld.nurseName = true;
break;
}
break;
case NPCID.Angler:
if (CalamityWorld.anglerName)
break;
switch (Main.rand.Next(23)) // 22 angler names
{
case 0:
npc.GivenName = "Dazren";
CalamityWorld.anglerName = true;
break;
default:
CalamityWorld.anglerName = true;
break;
}
break;
case NPCID.Clothier:
if (CalamityWorld.clothierName)
break;
switch (Main.rand.Next(26)) // 25 clothier names
{
case 0:
npc.GivenName = "Joeseph Jostar";
CalamityWorld.clothierName = true;
break;
default:
CalamityWorld.clothierName = true;
break;
}
@@ -3012,7 +3101,7 @@ namespace CalamityMod.NPCs
case 33:
if (npc.type != NPCType<Siren>() && npc.type != NPCType<Leviathan.Leviathan>() &&
npc.type != NPCType<AquaticAberration>() && npc.type != NPCType<Parasea>() &&
npc.type != NPCType<SirenIce>())
npc.type != NPCType<SirenIce>() && npc.type != NPCID.DetonatingBubble)
{
npc.active = false;
npc.netUpdate = true;
@@ -3198,6 +3287,8 @@ namespace CalamityMod.NPCs
relicOfResilienceCooldown--;
if (relicOfResilienceWeakness > 0)
relicOfResilienceWeakness--;
if (GaussFluxTimer > 0)
GaussFluxTimer--;
if (ladHearts > 0)
ladHearts--;
@@ -3888,28 +3979,13 @@ namespace CalamityMod.NPCs
if (Main.rand.NextBool(maxValue) && Main.wallDungeon[Main.tile[(int)npc.Center.X / 16, (int)npc.Center.Y / 16].wall])
{
int randomType = Main.rand.Next(4);
switch (randomType)
{
case 0:
randomType = NPCType<PhantomSpirit>();
break;
case 1:
randomType = NPCType<PhantomSpiritS>();
break;
case 2:
randomType = NPCType<PhantomSpiritM>();
break;
case 3:
randomType = NPCType<PhantomSpiritL>();
break;
default:
break;
}
int randomType = Utils.SelectRandom(Main.rand, new int[]
{
NPCType<PhantomSpirit>(),
NPCType<PhantomSpiritS>(),
NPCType<PhantomSpiritM>(),
NPCType<PhantomSpiritL>()
});
NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, randomType, 0, 0f, 0f, 0f, 0f, 255);
}
@@ -3931,25 +4007,22 @@ namespace CalamityMod.NPCs
{
if (Main.netMode != NetmodeID.MultiplayerClient)
{
int num261 = Main.rand.Next(2) + 2;
int num;
for (int num262 = 0; num262 < num261; num262 = num + 1)
int slimeAmt = Main.rand.Next(2) + 2; //2 to 3 extra
for (int s = 0; s < slimeAmt; s++)
{
int num263 = NPC.NewNPC((int)(npc.position.X + npc.width / 2), (int)(npc.position.Y + npc.height), 1, 0, 0f, 0f, 0f, 0f, 255);
NPC npc2 = Main.npc[num263];
npc2.SetDefaults(-5, -1f);
int slime = NPC.NewNPC((int)npc.Center.X, (int)(npc.position.Y + npc.height), NPCID.BlueSlime, 0, 0f, 0f, 0f, 0f, 255);
NPC npc2 = Main.npc[slime];
npc2.SetDefaults(NPCID.BabySlime);
npc2.velocity.X = npc.velocity.X * 2f;
npc2.velocity.Y = npc.velocity.Y;
npc2.velocity.X += Main.rand.Next(-20, 20) * 0.1f + num262 * npc.direction * 0.3f;
npc2.velocity.Y -= Main.rand.Next(0, 10) * 0.1f + num262;
npc2.velocity.X += Main.rand.Next(-20, 20) * 0.1f + s * npc.direction * 0.3f;
npc2.velocity.Y -= Main.rand.Next(0, 10) * 0.1f + s;
npc2.ai[0] = -1000 * Main.rand.Next(3);
if (Main.netMode == NetmodeID.Server && num263 < 200)
if (Main.netMode == NetmodeID.Server && slime < Main.maxNPCs)
{
NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num263, 0f, 0f, 0f, 0, 0, 0);
NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, slime, 0f, 0f, 0f, 0, 0, 0);
}
num = num262;
}
}
}
@@ -4166,6 +4239,13 @@ namespace CalamityMod.NPCs
pool[NPCID.BlueJellyfish] = SpawnCondition.CaveJellyfish.Chance;
}
// Add Truffle Worm spawns to surface mushroom biome
if (spawnInfo.player.ZoneGlowshroom && Main.hardMode && (spawnInfo.player.ZoneOverworldHeight || spawnInfo.player.ZoneSkyHeight))
{
if (NPC.CountNPCS(NPCID.TruffleWorm) < 2)
pool[NPCID.TruffleWorm] = SpawnCondition.OverworldMushroom.Chance * 0.5f;
}
if (spawnInfo.player.Calamity().ZoneAbyss ||
spawnInfo.player.Calamity().ZoneCalamity ||
spawnInfo.player.Calamity().ZoneSulphur ||
@@ -4445,7 +4525,6 @@ namespace CalamityMod.NPCs
dust.alpha = 200;
dust.velocity.Y -= 0.2f;
dust.velocity *= 1.2f;
dust = Main.dust[num4];
dust.scale += Main.rand.NextFloat();
}
}
@@ -4547,10 +4626,8 @@ namespace CalamityMod.NPCs
{
if (Main.rand.NextBool(5))
{
Vector2 vector2_2 = new Vector2((float)Main.rand.Next(-10, 11), (float)Main.rand.Next(-10, 11));
vector2_2.Normalize();
vector2_2.X *= 0.66f;
int heart = Gore.NewGore(npc.position + new Vector2((float)Main.rand.Next(npc.width + 1), (float)Main.rand.Next(npc.height + 1)), vector2_2 * (float)Main.rand.Next(3, 6) * 0.33f, 331, (float)Main.rand.Next(40, 121) * 0.01f);
Vector2 velocity = CalamityUtils.RandomVelocity(10f, 1f, 1f, 0.66f);
int heart = Gore.NewGore(npc.position + new Vector2(Main.rand.Next(npc.width + 1), Main.rand.Next(npc.height + 1)), velocity * Main.rand.Next(3, 6) * 0.33f, 331, Main.rand.Next(40, 121) * 0.01f);
Main.gore[heart].sticky = false;
Main.gore[heart].velocity *= 0.4f;
Main.gore[heart].velocity.Y -= 0.6f;
@@ -5662,10 +5739,46 @@ namespace CalamityMod.NPCs
break;
}
}
#endregion
#endregion
#region Shop Stuff
public override void SetupShop(int type, Chest shop, ref int nextSlot)
#region Buff Town NPC
public override void BuffTownNPC(ref float damageMult, ref int defense)
{
if (NPC.downedMoonlord)
{
damageMult += 0.6f;
defense += 20;
}
if (CalamityWorld.downedProvidence)
{
damageMult += 0.2f;
defense += 12;
}
if (CalamityWorld.downedPolterghast)
{
damageMult += 0.2f;
defense += 12;
}
if (CalamityWorld.downedDoG)
{
damageMult += 0.2f;
defense += 12;
}
if (CalamityWorld.downedYharon)
{
damageMult += 0.2f;
defense += 12;
}
if (CalamityWorld.downedSCal)
{
damageMult += 0.6f;
defense += 20;
}
}
#endregion
#region Shop Stuff
public override void SetupShop(int type, Chest shop, ref int nextSlot)
{
if (type == NPCID.Merchant)
{
@@ -6142,7 +6255,7 @@ namespace CalamityMod.NPCs
}
int players = 0;
for (int i = 0; i < 255; i++)
for (int i = 0; i < Main.maxPlayers; i++)
{
if (Main.player[i] != null && Main.player[i].active)
{
@@ -6188,14 +6301,14 @@ namespace CalamityMod.NPCs
{
if (plr == Main.myPlayer && projectile.ai[0] == 0f)
{
for (int num13 = 0; num13 < Main.maxInventory; num13++)
for (int item = 0; item < Main.maxInventory; item++)
{
if (player.inventory[num13].type == baitType)
if (player.inventory[item].type == baitType)
{
player.inventory[num13].stack--;
if (player.inventory[num13].stack <= 0)
player.inventory[item].stack--;
if (player.inventory[item].stack <= 0)
{
player.inventory[num13].SetDefaults(0, false);
player.inventory[item].SetDefaults(0, false);
}
break;
}
@@ -6206,8 +6319,8 @@ namespace CalamityMod.NPCs
if (Main.netMode != NetmodeID.MultiplayerClient)
{
int num8 = NPC.NewNPC((int)projectile.Center.X, (int)projectile.Center.Y + 100, type);
CalamityUtils.BossAwakenMessage(num8);
int boss = NPC.NewNPC((int)projectile.Center.X, (int)projectile.Center.Y + 100, type);
CalamityUtils.BossAwakenMessage(boss);
}
else
{
+48 -1
View File
@@ -407,91 +407,109 @@ namespace CalamityMod.NPCs
{
CalamityWorld.bossRushStage = 7;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
}
else if (npc.type == ModContent.NPCType<AstrumAureus.AstrumAureus>())
{
CalamityWorld.bossRushStage = 9;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
}
else if (npc.type == ModContent.NPCType<Bumblefuck>())
{
CalamityWorld.bossRushStage = 12;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
}
else if (npc.type == ModContent.NPCType<HiveMindP2>())
{
CalamityWorld.bossRushStage = 14;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
}
else if (npc.type == ModContent.NPCType<StormWeaverHeadNaked>())
{
CalamityWorld.bossRushStage = 16;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
}
else if (npc.type == ModContent.NPCType<AquaticScourgeHead>())
{
CalamityWorld.bossRushStage = 17;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
}
else if (npc.type == ModContent.NPCType<DesertScourgeHead>())
{
CalamityWorld.bossRushStage = 18;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
}
else if (npc.type == ModContent.NPCType<CrabulonIdle>())
{
CalamityWorld.bossRushStage = 20;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
}
else if (npc.type == ModContent.NPCType<CeaselessVoid.CeaselessVoid>())
{
CalamityWorld.bossRushStage = 22;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
}
else if (npc.type == ModContent.NPCType<PerforatorHive>())
{
CalamityWorld.bossRushStage = 23;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
}
else if (npc.type == ModContent.NPCType<Cryogen.Cryogen>())
{
CalamityWorld.bossRushStage = 24;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
}
else if (npc.type == ModContent.NPCType<BrimstoneElemental.BrimstoneElemental>())
{
CalamityWorld.bossRushStage = 25;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
}
else if (npc.type == ModContent.NPCType<Signus.Signus>())
{
CalamityWorld.bossRushStage = 26;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
}
else if (npc.type == ModContent.NPCType<RavagerBody>())
{
CalamityWorld.bossRushStage = 27;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
}
else if (npc.type == ModContent.NPCType<AstrumDeusHeadSpectral>())
{
CalamityWorld.bossRushStage = 30;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
}
else if (npc.type == ModContent.NPCType<Polterghast.Polterghast>())
{
CalamityWorld.bossRushStage = 31;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
}
else if (npc.type == ModContent.NPCType<PlaguebringerGoliath.PlaguebringerGoliath>())
{
CalamityWorld.bossRushStage = 32;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
}
else if (npc.type == ModContent.NPCType<CalamitasRun3>())
{
CalamityWorld.bossRushStage = 33;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
}
else if (npc.type == ModContent.NPCType<Siren>() || npc.type == ModContent.NPCType<Leviathan.Leviathan>())
{
@@ -500,12 +518,14 @@ namespace CalamityMod.NPCs
{
CalamityWorld.bossRushStage = 34;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
}
}
else if (npc.type == ModContent.NPCType<OldDuke.OldDuke>())
{
CalamityWorld.bossRushStage = 35;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
}
else if (npc.type == ModContent.NPCType<SlimeGodCore>() || npc.type == ModContent.NPCType<SlimeGodSplit>() || npc.type == ModContent.NPCType<SlimeGodRunSplit>())
{
@@ -514,24 +534,28 @@ namespace CalamityMod.NPCs
{
CalamityWorld.bossRushStage = 36;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
}
else if (npc.type == ModContent.NPCType<SlimeGodSplit>() && !NPC.AnyNPCs(ModContent.NPCType<SlimeGodCore>()) && !NPC.AnyNPCs(ModContent.NPCType<SlimeGodRunSplit>()) &&
NPC.CountNPCS(ModContent.NPCType<SlimeGodSplit>()) < 2 && !NPC.AnyNPCs(ModContent.NPCType<SlimeGodRun>()))
{
CalamityWorld.bossRushStage = 36;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
}
else if (npc.type == ModContent.NPCType<SlimeGodRunSplit>() && !NPC.AnyNPCs(ModContent.NPCType<SlimeGodCore>()) && !NPC.AnyNPCs(ModContent.NPCType<SlimeGodSplit>()) &&
NPC.CountNPCS(ModContent.NPCType<SlimeGodRunSplit>()) < 2 && !NPC.AnyNPCs(ModContent.NPCType<SlimeGod.SlimeGod>()))
{
CalamityWorld.bossRushStage = 36;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
}
}
else if (npc.type == ModContent.NPCType<Providence.Providence>())
{
CalamityWorld.bossRushStage = 37;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
string key = "Mods.CalamityMod.BossRushTierFourEndText";
Color messageColor = Color.LightCoral;
@@ -548,17 +572,20 @@ namespace CalamityMod.NPCs
{
CalamityWorld.bossRushStage = 38;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
}
else if (npc.type == ModContent.NPCType<Yharon.Yharon>())
{
CalamityWorld.bossRushStage = 39;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
}
else if (npc.type == ModContent.NPCType<DevourerofGodsHeadS>())
{
DropHelper.DropItem(npc, ModContent.ItemType<Rock>(), true);
CalamityWorld.bossRushStage = 0;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
CalamityWorld.bossRushActive = false;
CalamityMod.UpdateServerBoolean();
@@ -589,31 +616,37 @@ namespace CalamityMod.NPCs
case NPCID.QueenBee:
CalamityWorld.bossRushStage = 1;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
break;
case NPCID.BrainofCthulhu:
CalamityWorld.bossRushStage = 2;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
break;
case NPCID.KingSlime:
CalamityWorld.bossRushStage = 3;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
break;
case NPCID.EyeofCthulhu:
CalamityWorld.bossRushStage = 4;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
break;
case NPCID.SkeletronPrime:
CalamityWorld.bossRushStage = 5;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
break;
case NPCID.Golem:
CalamityWorld.bossRushStage = 6;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
break;
case NPCID.EaterofWorldsHead:
@@ -621,11 +654,13 @@ namespace CalamityMod.NPCs
case NPCID.EaterofWorldsTail:
CalamityWorld.bossRushStage = 8;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
break;
case NPCID.TheDestroyer:
CalamityWorld.bossRushStage = 10;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
string key = "Mods.CalamityMod.BossRushTierOneEndText";
Color messageColor = Color.LightCoral;
@@ -643,26 +678,31 @@ namespace CalamityMod.NPCs
case NPCID.Spazmatism:
CalamityWorld.bossRushStage = 11;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
break;
case NPCID.Retinazer:
CalamityWorld.bossRushStage = 11;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
break;
case NPCID.WallofFlesh:
CalamityWorld.bossRushStage = 13;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
break;
case NPCID.SkeletronHead:
CalamityWorld.bossRushStage = 15;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
break;
case NPCID.CultistBoss:
CalamityWorld.bossRushStage = 19;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
string key2 = "Mods.CalamityMod.BossRushTierTwoEndText";
Color messageColor2 = Color.LightCoral;
@@ -680,11 +720,13 @@ namespace CalamityMod.NPCs
case NPCID.Plantera:
CalamityWorld.bossRushStage = 21;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
break;
case NPCID.DukeFishron:
CalamityWorld.bossRushStage = 28;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
string key3 = "Mods.CalamityMod.BossRushTierThreeEndText";
Color messageColor3 = Color.LightCoral;
@@ -702,6 +744,7 @@ namespace CalamityMod.NPCs
case NPCID.MoonLordCore:
CalamityWorld.bossRushStage = 29;
CalamityUtils.KillAllHostileProjectiles();
CalamityWorld.bossRushHostileProjKillCounter = 3;
break;
default:
@@ -714,6 +757,10 @@ namespace CalamityMod.NPCs
netMessage.Write((byte)CalamityModMessageType.BossRushStage);
netMessage.Write(CalamityWorld.bossRushStage);
netMessage.Send();
var netMessage2 = mod.GetPacket();
netMessage2.Write((byte)CalamityModMessageType.BRHostileProjKillSync);
netMessage2.Write(CalamityWorld.bossRushHostileProjKillCounter);
netMessage2.Send();
}
return false;
@@ -1323,7 +1370,7 @@ namespace CalamityMod.NPCs
// Blood Orb drops: Valid enemy during a blood moon on the Surface
if (!npc.SpawnedFromStatue && (npc.damage > 5 || npc.boss) && Main.bloodMoon && npc.HasPlayerTarget && npc.position.Y / 16D < Main.worldSurface)
{
if (Main.player[Player.FindClosest(npc.position, npc.width, npc.height)].Calamity().bloodflareSet)
if (Main.player[Player.FindClosest(npc.Center, npc.width, npc.height)].Calamity().bloodflareSet)
{
DropHelper.DropItemChance(npc, ModContent.ItemType<BloodOrb>(), 2); // 50% chance of 1 orb with Bloodflare
}
+1 -1
View File
@@ -128,7 +128,7 @@ namespace CalamityMod.NPCs.Leviathan
// Phases
bool phase2 = (lifeRatio < 0.7f && expertMode) || death;
bool phase3 = lifeRatio < 0.4f;
bool phase4 = lifeRatio < 0.1f;
bool phase4 = lifeRatio < 0.2f;
npc.spriteDirection = (npc.direction > 0) ? 1 : -1;
+23 -1
View File
@@ -2,6 +2,7 @@ using CalamityMod.CalPlayer;
using CalamityMod.Items.Accessories;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System.IO;
using Terraria;
using Terraria.ID;
@@ -82,7 +83,28 @@ namespace CalamityMod.NPCs.Leviathan
npc.active = false;
}
public override float SpawnChance(NPCSpawnInfo spawnInfo)
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
SpriteEffects spriteEffects = SpriteEffects.None;
if (npc.spriteDirection == 1)
spriteEffects = SpriteEffects.FlipHorizontally;
Texture2D texture2D15 = Main.npcTexture[npc.type];
Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2);
Vector2 vector43 = npc.Center - Main.screenPosition;
vector43 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f;
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Leviathan/LeviathanStartGlow");
spriteBatch.Draw(texture2D15, vector43, npc.frame, Color.White, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
return false;
}
public override float SpawnChance(NPCSpawnInfo spawnInfo)
{
if (spawnInfo.playerSafe ||
NPC.AnyNPCs(NPCID.DukeFishron) ||
+1 -1
View File
@@ -141,7 +141,7 @@ namespace CalamityMod.NPCs.Leviathan
// Phases
bool phase2 = lifeRatio < 0.7f;
bool phase3 = lifeRatio < 0.4f;
bool phase4 = lifeRatio < 0.1f;
bool phase4 = lifeRatio < 0.2f;
// Spawn Leviathan and Clones, change music
if (Main.netMode != NetmodeID.MultiplayerClient)
+1 -1
View File
@@ -69,7 +69,7 @@ namespace CalamityMod.NPCs.NormalNPCs
public override void NPCLoot()
{
DropHelper.DropItem(npc, ModContent.ItemType<EbonianGel>(), 15, 16);
DropHelper.DropItem(npc, ModContent.ItemType<EbonianGel>(), 15, 20);
DropHelper.DropItem(npc, ItemID.Gel, 10, 14);
}
}
+1 -3
View File
@@ -1240,10 +1240,8 @@ namespace CalamityMod.NPCs.Providence
if (projectile.active)
{
if (projectile.type == ModContent.ProjectileType<HolyFire2>() || projectile.type == ModContent.ProjectileType<HolyFlare>())
{
projectile.Kill();
}
else if (projectile.type == ModContent.ProjectileType<MoltenBlast>())
else if (projectile.type == ModContent.ProjectileType<HolyBlast>() || projectile.type == ModContent.ProjectileType<HolyFire>())
projectile.active = false;
}
}
+35 -32
View File
@@ -95,14 +95,12 @@ namespace CalamityMod.NPCs.Ravager
public override void SendExtraAI(BinaryWriter writer)
{
writer.Write(npc.dontTakeDamage);
writer.Write(npc.noGravity);
writer.Write(velocityY);
}
public override void ReceiveExtraAI(BinaryReader reader)
{
npc.dontTakeDamage = reader.ReadBoolean();
npc.noGravity = reader.ReadBoolean();
velocityY = reader.ReadSingle();
}
@@ -137,11 +135,11 @@ namespace CalamityMod.NPCs.Ravager
if (npc.localAI[0] == 0f && Main.netMode != NetmodeID.MultiplayerClient)
{
npc.localAI[0] = 1f;
NPC.NewNPC((int)npc.Center.X - 70, (int)npc.Center.Y + 88, ModContent.NPCType<RavagerLegLeft>(), 0, 0f, 0f, 0f, 0f, 255);
NPC.NewNPC((int)npc.Center.X + 70, (int)npc.Center.Y + 88, ModContent.NPCType<RavagerLegRight>(), 0, 0f, 0f, 0f, 0f, 255);
NPC.NewNPC((int)npc.Center.X - 120, (int)npc.Center.Y + 50, ModContent.NPCType<RavagerClawLeft>(), 0, 0f, 0f, 0f, 0f, 255);
NPC.NewNPC((int)npc.Center.X + 120, (int)npc.Center.Y + 50, ModContent.NPCType<RavagerClawRight>(), 0, 0f, 0f, 0f, 0f, 255);
NPC.NewNPC((int)npc.Center.X + 1, (int)npc.Center.Y - 20, ModContent.NPCType<RavagerHead>(), 0, 0f, 0f, 0f, 0f, 255);
NPC.NewNPC((int)npc.Center.X - 70, (int)npc.Center.Y + 88, ModContent.NPCType<RavagerLegLeft>());
NPC.NewNPC((int)npc.Center.X + 70, (int)npc.Center.Y + 88, ModContent.NPCType<RavagerLegRight>());
NPC.NewNPC((int)npc.Center.X - 120, (int)npc.Center.Y + 50, ModContent.NPCType<RavagerClawLeft>());
NPC.NewNPC((int)npc.Center.X + 120, (int)npc.Center.Y + 50, ModContent.NPCType<RavagerClawRight>());
NPC.NewNPC((int)npc.Center.X + 1, (int)npc.Center.Y - 20, ModContent.NPCType<RavagerHead>());
}
if (npc.target >= 0 && Main.player[npc.target].dead)
@@ -519,13 +517,13 @@ namespace CalamityMod.NPCs.Ravager
if (!NPC.AnyNPCs(ModContent.NPCType<RockPillar>()))
{
NPC.NewNPC((int)npc.Center.X - spawnDistance, (int)npc.Center.Y - 10, ModContent.NPCType<RockPillar>(), 0, 0f, 0f, 0f, 0f, 255);
NPC.NewNPC((int)npc.Center.X + spawnDistance, (int)npc.Center.Y - 10, ModContent.NPCType<RockPillar>(), 0, 0f, 0f, 0f, 0f, 255);
NPC.NewNPC((int)npc.Center.X - spawnDistance, (int)npc.Center.Y - 10, ModContent.NPCType<RockPillar>());
NPC.NewNPC((int)npc.Center.X + spawnDistance, (int)npc.Center.Y - 10, ModContent.NPCType<RockPillar>());
}
else if (!NPC.AnyNPCs(ModContent.NPCType<FlamePillar>()))
{
NPC.NewNPC((int)npc.Center.X - spawnDistance * 2, (int)npc.Center.Y - 10, ModContent.NPCType<FlamePillar>(), 0, 0f, 0f, 0f, 0f, 255);
NPC.NewNPC((int)npc.Center.X + spawnDistance * 2, (int)npc.Center.Y - 10, ModContent.NPCType<FlamePillar>(), 0, 0f, 0f, 0f, 0f, 255);
NPC.NewNPC((int)npc.Center.X - spawnDistance * 2, (int)npc.Center.Y - 10, ModContent.NPCType<FlamePillar>());
NPC.NewNPC((int)npc.Center.X + spawnDistance * 2, (int)npc.Center.Y - 10, ModContent.NPCType<FlamePillar>());
}
}
}
@@ -534,6 +532,7 @@ namespace CalamityMod.NPCs.Ravager
npc.Calamity().newAI[0] += 1f;
npc.Calamity().newAI[1] = 0f;
npc.Calamity().newAI[3] = 0f;
for (int stompDustArea = (int)npc.position.X - 30; stompDustArea < (int)npc.position.X + npc.width + 60; stompDustArea += 30)
{
@@ -560,22 +559,26 @@ namespace CalamityMod.NPCs.Ravager
npc.noTileCollide = false;
}
float amount = death ? 1f : 1f - lifeRatio;
Vector2 targetVector = player.position;
float aimY = targetVector.Y - 320f;
float aimY = targetVector.Y - 480f;
float distanceFromTargetPos = Math.Abs(npc.Top.Y - aimY);
bool inRange = npc.Top.Y <= aimY + 16f && npc.Top.Y >= aimY - 16f;
if (npc.ai[0] == 2f && npc.ai[1] == 0f)
{
if (npc.Top.Y > aimY)
{
if (npc.velocity.Y > 0f)
npc.velocity.Y -= 0.5f + Math.Abs(npc.Top.Y - aimY) * 0.001f;
}
npc.Calamity().newAI[3] += 1f;
if (inRange)
npc.velocity.Y = 0f;
else if (npc.Top.Y > aimY)
npc.velocity.Y -= 0.2f + distanceFromTargetPos * 0.001f;
else
{
if (npc.velocity.Y < 0f)
npc.velocity.Y += 0.5f + Math.Abs(npc.Top.Y - aimY) * 0.001f;
}
npc.velocity.Y += 0.2f + distanceFromTargetPos * 0.001f;
if (npc.velocity.Y < velocityY)
npc.velocity.Y = velocityY;
if (npc.velocity.Y > -velocityY)
npc.velocity.Y = -velocityY;
}
float maxOffset = 160f + (death ? 160f : 160f * (1f - lifeRatio));
@@ -584,14 +587,16 @@ namespace CalamityMod.NPCs.Ravager
// Set offset to 0 if the target stops moving
if (Math.Abs(player.velocity.X) < 0.5f)
npc.Calamity().newAI[2] = 0f;
else
npc.Calamity().newAI[2] = player.direction;
if ((npc.position.X < targetVector.X + offset && npc.position.X + npc.width > targetVector.X + player.width + offset && (npc.Top.Y <= aimY || npc.ai[0] != 2f)) || npc.ai[1] > 0f)
if ((npc.position.X < targetVector.X + offset && npc.position.X + npc.width > targetVector.X + player.width + offset && (inRange || npc.ai[0] != 2f)) || npc.ai[1] > 0f || npc.Calamity().newAI[3] >= 180f)
{
if (npc.ai[0] == 2f)
{
float stopBeforeFallTime = npc.Calamity().newAI[2] == 0f ? 20f : 30f;
float stopBeforeFallTime = npc.Calamity().newAI[2] == 0f ? 15f : 20f;
if (expertMode)
stopBeforeFallTime -= death ? 15f : 15f * (1f - lifeRatio);
stopBeforeFallTime -= death ? 5f : 5f * (1f - lifeRatio);
if (npc.ai[1] < stopBeforeFallTime)
{
@@ -629,8 +634,12 @@ namespace CalamityMod.NPCs.Ravager
}
else
{
float velocityMult = 1.8f;
float velocityXChange = 0.2f + Math.Abs(npc.Center.X - player.Center.X) * 0.001f;
if (npc.ai[0] == 2f)
velocityXChange *= velocityMult;
if (npc.direction < 0)
npc.velocity.X -= velocityXChange;
else if (npc.direction > 0)
@@ -653,7 +662,7 @@ namespace CalamityMod.NPCs.Ravager
velocityX += 1f;
if (npc.ai[0] == 2f)
velocityX *= 1.4f;
velocityX *= velocityMult;
if (npc.velocity.X < -velocityX)
npc.velocity.X = -velocityX;
@@ -770,12 +779,6 @@ namespace CalamityMod.NPCs.Ravager
}
}
public override bool CanHitPlayer(Player target, ref int cooldownSlot)
{
cooldownSlot = 1;
return true;
}
public override void OnHitPlayer(Player player, int damage, bool crit)
{
if (CalamityWorld.revenge)
+2 -2
View File
@@ -364,7 +364,7 @@ namespace CalamityMod.NPCs.SlimeGod
if (Main.netMode != NetmodeID.MultiplayerClient)
{
if (npc.ai[1] % 10f == 0f && Vector2.Distance(player.Center, vectorCenter) > 160f)
if (npc.ai[1] % 15f == 0f && Vector2.Distance(player.Center, vectorCenter) > 160f)
{
if (expertMode && Main.rand.NextBool(2))
{
@@ -446,7 +446,7 @@ namespace CalamityMod.NPCs.SlimeGod
{
if (Main.netMode != NetmodeID.MultiplayerClient && Vector2.Distance(player.Center, vectorCenter) > 160f)
{
if (npc.ai[1] % 20f == 0f)
if (npc.ai[1] % 40f == 0f)
{
if (expertMode && Main.rand.NextBool(2))
{
+38 -36
View File
@@ -453,18 +453,18 @@ namespace CalamityMod.NPCs.SupremeCalamitas
int damage = expertMode ? 200 : 250; //800 500
if (bulletHellCounter2 < 300) //blasts from above
{
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 4f * uDieLul, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
}
else if (bulletHellCounter2 < 600) //blasts from left and right
{
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), -3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
}
else //blasts from above, left, and right
{
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 3f * uDieLul, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), -3f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), 3f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 3f * uDieLul, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
}
}
}
@@ -528,21 +528,21 @@ namespace CalamityMod.NPCs.SupremeCalamitas
{
if (bulletHellCounter2 % 180 == 0) //blasts from top
{
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType<BrimstoneGigaBlast>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType<BrimstoneGigaBlast>(), damage, 0f, Main.myPlayer, 0f, 0f);
}
}
else if (bulletHellCounter2 < 1500 && bulletHellCounter2 > 1200)
{
if (bulletHellCounter2 % 180 == 0) //blasts from right
{
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), -5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneGigaBlast>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneGigaBlast>(), damage, 0f, Main.myPlayer, 0f, 0f);
}
}
else if (bulletHellCounter2 > 1500)
{
if (bulletHellCounter2 % 180 == 0) //blasts from top
{
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType<BrimstoneGigaBlast>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType<BrimstoneGigaBlast>(), damage, 0f, Main.myPlayer, 0f, 0f);
}
}
bulletHellCounter += 1;
@@ -551,16 +551,16 @@ namespace CalamityMod.NPCs.SupremeCalamitas
bulletHellCounter = 0;
if (bulletHellCounter2 < 1200) //blasts from below
{
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y + 1000f, 0f, -4f * uDieLul, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y + 1000f, 0f, -4f * uDieLul, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
}
else if (bulletHellCounter2 < 1500) //blasts from left
{
Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
}
else //blasts from left and right
{
Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1000), 3f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), -3f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
}
}
}
@@ -603,11 +603,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas
int damage = expertMode ? 150 : 200;
if (bulletHellCounter2 % 180 == 0) //blasts from top
{
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType<BrimstoneGigaBlast>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType<BrimstoneGigaBlast>(), damage, 0f, Main.myPlayer, 0f, 0f);
}
if (bulletHellCounter2 % 240 == 0) //fireblasts from above
{
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 10f * uDieLul, ModContent.ProjectileType<BrimstoneFireblast>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 10f * uDieLul, ModContent.ProjectileType<BrimstoneFireblast>(), damage, 0f, Main.myPlayer, 0f, 0f);
}
bulletHellCounter += 1;
if (bulletHellCounter > (enraged ? 9 : 11))
@@ -615,16 +615,16 @@ namespace CalamityMod.NPCs.SupremeCalamitas
bulletHellCounter = 0;
if (bulletHellCounter2 < 2100) //blasts from above
{
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 4f * uDieLul, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
}
else if (bulletHellCounter2 < 2400) //blasts from right
{
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), -3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
}
else //blasts from left and right
{
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), -3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
}
}
}
@@ -672,16 +672,16 @@ namespace CalamityMod.NPCs.SupremeCalamitas
int damage = expertMode ? 150 : 200;
if (bulletHellCounter2 % 180 == 0) //blasts from top
{
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType<BrimstoneGigaBlast>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType<BrimstoneGigaBlast>(), damage, 0f, Main.myPlayer, 0f, 0f);
}
if (bulletHellCounter2 % 240 == 0) //fireblasts from above
{
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 10f * uDieLul, ModContent.ProjectileType<BrimstoneFireblast>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 10f * uDieLul, ModContent.ProjectileType<BrimstoneFireblast>(), damage, 0f, Main.myPlayer, 0f, 0f);
}
int divisor = revenge ? 225 : expertMode ? 450 : 675;
if (bulletHellCounter2 % divisor == 0 && expertMode) //giant homing fireballs
{
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 1f * uDieLul, ModContent.ProjectileType<BrimstoneMonster>(), damage, 0f, Main.myPlayer, 0f, passedVar);
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 1f * uDieLul, ModContent.ProjectileType<BrimstoneMonster>(), damage, 0f, Main.myPlayer, 0f, passedVar);
passedVar += 1f;
}
bulletHellCounter += 1;
@@ -690,16 +690,16 @@ namespace CalamityMod.NPCs.SupremeCalamitas
bulletHellCounter = 0;
if (bulletHellCounter2 < 3000) //blasts from below
{
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y + 1000f, 0f, -4f * uDieLul, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y + 1000f, 0f, -4f * uDieLul, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
}
else if (bulletHellCounter2 < 3300) //blasts from left
{
Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
}
else //blasts from left and right
{
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), -3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
}
}
}
@@ -747,34 +747,36 @@ namespace CalamityMod.NPCs.SupremeCalamitas
int damage = expertMode ? 150 : 200;
if (bulletHellCounter2 % 240 == 0) //blasts from top
{
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType<BrimstoneGigaBlast>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType<BrimstoneGigaBlast>(), damage, 0f, Main.myPlayer, 0f, 0f);
}
if (bulletHellCounter2 % 360 == 0) //fireblasts from above
{
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 10f * uDieLul, ModContent.ProjectileType<BrimstoneFireblast>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 10f * uDieLul, ModContent.ProjectileType<BrimstoneFireblast>(), damage, 0f, Main.myPlayer, 0f, 0f);
}
if (bulletHellCounter2 % 30 == 0) //projectiles that move in wave pattern
{
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-500, 500), -5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneWave>(), damage, 0f, Main.myPlayer, 0f, 0f);
}
int random = Main.rand.Next(-1000, 1001);
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + random, -5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneWave>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X - 1000f, player.position.Y - random, 5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneWave>(), damage, 0f, Main.myPlayer, 0f, 0f);
}
bulletHellCounter += 1;
if (bulletHellCounter > (enraged ? 12 : 14))
{
bulletHellCounter = 0;
if (bulletHellCounter2 < 3900) //blasts from above
{
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 4f * uDieLul, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
}
else if (bulletHellCounter2 < 4200) //blasts from left and right
{
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), -3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
}
else //blasts from above, left, and right
{
Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 3f * uDieLul, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), -3f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), 3f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 3f * uDieLul, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
}
}
}
+6 -17
View File
@@ -57,15 +57,10 @@ namespace CalamityMod.NPCs.TownNPCs
for (int k = 0; k < Main.maxPlayers; k++)
{
Player player = Main.player[k];
if (player.active)
bool hasVodka = player.InventoryHas(ModContent.ItemType<FabsolsVodka>())/* || player.PortableStorageHas(ModContent.ItemType<FabsolsVodka>())*/;
if (player.active && hasVodka)
{
for (int j = 0; j < player.inventory.Length; j++)
{
if (player.inventory[j].type == ModContent.ItemType<FabsolsVodka>())
{
return Main.hardMode;
}
}
return Main.hardMode || CalamityWorld.spawnedCirrus;
}
}
return CalamityWorld.spawnedCirrus;
@@ -94,7 +89,7 @@ namespace CalamityMod.NPCs.TownNPCs
int random = Main.rand.Next(4);
if (random == 0)
{
return "Hey! Nice night. I'm gonna make some Bloody Marys. Celery included. Want one?";
return "Hey, nice night! I'm gonna make some Bloody Marys, celery included. Want one?";
}
else if (random == 1)
{
@@ -172,13 +167,6 @@ namespace CalamityMod.NPCs.TownNPCs
dialogue.Add("My booze will always be better than " + Main.npc[tavernKeep].GivenName + "'s, and nobody can convince me otherwise.");
}
// Doesn't seem like a necessary line
/*
int dryad = NPC.FindFirstNPC(NPCID.Dryad);
if (dryad != -1)
dialogue.Add(Main.npc[dryad].GivenName + " is cool too, but she'd outlive me.");
*/
int permadong = NPC.FindFirstNPC(ModContent.NPCType<DILF>());
if (permadong != -1)
dialogue.Add("I never realized how well-endowed " + Main.npc[permadong].GivenName + " was. It had to be the largest icicle I had ever seen.");
@@ -189,7 +177,8 @@ namespace CalamityMod.NPCs.TownNPCs
dialogue.Add("You still can't stop me from trying to move in with " + Main.npc[waifu].GivenName + ".");
dialogue.Add("I love it when " + Main.npc[waifu].GivenName + "'s hands get sticky from all that...wax.");
dialogue.Add(Main.npc[waifu].GivenName + " works wonders for my hair...among other things.");
}
dialogue.Add("Ever since " + Main.npc[waifu].GivenName + " moved in I haven't been drinking as much...it's a weird feeling.");
}
if (Main.player[Main.myPlayer].Calamity().chibii)
dialogue.Add("Is that a toy? Looks like something I'd carry around if I was 5 years old.");
+3 -2
View File
@@ -71,9 +71,10 @@ namespace CalamityMod.NPCs.TownNPCs
for (int k = 0; k < Main.maxPlayers; k++)
{
Player player = Main.player[k];
if (player.active && player.InventoryHas(ItemID.PlatinumCoin))
bool rich = player.InventoryHas(ItemID.PlatinumCoin) || player.PortableStorageHas(ItemID.PlatinumCoin);
if (player.active && rich)
{
return NPC.downedBoss3;
return NPC.downedBoss3 || CalamityWorld.spawnedBandit;
}
}
return CalamityWorld.spawnedBandit;
+6 -2
View File
@@ -2867,8 +2867,12 @@ namespace CalamityMod.NPCs.Yharon
#region Strike NPC
public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit)
{
if (CalamityUtils.AntiButcher(npc, ref damage, 0.5f))
return false;
// Safeguard if damage would kill phase 1 before phase 2.
if (phaseOneLoot && (damage >= npc.life || (crit && damage * 2 >= npc.life)))
{
float lifeAboveTenPercent = npc.life - npc.lifeMax * 0.1f;
damage = MathHelper.Clamp((float)damage, 0f, lifeAboveTenPercent);
}
// Safeguard to prevent damage which would allow skipping phase 2.
if (!startSecondAI && dropLoot)
+5
View File
@@ -97,8 +97,13 @@ namespace CalamityMod.Prefixes
invalid = true;
if (item.useAnimation == Math.Round(item.useAnimation * useTimeMult) && useTimeMult != 1f)
invalid = true;
// This code is commented out because CanRoll already guarantees that rogue prefixes will never appear on consumable items.
// Setting invalid to true doesn't do anything good.
// It just makes prefixed consumable rogue weapons put TML in an infinite loop looking for an appropriate prefix.
/*
if (item.consumable)
invalid = true;
*/
}
}
+19 -26
View File
@@ -37,32 +37,25 @@ namespace CalamityMod.Projectiles.Boss
projectile.timeLeft = TotalRitualTime;
}
public override void AI()
{
Time++;
if (Time == TotalRitualTime - PulseTime)
{
int idx = NPC.NewNPC((int)projectile.Center.X, (int)projectile.Center.Y - (int)MaxUpwardRise, ModContent.NPCType<AstrumDeusHeadSpectral>(), 1);
if (idx != -1)
{
if (Main.netMode == NetmodeID.SinglePlayer)
{
Main.NewText(Language.GetTextValue("Announcement.HasAwoken", Main.npc[idx].TypeName), new Color(175, 75, 255));
return;
}
if (Main.netMode == NetmodeID.Server)
{
NetMessage.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", new object[]
{
Main.npc[idx].GetTypeNetName()
}), new Color(175, 75, 255));
return;
}
NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, idx);
}
}
}
public override void AI()
{
Time++;
if (Time == TotalRitualTime - PulseTime)
{
int idx = NPC.NewNPC((int)projectile.Center.X, (int)projectile.Center.Y - (int)MaxUpwardRise, ModContent.NPCType<AstrumDeusHeadSpectral>(), 1);
if (idx != -1)
{
if (Main.netMode != NetmodeID.MultiplayerClient)
{
CalamityUtils.BossAwakenMessage(idx);
}
else
{
NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, idx);
}
}
}
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
+31 -4
View File
@@ -13,6 +13,7 @@ using CalamityMod.Projectiles.Ranged;
using CalamityMod.Projectiles.Rogue;
using CalamityMod.Projectiles.Summon;
using CalamityMod.Projectiles.Typeless;
using CalamityMod.Projectiles.Typeless.FiniteUse;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
@@ -1021,6 +1022,8 @@ namespace CalamityMod.Projectiles
defCrit = modPlayer.critStats[3];
else if (projectile.IsSummon())
defCrit = 4;
else if (player.ActiveItem().crit > 0)
defCrit = player.ActiveItem().crit;
}
if (projectile.owner == Main.myPlayer/* && Main.netMode != NetmodeID.MultiplayerClient*/)
@@ -1118,6 +1121,15 @@ namespace CalamityMod.Projectiles
if (!crit)
crit = Main.rand.NextBool(10);
}
if (projectile.type == ProjectileType<MagnumRound>())
{
if (crit)
{
damage = (int)(damage * 1.25);
knockback *= 1.25f;
}
}
}
}
#endregion
@@ -2104,7 +2116,7 @@ namespace CalamityMod.Projectiles
}
}
public static void MagnetSphereHitscan(Projectile projectile, float distanceRequired, float homingVelocity, float projectileTimer, int maxTargets, int spawnedProjectile, double damageMult = 1D)
public static void MagnetSphereHitscan(Projectile projectile, float distanceRequired, float homingVelocity, float projectileTimer, int maxTargets, int spawnedProjectile, double damageMult = 1D, bool attackMultiple = false)
{
float maxDistance = distanceRequired;
bool homeIn = false;
@@ -2147,6 +2159,24 @@ namespace CalamityMod.Projectiles
Vector2 value = projectile.Center + projectile.velocity * 4f;
Vector2 velocity = Vector2.Normalize(Main.npc[randomTarget].Center - value) * homingVelocity;
if (attackMultiple)
{
for (int i = 0; i < targetArrayIndex; i++)
{
velocity = Vector2.Normalize(Main.npc[targetArray[i]].Center - value) * homingVelocity;
if (projectile.owner == Main.myPlayer)
{
int projectile2 = Projectile.NewProjectile(value.X, value.Y, velocity.X, velocity.Y, spawnedProjectile, (int)(projectile.damage * damageMult), projectile.knockBack, projectile.owner, 0f, 0f);
if (projectile.type == ProjectileType<EradicatorProjectile>() && projectile.Calamity().rogue)
Main.projectile[projectile2].Calamity().forceRogue = true;
}
}
return;
}
if (projectile.type == ProjectileType<GodsGambitYoyo>())
{
velocity.Y += Main.rand.Next(-30, 31) * 0.05f;
@@ -2160,9 +2190,6 @@ namespace CalamityMod.Projectiles
if (projectile.type == ProjectileType<CnidarianYoyo>() || projectile.type == ProjectileType<GodsGambitYoyo>() ||
projectile.type == ProjectileType<ShimmersparkYoyo>() || projectile.type == ProjectileType<VerdantYoyo>() || (projectile.type == ProjectileType<EradicatorProjectile>() && projectile.melee))
Main.projectile[projectile2].Calamity().forceMelee = true;
else if (projectile.type == ProjectileType<EradicatorProjectile>() && projectile.Calamity().rogue)
Main.projectile[projectile2].Calamity().forceRogue = true;
}
}
}
+81
View File
@@ -0,0 +1,81 @@
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.DraedonsArsenal
{
public class GaussFlux : ModProjectile
{
public float Time
{
get => projectile.ai[0];
set => projectile.ai[0] = value;
}
public NPC Target
{
get => Main.npc[(int)projectile.ai[1]];
set => projectile.ai[1] = value.whoAmI;
}
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Gauss Flux");
}
public override void SetDefaults()
{
projectile.width = 16;
projectile.height = 16;
projectile.friendly = true;
projectile.melee = true;
projectile.penetrate = -1;
projectile.timeLeft = 180;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 14;
}
public override void AI()
{
Lighting.AddLight(projectile.Center, Color.Lime.ToVector3());
if (!Target.active)
{
projectile.Kill();
return;
}
projectile.Center = Target.Center;
if (!Main.dedServ)
{
if (Time == 0)
{
for (int i = 0; i < 60; i++)
{
Dust dust = Dust.NewDustPerfect(Target.Center, 261);
dust.color = Utils.SelectRandom(Main.rand, Color.Yellow, Color.YellowGreen);
dust.velocity = Main.rand.NextVector2Circular(20f, 20f);
dust.scale = 2f;
dust.noGravity = true;
}
}
for (int i = 0; i < 7; i++)
{
for (int arcIndex = 0; arcIndex < 6; arcIndex++)
{
float offsetAngle = MathHelper.ToRadians(1080f) * i / 18f;
offsetAngle += Time / 10f;
float scale = 1.4f + (float)Math.Cos(i / 7f * MathHelper.TwoPi + Time / 30f) * 0.3f;
scale *= MathHelper.Lerp(1f, 0.4f, arcIndex / 6f);
Vector2 offset = Target.Size.RotatedBy(offsetAngle) * 0.5f;
offset += (arcIndex * MathHelper.TwoPi / 6f + Time / 20f).ToRotationVector2() * 6f * arcIndex;
Dust dust = Dust.NewDustPerfect(Target.Center + offset, 261);
dust.color = Utils.SelectRandom(Main.rand, Color.Yellow, Color.YellowGreen);
dust.velocity = Vector2.Zero;
dust.scale = scale;
dust.noGravity = true;
}
}
}
Time++;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 121 B

@@ -137,7 +137,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
Projectile.NewProjectileDirect(npc.Center,
Vector2.Zero,
ModContent.ProjectileType<VoltageStream>(),
projectile.damage,
(int)(projectile.damage * 0.35),
0f,
projectile.owner,
0f,
@@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
projectile.tileCollide = false;
projectile.Calamity().rogue = true;
projectile.usesIDStaticNPCImmunity = true;
projectile.idStaticNPCHitCooldown = 10;
projectile.idStaticNPCHitCooldown = 12;
}
public override void AI()
@@ -84,5 +84,15 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
}
}
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
projectile.damage /= 3;
}
public override void OnHitPvp(Player target, int damage, bool crit)
{
projectile.damage /= 3;
}
}
}
@@ -0,0 +1,67 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.DataStructures;
using Terraria.Graphics.Shaders;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.DraedonsArsenal
{
public class PhaseslayerBeam : ModProjectile
{
public const int Lifetime = 180;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Light Blade");
Main.projFrames[projectile.type] = 5;
}
public override void SetDefaults()
{
projectile.width = 64;
projectile.height = 120;
projectile.scale = 0.5f;
projectile.Size *= projectile.scale;
projectile.friendly = true;
projectile.penetrate = 3;
projectile.melee = true;
projectile.tileCollide = false;
projectile.penetrate = -1;
projectile.usesLocalNPCImmunity = true;
projectile.timeLeft = Lifetime;
projectile.localNPCHitCooldown = 6;
}
public override void AI()
{
projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2;
NPC potentialTarget = projectile.Center.ClosestNPCAt(1000f);
if (potentialTarget != null && projectile.Distance(potentialTarget.Center) > 40f && projectile.timeLeft > Lifetime - 60)
{
projectile.velocity = (projectile.velocity * 7f + projectile.DirectionTo(potentialTarget.Center) * 24f) / 8f;
}
projectile.frameCounter++;
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
Texture2D bladeTexture = ModContent.GetTexture(Texture);
MiscShaderData distortationShader = GameShaders.Misc["CalamityMod:LightDistortion"];
spriteBatch.End();
spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix);
Rectangle frame = bladeTexture.Frame(1, 5, 0, projectile.frameCounter / 4 % 5);
var drawData2 = new DrawData(bladeTexture, projectile.Center - Main.screenPosition, frame, Color.White, projectile.rotation, bladeTexture.Size() * 0.5f, projectile.scale * 1.2f, SpriteEffects.None, 0);
distortationShader.Apply(drawData2);
drawData2.Draw(spriteBatch);
return false;
}
public override void PostDraw(SpriteBatch spriteBatch, Color drawColor)
{
spriteBatch.End();
spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

@@ -0,0 +1,304 @@
using CalamityMod.Dusts;
using CalamityMod.Items;
using CalamityMod.Items.Weapons.DraedonsArsenal;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.DraedonsArsenal
{
public class PhaseslayerProjectile : ModProjectile
{
// The "average" or "expected" swing speed which the sword's damage balance is based off of.
// This is rotation EVERY FRAME. The "average" swing speed is 360 degrees in one second, aka pi/30 radians per frame.
public const float StandardSwingSpeed = MathHelper.Pi / 30f;
// How quickly the sword's damage updates to reflect its current speed. Higher values make it change damage more quickly.
public const float DamageUpdateResponsiveness = 0.08f;
// When the accumuluated "charge exhaustion" meter reaches this value, the Phaseslayer item loses one point of charge.
public const float ChargeLossBreakpoint = 300f;
public const int SwordBeamCooldown = 15;
private const float MaximumMouseRange = 360f;
private const float ProjCenterOffset = 36f;
public bool IsSmall
{
get
{
CalamityGlobalItem swordItem = Main.player[projectile.owner].ActiveItem().Calamity();
float chargeRatio = swordItem.CurrentCharge / (float)swordItem.ChargeMax;
return chargeRatio < Phaseslayer.SizeChargeThreshold;
}
}
// ai[0] wrapper. Stores a rolling lerped average of angular momentum which is used as the swing speed damage multiplier.
public float AngularDamageFactor
{
get => projectile.ai[0];
set => projectile.ai[0] = value;
}
// ai[1] wrapper. Stores an accumulating "charge exhaustion" meter. When it reaches the limit, a charge point is lost.
public float ChargeLossProgress
{
get => projectile.ai[1];
set => projectile.ai[1] = value;
}
// localAI[0] wrapper
public float FadeoutTime
{
get => projectile.localAI[0];
set => projectile.localAI[0] = value;
}
public int BladeFrameX => IsSmall ? 1 : projectile.frame / 7;
public int BladeFrameY => IsSmall ? projectile.frame % 3 : projectile.frame % 7;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Phaseslayer");
ProjectileID.Sets.TrailingMode[projectile.type] = 2;
ProjectileID.Sets.TrailCacheLength[projectile.type] = 8;
}
public override void SetDefaults()
{
projectile.width = 46; // Collision logic is done manually.
projectile.height = 46;
projectile.friendly = true;
projectile.melee = true;
projectile.tileCollide = false;
projectile.ignoreWater = true;
projectile.penetrate = -1;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 7;
}
public override void AI()
{
Player player = Main.player[projectile.owner];
// Angles are wrapped to be 0 to 2pi instead of -pi to pi for convenience with absolute values.
float rotationAdjusted = MathHelper.WrapAngle(projectile.rotation) + MathHelper.Pi;
float oldRotationAdjusted = MathHelper.WrapAngle(projectile.oldRot[1]) + MathHelper.Pi;
float deltaAngle = Math.Abs(rotationAdjusted - oldRotationAdjusted);
// Frame 1 effect: Prevent the sword from instantly firing a sword beam.
if (projectile.localAI[1] == 0f)
{
projectile.localAI[1] = 1f;
projectile.soundDelay = SwordBeamCooldown;
}
ManipulatePlayer(player);
bool wasBig = !IsSmall;
UpdateCharge(player);
bool justShrunk = IsSmall && wasBig;
if (justShrunk)
OnShrinkEffects();
AdjustDamageBasedOnRotation(player, deltaAngle);
ManipulateFrames();
HandleSwordBeams(player, deltaAngle);
HandleFadeout();
}
private void ManipulatePlayer(Player player)
{
if (Main.myPlayer == player.whoAmI)
{
// In addition to typical channel cancellation criteria, the sword fizzles out if it runs out of charge.
Item playerItem = player.ActiveItem();
bool hasCharge = playerItem.Calamity().CurrentCharge > 0;
if (player.channel && !player.noItems && !player.CCed && playerItem.type == ModContent.ItemType<Phaseslayer>() && hasCharge)
{
// The distance ratio ranges from 0 (your mouse is directly on the player) to 1 (your mouse is at the max range considered, or any further distance).
float mouseDistance = projectile.Distance(Main.MouseWorld);
float distRatio = Utils.InverseLerp(0f, MaximumMouseRange, mouseDistance, true);
// This formula ensures that the sword has a sudden and extremely harsh responsiveness penalty when the mouse is close to the player.
// Otherwise it controls perfectly fine.
float aimResponsiveness = 0.035f + 0.3f * (float)Math.Pow(distRatio, 1D/3);
// Update the sword's angle with the responsiveness determined by mouse position.
projectile.rotation = projectile.rotation.AngleLerp(player.AngleTo(Main.MouseWorld), aimResponsiveness);
}
// If the player is not wielding the sword, determine whether it should fade out or instantly vanish.
else if (FadeoutTime == 0f)
{
// If the player voluntarily stopped holding left mouse, start the fadeout timer.
if (!player.channel)
FadeoutTime = 10f;
// If the player was killed, frozen, cursed, etc. just delete it immediately.
else
projectile.Kill();
}
projectile.Center = player.MountedCenter + projectile.rotation.ToRotationVector2() * ProjCenterOffset;
}
// These lines ensure the player and their arm are rotated the correct direction to hold the sword.
projectile.direction = (Math.Cos(projectile.rotation) > 0).ToDirectionInt();
player.ChangeDir(projectile.direction);
player.heldProj = projectile.whoAmI;
player.itemTime = 2;
player.itemAnimation = 2;
player.itemRotation = projectile.rotation * projectile.direction;
}
private void UpdateCharge(Player player)
{
// Having the sword active at all costs some energy.
ChargeLossProgress += 1f;
// If charge is due to be lost, reset the accumuluated charge exhaustion and update the player's held item.
if (ChargeLossProgress > ChargeLossBreakpoint)
{
ChargeLossProgress -= ChargeLossBreakpoint;
if (Main.myPlayer == projectile.owner)
{
if (Main.mouseItem.active)
Main.mouseItem.Calamity().CurrentCharge--;
else
player.HeldItem.Calamity().CurrentCharge--;
}
}
}
private void OnShrinkEffects()
{
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/MechGaussRifle"), projectile.Center);
if (Main.dedServ)
return;
for (int i = 0; i < 60; i++)
{
Dust dust = Dust.NewDustPerfect(projectile.Center, (int)CalamityDusts.Brimstone);
dust.velocity = Main.rand.NextVector2Circular(20f, 20f);
dust.scale = 2.5f;
dust.fadeIn = 1.2f;
dust.noGravity = true;
}
}
private void AdjustDamageBasedOnRotation(Player player, float deltaAngle)
{
// Update the rolling "blade angular momentum" average by gently lerping in the newest data point.
AngularDamageFactor = MathHelper.Lerp(AngularDamageFactor, deltaAngle, DamageUpdateResponsiveness);
// 0x expected speed gives you 53.5% damage.
// 1x expected speed gives you 100.0% damage.
// 1.5x expected speed gives you 116.6% damage.
// 2x expected speed gives you 130.6% damage.
// 3x expected speed gives you 153.5% damage.
// 4x expected speed gives you 171.7% damage.
// 5x expected speed gives you 187.0% damage.
float speedDamageScalar = 0.166f + (float)Math.Log(AngularDamageFactor / StandardSwingSpeed + 1.5f, 3f);
float statDamageScalar = player.MeleeDamage() * (IsSmall ? Phaseslayer.SmallDamageMultiplier : 1f);
projectile.damage = (int)(Phaseslayer.Damage * speedDamageScalar * statDamageScalar);
}
private void ManipulateFrames()
{
projectile.frame = 0;
if (IsSmall)
{
// Fadeout frames.
if (FadeoutTime > 5)
projectile.frame = 1;
else if (FadeoutTime > 0)
projectile.frame = 2;
}
else
{
projectile.frameCounter++;
int adjustFrameCounter = projectile.frameCounter % 120;
// Idle lightning frames.
if (adjustFrameCounter >= 50 && adjustFrameCounter <= 78)
projectile.frame = (int)MathHelper.Lerp(1, 9, Utils.InverseLerp(50, 75, adjustFrameCounter, true));
if (adjustFrameCounter >= 90 && adjustFrameCounter <= 120)
projectile.frame = (int)MathHelper.Lerp(10, 18, Utils.InverseLerp(90, 117, adjustFrameCounter, true));
// Fadeout frames.
if (FadeoutTime > 5)
projectile.frame = 19;
else if (FadeoutTime > 0)
projectile.frame = 20;
}
}
private void HandleSwordBeams(Player player, float deltaAngle)
{
// Producing a sword beam takes a bit higher of a speed than the "typical" speed the sword is balanced around.
if (projectile.soundDelay <= 0 && deltaAngle >= 1.3f * StandardSwingSpeed)
{
// Sword beams cost a noticeable amount of energy, but deal the blade's current damage. Swing harder to get more damage!
ChargeLossProgress += 30f;
if (Main.myPlayer == player.whoAmI)
{
Vector2 velocity = projectile.rotation.ToRotationVector2() * 20f;
Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType<PhaseslayerBeam>(), projectile.damage, 0f, player.whoAmI);
}
// The sound delay doubles as the sword beam's cooldown.
projectile.soundDelay = SwordBeamCooldown;
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/ELRFire"), projectile.Center);
}
}
private void HandleFadeout()
{
if (FadeoutTime > 0)
{
FadeoutTime--;
if (FadeoutTime <= 0f)
projectile.Kill();
}
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
Texture2D bladeTexture = ModContent.GetTexture("CalamityMod/Projectiles/DraedonsArsenal/PhaseslayerBlade");
Texture2D hiltTexture = ModContent.GetTexture(Texture);
if (IsSmall)
bladeTexture = ModContent.GetTexture("CalamityMod/Projectiles/DraedonsArsenal/PhaseslayerBladeSmall");
Vector2 bladeOffset = projectile.rotation.ToRotationVector2() * (IsSmall ? 90f : 132f) * projectile.scale;
Vector2 origin = bladeTexture.Size() * 0.5f;
origin /= IsSmall ? new Vector2(1f, 3f) : new Vector2(3f, 7f);
Rectangle frame = IsSmall ? bladeTexture.Frame(1, 3, 0, BladeFrameY) : bladeTexture.Frame(3, 7, BladeFrameX, BladeFrameY);
// TODO: Update this afterimage drawcode to be more cool.
for (int i = 1; i < projectile.oldRot.Length; i++)
{
float angleDelta = MathHelper.Clamp(projectile.rotation - projectile.oldRot[i], -0.26f, 0.26f);
float angle = projectile.rotation + angleDelta;
angle += MathHelper.PiOver2;
Color color = Color.White * (float)Math.Pow(1f - i / (float)projectile.oldRot.Length, 3f);
Rectangle afterimageFrame = IsSmall ? bladeTexture.Frame(1, 3, 0, 2) : bladeTexture.Frame(3, 7, 2, 6);
spriteBatch.Draw(bladeTexture, projectile.Center + bladeOffset - Main.screenPosition, afterimageFrame, color, angle, origin, projectile.scale, SpriteEffects.None, 0f);
}
spriteBatch.Draw(bladeTexture, projectile.Center + bladeOffset - Main.screenPosition, frame, Color.White, projectile.rotation + MathHelper.PiOver2, origin, projectile.scale, SpriteEffects.None, 0f);
spriteBatch.Draw(hiltTexture, projectile.Center - Main.screenPosition, null, lightColor, projectile.rotation + MathHelper.PiOver2, hiltTexture.Size() * 0.5f, projectile.scale, SpriteEffects.None, 0f);
return false;
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox)
{
float _ = 0f;
Vector2 start = projectile.Center + projectile.rotation.ToRotationVector2() * 28f;
Vector2 end = start + projectile.rotation.ToRotationVector2() * (IsSmall ? 202f : 254f) * projectile.scale;
return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), start, end, 60f * projectile.scale, ref _);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 922 B

@@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
{
if (Main.myPlayer == projectile.owner)
{
Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType<MassivePlasmaExplosion>(), projectile.damage * 3, projectile.knockBack * 3f, projectile.owner);
Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType<MassivePlasmaExplosion>(), projectile.damage * 2, projectile.knockBack * 2f, projectile.owner);
}
if (!Main.dedServ)
{
@@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
}
else
{
CalamityGlobalProjectile.ExpandHitboxBy(projectile, 240);
CalamityGlobalProjectile.ExpandHitboxBy(projectile, 360);
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 10;
projectile.Damage();
@@ -84,7 +84,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
int type = Main.rand.NextBool(3) ? 261 : (int)CalamityDusts.SulfurousSeaAcid;
Dust dust = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(10f, 10f), type);
dust.scale = Main.rand.NextFloat(1.3f, 1.5f);
dust.velocity = Main.rand.NextVector2CircularEdge(10f, 10f);
dust.velocity = Main.rand.NextVector2CircularEdge(15f, 15f);
dust.noGravity = true;
if (type == 261)
{
@@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
}
GrantBuffs(player);
NPC potentialTarget = projectile.Center.MinionHoming(900f, player);
if (potentialTarget == null)
if (potentialTarget is null)
{
PlayerMovement(player);
RepelMovement();
@@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
projectile.width = 16;
projectile.height = 16;
projectile.friendly = true;
projectile.ranged = true;
projectile.magic = true;
projectile.penetrate = 1;
projectile.extraUpdates = 10;
projectile.timeLeft = 120 * (1 + projectile.extraUpdates);
+6 -4
View File
@@ -49,9 +49,9 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
projectile.velocity.Y += 0.5f;
}
NPC potentialTarget = projectile.Center.MinionHoming(850f, player);
NPC potentialTarget = projectile.Center.MinionHoming(850f, player, false);
if (potentialTarget != null && Collision.CanHit(projectile.position, projectile.width, projectile.height, potentialTarget.position, potentialTarget.width, potentialTarget.height))
if (potentialTarget != null)
{
projectile.spriteDirection = (potentialTarget.Center.X - projectile.Center.X > 0).ToDirectionInt();
projectile.ai[0]++;
@@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
{
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/PulseRifleFire"), shootPosition);
Projectile.NewProjectile(shootPosition,
Vector2.Normalize(potentialTarget.Center - shootPosition) * 24f,
Vector2.Normalize(potentialTarget.Center - shootPosition) * 12f,
ModContent.ProjectileType<PulseTurretShot>(),
projectile.damage,
projectile.knockBack,
@@ -93,7 +93,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
for (int i = -1; i <= 1; i += 2)
{
Projectile.NewProjectile(shootPosition,
Vector2.Normalize(potentialTarget.Center - shootPosition).RotatedBy(i * MathHelper.ToRadians(28f)) * 14f,
Vector2.Normalize(potentialTarget.Center - shootPosition).RotatedBy(i * MathHelper.ToRadians(28f)) * 7f,
ModContent.ProjectileType<PulseTurretShot>(),
projectile.damage,
projectile.knockBack,
@@ -118,6 +118,8 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
{
projectile.rotation = projectile.rotation.AngleLerp(0f, MathHelper.TwoPi / 50f);
}
projectile.StickToTiles(false, false);
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
@@ -1,6 +1,7 @@
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.DraedonsArsenal
@@ -12,18 +13,20 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Pulse Bolt");
ProjectileID.Sets.SentryShot[projectile.type] = true;
}
public override void SetDefaults()
{
projectile.width = 4;
projectile.height = 4;
projectile.width = 10;
projectile.height = 10;
projectile.friendly = true;
projectile.ranged = true;
projectile.minion = true;
projectile.penetrate = 1;
projectile.timeLeft = 300;
projectile.timeLeft = 600;
projectile.Calamity().hasInorganicEnemyHitBoost = true;
projectile.Calamity().inorganicEnemyHitBoost = 0.002f;
projectile.extraUpdates = 1;
}
public override void AI()
@@ -42,7 +45,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
}
if (projectile.ai[1] == 1f)
{
NPC potentialTarget = projectile.Center.MinionHoming(850f, Main.player[projectile.owner]);
NPC potentialTarget = projectile.Center.MinionHoming(850f, Main.player[projectile.owner], false);
if (potentialTarget != null)
{
float speed = projectile.velocity.Length();
@@ -189,7 +189,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
offsetMultiplier = new Vector2(1f, -1f);
break;
}
if (Time % 30f == 0f)
if (Time % 20f == 0f)
{
if (projectile.ai[1] > 0 && Main.myPlayer == projectile.owner)
{
@@ -206,8 +206,8 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
else
{
EyeOutwardness = MathHelper.Lerp(EyeOutwardness, 1f, 0.15f);
EyeRotation = EyeRotation.AngleTowards(projectile.AngleTo(npc.Center), MathHelper.TwoPi / 30f);
projectile.Center = Vector2.SmoothStep(OldCenter, npc.Center + (new Vector2(300f) + projectile.Size * 0.5f) * offsetMultiplier, Time % 30f / 30f);
EyeRotation = EyeRotation.AngleTowards(projectile.AngleTo(npc.Center), MathHelper.TwoPi / 20f);
projectile.Center = Vector2.SmoothStep(OldCenter, npc.Center + (new Vector2(300f) + projectile.Size * 0.5f) * offsetMultiplier, Time % 20f / 20f);
}
}
public void GenerateAfterimageDust()
@@ -137,7 +137,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
FallThroughYPoint = player.Top.Y;
}
AntiStickyMovement(0.05f);
projectile.MinionAntiClump();
ManipulateFrames(minimumFrame, maximumFrame);
}
@@ -261,7 +261,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
if (AcidShootTimer > 48)
{
AcidShootTimer = 0;
AcidShootCooldown = 30f;
AcidShootCooldown = 10f;
projectile.netUpdate = true;
}
}
@@ -269,34 +269,6 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
AcidShootCooldown--;
projectile.velocity.X *= 0.8f;
}
public void AntiStickyMovement(float antiStickAcceleration = 0.05f)
{
for (int index = 0; index < Main.projectile.Length; index++)
{
Projectile proj = Main.projectile[index];
if (index != projectile.whoAmI &&
proj.active && proj.owner == projectile.owner &&
proj.type == projectile.type && Math.Abs(projectile.position.X - proj.position.X) + Math.Abs(projectile.position.Y - proj.position.Y) < projectile.width)
{
if (projectile.position.X < proj.position.X)
{
projectile.velocity.X -= antiStickAcceleration;
}
else
{
projectile.velocity.X += antiStickAcceleration;
}
if (projectile.position.Y < proj.position.Y)
{
projectile.velocity.Y -= antiStickAcceleration;
}
else
{
projectile.velocity.Y += antiStickAcceleration;
}
}
}
}
public void ManipulateFrames(int minimumFrame, int maximumFrame)
{
if (projectile.frame < minimumFrame)
@@ -97,8 +97,26 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
projectile.Kill();
}
Time++;
if (projectile.damage <= 0)
projectile.Kill();
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
ReduceDamage();
}
public override void OnHitPvp(Player target, int damage, bool crit)
{
ReduceDamage();
}
private void ReduceDamage()
{
projectile.damage = (int)(projectile.damage * 0.75);
}
public override void Kill(int timeLeft)
{
}
+3 -3
View File
@@ -54,9 +54,7 @@ namespace CalamityMod.Projectiles.Enemy
}
public override void Kill(int timeLeft)
{
projectile.position = projectile.Center;
projectile.width = projectile.height = 150;
projectile.position -= projectile.Size / 2f;
CalamityGlobalProjectile.ExpandHitboxBy(projectile, 150);
projectile.Damage();
for (int i = 0; i <= 40; i++)
{
@@ -74,6 +72,8 @@ namespace CalamityMod.Projectiles.Enemy
}
}
public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, 200);
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
Loaded 100 of 150 files, more files were not shown because too many files have changed in this diff. Show more