This commit is contained in:
mountaindrew10 committed 2022-09-30 08:14:38 -05:00
commit 3a5a1e5b2b
57 files changed
+612 -454

No files matched your search

+14 -13
View File
@@ -2564,7 +2564,7 @@ namespace CalamityMod.CalPlayer
if (CalamityKeybinds.SandCloakHotkey.JustPressed && sandCloak && Main.myPlayer == Player.whoAmI && rogueStealth >= rogueStealthMax * 0.1f &&
wearingRogueArmor && rogueStealthMax > 0 && !Player.HasCooldown(Cooldowns.SandCloak.ID))
{
Player.AddCooldown(Cooldowns.SandCloak.ID, CalamityUtils.SecondsToFrames(25));
Player.AddCooldown(Cooldowns.SandCloak.ID, CalamityUtils.SecondsToFrames(30));
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<Items.Accessories.SandCloak>()));
rogueStealth -= rogueStealthMax * 0.1f;
@@ -6102,7 +6102,7 @@ namespace CalamityMod.CalPlayer
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<Items.Accessories.InkBomb>()));
if (Player.whoAmI == Main.myPlayer && !Player.HasCooldown(Cooldowns.InkBomb.ID))
{
Player.AddCooldown(Cooldowns.InkBomb.ID, CalamityUtils.SecondsToFrames(25));
Player.AddCooldown(Cooldowns.InkBomb.ID, CalamityUtils.SecondsToFrames(20));
rogueStealth += 0.5f;
for (int i = 0; i < 3; i++)
{
@@ -6614,26 +6614,27 @@ namespace CalamityMod.CalPlayer
// Update Dark God's Sheath and Eclipse Mirror's stealth acceleration
/*
* T = frame counter
* DGS = (100% + 1% * T)
* EM = (100% + 1% * T) * 1.0084^T
* BOTH = (100% + 1.5% * T) * 1.0084^T
* DGS = (100% + 0.7% * T)
* EM = (100% + 0.7% * T) * 1.006^T
* BOTH = (100% + 1% * T) * 1.006^T
*
* DGS alone caps in 100 frames
* EM alone caps in 41 frames
* Both together caps in 32 frames
* DGS alone caps in 143 frames
* EM alone caps in 59 frames
* Both together caps in 50 frames
*/
if (darkGodSheath && eclipseMirror)
{
stealthAcceleration += 0.015f;
stealthAcceleration *= 1.0084f;
stealthAcceleration += 0.01f;
stealthAcceleration *= 1.006f;
}
else if (eclipseMirror)
{
stealthAcceleration += 0.01f;
stealthAcceleration *= 1.0084f;
stealthAcceleration += 0.007f;
stealthAcceleration *= 1.006f;
}
else if (darkGodSheath)
stealthAcceleration += 0.01f;
stealthAcceleration += 0.007f;
stealthAcceleration = MathHelper.Clamp(stealthAcceleration, 1f, StealthAccelerationCap);
// You get 100% stealth regen while standing still and not on a mount. Otherwise, you get your stealth regeneration while moving.
+1 -1
View File
@@ -1070,7 +1070,7 @@ namespace CalamityMod.CalPlayer
break;
}
}
int damage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(550);
int damage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(300);
int projectileIndex = Projectile.NewProjectile(spawnSource, projTileX * 16 + 8, projTileY * 16 - 24, 0f, 0f, ProjectileType<InfernadoFriendly>(), damage, 15f, Main.myPlayer, 16f, 16f);
if (projectileIndex.WithinBounds(Main.maxProjectiles))
{
+21 -3
View File
@@ -104,7 +104,25 @@ namespace CalamityMod.Events
public static int CurrentlyFoughtBoss => Bosses[BossRushStage].EntityID;
public static int NextBossToFight => Bosses[BossRushStage + 1].EntityID;
public static readonly SoundStyle EndSound = new("CalamityMod/Sounds/Custom/BossRushEnd");
public static readonly SoundStyle BossSummonSound = new("CalamityMod/Sounds/Custom/BossRush/BossRushSummon", 2);
public static readonly SoundStyle TeleportSound = new("CalamityMod/Sounds/Custom/BossRush/BossRushTeleport");
public static readonly SoundStyle TerminusActivationSound = new("CalamityMod/Sounds/Custom/BossRush/BossRushTerminusActivate");
public static readonly SoundStyle StartBuildupSound = new("CalamityMod/Sounds/Custom/BossRush/BossRushTerminusCharge");
public static readonly SoundStyle TerminusDeactivationSound = new("CalamityMod/Sounds/Custom/BossRush/BossRushTerminusDeactivate");
public static readonly SoundStyle Tier2TransitionSound = new("CalamityMod/Sounds/Custom/BossRush/BossRushTier2Transition");
public static readonly SoundStyle Tier3TransitionSound = new("CalamityMod/Sounds/Custom/BossRush/BossRushTier3Transition");
public static readonly SoundStyle Tier4TransitionSound = new("CalamityMod/Sounds/Custom/BossRush/BossRushTier4Transition");
public static readonly SoundStyle Tier5TransitionSound = new("CalamityMod/Sounds/Custom/BossRush/BossRushTier5Transition");
public static readonly SoundStyle VictorySound = new("CalamityMod/Sounds/Custom/BossRush/BossRushVictory");
#region Loading and Unloading
public static void Load()
@@ -476,9 +494,9 @@ namespace CalamityMod.Events
if (Bosses[BossRushStage].ToChangeTimeTo != TimeChangeContext.None)
CalamityUtils.ChangeTime(Bosses[BossRushStage].ToChangeTimeTo == TimeChangeContext.Day);
// Play the typical boss roar sound.
// Play a special boss roar sound by default.
if (!Bosses[BossRushStage].UsesSpecialSound)
SoundEngine.PlaySound(SoundID.Roar, Main.player[ClosestPlayerToWorldCenter].position);
SoundEngine.PlaySound(BossSummonSound, Main.player[ClosestPlayerToWorldCenter].position);
// And spawn the boss.
Bosses[BossRushStage].SpawnContext.Invoke(CurrentlyFoughtBoss);
+3 -3
View File
@@ -15,7 +15,7 @@ namespace CalamityMod.Items.Accessories
DisplayName.SetDefault("Abyssal Mirror");
Tooltip.SetDefault("Light does not reach the depths of the ocean\n" +
"Significantly reduces enemy aggression, even in the abyss\n" +
"Stealth generates 30% faster when standing still and 20% faster while moving\n" +
"Stealth generates 25% faster when standing still and 12% faster while moving\n" +
"Grants the ability to evade attacks, releasing a cloud of lumenyl fluid which damages and stuns nearby enemies\n" +
"Evading an attack grants a lot of stealth but has a 90 second cooldown\n" +
"This cooldown is shared with all other dodges and reflects");
@@ -33,8 +33,8 @@ namespace CalamityMod.Items.Accessories
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.stealthGenStandstill += 0.3f;
modPlayer.stealthGenMoving += 0.2f;
modPlayer.stealthGenStandstill += 0.25f;
modPlayer.stealthGenMoving += 0.12f;
modPlayer.abyssalMirror = true;
player.aggro -= 450;
}
+2 -2
View File
@@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories
"+10 maximum stealth\n" +
"6% increased rogue damage, and 6% increased rogue crit chance\n" +
"Vastly reduces enemy aggression, even in the abyss\n" +
"Stealth generates 20% faster when standing still\n" +
"Stealth generates 25% faster when standing still\n" +
"Mobile stealth generation exponentially accelerates while not attacking\n" +
"Stealth strikes only expend 50% of your max stealth\n" +
"Grants the ability to evade attacks in a blast of darksun light, which inflicts extreme damage in a wide area\n" +
@@ -38,7 +38,7 @@ namespace CalamityMod.Items.Accessories
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.stealthGenStandstill += 0.2f;
modPlayer.stealthGenStandstill += 0.25f;
modPlayer.rogueStealthMax += 0.1f;
modPlayer.eclipseMirror = true;
modPlayer.stealthStrikeHalfCost = true;
+1 -1
View File
@@ -13,7 +13,7 @@ namespace CalamityMod.Items.Accessories
DisplayName.SetDefault("Ink Bomb");
Tooltip.SetDefault("Throws several ink bombs when hit that explode in a confusing cloud of ink\n" +
"Gain a lot of stealth when struck\n" +
"This effect has a 25 second cooldown before it can occur again");
"This effect has a 20 second cooldown before it can occur again");
}
public override void SetDefaults()
+3 -3
View File
@@ -13,7 +13,7 @@ namespace CalamityMod.Items.Accessories
DisplayName.SetDefault("Mirage Mirror");
Tooltip.SetDefault("Bend light around you\n" +
"Reduces enemy aggression outside of the abyss\n" +
"Stealth generates 30% faster when standing still and 20% faster while moving");
"Stealth generates 25% faster when standing still and 12% faster while moving");
}
public override void SetDefaults()
@@ -28,8 +28,8 @@ namespace CalamityMod.Items.Accessories
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.stealthGenStandstill += 0.3f;
modPlayer.stealthGenMoving += 0.2f;
modPlayer.stealthGenStandstill += 0.25f;
modPlayer.stealthGenMoving += 0.12f;
player.aggro -= 200;
}
+1 -1
View File
@@ -14,7 +14,7 @@ namespace CalamityMod.Items.Accessories
DisplayName.SetDefault("Sand Cloak");
Tooltip.SetDefault("+2 defense and 5% increased movement speed\n" +
"TOOLTIP LINE HERE\n" +
"This effect has a 25 second cooldown before it can be used again");
"This effect has a 30 second cooldown before it can be used again");
}
public override void SetDefaults()
+3 -2
View File
@@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories
"TOOLTIP LINE HERE\n" +
"If you dodge something while invulnerable, you instantly gain full stealth\n" +
"Teleportation is disabled while Chaos State is active\n" +
"Stealth generates 20% faster while moving");
"Stealth generates 15% faster");
}
public override void SetDefaults()
@@ -42,7 +42,8 @@ namespace CalamityMod.Items.Accessories
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.Calamity().spectralVeil = true;
player.Calamity().stealthGenMoving += 0.2f;
player.Calamity().stealthGenMoving += 0.15f;
player.Calamity().stealthGenStandstill += 0.15f;
}
}
}
+2 -2
View File
@@ -41,12 +41,12 @@ namespace CalamityMod.Items.Armor.Aerospec
public override void UpdateArmorSet(Player player)
{
player.setBonus = "5% increased movement speed and rogue critical strike chance\n" +
"+100 maximum stealth\n" +
"+80 maximum stealth\n" +
"Taking over 25 damage in one hit will cause a spread of homing feathers to fall\n" +
"Allows you to fall more quickly and disables fall damage";
var modPlayer = player.Calamity();
modPlayer.aeroSet = true;
modPlayer.rogueStealthMax += 1f;
modPlayer.rogueStealthMax += 0.8f;
player.noFallDmg = true;
player.moveSpeed += 0.05f;
player.GetCritChance<ThrowingDamageClass>() += 5;
+2 -2
View File
@@ -38,11 +38,11 @@ namespace CalamityMod.Items.Armor.Statigel
player.setBonus = "When you take over 100 damage in one hit you become immune to damage for an extended period of time\n" +
"Grants an extra jump and increased jump height\n" +
"12% increased jump speed\n" +
"+100 maximum stealth";
"+90 maximum stealth";
var modPlayer = player.Calamity();
modPlayer.statigelSet = true;
modPlayer.statigelJump = true;
modPlayer.rogueStealthMax += 1f;
modPlayer.rogueStealthMax += 0.9f;
modPlayer.wearingRogueArmor = true;
Player.jumpHeight += 5;
player.jumpSpeedBoost += 0.6f;
+2 -2
View File
@@ -37,14 +37,14 @@ namespace CalamityMod.Items.Armor.Sulphurous
public override void UpdateArmorSet(Player player)
{
player.setBonus = "+95 maximum stealth\n" +
player.setBonus = "+70 maximum stealth\n" +
"Attacking and being attacked by enemies inflicts poison\n" +
"Grants an additional jump that summons a sulphurous bubble\n" +
"Provides increased underwater mobility and reduces the severity of the sulphuric waters";
var modPlayer = player.Calamity();
modPlayer.sulfurSet = true;
modPlayer.sulfurJump = true;
modPlayer.rogueStealthMax += 0.95f;
modPlayer.rogueStealthMax += 0.7f;
modPlayer.wearingRogueArmor = true;
player.ignoreWater = true;
}
+2 -2
View File
@@ -37,10 +37,10 @@ namespace CalamityMod.Items.Armor.Victide
"When using any weapon you have a 10% chance to throw a returning seashell projectile\n" +
"This seashell does true damage and does not benefit from any damage class\n" +
"Provides increased underwater mobility and slightly reduces breath loss in the abyss\n" +
"+90 maximum stealth";
"+60 maximum stealth";
var modPlayer = player.Calamity();
modPlayer.victideSet = true;
modPlayer.rogueStealthMax += 0.9f;
modPlayer.rogueStealthMax += 0.6f;
modPlayer.wearingRogueArmor = true;
player.ignoreWater = true;
if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir))
+1 -1
View File
@@ -291,7 +291,7 @@ namespace CalamityMod.Items
{ ItemID.MaceWhip, autoReuse },
{ ItemID.MagicalHarp, Do(DamageExact(50), ShootSpeedExact(12f)) },
{ ItemID.MagicDagger, Do(AutoReuse, DamageExact(77), UseExact(16), ShootSpeedExact(30)) },
{ ItemID.MagicMissile, Do(DamageExact(20), ManaExact(10), UseAnimationExact(20), UseTimeExact(10)) },
{ ItemID.MagicMissile, Do(DamageExact(23), ManaExact(10), UseAnimationExact(20), UseTimeExact(10)) },
{ ItemID.MagnetSphere, Do(DamageRatio(1.1f)) },
{ ItemID.ManaCrystal, autoReuse },
{ ItemID.Marrow, Do(PointBlank, AutoReuse, DamageExact(69)) },
+5
View File
@@ -47,6 +47,11 @@ namespace CalamityMod.Items.Materials
Item.ammo = Item.type;
}
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
{
itemGroup = ContentSamples.CreativeHelper.ItemGroup.Material;
}
public override void OnSpawn(IEntitySource source)
{
if (source is EntitySource_Loot)
+7 -2
View File
@@ -1,7 +1,7 @@
using Terraria;
using CalamityMod.Buffs.Potions;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Buffs.Potions;
namespace CalamityMod.Items.Potions
{
@@ -36,6 +36,11 @@ namespace CalamityMod.Items.Potions
Item.buffTime = CalamityUtils.SecondsToFrames(300f);
}
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
{
itemGroup = ContentSamples.CreativeHelper.ItemGroup.Food;
}
public override void OnConsumeItem(Player player)
{
//5 minutes for both
+2
View File
@@ -6,6 +6,7 @@ using CalamityMod.Items.Weapons.Magic;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Items.Weapons.Rogue;
using CalamityMod.Items.Weapons.Summon;
using CalamityMod.NPCs.Crabulon;
using CalamityMod.World;
using Microsoft.Xna.Framework;
@@ -71,6 +72,7 @@ namespace CalamityMod.Items.TreasureBags
ModContent.ItemType<HyphaeRod>(),
ModContent.ItemType<InfestedClawmerang>(),
ModContent.ItemType<Mycoroot>(),
ModContent.ItemType<PuffShroom>(),
}));
// Equipment
@@ -21,7 +21,7 @@ namespace CalamityMod.Items.VanillaArmorChanges
public override void UpdateSetBonusText(ref string setBonusText)
{
setBonusText += "\n+3 defense\n" +
"+70 maximum stealth\n" +
"+60 maximum stealth\n" +
"5% increased rogue damage and 10% increased velocity";
}
@@ -42,7 +42,7 @@ namespace CalamityMod.Items.VanillaArmorChanges
public override void ApplyArmorSetBonus(Player player)
{
player.Calamity().rogueStealthMax += 0.7f;
player.Calamity().rogueStealthMax += 0.6f;
player.Calamity().wearingRogueArmor = true;
player.GetDamage<ThrowingDamageClass>() += 0.05f;
player.Calamity().rogueVelocity += 0.1f;
+2 -2
View File
@@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Summon
public const int HeatDissipationTime = 180;
// This shouldn't be too high. If it is, the overdrive mode will be frustratingly inconsistent to use.
public const float OverdriveProjectileAngularRandomness = 0.15f;
public const float OverdriveProjectileAngularRandomness = 0.1f;
public static readonly Color HeatGlowColor = Color.OrangeRed with { A = 64 };
@@ -57,7 +57,7 @@ namespace CalamityMod.Items.Weapons.Summon
public override void SetDefaults()
{
Item.damage = 640;
Item.damage = 150;
Item.mana = 10;
Item.width = 40;
Item.height = 38;
+32 -32
View File
@@ -1,7 +1,6 @@
using Terraria.DataStructures;
using CalamityMod.Projectiles.Summon;
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -10,16 +9,37 @@ namespace CalamityMod.Items.Weapons.Summon
{
public class InfectedRemote : ModItem
{
int viruliSlots;
public const int DefaultIframes = 10;
public const int ChargeIframes = 2;
public const int RocketShootRate = 6;
public const int BeeShootRate = 22;
public const int MaxUpdatesWhenCharging = 2;
public const float RegularChargeSpeed = 40f;
public const float HorizontalRocketChargeSpeed = 22f;
public const float RocketDamageFactor = 0.7f;
public const float BeeDamageFactor = 0.65f;
public const float MinionSlotRequirement = 3f;
public const float EnemyTargetingRange = 1300f;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Infected Remote");
Tooltip.SetDefault("There’s a faded note written on it in green\n" +
"Only the first line is readable: 'She won’t afflict you, I promise!'\n" +
"Summons the harbinger of the plague...?\n" +
"Consumes all of the remaining minion slots on use\n" +
"Must be used from the hotbar\n" +
"Increased power based on the number of minion slots used");
Tooltip.SetDefault("Summons a humanoid-hybrid Plaguebringer, codenamed 'Virili', to aid you in battle\n" +
$"Virili requires {MinionSlotRequirement} minion slots to summon, and can only be summoned once\n" +
"Virili uses a variety of attacks which she cycles through on a timer\n" +
"All attacks spread the plague, as was her original design intention\n" +
"'A single note graces the back:'\n" +
"'WARNING: Subject is extremely corrosive and contagious. Avoid direct contact.'");
SacrificeTotal = 1;
}
@@ -43,35 +63,15 @@ namespace CalamityMod.Items.Weapons.Summon
Item.Calamity().donorItem = true;
}
public override void HoldItem(Player player)
{
double minionCount = 0;
for (int j = 0; j < Main.projectile.Length; j++)
{
Projectile projectile = Main.projectile[j];
if (projectile.active && projectile.owner == player.whoAmI && projectile.minion && projectile.type != ModContent.ProjectileType<PlaguePrincess>())
{
minionCount += projectile.minionSlots;
}
}
viruliSlots = (int)((double)player.maxMinions - minionCount);
}
public override bool CanUseItem(Player player)
{
return viruliSlots >= 1 && player.ownedProjectileCounts[Item.shoot] <= 0;
}
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
CalamityUtils.KillShootProjectiles(true, type, player);
float damageMult = ((float)Math.Log(viruliSlots, 10f)) + 1f;
position = Main.MouseWorld;
velocity.X = 0;
velocity.Y = 0;
int p = Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, (int)(damage * damageMult), knockback, player.whoAmI, viruliSlots, 1f);
int p = Projectile.NewProjectile(source, Main.MouseWorld, Vector2.Zero, type, damage, knockback, player.whoAmI);
if (Main.projectile.IndexInRange(p))
Main.projectile[p].originalDamage = (int)(Item.damage * damageMult);
Main.projectile[p].originalDamage = Item.damage;
return false;
}
}
+15 -2
View File
@@ -1,10 +1,12 @@
using Terraria.DataStructures;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Ores;
using CalamityMod.Projectiles.Summon;
using CalamityMod.Rarities;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Rarities;
namespace CalamityMod.Items.Weapons.Summon
{
@@ -57,5 +59,16 @@ namespace CalamityMod.Items.Weapons.Summon
}
return false;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient(ItemID.GolemFist).
AddIngredient<Lumenyl>(10).
AddIngredient<ExodiumCluster>(5).
AddIngredient<RuinousSoul>(5).
AddTile(TileID.LunarCraftingStation).
Register();
}
}
}
+2
View File
@@ -1057,6 +1057,7 @@ namespace CalamityMod
RegisterSummon(ItemType<SeaboundStaff>(), BuffType<BrittleStar>(), ProjectileType<BrittleStarMinion>());
RegisterSummon(ItemType<MagicalConch>(), BuffType<HermitCrab>(), ProjectileType<HermitCrabMinion>());
RegisterSummon(ItemType<DeathstareRod>(), BuffType<MiniatureEyeofCthulhu>(), ProjectileType<DeathstareEyeball>());
RegisterSummon(ItemType<PuffShroom>(), BuffType<PuffWarriorBuff>(), ProjectileType<PuffWarrior>());
RegisterSummon(ItemType<VileFeeder>(), BuffType<VileFeederBuff>(), ProjectileType<VileFeederSummon>());
RegisterSummon(ItemType<ScabRipper>(), BuffType<BabyBloodCrawlerBuff>(), ProjectileType<BabyBloodCrawler>());
RegisterSummon(ItemType<CinderBlossomStaff>(), BuffType<CinderBlossomBuff>(), ProjectileType<CinderBlossom>());
@@ -1101,6 +1102,7 @@ namespace CalamityMod
RegisterSummon(ItemType<EtherealSubjugator>(), BuffType<Phantom>(), ProjectileType<PhantomGuy>());
RegisterSummon(ItemType<CalamarisLament>(), BuffType<Calamari>(), ProjectileType<CalamariMinion>());
RegisterSummon(ItemType<GammaHeart>(), BuffType<GammaHydraBuff>(), ProjectileType<GammaHead>());
RegisterSummon(ItemType<WarloksMoonFist>(), BuffType<MoonFistBuff>(), ProjectileType<MoonFist>());
RegisterSummon(ItemType<StaffoftheMechworm>(), BuffType<Mechworm>(), ProjectileType<MechwormBody>());
RegisterSummon(ItemType<CorvidHarbringerStaff>(), BuffType<CorvidHarbringerBuff>(), ProjectileType<PowerfulRaven>());
RegisterSummon(ItemType<EndoHydraStaff>(), BuffType<EndoHydraBuff>(), ProjectileType<EndoHydraHead>());
-1
View File
@@ -836,7 +836,6 @@ namespace CalamityMod.NPCs
if (npc.daybreak)
{
int projAmt = 0;
int num7 = 4;
for (int k = 0; k < Main.maxProjectiles; k++)
{
if (Main.projectile[k].active && Main.projectile[k].type == ProjectileID.Daybreak && Main.projectile[k].ai[0] == 1f && Main.projectile[k].ai[1] == npc.whoAmI)
+2
View File
@@ -11,6 +11,7 @@ using CalamityMod.Items.Weapons.Magic;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Items.Weapons.Rogue;
using CalamityMod.Items.Weapons.Summon;
using CalamityMod.Projectiles.Boss;
using CalamityMod.World;
using Microsoft.Xna.Framework;
@@ -823,6 +824,7 @@ namespace CalamityMod.NPCs.Crabulon
ModContent.ItemType<HyphaeRod>(),
ModContent.ItemType<Mycoroot>(),
ModContent.ItemType<InfestedClawmerang>(),
ModContent.ItemType<PuffShroom>(),
};
normalOnly.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, weapons));
+17 -16
View File
@@ -35,36 +35,37 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
public ThanatosSmokeParticleSet SmokeDrawer = new ThanatosSmokeParticleSet(-1, 3, 0f, 16f, 1.5f);
public AresCannonChargeParticleSet EnergyDrawer = new AresCannonChargeParticleSet(-1, 15, 40f, Color.Yellow);
public Vector2 CoreSpritePosition => NPC.Center + NPC.spriteDirection * NPC.rotation.ToRotationVector2() * 35f + (NPC.rotation + MathHelper.PiOver2).ToRotationVector2() * 5f;
// This stores the sound slot of the telegraph sound it makes, so it may be properly updated in terms of position.
public SlotId TelegraphSoundSlot;
// Number of frames on the X and Y axis
private const int maxFramesX = 9;
private const int maxFramesY = 12;
public const int maxFramesX = 9;
public const int maxFramesY = 12;
// Counters for frames on the X and Y axis
private int frameX = 0;
private int frameY = 0;
public int frameX = 0;
public int frameY = 0;
// Frame limit per animation, these are the specific frames where each animation ends
private const int normalFrameLimit = 11;
private const int firstStageGaussNukeChargeFrameLimit = 23;
private const int secondStageGaussNukeChargeFrameLimit = 35;
private const int finalStageGaussNukeChargeFrameLimit = 47;
private const int reloadFrameLimit = 107;
public const int normalFrameLimit = 11;
public const int firstStageGaussNukeChargeFrameLimit = 23;
public const int secondStageGaussNukeChargeFrameLimit = 35;
public const int finalStageGaussNukeChargeFrameLimit = 47;
public const int reloadFrameLimit = 107;
// Default life ratio for the other mechs
private const float defaultLifeRatio = 5f;
public const float defaultLifeRatio = 5f;
// Total duration of the gauss nuke telegraph
private const float gaussNukeTelegraphDuration = 216f;
public const float gaussNukeTelegraphDuration = 216f;
// Total duration of the gauss nuke firing phase
private const float gaussNukeReloadDuration = 360f;
public const float gaussNukeReloadDuration = 360f;
//This stores the sound slot of the telegraph sound it makes, so it may be properly updated in terms of position.
private SlotId TelegraphSoundSlot;
//Telegraph sound
// Telegraph sound.
public static readonly SoundStyle TelSound = new("CalamityMod/Sounds/Custom/AresGaussNukeArmCharge");
public override void SetStaticDefaults()
+15 -14
View File
@@ -35,35 +35,36 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
public ThanatosSmokeParticleSet SmokeDrawer = new ThanatosSmokeParticleSet(-1, 3, 0f, 16f, 1.5f);
public AresCannonChargeParticleSet EnergyDrawer = new AresCannonChargeParticleSet(-1, 15, 40f, Color.OrangeRed);
public Vector2 CoreSpritePosition => NPC.Center + NPC.spriteDirection * NPC.rotation.ToRotationVector2() * 30f + (NPC.rotation + MathHelper.PiOver2).ToRotationVector2() * 15f;
// Number of frames on the X and Y axis
private const int maxFramesX = 6;
private const int maxFramesY = 8;
public const int maxFramesX = 6;
public const int maxFramesY = 8;
// Counters for frames on the X and Y axis
private int frameX = 0;
private int frameY = 0;
public int frameX = 0;
public int frameY = 0;
// Frame limit per animation, these are the specific frames where each animation ends
private const int normalFrameLimit = 11;
private const int firstStageDeathrayChargeFrameLimit = 23;
private const int secondStageDeathrayChargeFrameLimit = 35;
private const int finalStageDeathrayChargeFrameLimit = 47;
public const int normalFrameLimit = 11;
public const int firstStageDeathrayChargeFrameLimit = 23;
public const int secondStageDeathrayChargeFrameLimit = 35;
public const int finalStageDeathrayChargeFrameLimit = 47;
// Default life ratio for the other mechs
private const float defaultLifeRatio = 5f;
public const float defaultLifeRatio = 5f;
// Total duration of the deathray telegraph
private const float deathrayTelegraphDuration = 144f;
public const float deathrayTelegraphDuration = 144f;
// Total duration of the deathray
private const float deathrayDuration = 60f;
public const float deathrayDuration = 60f;
//This stores the sound slot of the telegraph sound it makes, so it may be properly updated in terms of position.
private SlotId DeathraySoundSlot;
// This stores the sound slot of the telegraph sound it makes, so it may be properly updated in terms of position.
public SlotId DeathraySoundSlot;
//Telegraph sound
// Telegraph sound.
public static readonly SoundStyle TelSound = new("CalamityMod/Sounds/Custom/AresLaserArmCharge");
public override void SetStaticDefaults()
+15 -14
View File
@@ -34,35 +34,36 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
public ThanatosSmokeParticleSet SmokeDrawer = new ThanatosSmokeParticleSet(-1, 3, 0f, 16f, 1.5f);
public AresCannonChargeParticleSet EnergyDrawer = new AresCannonChargeParticleSet(-1, 15, 40f, Color.GreenYellow);
public Vector2 CoreSpritePosition => NPC.Center + NPC.spriteDirection * NPC.rotation.ToRotationVector2() * 30f + (NPC.rotation + MathHelper.PiOver2).ToRotationVector2() * 15f;
// Number of frames on the X and Y axis
private const int maxFramesX = 6;
private const int maxFramesY = 8;
public const int maxFramesX = 6;
public const int maxFramesY = 8;
// Counters for frames on the X and Y axis
private int frameX = 0;
private int frameY = 0;
public int frameX = 0;
public int frameY = 0;
// Frame limit per animation, these are the specific frames where each animation ends
private const int normalFrameLimit = 11;
private const int firstStagePlasmaBoltChargeFrameLimit = 23;
private const int secondStagePlasmaBoltChargeFrameLimit = 35;
private const int finalStagePlasmaBoltChargeFrameLimit = 47;
public const int normalFrameLimit = 11;
public const int firstStagePlasmaBoltChargeFrameLimit = 23;
public const int secondStagePlasmaBoltChargeFrameLimit = 35;
public const int finalStagePlasmaBoltChargeFrameLimit = 47;
// Default life ratio for the other mechs
private const float defaultLifeRatio = 5f;
public const float defaultLifeRatio = 5f;
// Total duration of the plasma bolt telegraph
private const float plasmaBoltTelegraphDuration = 144f;
public const float plasmaBoltTelegraphDuration = 144f;
// Total duration of the plasma bolt firing phase
private const float plasmaBoltDuration = 120f;
public const float plasmaBoltDuration = 120f;
//This stores the sound slot of the telegraph sound it makes, so it may be properly updated in terms of position.
private SlotId TelegraphSoundSlot;
// This stores the sound slot of the telegraph sound it makes, so it may be properly updated in terms of position.
public SlotId TelegraphSoundSlot;
//Telegraph sound
// Telegraph sound.
public static readonly SoundStyle TelSound = new("CalamityMod/Sounds/Custom/AresPlasmaArmCharge");
public override void SetStaticDefaults()
+15 -14
View File
@@ -34,35 +34,36 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
public ThanatosSmokeParticleSet SmokeDrawer = new ThanatosSmokeParticleSet(-1, 3, 0f, 16f, 1.5f);
public AresCannonChargeParticleSet EnergyDrawer = new AresCannonChargeParticleSet(-1, 15, 40f, Color.Aqua);
public Vector2 CoreSpritePosition => NPC.Center + NPC.spriteDirection * NPC.rotation.ToRotationVector2() * 35f + (NPC.rotation + MathHelper.PiOver2).ToRotationVector2() * 5f;
// Number of frames on the X and Y axis
private const int maxFramesX = 6;
private const int maxFramesY = 8;
public const int maxFramesX = 6;
public const int maxFramesY = 8;
// Counters for frames on the X and Y axis
private int frameX = 0;
private int frameY = 0;
public int frameX = 0;
public int frameY = 0;
// Frame limit per animation, these are the specific frames where each animation ends
private const int normalFrameLimit = 11;
private const int firstStageTeslaOrbChargeFrameLimit = 23;
private const int secondStageTeslaOrbChargeFrameLimit = 35;
private const int finalStageTeslaOrbChargeFrameLimit = 47;
public const int normalFrameLimit = 11;
public const int firstStageTeslaOrbChargeFrameLimit = 23;
public const int secondStageTeslaOrbChargeFrameLimit = 35;
public const int finalStageTeslaOrbChargeFrameLimit = 47;
// Default life ratio for the other mechs
private const float defaultLifeRatio = 5f;
public const float defaultLifeRatio = 5f;
// Total duration of the tesla orb telegraph
private const float teslaOrbTelegraphDuration = 144f;
public const float teslaOrbTelegraphDuration = 144f;
// Total duration of the tesla orb firing phase
private const float teslaOrbDuration = 120f;
public const float teslaOrbDuration = 120f;
//This stores the sound slot of the telegraph sound it makes, so it may be properly updated in terms of position.
private SlotId TelegraphSoundSlot;
// This stores the sound slot of the telegraph sound it makes, so it may be properly updated in terms of position.
public SlotId TelegraphSoundSlot;
//Telegraph sound
// Telegraph sound.
public static readonly SoundStyle TelSound = new("CalamityMod/Sounds/Custom/AresTeslaArmCharge");
public override void SetStaticDefaults()
+1 -1
View File
@@ -2585,7 +2585,7 @@ namespace CalamityMod.Projectiles
if (modPlayer.scuttlersJewel && stealthStrike && modPlayer.scuttlerCooldown <= 0)
{
int damage = (int)player.GetTotalDamage<RogueDamageClass>().ApplyTo(20);
int damage = (int)player.GetTotalDamage<RogueDamageClass>().ApplyTo(15);
int spike = Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, ProjectileType<JewelSpike>(), damage, projectile.knockBack, projectile.owner);
Main.projectile[spike].frame = 4;
if (spike.WithinBounds(Main.maxProjectiles))
@@ -310,5 +310,11 @@ namespace CalamityMod.Projectiles.Summon
// Don't die on tile collision.
public override bool OnTileCollide(Vector2 oldVelocity) => false;
public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough, ref Vector2 hitboxCenterFrac)
{
fallThrough = false;
return true;
}
}
}
@@ -109,8 +109,8 @@ namespace CalamityMod.Projectiles.Summon
SmokeDrawer.BaseMoveRotation = MathHelper.PiOver2 + Projectile.spriteDirection * (Projectile.position.X - Projectile.oldPosition.X) * 0.04f;
SmokeDrawer.Update();
// Cool down if not being fired.
if (!IsFiring)
// Cool down if not being held.
if (!BeingHeld)
HeatInterpolant = MathHelper.Clamp(HeatInterpolant - 1f / AtlasMunitionsBeacon.HeatDissipationTime, 0f, 1f);
if (BeingHeld)
@@ -186,7 +186,8 @@ namespace CalamityMod.Projectiles.Summon
// Be picked up by nearby players if they right click and are holding the appropriate item.
bool rightClick = Main.mouseRight && Main.mouseRightRelease;
if (Main.LocalPlayer.WithinRange(Projectile.Center, AtlasMunitionsBeacon.PickupRange) && rightClick && Main.LocalPlayer.ActiveItem().type == ModContent.ItemType<AtlasMunitionsBeacon>())
bool correctItem = Main.LocalPlayer.ActiveItem().type == ModContent.ItemType<AtlasMunitionsBeacon>();
if (Main.LocalPlayer.WithinRange(Projectile.Center, AtlasMunitionsBeacon.PickupRange) && rightClick && correctItem && HeatInterpolant < 0.5f)
{
BeingHeld = true;
Projectile.owner = Main.myPlayer;
@@ -257,9 +258,9 @@ namespace CalamityMod.Projectiles.Summon
int laserCount = 3;
int laserDamage = Projectile.damage;
int laserID = ModContent.ProjectileType<AtlasMunitionsLaserOverdrive>();
Vector2 laserVelocity = Projectile.velocity.RotatedBy(AtlasMunitionsBeacon.OverdriveProjectileAngularRandomness) * 9.25f;
for (int i = 0; i < laserCount; i++)
{
Vector2 laserVelocity = Projectile.velocity.RotatedByRandom(AtlasMunitionsBeacon.OverdriveProjectileAngularRandomness) * 9.25f;
Vector2 laserSpawnOffset = Projectile.velocity * 66f + (MathHelper.TwoPi * i / laserCount + MathHelper.PiOver2 / laserCount).ToRotationVector2() * 10f;
Projectile.NewProjectile(Projectile.GetSource_FromAI(), Projectile.Center + laserSpawnOffset, laserVelocity, laserID, laserDamage, 0f, Projectile.owner);
}
@@ -140,6 +140,12 @@ namespace CalamityMod.Projectiles.Summon
public override bool OnTileCollide(Vector2 oldVelocity) => false;
public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough, ref Vector2 hitboxCenterFrac)
{
fallThrough = false;
return true;
}
public override bool PreDraw(ref Color lightColor)
{
Texture2D texture = ModContent.Request<Texture2D>(Texture).Value;
+1 -1
View File
@@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Summon
Projectile.ignoreWater = true;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 15;
Projectile.extraUpdates = 0;
Projectile.MaxUpdates = 2;
Projectile.minionSlots = 0f;
Projectile.timeLeft = 360;
Projectile.penetrate = 3;
+1 -2
View File
@@ -28,8 +28,7 @@ namespace CalamityMod.Projectiles.Summon
Projectile.minionSlots = 0f;
Projectile.penetrate = 1;
Projectile.timeLeft = 120;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 8;
Projectile.Opacity = 0.5f;
Projectile.DamageType = DamageClass.Summon;
}
+1 -1
View File
@@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Summon
public static void HomeInOnTarget(Projectile projectile, NPC target)
{
float speed = MathHelper.Lerp(11f, 21f, (float)Math.Sin(projectile.identity % 7f / 7f * MathHelper.TwoPi) * 0.5f + 0.5f);
float speed = MathHelper.Lerp(21f, 31f, (float)Math.Sin(projectile.identity % 7f / 7f * MathHelper.TwoPi) * 0.5f + 0.5f);
projectile.velocity = Vector2.Lerp(projectile.velocity, projectile.SafeDirectionTo(target.Center) * speed, 0.075f);
}
+2 -1
View File
@@ -25,6 +25,7 @@ namespace CalamityMod.Projectiles.Summon
Projectile.timeLeft = 420;
Projectile.ignoreWater = true;
Projectile.minion = true;
Projectile.MaxUpdates = 2;
Projectile.DamageType = DamageClass.Summon;
}
@@ -101,7 +102,7 @@ namespace CalamityMod.Projectiles.Summon
center.X = Projectile.Center.X + Projectile.velocity.X * 100f;
center.Y = Projectile.Center.Y + Projectile.velocity.Y * 100f;
}
float speed = 10f;
float speed = 15f;
float velocityTweak = 0.14f;
Vector2 projPos = Projectile.Center;
Vector2 velocity = center - projPos;
+326 -292
View File
@@ -6,22 +6,45 @@ using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Items.Weapons.Summon;
using Microsoft.Xna.Framework.Graphics;
using Terraria.Audio;
using CalamityMod.Sounds;
using CalamityMod.Particles;
using CalamityMod.NPCs.PlaguebringerGoliath;
namespace CalamityMod.Projectiles.Summon
{
public class PlaguePrincess : ModProjectile
{
private bool dust = true;
private int mode = 0; //0 missiles, 1 mini bees, 2 charging
private int modeCounter = 0;
private int AIint = 0;
public enum ViriliAIState
{
HoverNearOwner,
ChargeAtEnemies,
BombardEnemiesWithRockets,
SummonPlagueBeesOnEnemies
}
public bool UseAfterimages;
public ViriliAIState CurrentState
{
get => (ViriliAIState)Projectile.ai[0];
set => Projectile.ai[0] = (int)value;
}
public Player Owner => Main.player[Projectile.owner];
public ref float AITimer => ref Projectile.ai[1];
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Virili");
Main.projFrames[Projectile.type] = 6;
ProjectileID.Sets.MinionSacrificable[Projectile.type] = true;
ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true;
ProjectileID.Sets.TrailingMode[Type] = 2;
ProjectileID.Sets.TrailCacheLength[Type] = 8;
ProjectileID.Sets.MinionSacrificable[Type] = true;
ProjectileID.Sets.MinionTargettingFeature[Type] = true;
}
public override void SetDefaults()
@@ -31,336 +54,347 @@ namespace CalamityMod.Projectiles.Summon
Projectile.netImportant = true;
Projectile.friendly = true;
Projectile.ignoreWater = true;
Projectile.minionSlots = 1f;
Projectile.timeLeft = 18000;
Projectile.minionSlots = InfectedRemote.MinionSlotRequirement;
Projectile.timeLeft = 90000;
Projectile.penetrate = -1;
Projectile.tileCollide = false;
Projectile.timeLeft *= 5;
Projectile.minion = true;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 10;
Projectile.localNPCHitCooldown = InfectedRemote.DefaultIframes;
Projectile.tileCollide = false;
Projectile.DamageType = DamageClass.Summon;
}
public override void AI()
{
Player player = Main.player[Projectile.owner];
CalamityPlayer modPlayer = player.Calamity();
// Decide whether the minion should still exist.
HandleMinionBools();
Projectile.minionSlots = Projectile.ai[0];
// Decide frames.
DecideFrames();
//bools and crap
bool correctMinion = Projectile.type == ModContent.ProjectileType<PlaguePrincess>();
player.AddBuff(ModContent.BuffType<ViriliBuff>(), 3600);
if (correctMinion)
// Reset afterimages, extra updates, and i-frames.
UseAfterimages = false;
Projectile.MaxUpdates = 1;
Projectile.localNPCHitCooldown = InfectedRemote.DefaultIframes;
NPC potentialTarget = Projectile.Center.MinionHoming(InfectedRemote.EnemyTargetingRange, Owner);
switch (CurrentState)
{
if (player.dead)
{
modPlayer.virili = false;
}
if (modPlayer.virili)
{
case ViriliAIState.HoverNearOwner:
DoBehavior_HoverNearOwner(potentialTarget);
break;
case ViriliAIState.ChargeAtEnemies:
DoBehavior_ChargeAtEnemies(potentialTarget);
break;
case ViriliAIState.BombardEnemiesWithRockets:
DoBehavior_BombardEnemiesWithRockets(potentialTarget);
break;
case ViriliAIState.SummonPlagueBeesOnEnemies:
DoBehavior_SummonPlagueBeesOnEnemies(potentialTarget);
break;
}
AITimer++;
}
public void HandleMinionBools()
{
Owner.AddBuff(ModContent.BuffType<ViriliBuff>(), 3600);
if (Projectile.type == ModContent.ProjectileType<PlaguePrincess>())
{
if (Owner.dead)
Owner.Calamity().virili = false;
if (Owner.Calamity().virili)
Projectile.timeLeft = 2;
}
}
}
//dust and flexible damage
if (dust)
{
int num501 = 50;
for (int num502 = 0; num502 < num501; num502++)
{
int num503 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y + 16f), Projectile.width, Projectile.height - 16, 89, 0f, 0f, 0, default, 1f);
Main.dust[num503].velocity *= 2f;
Main.dust[num503].scale *= 1.15f;
}
dust = false;
}
//framing
public void DecideFrames()
{
Projectile.frameCounter++;
if (Projectile.frameCounter > 6)
{
Projectile.frame++;
Projectile.frameCounter = 0;
}
if (Projectile.frame >= Main.projFrames[Projectile.type])
{
Projectile.frame = 0;
}
Projectile.frame = Projectile.frameCounter / 6 % Main.projFrames[Projectile.type];
}
//direction
if ((double)Math.Abs(Projectile.velocity.X) > 0.2)
{
Projectile.spriteDirection = -Projectile.direction;
}
public void DoBehavior_HoverNearOwner(NPC potentialTarget)
{
if (Projectile.WithinRange(Owner.Center, 160f))
return;
//Lighting
float num = (float)Main.rand.Next(90, 111) * 0.01f;
num *= Main.essScale;
Lighting.AddLight(Projectile.Center, 0f * num, 1.25f * num, 0f * num);
// Hover near the owner.
Projectile.velocity = (Projectile.velocity * 34f + Projectile.SafeDirectionTo(Owner.Center) * 17f) / 35f;
//change modes every 10 seconds
modeCounter++;
if (modeCounter >= 600)
// Teleport to the owner if sufficiently far away.
if (!Projectile.WithinRange(Owner.Center, 2500f))
{
modeCounter = 0;
mode++;
if (mode > 2)
mode = 0;
}
//anti sticking movement
Projectile.MinionAntiClump();
//anti-sticking also applies to the player
float antiStickFloat = 0.05f;
if (Projectile.position.X < player.position.X)
{
Projectile.velocity.X -= antiStickFloat;
}
else
{
Projectile.velocity.X += antiStickFloat;
}
if (Projectile.position.Y < player.position.Y)
{
Projectile.velocity.Y -= antiStickFloat;
}
else
{
Projectile.velocity.Y += antiStickFloat;
}
bool cancelAttack = false;
if (mode == 2)
{
if (AIint == 2)
{
Projectile.ai[1] += 1f;
Projectile.extraUpdates = 2;
if (Projectile.ai[1] > 30f)
{
Projectile.ai[1] = 1f;
AIint = 0;
Projectile.extraUpdates = 1;
Projectile.numUpdates = 0;
Projectile.netUpdate = true;
}
else
{
cancelAttack = true;
}
}
else
{
Projectile.extraUpdates = 1;
}
if (cancelAttack)
{
return;
}
}
if (mode == 0 || mode == 1)
{
Projectile.extraUpdates = 1;
if (AIint == 2)
AIint = 0;
}
float num633 = 1040f;
float num636 = 400f; //150
Vector2 targetLocation = Projectile.position;
bool targetFound = false;
if (player.HasMinionAttackTargetNPC)
{
NPC npc = Main.npc[player.MinionAttackTargetNPC];
if (npc.CanBeChasedBy(Projectile, false))
{
float num646 = Vector2.Distance(npc.Center, Projectile.Center);
if ((!targetFound && num646 < num633) && Collision.CanHitLine(Projectile.position, Projectile.width, Projectile.height, npc.position, npc.width, npc.height))
{
num633 = num646;
targetLocation = npc.Center;
targetFound = true;
}
}
}
if (!targetFound)
{
for (int num645 = 0; num645 < Main.maxNPCs; num645++)
{
NPC nPC2 = Main.npc[num645];
if (nPC2.CanBeChasedBy(Projectile, false))
{
float num646 = Vector2.Distance(nPC2.Center, Projectile.Center);
if ((!targetFound && num646 < num633) && Collision.CanHitLine(Projectile.position, Projectile.width, Projectile.height, nPC2.position, nPC2.width, nPC2.height))
{
num633 = num646;
targetLocation = nPC2.Center;
targetFound = true;
}
}
}
}
//head back to player if too far
if (Vector2.Distance(player.Center, Projectile.Center) > 1200f)
{
AIint = 1;
Projectile.Center = Owner.Center;
Projectile.velocity *= 0.3f;
Projectile.netUpdate = true;
}
if (targetFound && AIint == 0)
{
Vector2 targetVector = targetLocation - Projectile.Center;
float targetDist = targetVector.Length();
targetVector.Normalize();
if (targetDist > 200f)
{
float scaleFactor2 = 8f;
targetVector *= scaleFactor2;
Projectile.velocity = (Projectile.velocity * 40f + targetVector) / 41f;
}
else if (mode == 2) //charging
{
float scaleFactor3 = 4f;
targetVector *= -scaleFactor3;
Projectile.velocity = (Projectile.velocity * 40f + targetVector) / 41f;
}
else if (Projectile.velocity.Y > -1f)
Projectile.velocity.Y -= 0.1f;
}
else //idle movement
{
bool returningToPlayer = false;
if (!returningToPlayer)
{
returningToPlayer = AIint == 1;
}
if (Math.Abs(Projectile.velocity.X) > 0.2f)
Projectile.spriteDirection = Math.Sign(Projectile.velocity.X);
//set minion speed
float speedFloat = 5f; //6
if (returningToPlayer)
{
speedFloat = 12f; //15
}
Vector2 projVector = Projectile.Center;
Vector2 playerVector = player.Center - projVector + new Vector2(0, -60f); //-60
float playerDist = playerVector.Length();
if (playerDist > 200f && speedFloat < 6.5f) //200 and 8
{
speedFloat = 6.5f; //8
}
if (playerDist < num636 && returningToPlayer && !Collision.SolidCollision(Projectile.position, Projectile.width, Projectile.height))
{
AIint = 0;
Projectile.netUpdate = true;
}
if (playerDist > 2000f) //if too far, teleport to player
{
Projectile.position.X = Main.player[Projectile.owner].Center.X - (float)(Projectile.width / 2);
Projectile.position.Y = Main.player[Projectile.owner].Center.Y - (float)(Projectile.height / 2);
Projectile.netUpdate = true;
}
if (playerDist > 70f)
{
playerVector.Normalize();
playerVector *= speedFloat;
Projectile.velocity = (Projectile.velocity * 40f + playerVector) / 41f;
}
else if (Projectile.velocity.X == 0f && Projectile.velocity.Y == 0f)
{
Projectile.velocity.X = -0.18f;
Projectile.velocity.Y = -0.08f;
}
}
//increment attack cooldown
float cooldown = 100f;
if (mode == 0)
cooldown = 200f;
else if (mode == 1)
cooldown = 110f;
else if (mode == 2)
cooldown = 80f;
if (Projectile.ai[1] > 0f)
if (potentialTarget is not null)
{
Projectile.ai[1] += (float)Main.rand.Next(1, 4);
}
if (Projectile.ai[1] > cooldown)
{
Projectile.ai[1] = 0f;
CurrentState = ViriliAIState.ChargeAtEnemies;
AITimer = 0f;
Projectile.netUpdate = true;
}
if (AIint == 0)
// Stop rotating.
Projectile.rotation = Projectile.rotation.AngleTowards(0f, 0.1f);
}
public void DoBehavior_ChargeAtEnemies(NPC target)
{
int hoverTime = 18;
int chargeTime = 16;
int slowdownTime = 15;
int chargeCount = 6;
float hoverSpeed = 17f;
// Exit the attack state if Virili no longer has a valid target.
if (target is null)
{
if (mode == 0)
ReturnToIdleState();
return;
}
// Use more extra updates and less i-frames.
Projectile.MaxUpdates = InfectedRemote.MaxUpdatesWhenCharging;
Projectile.localNPCHitCooldown = InfectedRemote.ChargeIframes;
float wrappedAttackTimer = AITimer % (hoverTime + chargeTime + slowdownTime);
// Hover into position, to the top left/right of the target.
if (wrappedAttackTimer < hoverTime)
{
// Look at the target.
Projectile.spriteDirection = (target.Center.X > Projectile.Center.X).ToDirectionInt();
HoverToPosition(target.Center + new Vector2(Projectile.spriteDirection * -270f, -150f), hoverSpeed);
}
else
{
UseAfterimages = true;
if (wrappedAttackTimer < hoverTime + chargeTime)
{
if (targetFound && Projectile.ai[1] == 0f)
// Create anime-esque streaks during the dash.
if (wrappedAttackTimer % 2f == 1f && wrappedAttackTimer >= hoverTime + 3f)
{
Projectile.ai[1] += 1f;
float scaleFactor4 = 14f;
int projType = ModContent.ProjectileType<PrincessMissile>();
if (Main.myPlayer == Projectile.owner && Collision.CanHitLine(Projectile.position, Projectile.width, Projectile.height, targetLocation, 0, 0))
{
Vector2 projVect = targetLocation - Projectile.Center;
projVect.Normalize();
projVect *= scaleFactor4;
int p = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, projVect, projType, (int)(Projectile.damage * 0.6f), 0f, Main.myPlayer, 0f, 0f);
if (Main.projectile.IndexInRange(p))
Main.projectile[p].originalDamage = (int)(Projectile.originalDamage * 0.6);
Projectile.netUpdate = true;
}
Vector2 particleVelocity = -Projectile.velocity.SafeNormalize(Vector2.UnitY) * Main.rand.NextFloat(6f, 10f);
var energyLeak = new SquishyLightParticle(Projectile.Center + Main.rand.NextVector2Circular(50f, 50f) + Projectile.velocity * 5f, particleVelocity, Main.rand.NextFloat(0.45f, 0.87f), Color.ForestGreen, 30, 3.4f, 4.5f);
GeneralParticleHandler.SpawnParticle(energyLeak);
}
if (Projectile.velocity.Length() < InfectedRemote.RegularChargeSpeed)
Projectile.velocity *= 1.1f;
}
else if (mode == 1)
}
// Dash extremely quickly at the target.
if (wrappedAttackTimer == hoverTime)
{
SoundEngine.PlaySound(CommonCalamitySounds.ELRFireSound, Projectile.Center);
Projectile.velocity = CalamityUtils.CalculatePredictiveAimToTarget(Projectile.Center, target, InfectedRemote.RegularChargeSpeed * 0.55f, 8);
Projectile.netUpdate = true;
}
// Slow down rapidly to a crawl after the charge.
if (wrappedAttackTimer >= hoverTime + chargeTime)
Projectile.velocity *= 0.825f;
// Determine rotation.
Projectile.rotation = Projectile.velocity.X * 0.014f;
// Transition to the next attack state once enough charges have happened.
if (AITimer >= (hoverTime + chargeTime + slowdownTime) * chargeCount)
{
AITimer = 0f;
Projectile.velocity *= 0.3f;
CurrentState = ViriliAIState.BombardEnemiesWithRockets;
Projectile.netUpdate = true;
}
}
public void DoBehavior_BombardEnemiesWithRockets(NPC target)
{
int hoverTime = 50;
int chargeTime = 50;
int chargeCount = 6;
float hoverSpeed = 17f;
float rocketShootSpeed = 7f;
// Exit the attack state if Virili no longer has a valid target.
if (target is null)
{
ReturnToIdleState();
return;
}
// Use more extra updates.
Projectile.MaxUpdates = InfectedRemote.MaxUpdatesWhenCharging;
float wrappedAttackTimer = AITimer % (hoverTime + chargeTime);
// Hover into position, to the top left/right of the target.
if (wrappedAttackTimer < hoverTime)
{
// Look at the target.
Projectile.spriteDirection = (target.Center.X > Projectile.Center.X).ToDirectionInt();
Vector2 hoverDestination = target.Center + new Vector2(Projectile.spriteDirection * -480f, -280f);
HoverToPosition(hoverDestination, hoverSpeed);
if (Projectile.WithinRange(hoverDestination, 150f))
{
if (targetFound && Projectile.ai[1] == 0f)
Projectile.velocity *= 0.85f;
Projectile.Center = Vector2.Lerp(Projectile.Center, hoverDestination, 0.03f);
}
}
else
{
UseAfterimages = true;
if (wrappedAttackTimer < hoverTime + chargeTime)
{
// Create anime-esque streaks during the dash.
if (wrappedAttackTimer % 2f == 1f && wrappedAttackTimer >= hoverTime + 3f)
{
Projectile.ai[1] += 1f;
int smallBee = ModContent.ProjectileType<PlagueBeeSmall>();
int bigBee = ModContent.ProjectileType<BabyPlaguebringer>();
int projType = smallBee;
if (player.ownedProjectileCounts[bigBee] < 1 && Main.rand.NextBool(3))
projType = bigBee;
if (Main.myPlayer == Projectile.owner && Collision.CanHitLine(Projectile.position, Projectile.width, Projectile.height, targetLocation, 0, 0))
Vector2 particleVelocity = -Projectile.velocity.SafeNormalize(Vector2.UnitY) * Main.rand.NextFloat(6f, 10f);
var energyLeak = new SquishyLightParticle(Projectile.Center + Main.rand.NextVector2Circular(50f, 50f) + Projectile.velocity * 5f, particleVelocity, Main.rand.NextFloat(0.45f, 0.87f), Color.ForestGreen, 30, 3.4f, 4.5f);
GeneralParticleHandler.SpawnParticle(energyLeak);
}
// Release rockets.
if (Main.myPlayer == Projectile.owner && wrappedAttackTimer % InfectedRemote.RocketShootRate == InfectedRemote.RocketShootRate - 1f)
{
Vector2 rocketSpawnPosition = Projectile.Center + Vector2.UnitY * Projectile.scale * 48f;
Vector2 rocketVelocity = (target.Center - rocketSpawnPosition).SafeNormalize(Vector2.UnitY) * rocketShootSpeed;
int rocket = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, rocketVelocity, ModContent.ProjectileType<MK2RocketHoming>(), (int)(Projectile.damage * InfectedRemote.RocketDamageFactor), 3f, Projectile.owner);
if (Main.projectile.IndexInRange(rocket))
Main.projectile[rocket].originalDamage = (int)(Projectile.originalDamage * InfectedRemote.RocketDamageFactor);
}
if (Projectile.velocity.Length() < InfectedRemote.HorizontalRocketChargeSpeed)
Projectile.velocity *= 1.1f;
}
}
// Dash extremely quickly above the target.
if (wrappedAttackTimer == hoverTime)
{
SoundEngine.PlaySound(PlaguebringerGoliath.BarrageLaunchSound, Projectile.Center);
Projectile.velocity = Vector2.UnitX * InfectedRemote.HorizontalRocketChargeSpeed * Projectile.spriteDirection * 0.55f;
Projectile.netUpdate = true;
}
// Transition to the next attack state once enough charges have happened.
if (AITimer >= (hoverTime + chargeTime) * chargeCount)
{
AITimer = 0f;
Projectile.velocity *= 0.3f;
CurrentState = ViriliAIState.SummonPlagueBeesOnEnemies;
Projectile.netUpdate = true;
}
}
public void DoBehavior_SummonPlagueBeesOnEnemies(NPC target)
{
int shootTime = 300;
float hoverSpeed = 23f;
// Exit the attack state if Virili no longer has a valid target.
if (target is null)
{
ReturnToIdleState();
return;
}
// Hover above the target.
Vector2 hoverDestination = target.Center - Vector2.UnitY * 350f;
HoverToPosition(hoverDestination, hoverSpeed);
if (Projectile.WithinRange(hoverDestination, 240f))
{
Projectile.velocity *= 0.7f;
Projectile.Center = Vector2.Lerp(Projectile.Center, hoverDestination, 0.04f);
// Release bees.
if (Main.myPlayer == Projectile.owner && AITimer % InfectedRemote.BeeShootRate == InfectedRemote.BeeShootRate - 1f)
{
int smallBee = ModContent.ProjectileType<PlagueBeeSmall>();
int bigBee = ModContent.ProjectileType<BabyPlaguebringer>();
int projType = smallBee;
if (Owner.ownedProjectileCounts[bigBee] <= 0 && Main.rand.NextBool(2))
projType = bigBee;
if (Main.myPlayer == Projectile.owner && Collision.CanHitLine(Projectile.position, Projectile.width, Projectile.height, target.Center, 0, 0))
{
int beeCount = projType == bigBee ? 1 : 4;
for (int i = 0; i < beeCount; i++)
{
for (int beeIndex = 0; beeIndex < (projType == bigBee ? 1 : Main.rand.Next(1,5)); beeIndex++)
Vector2 beeVelocity = Projectile.SafeDirectionTo(target.Center) * 6f;
int bee = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, beeVelocity, projType, (int)(Projectile.damage * InfectedRemote.BeeDamageFactor), 0f, Projectile.owner);
if (Main.projectile.IndexInRange(bee))
{
Vector2 projVect2 = targetLocation - Projectile.Center;
projVect2.Normalize();
float SpeedX = projVect2.X + (float)Main.rand.Next(-30, 31) * 0.05f;
float SpeedY = projVect2.Y + (float)Main.rand.Next(-30, 31) * 0.05f;
int bee = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, SpeedX, SpeedY, projType, (int)(Projectile.damage * 0.8f), 0f, Main.myPlayer, 0f, 0f);
if (projType == bigBee)
{
Main.projectile[bee].frame = 2;
}
if (Main.projectile.IndexInRange(bee))
Main.projectile[bee].originalDamage = (int)(Projectile.originalDamage * 0.8f);
Projectile.netUpdate = true;
Main.projectile[bee].originalDamage = (int)(Projectile.originalDamage * InfectedRemote.BeeDamageFactor);
}
}
}
}
else if (mode == 2)
{
if (Projectile.ai[1] == 0f && targetFound && num633 < 500f)
{
Projectile.ai[1] += 1f;
if (Main.myPlayer == Projectile.owner)
{
AIint = 2;
Vector2 targetVect = targetLocation - Projectile.Center;
targetVect.Normalize();
Projectile.velocity = targetVect * 8f;
Projectile.netUpdate = true;
}
}
}
}
if (AITimer >= shootTime)
{
AITimer = 0f;
Projectile.velocity *= 0.3f;
CurrentState = ViriliAIState.ChargeAtEnemies;
Projectile.netUpdate = true;
}
}
public void HoverToPosition(Vector2 hoverDestination, float hoverSpeed)
{
Vector2 baseHoverVelocity = Projectile.SafeDirectionTo(hoverDestination) * hoverSpeed;
// If not close to the hover destination, rapidly zoom towards it. Otherwise, hover in place.
if (!Projectile.WithinRange(hoverDestination, 150f))
{
float hyperspeedInterpolant = Utils.GetLerpValue(Projectile.Distance(hoverDestination), 500f, 960f, true);
Projectile.velocity = Vector2.Lerp(Projectile.velocity, Vector2.Lerp(baseHoverVelocity * 1.4f, (hoverDestination - Projectile.Center) * 0.1f, hyperspeedInterpolant), 0.2f);
}
else
{
Projectile.velocity = (Projectile.velocity * 29f + baseHoverVelocity) / 30f;
Projectile.velocity = Projectile.velocity.MoveTowards(baseHoverVelocity, hoverSpeed / 11f);
}
}
public void ReturnToIdleState()
{
CurrentState = ViriliAIState.HoverNearOwner;
Projectile.netUpdate = true;
}
public override bool PreDraw(ref Color lightColor)
{
Texture2D texture = ModContent.Request<Texture2D>(Texture).Value;
Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame);
Vector2 origin = frame.Size() * 0.5f;
Vector2 drawPosition = Projectile.Center - Main.screenPosition;
SpriteEffects direction = Projectile.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None;
if (UseAfterimages)
{
for (int i = 0; i < Projectile.oldPos.Length; i++)
{
Color afterimageDrawColor = Color.ForestGreen with { A = 25 } * Projectile.Opacity * (1f - i / (float)Projectile.oldPos.Length);
Vector2 afterimageDrawPosition = Projectile.oldPos[i] + Projectile.Size * 0.5f - Main.screenPosition;
Main.EntitySpriteDraw(texture, afterimageDrawPosition, frame, afterimageDrawColor, Projectile.rotation, origin, Projectile.scale, direction, 0);
}
}
Main.EntitySpriteDraw(texture, drawPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, direction, 0);
return false;
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
@@ -373,6 +407,6 @@ namespace CalamityMod.Projectiles.Summon
target.AddBuff(ModContent.BuffType<Plague>(), 180);
}
public override bool? CanDamage() => mode == 2;
public override bool? CanDamage() => CurrentState == ViriliAIState.ChargeAtEnemies ? null : false;
}
}
+1 -2
View File
@@ -18,11 +18,10 @@ namespace CalamityMod.Projectiles.Summon
{
Projectile.width = Projectile.height = 16;
Projectile.friendly = true;
Projectile.minion = true;
Projectile.minionSlots = 0f;
Projectile.ignoreWater = true;
Projectile.penetrate = 1;
Projectile.tileCollide = false;
Projectile.DamageType = DamageClass.Summon;
}
public override void AI()
+5 -2
View File
@@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Summon
{
public Player Owner => Main.player[Projectile.owner];
public Tile GroundTile => CalamityUtils.ParanoidTileRetrieval((int)(Projectile.Bottom.X / 16), (int)(Projectile.Bottom.Y / 16) + 1);
public Tile GroundTile => CalamityUtils.ParanoidTileRetrieval((int)Projectile.Bottom.X / 16, (int)Projectile.Bottom.Y / 16);
public bool Jumping => !GroundTile.IsTileSolidGround() || Math.Abs(Projectile.velocity.Y) > 5f;
@@ -41,6 +41,7 @@ namespace CalamityMod.Projectiles.Summon
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 18;
Projectile.tileCollide = true;
Projectile.DamageType = DamageClass.Summon;
}
public override void AI()
@@ -57,7 +58,9 @@ namespace CalamityMod.Projectiles.Summon
else
HopToTarget(potentialTarget);
Projectile.spriteDirection = (Projectile.velocity.X > 0).ToDirectionInt();
if (Math.Abs(Projectile.velocity.X) > 0.02f)
Projectile.spriteDirection = -Projectile.direction;
Projectile.rotation = Jumping ? Projectile.rotation + MathHelper.Pi / 10f * Projectile.spriteDirection : 0f;
while (Collision.SolidCollision(Projectile.position, Projectile.width, Projectile.height))
+13 -2
View File
@@ -98,9 +98,20 @@ namespace CalamityMod.Projectiles.Summon
internal void FlyNearOwner()
{
// Make an imp laugh sound every so often.
// Make an imp laugh sound every so often if you're the first seeker in the projectile array.
if (Main.rand.NextBool(1600))
SoundEngine.PlaySound(SoundID.DD2_KoboldFlyerHurt);
{
for (int i = 0; i < Main.maxProjectiles; i++)
{
Projectile seeker = Main.projectile[i];
if (seeker.type == Projectile.type)
{
if (seeker == Projectile)
SoundEngine.PlaySound(SoundID.DD2_KoboldFlyerHurt);
break;
}
}
}
Vector2 destination = Owner.Center + (MathHelper.TwoPi * CircleAngleRatio / Owner.ownedProjectileCounts[Type] - MathHelper.PiOver2).ToRotationVector2() * 310f;
Projectile.Center = Vector2.Lerp(Projectile.Center, destination, 0.03f);
@@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Typeless
public override void AI()
{
if (Time == 25f)
SoundEngine.PlaySound(BossRushEvent.EndSound, Main.LocalPlayer.Center);
SoundEngine.PlaySound(BossRushEvent.VictorySound, Main.LocalPlayer.Center);
Projectile.Center = Owner.Center;
BossRushEvent.SyncEndTimer((int)Time);
@@ -2,6 +2,8 @@
using Terraria.ModLoader;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria.Audio;
using static CalamityMod.Events.BossRushEvent;
namespace CalamityMod.Projectiles.Typeless
{
@@ -35,6 +37,28 @@ namespace CalamityMod.Projectiles.Typeless
Projectile.frame = Projectile.frameCounter / FrameChangeRate;
if (Projectile.frame >= TotalFrames)
Projectile.frame = TotalFrames;
// Play tier transition sounds on the first frame.
if (Projectile.localAI[0] == 0f)
{
float volume = 1.8f;
switch (Tier)
{
case 2:
SoundEngine.PlaySound(Tier2TransitionSound with { Volume = volume }, Main.LocalPlayer.Center);
break;
case 3:
SoundEngine.PlaySound(Tier3TransitionSound with { Volume = volume }, Main.LocalPlayer.Center);
break;
case 4:
SoundEngine.PlaySound(Tier4TransitionSound with { Volume = volume }, Main.LocalPlayer.Center);
break;
case 5:
SoundEngine.PlaySound(Tier5TransitionSound with { Volume = volume }, Main.LocalPlayer.Center);
break;
}
Projectile.localAI[0] = 1f;
}
}
public override Color? GetAlpha(Color lightColor) => Color.White * Projectile.Opacity;
+23 -3
View File
@@ -7,15 +7,22 @@ using Terraria.GameContent.Events;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
using ReLogic.Utilities;
namespace CalamityMod.Projectiles.Typeless
{
public class TerminusHoldout : ModProjectile
{
public SlotId ActivationSoundSlot;
public Player Owner => Main.player[Projectile.owner];
public ref float Time => ref Projectile.ai[0];
public const int Lifetime = 300;
public override string Texture => "CalamityMod/Items/SummonItems/Terminus";
public override void SetDefaults()
{
Projectile.width = 50;
@@ -35,6 +42,8 @@ namespace CalamityMod.Projectiles.Typeless
// Reset the boss rush timer to what it would normally be if disabling is done prematurely.
if (BossRushEvent.BossRushActive || BossRushEvent.StartTimer > 0)
BossRushEvent.SyncStartTimer(BossRushEvent.StartEffectTotalTime);
if (SoundEngine.TryGetActiveSound(ActivationSoundSlot, out var t) && t.IsPlaying)
t.Stop();
CreateMysticDeathDust();
Projectile.Kill();
@@ -42,8 +51,13 @@ namespace CalamityMod.Projectiles.Typeless
}
UpdatePlayerFields();
// Turn off boss rush mode.
if (BossRushEvent.BossRushActive || BossRushEvent.StartTimer > 0)
{
if (Time == 2f)
SoundEngine.PlaySound(BossRushEvent.TerminusDeactivationSound, Main.LocalPlayer.Center);
float lifetime = Utils.GetLerpValue(0f, 30f, Time, true);
if (Time % 5f == 4f)
BossRushEvent.SyncStartTimer((int)MathHelper.Lerp(0f, BossRushEvent.StartEffectTotalTime, 1f - lifetime));
@@ -51,8 +65,6 @@ namespace CalamityMod.Projectiles.Typeless
MoonlordDeathDrama.RequestLight(Utils.GetLerpValue(0f, 15f, Time, true), Main.LocalPlayer.Center);
if (Time >= 45f)
{
SoundEngine.PlaySound(SoundID.DD2_EtherianPortalOpen, Main.LocalPlayer.Center);
if (Main.netMode != NetmodeID.MultiplayerClient)
BossRushEvent.End();
@@ -62,6 +74,14 @@ namespace CalamityMod.Projectiles.Typeless
return;
}
// Play the activation sound.
if (Time == 2f)
ActivationSoundSlot = SoundEngine.PlaySound(BossRushEvent.TerminusActivationSound, Main.LocalPlayer.Center);
// Update the activation sound.
if (SoundEngine.TryGetActiveSound(ActivationSoundSlot, out var t2) && t2.IsPlaying)
t2.Position = Projectile.Center;
if (Projectile.timeLeft == 1)
{
Projectile.Kill();
@@ -77,7 +97,7 @@ namespace CalamityMod.Projectiles.Typeless
public void CreateEffectsHandler()
{
SoundEngine.PlaySound(SoundID.DD2_EtherianPortalDryadTouch, Main.LocalPlayer.Center);
SoundEngine.PlaySound(BossRushEvent.StartBuildupSound, Main.LocalPlayer.Center);
Main.LocalPlayer.Calamity().GeneralScreenShakePower = 16f;
if (Main.myPlayer == Projectile.owner)
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<BossRushEffectThing>(), 0, 0f, Projectile.owner);
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-2
View File
@@ -11,8 +11,6 @@ namespace CalamityMod.Tiles
[LegacyName("ChaoticBrick")]
public class ScoriaBrick : ModTile
{
int subsheetHeight = 72;
int subsheetWidth = 216;
internal static Texture2D GlowTexture;
public override void SetStaticDefaults()
{
+7 -3
View File
@@ -123,7 +123,7 @@ namespace CalamityMod.UI
Main.mouseLeftRelease = false;
Main.mouseLeft = false;
DoTeleportation(current);
DoTeleportation(current, forceOpenAndTeleport);
}
}
@@ -151,18 +151,22 @@ namespace CalamityMod.UI
Utils.DrawBorderStringFourWay(sb, FontAssets.MouseText.Value, text, CenterPoint.X - size.X / 2f, CenterPoint.Y + CircleOffset + CircleTextureSize / 2 + 4, Color.White, Color.Black, default);
}
public static void DoTeleportation(int circle)
public static void DoTeleportation(int circle, bool forcedByBossRush)
{
Open = false;
Player p = Main.LocalPlayer;
if (forcedByBossRush)
SoundEngine.PlaySound(BossRushEvent.TeleportSound with { Volume = 1.6f }, p.position);
if (circle == 3)
{
if (Main.netMode == NetmodeID.SinglePlayer)
{
p.TeleportationPotion();
SoundEngine.PlaySound(SoundID.Item6, p.position);
if (!forcedByBossRush)
SoundEngine.PlaySound(SoundID.Item6, p.position);
}
else if (Main.netMode == NetmodeID.MultiplayerClient)
{