Merge branch '1.4.4' into staging
No files matched your search
@@ -11,6 +11,7 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,13 +11,13 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
player.Calamity().cinnamonRoll = true;
|
||||
player.Calamity().HeatDebuffMultiplier += 0.5f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
using CalamityMod.Projectiles.Pets;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Pets
|
||||
{
|
||||
public class BurrowerBuff : ModBuff
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.buffNoTimeDisplay[Type] = true;
|
||||
Main.lightPet[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
player.buffTime[buffIndex] = 18000;
|
||||
player.Calamity().burrowerPet = true;
|
||||
bool petProjectileNotSpawned = player.ownedProjectileCounts[ModContent.ProjectileType<BurrowerPet>()] <= 0;
|
||||
if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
Projectile.NewProjectile(player.GetSource_Buff(buffIndex), player.Top, Vector2.Zero, ModContent.ProjectileType<BurrowerPet>(), 0, 0f, player.whoAmI, 1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 584 B |
@@ -546,6 +546,7 @@ namespace CalamityMod.CalPlayer
|
||||
#endregion
|
||||
|
||||
#region Pet
|
||||
public bool burrowerPet = false;
|
||||
public bool thirdSage = false;
|
||||
public bool perfmini = false;
|
||||
public bool akato = false;
|
||||
@@ -2212,6 +2213,7 @@ namespace CalamityMod.CalPlayer
|
||||
perfmini = false;
|
||||
akato = false;
|
||||
yharonPet = false;
|
||||
burrowerPet = false;
|
||||
leviPet = false;
|
||||
plaguebringerBab = false;
|
||||
rotomPet = false;
|
||||
@@ -5668,13 +5670,6 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((CalamityWorld.death || BossRushEvent.BossRushActive) && areThereAnyDamnBosses)
|
||||
{
|
||||
chatText = CalamityUtils.GetTextValue("Vanilla.NurseChat.HealNotAllowed");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -5691,6 +5686,8 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (price > 0)
|
||||
{
|
||||
if (CalamityWorld.death)
|
||||
price *= 2;
|
||||
if (areThereAnyDamnBosses)
|
||||
price *= 5;
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ namespace CalamityMod.CalPlayer
|
||||
else
|
||||
{
|
||||
var dis = Player.Distance(DoG.NPC.Center);
|
||||
if ((DoG.NPC.ai[3] < 3 || !DoG.Phase2Started) && DoG.NPC.Opacity > 0.5f && !DoG.Dying)
|
||||
if ((DoG.NPC.ai[3] < 3 || !DoG.Phase2Started) && DoG.NPC.Opacity > 0.5f && !DoG.Dying && !drawInfo.drawPlayer.isDisplayDollOrInanimate)
|
||||
{
|
||||
string phase1IconPath = "CalamityMod/NPCs/DevourerofGods/DevourerofGodsHead_Head_Boss";
|
||||
string phase2IconPath = "CalamityMod/NPCs/DevourerofGods/DevourerofGodsHead_P2_Head_Boss";
|
||||
|
||||
@@ -570,7 +570,7 @@ namespace CalamityMod.DataStructures
|
||||
item.shootSpeed = 12f;
|
||||
item.UseSound = null;
|
||||
item.noMelee = true;
|
||||
item.reuseDelay = 30;
|
||||
item.reuseDelay = 12;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -595,7 +595,7 @@ namespace CalamityMod.DataStructures
|
||||
item.shootSpeed = 12f;
|
||||
item.UseSound = null;
|
||||
item.noMelee = true;
|
||||
item.reuseDelay = 30;
|
||||
item.reuseDelay = 12;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -646,7 +646,7 @@ namespace CalamityMod.DataStructures
|
||||
item.shootSpeed = 12f;
|
||||
item.UseSound = null;
|
||||
item.noMelee = true;
|
||||
item.reuseDelay = 30;
|
||||
item.reuseDelay = 12;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ float4 uShaderSpecificData;
|
||||
float4 AdjustPixelPosition(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
|
||||
{
|
||||
// Drift to offset the noisemap. X multiplier is a prime number to ensure the "loop time" of this is very high, it takes 100 uTime to return to the original state
|
||||
float2 drift = float2(uTime * uRotation, uTime * uSaturation);
|
||||
float2 drift = float2(0.23 * uTime * uSaturation, uTime * uSaturation);
|
||||
|
||||
//This is the uv distance from the center of the texture
|
||||
float2 uvOffsetFromCenter = (coords - 0.5);
|
||||
@@ -38,16 +38,8 @@ float4 AdjustPixelPosition(float4 sampleColor : COLOR0, float2 coords : TEXCOORD
|
||||
// I would like to be able to draw directly additive, but I have been unable to make that work and this has worked well.
|
||||
float4 distortedColor = tex2D(uImage0, modifiedCoords);
|
||||
distortedColor.a = distortedColor.x;
|
||||
distortedColor *= uDirection;
|
||||
|
||||
float4 drawColor = sampleColor;
|
||||
float4 borderColor = sampleColor;
|
||||
borderColor.rgb = uSecondaryColor;
|
||||
|
||||
if(dist > 0.4)
|
||||
drawColor = lerp(sampleColor, borderColor, (dist - 0.4) / 0.1);
|
||||
|
||||
return distortedColor * drawColor * mask;
|
||||
return distortedColor * sampleColor * mask;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 9.0 KiB |
@@ -28,6 +28,7 @@ using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.UI.Chat;
|
||||
using static CalamityMod.CalamityUtils;
|
||||
|
||||
namespace CalamityMod.Items
|
||||
{
|
||||
@@ -1635,7 +1636,35 @@ namespace CalamityMod.Items
|
||||
|
||||
return false;
|
||||
}
|
||||
// IV Drip tooltip FX
|
||||
if (line.Mod == "Terraria" && item.type == ModContent.ItemType<IVDripOnTheRocks>() && line.Name == "Tooltip4")
|
||||
{
|
||||
Vector2 basePosition = new Vector2(line.X, line.Y);
|
||||
|
||||
Main.spriteBatch.End();
|
||||
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, null, null, null, null, Main.UIScaleMatrix);
|
||||
|
||||
for (int i = 0; i < 3; i++) // Draw 3 lines of differing opacity, color, and displacement.
|
||||
{
|
||||
float timer = (float)Math.Sin(Main.GlobalTimeWrappedHourly + 1f) / 2f;
|
||||
|
||||
float angle = (Main.GlobalTimeWrappedHourly * 2f) + (i * MathHelper.TwoPi / 3f);
|
||||
float radius = timer * (3f + i * 6f);
|
||||
Vector2 offset = new Vector2((float)Math.Cos(angle) * 1.7f, (float)Math.Sin(angle) * 1f) * radius; // Offset in an elliptical pattern
|
||||
Vector2 pos = basePosition + offset;
|
||||
|
||||
Color color = MulticolorLerp(Math.Abs(timer + (i * 0.2f)) % 1f, Color.LightBlue, Color.LightGreen, (i == 3) ? Color.Blue : (i == 2) ? Color.Red : Color.White);
|
||||
float opacity = 1f - (i * 0.2f);
|
||||
float rotation = line.Rotation + (timer * (Main.GlobalTimeWrappedHourly * 0.00001f)); // This precision is intended
|
||||
|
||||
ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, line.Font, line.Text, pos, color * opacity, rotation, line.Origin, line.BaseScale, line.MaxWidth, line.Spread);
|
||||
}
|
||||
|
||||
Main.spriteBatch.End();
|
||||
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, Main.UIScaleMatrix);
|
||||
|
||||
return false;
|
||||
}
|
||||
if (line.Mod == "Terraria" && item.type == ModContent.ItemType<OntologicalDespoiler>() && (line.Name == "Tooltip1" || line.Name == "Tooltip2" || line.Name == "Tooltip4" || line.Name == "Tooltip5" || line.Name == "Tooltip7"))
|
||||
{
|
||||
Color rarityColor = Color.Black;
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
using CalamityMod.Buffs.Pets;
|
||||
using CalamityMod.NPCs.ExoMechs.Thanatos;
|
||||
using CalamityMod.Projectiles.Pets;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Pets
|
||||
{
|
||||
public class BurrowerController : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Pets";
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.DefaultToVanitypet(ModContent.ProjectileType<BurrowerPet>(), ModContent.BuffType<BurrowerBuff>());
|
||||
Item.rare = ItemRarityID.Green;
|
||||
Item.value = Item.sellPrice(gold: 3);
|
||||
Item.UseSound = ThanatosHead.ThanatosHitSoundClosed;
|
||||
}
|
||||
|
||||
public override void UseStyle(Player player, Rectangle heldItemFrame)
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer && player.itemTime == 0)
|
||||
{
|
||||
player.AddBuff(Item.buffType, 3600, true);
|
||||
}
|
||||
}
|
||||
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
|
||||
{
|
||||
CalamityUtils.DrawInventoryCustomScale(
|
||||
spriteBatch,
|
||||
texture: TextureAssets.Item[Type].Value,
|
||||
position,
|
||||
frame,
|
||||
drawColor,
|
||||
itemColor,
|
||||
origin,
|
||||
scale,
|
||||
wantedScale: 0.8f,
|
||||
drawOffset: new(0f, 0f)
|
||||
);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 3.2 KiB |
@@ -1,4 +1,5 @@
|
||||
using Terraria.ID;
|
||||
using CalamityMod.Items.Placeables.Walls;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Placeables.SunkenSea
|
||||
@@ -19,6 +20,12 @@ namespace CalamityMod.Items.Placeables.SunkenSea
|
||||
AddIngredient<EutrophicSand>(2).
|
||||
AddTile(TileID.Furnaces).
|
||||
Register();
|
||||
|
||||
CreateRecipe().
|
||||
AddIngredient<EutrophicGlassWall>(4).
|
||||
AddTile(TileID.WorkBenches).
|
||||
DisableDecraft().
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ namespace CalamityMod.Items.Potions.Alcohol
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 30;
|
||||
Item.ResearchUnlockCount = 20;
|
||||
ItemID.Sets.DrinkParticleColors[Type] = new Color[3] {
|
||||
new Color(36, 2, 41),
|
||||
new Color(56, 0, 64),
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace CalamityMod.Items.Potions.Alcohol
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 30;
|
||||
Item.ResearchUnlockCount = 20;
|
||||
ItemID.Sets.DrinkParticleColors[Type] = new Color[3] {
|
||||
new Color(219, 227, 191),
|
||||
new Color(186, 189, 147),
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace CalamityMod.Items.Potions.Alcohol
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 30;
|
||||
Item.ResearchUnlockCount = 20;
|
||||
ItemID.Sets.DrinkParticleColors[Type] = new Color[3] {
|
||||
new Color(54, 5, 21),
|
||||
new Color(82, 9, 36),
|
||||
|
||||
@@ -36,8 +36,8 @@ namespace CalamityMod.Items.Potions.Alcohol
|
||||
}
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(6).
|
||||
AddIngredient(ItemID.BottledWater, 6).
|
||||
CreateRecipe(10).
|
||||
AddIngredient(ItemID.Bottle, 10).
|
||||
AddIngredient<PurifiedGel>(10).
|
||||
AddIngredient<StarblightSoot>(10).
|
||||
AddTile(TileID.Kegs).
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace CalamityMod.Items.Potions.Alcohol
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 30;
|
||||
Item.ResearchUnlockCount = 20;
|
||||
// Clear, yellow-green
|
||||
ItemID.Sets.DrinkParticleColors[Type] = new Color[3] {
|
||||
new Color(242, 252, 177, 180),
|
||||
|
||||
@@ -120,7 +120,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
Item.rare = RarityType<Turquoise>();
|
||||
Item.shoot = ProjectileID.PurificationPowder;
|
||||
Item.shootSpeed = 24f;
|
||||
Item.reuseDelay = 30;
|
||||
Item.reuseDelay = 12;
|
||||
}
|
||||
|
||||
#region saving and syncing attunements
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
Item.width = 84;
|
||||
Item.height = 46;
|
||||
Item.damage = 97;
|
||||
Item.damage = 100;
|
||||
Item.DamageType = DamageClass.Ranged;
|
||||
Item.useTime = 10;
|
||||
Item.useAnimation = 10;
|
||||
|
||||
@@ -9,11 +9,6 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
public class HardenedHoneycomb : RogueWeapon
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 99;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 30;
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
Item.width = 20;
|
||||
Item.height = 20;
|
||||
Item.damage = 60;
|
||||
Item.damage = 50;
|
||||
Item.noMelee = true;
|
||||
Item.noUseGraphic = true;
|
||||
Item.autoReuse = true;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Pets;
|
||||
using CalamityMod.Items.SummonItems;
|
||||
using CalamityMod.Projectiles.Summon;
|
||||
using CalamityMod.Rarities;
|
||||
@@ -75,6 +76,7 @@ namespace CalamityMod.Items.Weapons.Summon
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<BurrowerController>().
|
||||
AddIngredient<Abombination>().
|
||||
AddIngredient<ShadowspecBar>(5).
|
||||
AddTile<DraedonsForge>().
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Put their internal name here
|
||||
NPCName: {
|
||||
Guide: Once tasked with shepherding the Wall of Flesh, the Guide is a godlike figure in Demon folklore. However, the former warlock apprentice now savors a humble life, mentoring adventurers with his sharp intuition.
|
||||
Guide: Once tasked with shepherding the Wall of Flesh, the Guide is a godlike figure in Demon folklore. However, the former warlock apprentice now savors a humble life, offering useful advice and crafting recipes.
|
||||
Dryad: The Dryad practices the art of Life Magic, pioneered by Silva. She is connected with nature and can analyze its purity worldwide. She sells seeds, too!
|
||||
Mechanic: The Mechanic was imprisoned for sticking her nose where she shouldn't. She sells wiring and tools for putting together anything imaginable.
|
||||
EmpressButterfly: These familiars conjured by the Empress draw power from their surroundings and later bring it to their master. They remind her of a lost loved one, and should one perish in the chaos of night, she shall unleash her full fury upon the attacker.
|
||||
@@ -56,13 +56,12 @@ NPCName: {
|
||||
RaggedCaster: "{$CommonEntries.RaggedCaster}"
|
||||
RaggedCasterOpenCoat: "{$CommonEntries.RaggedCaster}"
|
||||
DungeonGuardian: The Old Man is cursed to never leave nor enter the Dungeon, much less die. Whoever crosses paths with him and dares to descend into those halls shall not pass!
|
||||
BoneSerpentHead: Mighty serpentine beasts ruled hell since before history, later led by the exiled Flame Dragon. For said alliance, their obsidian scales were turned to Ash shortly after his demise. Now their skeletal husks remain, forced to protect the demonic territory using stolen Azafurian spells.
|
||||
BoneSerpentHead: Mighty serpentine beasts ruled hell since before history, but after the demise of their liege, godly wrath had their obsidian scales immolated. Now only their skeletal husks remain, forced by stolen spells to protect demonic territory.
|
||||
Demon: Despite being a primitive civilization, demons populate most of the underworld. Unlike their lesser brothers, they cast shadow magic rather than hell magic.
|
||||
VoodooDemon: Demons have several religious practices, especially sacrifices. They worship the Wall of Flesh ever since it started roaming the underworld, using offerings to draw it closer.
|
||||
RedDevil: Conjuring potent spears of dark magic, these elite demons look after the adventurer that destroyed their perceived deity.
|
||||
RedDevil: Conjuring potent spears of dark magic, these elite demons hunt after the adventurer that destroyed their perceived deity.
|
||||
WyvernHead: Deeply in tune with the magic of the world, these serpentine dragons guard the skyward ruins of Chrysadia on behalf of the Storm Dragon. Now, their duty calls louder as divine essence surges through the land.
|
||||
Harpy: Winged, demi-human creatures from distant southward mountains who came to inhabit Chrysadia after its tragic downfall. They defend their new territory fiercely against invaders with their razor-sharp feathers.
|
||||
Scutlix: One of the few creatures left in the Martian homeworld, these creatures function similarly to horses. That is, if horses could fire lasers from their eyes.
|
||||
Harpy: Winged, demi-human creatures from distant southward mountains who came to inhabit the sky archipelago after the ruin of its old civilization. They defend their new territory fiercely against invaders with their razor-sharp feathers.
|
||||
MartianProbe: Sensing growing power on the planet, otherworldly beings send space-age technology to scan for valuable resources.
|
||||
SeekerHead: Godly magicks have unleashed the dark influences that gave birth to the Eater of Worlds, producing smaller, but just as deadly worms.
|
||||
DesertDjinn: Buried in these caves lie cryptic artifacts older than Ilmeris, their origins swept away by the sands of time. Corrupted by divine magicks, the once friendly djinns within them now reemerge, full of hostility.
|
||||
@@ -82,7 +81,7 @@ NPCName: {
|
||||
Spazmatism: A pair of mechanical eyes built by Draedon for reconnaissance and assassination, Spazmatism chases at high speed, exhaling cursed flames.
|
||||
TheDestroyer: Despite being made with repurposed mining equipment, the Destroyer was built for fighting other deities in single combat, decorated in laser-armed probes, which detach from its body when damaged.
|
||||
SkeletronPrime: Built with the express purpose of inciting fear into the hearts of any god worshiper, this machine has more arms than ever before, and a variety of fierce weapons.
|
||||
Plantera: A creation of the Vernal Pass meant to replace Braelor in his absence. They harnessed dead animal souls to give it life, but the span of such magic was far larger than anticipated. It didn't take long for the Plantera to grow out of control and slaughter its masters.
|
||||
Plantera: A dormant, yet powerful floral guardian grown by the elders of the Vernal Pass, using volatile animal souls as nourishment. Unshackled in a fit of herbage carnage, its reach now spans the entire jungle.
|
||||
HallowBoss: Despite their parentage, children of gods do not inherit a shred of their power. The Empress chose to claim power for herself by siphoning it from other places and beings. She found a perfect candidate in the Hallow due to its unstable nature, and is now transformed into a mighty fae.
|
||||
Golem: A remarkable display of ingenuity constructed by the Lihzahrd race. Seeking light after they hid away in their temple out of shame for driving their goddess away, they built this construct. Powered by solar energy cells, it is ready to guard the Temple.
|
||||
DukeFishron: An aquatic-evolved species which lives in isolation in the depths of the ocean. Despite their shortcomings, they still share blood with the dragons of old, claiming near complete dominion over the oceans. Legends claim it only surfaces in search of a rare, savory type of worm.
|
||||
|
||||
@@ -1195,6 +1195,11 @@ BrittleStar: {
|
||||
Description: The brittle star will protect you
|
||||
}
|
||||
|
||||
BurrowerBuff: {
|
||||
DisplayName: Burrower
|
||||
Description: A friendly burrower answered your call
|
||||
}
|
||||
|
||||
CalamarisLamentBuff: {
|
||||
DisplayName: Calamari
|
||||
Description: Time to transport all of your foes to stupid squid jail!
|
||||
|
||||
@@ -434,7 +434,7 @@ CorrosiveSpine: {
|
||||
Tooltip:
|
||||
'''
|
||||
5% increased movement speed
|
||||
Multiplies all sickness and water-related debuff damage by 1.25x
|
||||
25% increased Sickness and Water debuff damage
|
||||
All attacks irradiate enemies and reduces the severity of the sulphuric waters
|
||||
You burst into radioactive clouds when struck
|
||||
'''
|
||||
@@ -490,7 +490,7 @@ CryoStone: {
|
||||
DisplayName: Cryo Stone
|
||||
Tooltip:
|
||||
'''
|
||||
Multiplies all cold-based debuff damage by 1.5x
|
||||
50% increased Cold debuff damage
|
||||
Creates a rotating ice shield around you that damages and slows down enemies on contact
|
||||
'One of the ancient relics'
|
||||
'''
|
||||
@@ -593,7 +593,7 @@ DiamondOfTheDeep: {
|
||||
DisplayName: Diamond of the Deep
|
||||
Tooltip:
|
||||
'''
|
||||
Multiplies all water debuff damage by 1.6x
|
||||
60% increased Water debuff damage
|
||||
Slowly accrue up to three different abyssal spirits
|
||||
Dash to disperse the spirits and have them attack enemies
|
||||
When dispersed [c/CB7AD7:below 50% life], the spirits support you instead
|
||||
@@ -1575,7 +1575,7 @@ SeaSpiritAmulet: {
|
||||
Slowly accumulate up to eight spirit orbs that follow you
|
||||
Spirits disperse when dashing
|
||||
If below 50% life, they will heal you, otherwise they will attack nearby enemies
|
||||
Multiplies all water debuff damage by 1.35x
|
||||
35% increased Water debuff damage
|
||||
Spirit orbs are transparent and silent if visibility is disabled
|
||||
'''
|
||||
}
|
||||
@@ -1877,7 +1877,7 @@ TheAmalgam: {
|
||||
Tooltip:
|
||||
'''
|
||||
10% increased damage
|
||||
All attacks inflict a variety of debuffs and multiplies all elemental debuff damage by 3x
|
||||
All attacks inflict a variety of debuffs, 200% increased elemental debuff damage
|
||||
Most buffs last twice as long, and persist after dying
|
||||
Taking damage confuses nearby enemies and spawns a dank creeper
|
||||
The dank creeper flies above you, exploding into several shaderain clouds
|
||||
@@ -1990,7 +1990,7 @@ ToxicHeart: {
|
||||
'''
|
||||
Your heart beats with the plague, pulsing outside of your body
|
||||
Pulse frequency scale with regen, and pulses that kill enemies pulse again to heal you
|
||||
Multiplies all sickness debuff damage by 1.5x
|
||||
50% increased Sickness debuff damage
|
||||
Effects are transparent and silent if visibility is disabled
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -26,6 +26,15 @@ BrimstoneJewel: {
|
||||
'''
|
||||
}
|
||||
|
||||
BurrowerController: {
|
||||
DisplayName: Burrower Beacon
|
||||
Tooltip:
|
||||
'''
|
||||
Requests a friendly burrower to follow you around and illuminate ores
|
||||
Counts as a light pet
|
||||
'''
|
||||
}
|
||||
|
||||
CharredRelic: {
|
||||
DisplayName: Charred Relic
|
||||
Tooltip: Contains a small amount of brimstone
|
||||
|
||||
@@ -166,7 +166,6 @@ ZergPotion: {
|
||||
Tooltip: Vastly increases enemy spawn rate
|
||||
}
|
||||
|
||||
// Very normal Keg crafts
|
||||
BloodyMary: {
|
||||
DisplayName: Bloody Mary
|
||||
Tooltip:
|
||||
@@ -376,7 +375,7 @@ Vodka: {
|
||||
Tooltip:
|
||||
'''
|
||||
{0}% increased Typeless debuff damage
|
||||
{1}% decreased other debuff damage
|
||||
{1}% decreased elemental debuff damage
|
||||
{$Common.AlcoholWarning}
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -415,6 +415,7 @@ WulfrumDiggingTurtle: {
|
||||
'''
|
||||
Throws a rickety mining contraption to dig out a small tunnel
|
||||
In case of an emergency, press <right> to instantly detonate all your digging turtles
|
||||
The turtle scales with your pickaxe power
|
||||
'''
|
||||
}
|
||||
|
||||
|
||||
@@ -31,3 +31,4 @@ Sparks.DisplayName: Sparks
|
||||
ThirdSage.DisplayName: Third Sage
|
||||
ToastyBatPet.DisplayName: Toasty Bat Friend
|
||||
YharonSonPet.DisplayName: Son of Yharon
|
||||
BurrowerPet.DisplayName: Burrower
|
||||
@@ -1,4 +1,4 @@
|
||||
SmallWorldWarning: "[c/FF0000:SMALL WORLDS NOT SUPPORTED BY CALAMITY]"
|
||||
SmallWorldWarning: "[c/FF0000:SMALL WORLDS NOT SUPPORTED BY CALAMITY]"
|
||||
// Main Menu Name
|
||||
MainMenu: Calamity Style
|
||||
MainMenuClassic: Calamity Style - Classic
|
||||
@@ -34,47 +34,52 @@ DifficultyClickText: "[c/919191:Click to select a difficulty mode]"
|
||||
ExpertDifficultyLock: "[c/919191:Higher difficulty modes can only be toggled in Expert Mode or above]"
|
||||
ChangingTheRules: "[c/919191:You cannot change the rules now!]"
|
||||
DifficultySwitch: Difficulty changed from [c/{0}:{1}] to [c/{2}:{3}].
|
||||
ClassicInfo: Your Adventure Begins... A far more relaxed Terraria experience
|
||||
ExpertShortInfo: "[c/FFBA75:Fortune & Glory, Kid. For those looking for a more difficult vanilla experience]"
|
||||
ClassicInfo: Your Adventure Begins... A relaxed, casual Terraria experience
|
||||
ExpertShortInfo: "[c/FF9900:Fortune & Glory, Kid. For those looking for a more difficult vanilla experience]"
|
||||
ExpertExpandedInfo:
|
||||
'''
|
||||
[c/A87A07:Most bosses gain new attacks and more difficult attack patterns]
|
||||
[c/A87A07:Most enemies have twice as much health, deal twice as much damage and receive 10% less knockback]
|
||||
[c/A87A07:Certain enemies have new attacks, can inflict new debuffs or have a higher chance of inflicting debuffs they already had]
|
||||
[c/A87A07:Enemies drop more loot, as well as having higher chances]
|
||||
[c/A87A07:Enemies drop more loot and have higher drop rates for their items]
|
||||
[c/A87A07:Bosses have exclusive, signature "Expert drop" items]
|
||||
[c/A87A07:Players drop more of their coins on death]
|
||||
'''
|
||||
MasterShortInfo: "[c/1CFFAA:Game over man, game over! A tougher step up in stats from Expert Mode]"
|
||||
MasterShortInfo: "[c/FF2619:Game over man, game over! A tough step up in stats from Expert Mode]"
|
||||
MasterExpandedInfo:
|
||||
'''
|
||||
[c/029C6D:Most enemies have even more health and knockback resistance added on from Expert Mode]
|
||||
[c/029C6D:Bosses have new exclusive vanity rewards]
|
||||
[c/029C6D:Players drop ALL their coins on death]
|
||||
[c/029C6D:Players gain an additional accessory slot at the start of the game]
|
||||
[c/bd5e6e:Most enemies have even more health and knockback resistance than in Expert Mode]
|
||||
[c/bd5e6e:All foes deal even more damage than in Expert Mode]
|
||||
[c/bd5e6e:Bosses have new exclusive vanity rewards]
|
||||
[c/bd5e6e:Players drop ALL their coins on death]
|
||||
[c/bd5e6e:Players gain an additional accessory slot at the start of the game]
|
||||
'''
|
||||
LegendaryShortInfo: "[c/32CD32:For those who are worthy... Even higher stats than Master Mode]"
|
||||
LegendaryExpandedInfo: "[c/0b870b:Enemies have further increased health and contact damage from Master Mode]"
|
||||
Revengeance: Revengeance
|
||||
RevengeanceShortInfo: "[c/F54254:The intended Calamity experience! Can only be enabled in Expert Mode!]"
|
||||
RevengeanceShortInfo: "[c/F54254:The intended Calamity experience. Can only be enabled in Expert Mode]"
|
||||
RevengeanceExpandedInfo:
|
||||
'''
|
||||
[c/B55362:Enables the] [c/85FFE9:Adrenaline] [c/B55362:mechanic. You gain Adrenaline while fighting bosses. Getting hit drops Adrenaline back to 0]
|
||||
[c/B55362: When Adrenaline is maxed, press] {1} [c/B55362:for a large damage boost]
|
||||
[c/B55362:Enables the] [c/FF8B54:Rage] [c/B55362:mechanic. You gain Rage when in proximity of enemies or by using certain items]
|
||||
[c/B55362: When Rage is maxed, press] {0} [c/B55362:for a temporary damage boost]
|
||||
[c/B55362:Most foes have higher stats and more aggressive AIs]
|
||||
[c/B55362:Bosses have new AI mechanics, new phases, and will drop Master Mode loot. Enemies spawn more frequently]
|
||||
[c/F7342A:This mode is more difficult than Expert. Be sure to prepare for the challenge]
|
||||
[c/B55362:Many enemies have new, more aggressive behavior patterns. Enemies spawn more frequently]
|
||||
[c/B55362:All bosses have new attacks and patterns. Some are completely changed]
|
||||
[c/B55362:Bosses will drop both "Expert drop" items and Master Mode's vanity rewards]
|
||||
'''
|
||||
Death: Death
|
||||
DeathShortInfo: "[c/E066F7:A far more difficult challenge than Revengeance Mode! Can only be enabled in Master Mode!]"
|
||||
DeathShortInfo: "[c/E066F7:A far greater challenge than Revengeance! Can only be enabled in Master Mode]"
|
||||
DeathExpandedInfo:
|
||||
'''
|
||||
[c/B834E0:All foes will pose a much larger threat with highly aggressive AIs]
|
||||
[c/B834E0:Bosses have substantially harder AI changes. Enemies are even more numerous and can easily overwhelm you]
|
||||
[c/B834E0:Most basic enemies pose a much larger threat with highly aggressive behavior]
|
||||
[c/B834E0:Blood Moons spawn unending waves of foes which can quickly overwhelm you]
|
||||
[c/B834E0:Bosses are substantially faster and much more difficult than in Revengeance Mode]
|
||||
[c/B834E0:Debuffs are especially lethal and the Abyss is significantly more dangerous]
|
||||
[c/E945FF:Vigilance and tenacity are crucial to survival]
|
||||
'''
|
||||
// Legendary (FTW + Master) + Death Mode
|
||||
Malice: Malice
|
||||
MaliceShortInfo: "[c/f08080:For those who wish for suffering. Can only be enabled in Legendary Mode]"
|
||||
MaliceExpandedInfo: "[c/a34e4e:Enemies have Death Mode and For The Worthy behavior with Legendary Mode stats]"
|
||||
// Calamity Health Bar
|
||||
ExoTwinsNameNormal: XS-01 Artemis and XS-03 Apollo
|
||||
ExoTwinsNameHekate: Eyes of XB-∞ Hekate
|
||||
|
||||
@@ -28,7 +28,7 @@ SetBonus: {
|
||||
'''
|
||||
Eskimo:
|
||||
'''
|
||||
Multiplies all cold-based debuff damage by 1.25x
|
||||
25% increased Cold debuff damage
|
||||
Provides immunity to the Chilled, Frozen, and Frostburn debuffs
|
||||
'''
|
||||
Rain:
|
||||
|
||||
@@ -19,7 +19,7 @@ AddedTooltip: {
|
||||
ArcaneFlower: 5% increased magic damage
|
||||
HellfireTreads:
|
||||
'''
|
||||
Multiplies all fire-based debuff damage by 1.5x, does not stack with downgrades
|
||||
50% increased Heat debuff damage, does not stack with downgrades
|
||||
All attacks inflict Hellfire
|
||||
'''
|
||||
FairyBoots:
|
||||
@@ -200,7 +200,7 @@ EditedTooltip: {
|
||||
'''
|
||||
FlameWakerBoots:
|
||||
'''
|
||||
Multiplies all fire-based debuff damage by 1.25x
|
||||
25% increased Heat debuff damage
|
||||
All attacks light enemies on fire
|
||||
'Never get cold feet again'
|
||||
'''
|
||||
@@ -341,8 +341,6 @@ MerchantChat: {
|
||||
Bandit: I happen to have several Angel Statues at the moment, a truely rare commodity. Want one?
|
||||
}
|
||||
|
||||
NurseChat.HealNotAllowed: Now is not the time!
|
||||
|
||||
PainterChat: {
|
||||
Corruption: A little sickness isn't going to stop me from doing my work as an artist!
|
||||
Crimson: There's a surprising art to this area. A sort of horrifying, eldritch feeling. It inspires me!
|
||||
|
||||
@@ -220,7 +220,7 @@ namespace CalamityMod.NPCs.Abyss
|
||||
|
||||
public override void ModifyNPCLoot(NPCLoot npcLoot)
|
||||
{
|
||||
npcLoot.Add(ItemID.JellyfishNecklace, 25);
|
||||
npcLoot.Add(ItemID.JellyfishNecklace, 30);
|
||||
var postSkeletron = npcLoot.DefineConditionalDropSet(() => NPC.downedBoss3);
|
||||
postSkeletron.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType<AbyssShocker>(), 50, 40));
|
||||
}
|
||||
|
||||
@@ -321,7 +321,7 @@ namespace CalamityMod.NPCs.Abyss
|
||||
{
|
||||
npcLoot.Add(ItemID.Bomb);
|
||||
npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.Bezoar, 100, 50));
|
||||
npcLoot.Add(ItemID.JellyfishNecklace, 25);
|
||||
npcLoot.Add(ItemID.JellyfishNecklace, 30);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -76,6 +76,7 @@ using Terraria.GameContent;
|
||||
using Terraria.GameContent.Achievements;
|
||||
using Terraria.GameContent.Bestiary;
|
||||
using Terraria.GameContent.Events;
|
||||
using Terraria.GameContent.UI.BigProgressBar;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -1213,9 +1214,13 @@ namespace CalamityMod.NPCs
|
||||
|
||||
VulnerabilitiesAndResistances(npc);
|
||||
|
||||
//Gives Brain of Cthulhu a unique boss bar in Rev+ where Creepers contribute to a Shield rather than additional Health
|
||||
// Gives Brain of Cthulhu a unique boss bar in Rev+ where Creepers contribute to a Shield rather than additional Health
|
||||
if (npc.type == NPCID.BrainofCthulhu && CalamityWorld.revenge)
|
||||
npc.BossBar = GetInstance<RevBrainOfCthulhuBossBar>();
|
||||
// Replaces Moon Lord's boss bar in Rev+ to fix a health counting bug with the eyes after being killed
|
||||
bool hasBar = Main.BigBossProgressBar.TryGetSpecialVanillaBossBar(npc.type, out IBigProgressBar bar);
|
||||
if (hasBar && bar is MoonLordProgressBar && CalamityWorld.revenge)
|
||||
npc.BossBar = GetInstance<RevMoonLordBossBar>();
|
||||
}
|
||||
|
||||
public override bool? CanFallThroughPlatforms(NPC npc)
|
||||
@@ -6204,7 +6209,6 @@ namespace CalamityMod.NPCs
|
||||
case NPCID.GoblinSummoner:
|
||||
case NPCID.GoblinSorcerer:
|
||||
case NPCID.PirateCaptain:
|
||||
case NPCID.Scutlix:
|
||||
case NPCID.MartianSaucerCore:
|
||||
case NPCID.TorchGod:
|
||||
case NPCID.EyeofCthulhu:
|
||||
|
||||
@@ -104,11 +104,9 @@ namespace CalamityMod.NPCs
|
||||
#region Sky / Space
|
||||
// Harpy
|
||||
// Sky Glaze @ 3.33% IF Eye of Cthulhu dead
|
||||
// Giant Harpy Feather @ 1.25% (0.67% in Vanilla)
|
||||
// Essence of Sunlight @ 50% IF Hardmode and not statue spawned
|
||||
case NPCID.Harpy:
|
||||
postEoC.Add(ModContent.ItemType<SkyGlaze>(), 30);
|
||||
npcLoot.ChangeDropRate(ItemID.GiantHarpyFeather, 1, 80);
|
||||
hardmode.AddIf(() => !npc.SpawnedFromStatue, ModContent.ItemType<EssenceofSunlight>(), 2);
|
||||
break;
|
||||
|
||||
@@ -150,13 +148,13 @@ namespace CalamityMod.NPCs
|
||||
break;
|
||||
|
||||
// Medusa
|
||||
// Pocket Mirror @ 10% Normal, 20% Expert+
|
||||
// Pocket Mirror @ 7.14% Normal, 14.29% Expert+ (2.5% Normal, 5% Expert+ in vanilla)
|
||||
case NPCID.Medusa:
|
||||
// Remove the vanilla loot rule for Pocket Mirror.
|
||||
npcLoot.RemoveWhere((rule) => rule is CommonDrop conditionalRule && conditionalRule.itemId == ItemID.PocketMirror);
|
||||
|
||||
// Define a replacement rule which has an increased chance.
|
||||
npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.PocketMirror, 10, 5));
|
||||
npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.PocketMirror, 14, 7));
|
||||
break;
|
||||
|
||||
// Tim
|
||||
@@ -167,23 +165,16 @@ namespace CalamityMod.NPCs
|
||||
|
||||
// Skeleton Archer
|
||||
// Magic Quiver @ 5% (2.5% in Vanilla)
|
||||
// Marrow @ 2.5% (0.5% in Vanilla)
|
||||
// Marrow @ 2% (0.5% in Vanilla)
|
||||
case NPCID.SkeletonArcher:
|
||||
npcLoot.ChangeDropRate(ItemID.MagicQuiver, 1, 20);
|
||||
npcLoot.ChangeDropRate(ItemID.Marrow, 1, 40);
|
||||
npcLoot.ChangeDropRate(ItemID.Marrow, 1, 50);
|
||||
break;
|
||||
|
||||
// Armored Skeleton
|
||||
// Beam Sword @ 2.5% (0.67% in Vanilla)
|
||||
// Beam Sword @ 2% (0.67% in Vanilla)
|
||||
case NPCID.ArmoredSkeleton:
|
||||
npcLoot.ChangeDropRate(ItemID.BeamSword, 1, 40);
|
||||
break;
|
||||
|
||||
// Black Recluse
|
||||
// Poison Staff @ 5% (2.5% in Vanilla)
|
||||
case NPCID.BlackRecluse:
|
||||
case NPCID.BlackRecluseWall:
|
||||
npcLoot.ChangeDropRate(ItemID.PoisonStaff, 1, 20);
|
||||
npcLoot.ChangeDropRate(ItemID.BeamSword, 1, 50);
|
||||
break;
|
||||
|
||||
// Mimic
|
||||
@@ -397,23 +388,24 @@ namespace CalamityMod.NPCs
|
||||
#region Aquatic / Ocean
|
||||
// Pink Jellyfish
|
||||
// Life Jelly @ 10% Normal, 14.29% Expert+
|
||||
// Jellyfish Necklace @ 3.33% (1% in vanilla)
|
||||
case NPCID.PinkJellyfish:
|
||||
npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType<LifeJelly>(), 10, 7));
|
||||
npcLoot.ChangeDropRate(ItemID.JellyfishNecklace, 1, 25);
|
||||
npcLoot.ChangeDropRate(ItemID.JellyfishNecklace, 1, 30);
|
||||
break;
|
||||
|
||||
// Blue Jellyfish
|
||||
// Cleansing Jelly @ 10% Normal, 14.29% Expert+
|
||||
case NPCID.BlueJellyfish:
|
||||
npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType<CleansingJelly>(), 10, 7));
|
||||
npcLoot.ChangeDropRate(ItemID.JellyfishNecklace, 1, 25);
|
||||
npcLoot.ChangeDropRate(ItemID.JellyfishNecklace, 1, 30);
|
||||
break;
|
||||
|
||||
// Green Jellyfish
|
||||
// Vital Jelly @ 12.5% Normal, 20% Expert+
|
||||
case NPCID.GreenJellyfish:
|
||||
npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType<VitalJelly>(), 8, 5));
|
||||
npcLoot.ChangeDropRate(ItemID.JellyfishNecklace, 1, 25);
|
||||
npcLoot.ChangeDropRate(ItemID.JellyfishNecklace, 1, 30);
|
||||
break;
|
||||
|
||||
// Piranha, Arapaima, Blood Feeder
|
||||
@@ -435,10 +427,10 @@ namespace CalamityMod.NPCs
|
||||
break;
|
||||
|
||||
// Blood Jelly, Fungo Fish
|
||||
// Jellyfish Necklace @ 1%
|
||||
// Jellyfish Necklace @ 3.33%
|
||||
case NPCID.BloodJelly:
|
||||
case NPCID.FungoFish:
|
||||
npcLoot.Add(ItemID.JellyfishNecklace, 25);
|
||||
npcLoot.Add(ItemID.JellyfishNecklace, 30);
|
||||
break;
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -184,6 +184,7 @@ namespace CalamityMod.NPCs
|
||||
"Robin", // <@!654737510030639112> (altzeus)
|
||||
"Curly", // <@!673092101780668416> (curly4830)
|
||||
"Cobalt", // <@!132962828922388481> (cobalt_44)
|
||||
"Dizzetriya", // <@!719818245665980517> (dizzykbity)
|
||||
];
|
||||
private static readonly string[] MerchantNames =
|
||||
[
|
||||
@@ -206,6 +207,7 @@ namespace CalamityMod.NPCs
|
||||
[
|
||||
"Arin", // <@!268169458302976012> (kiyotu)
|
||||
"Typhäne", // <@!222064016107896832> (typhane.)
|
||||
"Charlotte Linlin", // <@!563406464522125323> (vixcalibur)
|
||||
];
|
||||
private static readonly string[] PirateNames =
|
||||
[
|
||||
@@ -307,6 +309,7 @@ namespace CalamityMod.NPCs
|
||||
"Nextdoor Psycho", // <@!173261518572486656> (nextdoorpsycho)
|
||||
"Mike Cyclops", // <@!702327497475227741> (seichoseicho)
|
||||
"Derin", // <@!466703979695308820> (god_15)
|
||||
"Umbara", // <@!450062421294579712> (umbaraeclipse)
|
||||
];
|
||||
private static readonly string[] ZoologistNames =
|
||||
[
|
||||
@@ -1230,10 +1233,7 @@ namespace CalamityMod.NPCs
|
||||
shop.AddWithCustomValue(ItemType<M1Garand>(), Item.buyPrice(gold: 20), Condition.DownedSkeletron)
|
||||
.Add<P90>(Condition.Hardmode)
|
||||
.AddWithCustomValue(ItemID.Boomstick, Item.buyPrice(gold: 25), Condition.DownedQueenBee)
|
||||
.AddWithCustomValue(ItemID.Uzi, Item.buyPrice(gold: 50), Condition.DownedPlantera)
|
||||
.AddWithCustomValue(ItemID.TacticalShotgun, Item.buyPrice(platinum: 1), Condition.DownedGolem)
|
||||
.AddWithCustomValue(ItemID.SniperRifle, Item.buyPrice(platinum: 1), Condition.DownedGolem)
|
||||
.AddWithCustomValue(ItemID.RifleScope, Item.buyPrice(platinum: 1), Condition.DownedGolem);
|
||||
.AddWithCustomValue(ItemID.Uzi, Item.buyPrice(gold: 50), Condition.DownedPlantera);
|
||||
}
|
||||
|
||||
if (type == NPCID.Stylist)
|
||||
@@ -1247,8 +1247,7 @@ namespace CalamityMod.NPCs
|
||||
|
||||
if (type == NPCID.Cyborg)
|
||||
{
|
||||
shop.AddWithCustomValue(ItemID.RocketLauncher, Item.buyPrice(platinum: 1), Condition.DownedGolem)
|
||||
.Add<MartianDistressRemote>(Condition.DownedGolem)
|
||||
shop.Add<MartianDistressRemote>(Condition.DownedGolem)
|
||||
.Add<LionHeart>(CalamityConditions.DownedPolterghast);
|
||||
}
|
||||
|
||||
@@ -1309,10 +1308,6 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
shop.Add<HowlsHeart>()
|
||||
.AddWithCustomValue(ItemID.MagicMissile, Item.buyPrice(gold: 25))
|
||||
.AddWithCustomValue(ItemID.SpectreStaff, Item.buyPrice(platinum: 1), Condition.DownedGolem)
|
||||
.AddWithCustomValue(ItemID.InfernoFork, Item.buyPrice(platinum: 1), Condition.DownedGolem)
|
||||
.AddWithCustomValue(ItemID.ShadowbeamStaff, Item.buyPrice(platinum: 1), Condition.DownedGolem)
|
||||
.AddWithCustomValue(ItemID.MagnetSphere, Item.buyPrice(platinum: 1), Condition.DownedGolem)
|
||||
.Add<ResilientCandle>()
|
||||
.Add<SpitefulCandle>()
|
||||
.Add<VigorousCandle>()
|
||||
@@ -1325,8 +1320,7 @@ namespace CalamityMod.NPCs
|
||||
.InsertAfter(ItemID.OasisFountain, ItemType<SulphurousFountainItem>())
|
||||
.InsertAfter(ItemID.OasisFountain, ItemType<AbyssFountainItem>())
|
||||
.InsertAfter(ItemID.OasisFountain, ItemType<AstralFountainItem>())
|
||||
.InsertAfter(ItemID.OasisFountain, ItemType<BrimstoneLavaFountainItem>())
|
||||
.AddWithCustomValue(ItemID.ButterflyDust, Item.buyPrice(gold: 25), Condition.DownedGolem);
|
||||
.InsertAfter(ItemID.OasisFountain, ItemType<BrimstoneLavaFountainItem>());
|
||||
}
|
||||
|
||||
if (type == NPCID.PartyGirl)
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Effects;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Pets;
|
||||
using CalamityMod.Items.Placeables.Banners;
|
||||
using CalamityMod.NPCs.ExoMechs.Thanatos;
|
||||
using CalamityMod.Particles;
|
||||
@@ -190,26 +191,6 @@ namespace CalamityMod.NPCs.Deconstructors
|
||||
public Vector2 TargetVector = Vector2.Zero;
|
||||
public Vector2 SecondaryVector = Vector2.Zero;
|
||||
public float StoredValue = 0;
|
||||
void TurnTowards(Vector2 goal, float offset = 0, float maxSpeed = 1)
|
||||
{
|
||||
float goal2 = (goal - NPC.Center).ToRotation() + offset;
|
||||
maxSpeed *= (float)Math.PI / 180f;
|
||||
var dif = MathF.Atan2(MathF.Sin(goal2 - VelocityRotation), MathF.Cos(goal2 - VelocityRotation));
|
||||
if (dif < 0)
|
||||
{
|
||||
if (-dif > maxSpeed)
|
||||
VelocityRotation -= maxSpeed;
|
||||
else
|
||||
VelocityRotation += dif;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dif > maxSpeed)
|
||||
VelocityRotation += maxSpeed;
|
||||
else
|
||||
VelocityRotation += dif;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
public void SwitchAttackState(AttackState State, float Substate = 0, bool resetVector = true)
|
||||
@@ -227,10 +208,9 @@ namespace CalamityMod.NPCs.Deconstructors
|
||||
MainTimer++;
|
||||
UpdateSegments();
|
||||
}
|
||||
public List<List<Point>> FindOreVeins()
|
||||
public static List<List<Point>> FindOreVeins(Point wormTile)
|
||||
{
|
||||
List<List<Point>> oreVeins = new();
|
||||
var wormTile = NPC.Center.ToTileCoordinates();
|
||||
HashSet<Point> visited = new();
|
||||
|
||||
for (int x = -30; x <= 30; x++)
|
||||
@@ -355,7 +335,7 @@ namespace CalamityMod.NPCs.Deconstructors
|
||||
{
|
||||
if (Main.rand.NextBool())
|
||||
{
|
||||
var veins = FindOreVeins();
|
||||
var veins = FindOreVeins(NPC.Center.ToTileCoordinates());
|
||||
while (veins.Count > 0)
|
||||
{
|
||||
var targetVein = veins[Main.rand.Next(veins.Count)];
|
||||
@@ -533,6 +513,7 @@ namespace CalamityMod.NPCs.Deconstructors
|
||||
{
|
||||
npcLoot.Add(ModContent.ItemType<MysteriousCircuitry>(), 1, 4, 8);
|
||||
npcLoot.Add(ModContent.ItemType<DubiousPlating>(), 1, 4, 8);
|
||||
npcLoot.Add(ModContent.ItemType<BurrowerController>(), 10);
|
||||
npcLoot.Add(ItemID.CopperOre, 2, 6, 32);
|
||||
npcLoot.Add(ItemID.TinOre, 2, 6, 32);
|
||||
npcLoot.Add(ItemID.IronOre, 2, 6, 32);
|
||||
|
||||
@@ -3,8 +3,10 @@ using System.IO;
|
||||
using CalamityMod.Events;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.Bestiary;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -36,14 +38,13 @@ namespace CalamityMod.NPCs.DesertScourge
|
||||
NPCID.Sets.BossBestiaryPriority.Add(Type);
|
||||
NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers()
|
||||
{
|
||||
Scale = 0.6f,
|
||||
PortraitScale = 0.6f,
|
||||
CustomTexturePath = "CalamityMod/ExtraTextures/Bestiary/DesertNuisance_Bestiary",
|
||||
PortraitPositionXOverride = 40,
|
||||
PortraitPositionYOverride = 40
|
||||
Scale = 0.65f,
|
||||
PortraitScale = 0.7f,
|
||||
PortraitPositionXOverride = 0,
|
||||
PortraitPositionYOverride = 0
|
||||
};
|
||||
value.Position.X += 45;
|
||||
value.Position.Y += 30;
|
||||
value.Position.X += 0;
|
||||
value.Position.Y -= 20;
|
||||
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
|
||||
NPCID.Sets.MPAllowedEnemies[Type] = true;
|
||||
NPCID.Sets.CantTakeLunchMoney[Type] = true;
|
||||
@@ -574,6 +575,40 @@ namespace CalamityMod.NPCs.DesertScourge
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
|
||||
{
|
||||
if (NPC.IsABestiaryIconDummy)
|
||||
{
|
||||
Texture2D texture = TextureAssets.Npc[NPC.type].Value;
|
||||
NPC.Opacity = 1f;
|
||||
// Reimplementation of CalamityUtils.DrawAnimatedBestiaryWorm but tweaked due to this entity' animations
|
||||
NPC.frame = texture.Frame();
|
||||
// Buffers the segment position and rotations
|
||||
float offset = -0.2f;
|
||||
float startX = 60;
|
||||
float startY = 70;
|
||||
int segmentSpacing = 50;
|
||||
int animationSpeed = 8;
|
||||
float wormTimer = NPC.Calamity().bestiaryWormTimer;
|
||||
int segCount = 3;
|
||||
// Draw the body segments
|
||||
for (int i = segCount; i > 0; i--)
|
||||
{
|
||||
// The first segment is slightly closer to keep up with the head
|
||||
float bodyOffset = i * segmentSpacing - segmentSpacing * 0.5f;
|
||||
|
||||
Texture2D toUse = i == 1 ? TextureAssets.Npc[ModContent.NPCType<DesertNuisanceBody>()].Value : DesertNuisanceBody.BodyTexture2.Value;
|
||||
int frameCount = i == 1 ? 7 : 1;
|
||||
spriteBatch.Draw(toUse, NPC.position + new Vector2(startX + bodyOffset, MathF.Sin((wormTimer + offset * i) * animationSpeed) * 2 + startY), toUse.Frame(1, frameCount, 0, 0), NPC.GetAlpha(drawColor), NPC.rotation - MathHelper.PiOver2 - MathF.Cos((wormTimer + offset * i) * animationSpeed) * MathHelper.PiOver4 * 0.075f, new Vector2(toUse.Width / 2, toUse.Height / (frameCount * 2)), NPC.scale, SpriteEffects.None, 0f);
|
||||
}
|
||||
// Draw the head
|
||||
spriteBatch.Draw(texture, NPC.position + new Vector2(startX + 18, MathF.Sin(wormTimer * animationSpeed) * 2 + startY), texture.Frame(1, 7, 0, 0), NPC.GetAlpha(drawColor), NPC.rotation - MathHelper.PiOver2 - MathF.Cos(wormTimer * animationSpeed) * MathHelper.PiOver4 * 0.075f, new Vector2(texture.Width * 0.5f, texture.Height / 7), NPC.scale, SpriteEffects.None, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment)
|
||||
{
|
||||
NPC.lifeMax = (int)(NPC.lifeMax * 0.7f * balance);
|
||||
|
||||
@@ -16,12 +16,14 @@ using CalamityMod.Items.Weapons.Ranged;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using CalamityMod.Items.Weapons.Summon;
|
||||
using CalamityMod.NPCs.AquaticScourge;
|
||||
using CalamityMod.NPCs.ExoMechs.Thanatos;
|
||||
using CalamityMod.Projectiles.Boss;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.Bestiary;
|
||||
using Terraria.GameContent.ItemDropRules;
|
||||
using Terraria.ID;
|
||||
@@ -72,12 +74,11 @@ namespace CalamityMod.NPCs.DesertScourge
|
||||
{
|
||||
Scale = 0.65f,
|
||||
PortraitScale = 0.7f,
|
||||
CustomTexturePath = "CalamityMod/ExtraTextures/Bestiary/DesertScourge_Bestiary",
|
||||
PortraitPositionXOverride = 40,
|
||||
PortraitPositionYOverride = 40
|
||||
PortraitPositionXOverride = 0,
|
||||
PortraitPositionYOverride = 0
|
||||
};
|
||||
value.Position.X += 65;
|
||||
value.Position.Y += 35;
|
||||
value.Position.X += 20;
|
||||
value.Position.Y -= 15;
|
||||
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
|
||||
NPCID.Sets.MPAllowedEnemies[Type] = true;
|
||||
}
|
||||
@@ -1033,8 +1034,34 @@ namespace CalamityMod.NPCs.DesertScourge
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
|
||||
{
|
||||
if (NPC.IsABestiaryIconDummy)
|
||||
{
|
||||
Texture2D texture = TextureAssets.Npc[NPC.type].Value;
|
||||
NPC.Opacity = 1f;
|
||||
// Reimplementation of CalamityUtils.DrawAnimatedBestiaryWorm but tweaked due to this entity' animations
|
||||
NPC.frame = texture.Frame();
|
||||
// Buffers the segment position and rotations
|
||||
float offset = -0.2f;
|
||||
float startX = 60;
|
||||
float startY = 70;
|
||||
int segmentSpacing = 50;
|
||||
int animationSpeed = 4;
|
||||
float wormTimer = NPC.Calamity().bestiaryWormTimer;
|
||||
int segCount = 3;
|
||||
// Draw the body segments
|
||||
for (int i = segCount; i > 0; i--)
|
||||
{
|
||||
// The first segment is slightly closer to keep up with the head
|
||||
float bodyOffset = i * segmentSpacing - segmentSpacing * 0.5f;
|
||||
|
||||
Texture2D toUse = i == 1 ? TextureAssets.Npc[ModContent.NPCType<DesertScourgeBody>()].Value : DesertScourgeBody.BodyTexture2.Value;
|
||||
int frameCount = i == 1 ? 7 : 1;
|
||||
spriteBatch.Draw(toUse, NPC.position + new Vector2(startX + bodyOffset, MathF.Sin((wormTimer + offset * i) * animationSpeed) * 2 + startY), toUse.Frame(1, frameCount, 0, 0), NPC.GetAlpha(drawColor), NPC.rotation - MathHelper.PiOver2 - MathF.Cos((wormTimer + offset * i) * animationSpeed) * MathHelper.PiOver4 * 0.075f, new Vector2(toUse.Width / 2, toUse.Height / (frameCount * 2)), NPC.scale, SpriteEffects.None, 0f);
|
||||
}
|
||||
// Draw the head
|
||||
spriteBatch.Draw(texture, NPC.position + new Vector2(startX + 18, MathF.Sin(wormTimer * animationSpeed) * 2 + startY), texture.Frame(1, 7, 0, 0), NPC.GetAlpha(drawColor), NPC.rotation - MathHelper.PiOver2 - MathF.Cos(wormTimer * animationSpeed) * MathHelper.PiOver4 * 0.075f, new Vector2(texture.Width * 0.5f, texture.Height / 7), NPC.scale, SpriteEffects.None, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
|
||||
// Ouch, don't get hit twice in a row :)
|
||||
if (hurtInfo.Damage > 0)
|
||||
target.AddBuff(BuffID.BrokenArmor, 300, true);
|
||||
target.AddBuff(BuffID.BrokenArmor, 600, true);
|
||||
}
|
||||
|
||||
public override void FindFrame(int frameHeight)
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
{
|
||||
if (spawnInfo.Player.Calamity().ZoneSulphur || spawnInfo.Player.Calamity().ZoneSunkenSea)
|
||||
if (!spawnInfo.Player.ZonePurity)
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
@@ -153,7 +153,7 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
}
|
||||
}
|
||||
|
||||
public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ItemID.Mushroom, 1, 1, 4);
|
||||
public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ItemID.Mushroom);
|
||||
|
||||
public override void HitEffect(NPC.HitInfo hit)
|
||||
{
|
||||
|
||||
@@ -190,7 +190,7 @@ namespace CalamityMod.NPCs.SunkenSea
|
||||
|
||||
public override void ModifyNPCLoot(NPCLoot npcLoot)
|
||||
{
|
||||
npcLoot.Add(ItemID.JellyfishNecklace, 25);
|
||||
npcLoot.Add(ItemID.JellyfishNecklace, 30);
|
||||
LeadingConditionRule postDS = npcLoot.DefineConditionalDropSet(DropHelper.PostDS());
|
||||
postDS.Add(ModContent.ItemType<VoltaicJelly>(), 5);
|
||||
}
|
||||
|
||||
@@ -120,6 +120,7 @@ namespace CalamityMod.NPCs.TownNPCs
|
||||
"Ishmael", // <@!840416568000381046> (vanillaoyster)
|
||||
"Ariallis", // <@!518231218806980609> (ariallis)
|
||||
"Shade", // <@!613133259563466755> (shade__storm)
|
||||
"Orion", // <@!119164557657636865> (canacx)
|
||||
|
||||
// Original names
|
||||
this.GetLocalizedValue("Name.Laura"),
|
||||
|
||||
@@ -508,57 +508,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void FindFrame(Mod mod, int frameHeight)
|
||||
{
|
||||
// Used to force the head to look to the sides for the laser spread attack
|
||||
if (NPC.ai[0] == 2f || NPC.ai[0] == 3f)
|
||||
{
|
||||
if (NPC.localAI[1] == 1f)
|
||||
NPC.frame.Y = frameHeight * 2;
|
||||
else
|
||||
NPC.frame.Y = frameHeight * 4;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(Mod mod, SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
|
||||
{
|
||||
// Draw the head as usual.
|
||||
Texture2D golemHeadTexture = TextureAssets.Npc[NPC.type].Value;
|
||||
Vector2 headDrawPosition = NPC.Center - screenPos;
|
||||
spriteBatch.Draw(golemHeadTexture, headDrawPosition, NPC.frame, NPC.GetAlpha(drawColor), 0f, NPC.frame.Size() * 0.5f, NPC.scale, SpriteEffects.None, 0f);
|
||||
|
||||
// Draw the eyes. The way vanilla handles this is hardcoded bullshit that cannot handle different hitboxes and thus requires rewriting.
|
||||
Color eyeColor = new Color(Main.mouseTextColor, Main.mouseTextColor, Main.mouseTextColor, 0);
|
||||
Vector2 eyesDrawPosition = headDrawPosition - NPC.scale * new Vector2(1f, 12f);
|
||||
Rectangle eyesFrame = new Rectangle(0, 0, TextureAssets.Golem[1].Value.Width, TextureAssets.Golem[1].Value.Height / 2);
|
||||
spriteBatch.Draw(TextureAssets.Golem[1].Value, eyesDrawPosition, eyesFrame, eyeColor, 0f, eyesFrame.Size() * 0.5f, NPC.scale, SpriteEffects.None, 0f);
|
||||
|
||||
// Draw the glowmasks.
|
||||
int frameCounter = (int)NPC.frameCounter / 4;
|
||||
Rectangle frame = TextureAssets.Extra[ExtrasID.GolemLights4].Value.Frame(1, 8);
|
||||
frame.Y += frame.Height * 2 * frameCounter + NPC.frame.Y;
|
||||
Rectangle glowFrame = frame;
|
||||
spriteBatch.Draw(TextureAssets.Extra[ExtrasID.GolemLights4].Value, eyesDrawPosition, glowFrame, eyeColor, 0f, glowFrame.Size() * 0.5f, NPC.scale, SpriteEffects.None, 0f);
|
||||
frame = NPC.frame;
|
||||
Rectangle glowFrame2 = frame;
|
||||
spriteBatch.Draw(TextureAssets.Extra[ExtrasID.GolemLights5].Value, eyesDrawPosition, glowFrame2, eyeColor, 0f, glowFrame2.Size() * 0.5f, NPC.scale, SpriteEffects.None, 0f);
|
||||
|
||||
// Draw the sparkle telegraphs for the laser spread attack if applicable.
|
||||
if (NPC.ai[0] == 3f && NPC.ai[1] <= 60f)
|
||||
{
|
||||
spriteBatch.SetBlendState(BlendState.Additive);
|
||||
for (int i = -1; i <= 1; i += 2)
|
||||
{
|
||||
Texture2D sparkle = ModContent.Request<Texture2D>("CalamityMod/Particles/Sparkle2").Value;
|
||||
Vector2 sparkleDraw = headDrawPosition + new Vector2(14f * i, -15f) * NPC.scale;
|
||||
var drawFade = Color.Yellow * Utils.GetLerpValue(0, 30, 60f - NPC.ai[1], true);
|
||||
spriteBatch.Draw(sparkle, sparkleDraw, null, drawFade, MathHelper.Pi * 0.02f * NPC.ai[1] * i, sparkle.Size() / 2f, 1.25f * NPC.scale, SpriteEffects.None, 0f);
|
||||
}
|
||||
spriteBatch.SetBlendState(BlendState.AlphaBlend);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public class FistAI : VanillaAIOverride
|
||||
{
|
||||
public override bool AI(Mod mod)
|
||||
@@ -1152,6 +1101,18 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void FindFrame(Mod mod, int frameHeight)
|
||||
{
|
||||
// Used to force the head to look to the sides for the laser spread attack
|
||||
if (NPC.ai[0] == 2f || NPC.ai[0] == 3f)
|
||||
{
|
||||
if (NPC.localAI[1] == 1f)
|
||||
NPC.frame.Y = frameHeight * 2;
|
||||
else
|
||||
NPC.frame.Y = frameHeight * 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class HeadFreeAI : VanillaAIOverride
|
||||
@@ -1428,6 +1389,45 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool PreDraw(Mod mod, SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
|
||||
{
|
||||
// Draw the head as usual.
|
||||
Texture2D golemHeadTexture = TextureAssets.Npc[NPC.type].Value;
|
||||
Vector2 headDrawPosition = NPC.Center - screenPos;
|
||||
spriteBatch.Draw(golemHeadTexture, headDrawPosition, NPC.frame, NPC.GetAlpha(drawColor), 0f, NPC.frame.Size() * 0.5f, NPC.scale, SpriteEffects.None, 0f);
|
||||
|
||||
// Draw the eyes. The way vanilla handles this is hardcoded bullshit that cannot handle different hitboxes and thus requires rewriting.
|
||||
Color eyeColor = new Color(Main.mouseTextColor, Main.mouseTextColor, Main.mouseTextColor, 0);
|
||||
Vector2 eyesDrawPosition = headDrawPosition - NPC.scale * new Vector2(1f, 12f);
|
||||
Rectangle eyesFrame = new Rectangle(0, 0, TextureAssets.Golem[1].Value.Width, TextureAssets.Golem[1].Value.Height / 2);
|
||||
spriteBatch.Draw(TextureAssets.Golem[1].Value, eyesDrawPosition, eyesFrame, eyeColor, 0f, eyesFrame.Size() * 0.5f, NPC.scale, SpriteEffects.None, 0f);
|
||||
|
||||
// Draw the glowmasks.
|
||||
int frameCounter = (int)NPC.frameCounter / 4;
|
||||
Rectangle frame = TextureAssets.Extra[ExtrasID.GolemLights4].Value.Frame(1, 8);
|
||||
frame.Y += frame.Height * 2 * frameCounter + NPC.frame.Y;
|
||||
Rectangle glowFrame = frame;
|
||||
spriteBatch.Draw(TextureAssets.Extra[ExtrasID.GolemLights4].Value, eyesDrawPosition, glowFrame, eyeColor, 0f, glowFrame.Size() * 0.5f, NPC.scale, SpriteEffects.None, 0f);
|
||||
frame = NPC.frame;
|
||||
Rectangle glowFrame2 = frame;
|
||||
spriteBatch.Draw(TextureAssets.Extra[ExtrasID.GolemLights5].Value, eyesDrawPosition, glowFrame2, eyeColor, 0f, glowFrame2.Size() * 0.5f, NPC.scale, SpriteEffects.None, 0f);
|
||||
|
||||
// Draw the sparkle telegraphs for the laser spread attack if applicable.
|
||||
if (NPC.ai[0] == 3f && NPC.ai[1] <= 60f)
|
||||
{
|
||||
spriteBatch.SetBlendState(BlendState.Additive);
|
||||
for (int i = -1; i <= 1; i += 2)
|
||||
{
|
||||
Texture2D sparkle = ModContent.Request<Texture2D>("CalamityMod/Particles/Sparkle2").Value;
|
||||
Vector2 sparkleDraw = headDrawPosition + new Vector2(14f * i, -15f) * NPC.scale;
|
||||
var drawFade = Color.Yellow * Utils.GetLerpValue(0, 30, 60f - NPC.ai[1], true);
|
||||
spriteBatch.Draw(sparkle, sparkleDraw, null, drawFade, MathHelper.Pi * 0.02f * NPC.ai[1] * i, sparkle.Size() / 2f, 1.25f * NPC.scale, SpriteEffects.None, 0f);
|
||||
}
|
||||
spriteBatch.SetBlendState(BlendState.AlphaBlend);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -100,9 +100,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
float finalPhaseLifeRatio = death ? 0.4f : 0.25f;
|
||||
|
||||
// Movement variables
|
||||
float phase1MaxSpeedIncrease = death ? 2f : 4f;
|
||||
float phase1MaxAccelerationIncrease = death ? 0.025f : 0.05f;
|
||||
float phase1MaxChargeSpeedIncrease = death ? 3f : 6f;
|
||||
float phase1MaxSpeedIncrease = 1f;
|
||||
float phase1MaxChargeSpeedIncrease = 1.5f;
|
||||
|
||||
// Phase duration variables
|
||||
float phase1MaxLaserPhaseDurationDecrease = death ? 120f : 300f;
|
||||
@@ -140,13 +139,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
{
|
||||
if (NPC.ai[1] == 0f)
|
||||
{
|
||||
float maxVelocity = (death ? 9.45f : 8.25f);
|
||||
float acceleration = (death ? 0.13f : 0.115f);
|
||||
float maxVelocity = death ? 9.25f : 8.25f;
|
||||
float acceleration = death ? 0.13f : 0.115f;
|
||||
|
||||
if (death)
|
||||
{
|
||||
maxVelocity += phase1MaxSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)) / 2;
|
||||
acceleration += phase1MaxAccelerationIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)) / 2;
|
||||
maxVelocity += phase1MaxSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio));
|
||||
}
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
@@ -213,7 +211,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
float laserSpeed = death ? 11.4f : 10.5f;
|
||||
float laserSpeed = death ? 11.25f : 10.5f;
|
||||
|
||||
int type = ProjectileID.EyeLaser;
|
||||
int damage = LaserDamage.CalculateMechDamage();
|
||||
@@ -228,9 +226,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
{
|
||||
NPC.rotation = hoverRotation;
|
||||
|
||||
float chargeSpeed = death ? 18f : 15f;
|
||||
float chargeSpeed = death ? 17.5f : 15f;
|
||||
if (death)
|
||||
chargeSpeed += phase1MaxChargeSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)) / 2;
|
||||
chargeSpeed += phase1MaxChargeSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio));
|
||||
if (Main.getGoodWorld)
|
||||
chargeSpeed += 2f;
|
||||
|
||||
@@ -241,7 +239,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
else if (NPC.ai[1] == 2f)
|
||||
{
|
||||
NPC.ai[2] += 1f;
|
||||
float decelerateGateValue = (death ? 36f : 32f) + (death ? 6f * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f);
|
||||
float decelerateGateValue = (death ? 36f : 32f) + (death ? 4f * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f);
|
||||
if (NPC.ai[2] >= decelerateGateValue)
|
||||
{
|
||||
float decelerationMultiplier = (death ? 0.84f : 0.92f) - (death ? 0.16f * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f);
|
||||
@@ -255,7 +253,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
else
|
||||
NPC.rotation = NPC.velocity.ToRotation() - MathHelper.PiOver2;
|
||||
|
||||
float delayBeforeChargingAgain = (death ? 48f : 56f) - (death ? 1.5f * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f);
|
||||
float delayBeforeChargingAgain = death ? 48f : 56f;
|
||||
if (NPC.ai[2] >= delayBeforeChargingAgain)
|
||||
{
|
||||
NPC.ai[3] += 1f;
|
||||
@@ -391,8 +389,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
|
||||
if (NPC.ai[1] == 0f)
|
||||
{
|
||||
float maxVelocity = death ? 10.85f + 1.75f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 9.5f;
|
||||
float acceleration = death ? 0.1975f + 0.025f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0.175f;
|
||||
float maxVelocity = death ? 10.65f + (1.5f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio)) : 9.5f;
|
||||
float acceleration = death ? 0.1975f : 0.175f;
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
@@ -461,8 +459,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
{
|
||||
if (NPC.ai[1] == 1f)
|
||||
{
|
||||
float maxVelocity = death ? 10.85f + 1.75f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 9.5f;
|
||||
float acceleration = death ? 0.295f + 0.075f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0.25f;
|
||||
float maxVelocity = death ? 10.65f + (1.5f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio)) : 9.5f;
|
||||
float acceleration = death ? 0.295f : 0.25f;
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
@@ -518,7 +516,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
// Set rotation and velocity
|
||||
NPC.rotation = hoverRotation;
|
||||
|
||||
float chargeSpeed = (death ? 25f : 22f) + (death ? 3.25f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f);
|
||||
float chargeSpeed = (death ? 25f : 22f) + (death ? 3f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f);
|
||||
if (!spazAlive)
|
||||
chargeSpeed += 2f;
|
||||
if (Main.getGoodWorld)
|
||||
@@ -562,7 +560,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
SoundEngine.PlaySound(SoundID.Item33, NPC.Center);
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
float laserDartSpeed = (death ? 7.5f : 6f) * (spazAlive ? 1f : 1.5f);
|
||||
float laserDartSpeed = (death ? 7.25f : 6f) * (spazAlive ? 1f : 1.5f);
|
||||
int type = ModContent.ProjectileType<HomingLaserDart>();
|
||||
int damage = HomingDartDamage.CalculateMechDamage();
|
||||
|
||||
@@ -622,8 +620,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
else if (NPC.ai[1] == 4f)
|
||||
{
|
||||
float chargeLineUpDistance = spazAlive ? 600f : 500f;
|
||||
float chargeSpeed = (death ? 19.8f : 18f) + (death ? 2.5f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f);
|
||||
float chargeAcceleration = (death ? 0.495f : 0.45f) + (death ? 0.1f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f);
|
||||
float chargeSpeed = (death ? 20f : 18f) + (death ? 1.5f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f);
|
||||
float chargeAcceleration = death ? 0.495f : 0.45f;
|
||||
|
||||
if (spazAlive)
|
||||
{
|
||||
@@ -724,13 +722,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
float finalPhaseLifeRatio = death ? 0.4f : 0.25f;
|
||||
|
||||
// Movement variables
|
||||
float phase1MaxSpeedIncrease = death ? 2.25f : 4.5f;
|
||||
float phase1MaxAccelerationIncrease = death ? 0.075f : 0.15f;
|
||||
float phase1MaxChargeSpeedIncrease = death ? 3f : 6f;
|
||||
float phase1MaxSpeedIncrease = 1.125f;
|
||||
float phase1MaxChargeSpeedIncrease = 1.4f;
|
||||
|
||||
// Phase duration variables
|
||||
float phase1MaxCursedFlamePhaseDurationDecrease = death ? 80f : 200f;
|
||||
float phase1MaxChargesDecrease = death ? 2f : 4f;
|
||||
float phase1MaxChargesDecrease = 2f;
|
||||
|
||||
// Phase checks
|
||||
bool phase2 = lifeRatio < phase2LifeRatio;
|
||||
@@ -768,13 +765,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
if (NPC.ai[1] == 0f)
|
||||
{
|
||||
// Velocity
|
||||
float maxVelocity = death ? 13.8f : 12f;
|
||||
float maxVelocity = death ? 13.5f : 12f;
|
||||
float acceleration = death ? 0.46f : 0.4f;
|
||||
|
||||
if (death)
|
||||
{
|
||||
maxVelocity += phase1MaxSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)) / 2;
|
||||
acceleration += phase1MaxAccelerationIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)) / 2;
|
||||
maxVelocity += phase1MaxSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio));
|
||||
}
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
@@ -848,7 +844,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
// Rotation and velocity
|
||||
NPC.rotation = hoverRotation;
|
||||
|
||||
float chargeSpeed = death ? 20.4f + phase1MaxChargeSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 18f;
|
||||
float chargeSpeed = death ? 19.25f + (phase1MaxChargeSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio))) : 18f;
|
||||
if (Main.getGoodWorld)
|
||||
chargeSpeed *= 1.2f;
|
||||
|
||||
@@ -860,7 +856,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
{
|
||||
NPC.ai[2] += 1f;
|
||||
|
||||
float timeBeforeSlowDown = death ? 18f : 10f;
|
||||
float timeBeforeSlowDown = death ? 14f : 10f;
|
||||
if (NPC.ai[2] >= timeBeforeSlowDown)
|
||||
{
|
||||
// Slow down
|
||||
@@ -1019,8 +1015,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
// Shadowflamethrower phase
|
||||
if (NPC.ai[1] == 0f)
|
||||
{
|
||||
float maxVelocity = 7.1f + (death ? 0.8f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f);
|
||||
float acceleration = 0.118f + (death ? 0.02f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f);
|
||||
float maxVelocity = 7.1f + (death ? 0.7f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f);
|
||||
float acceleration = 0.118f + (death ? 0.0175f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f);
|
||||
|
||||
float distanceFromTarget = 180f;
|
||||
Vector2 destination = Main.player[NPC.target].Center + Vector2.UnitX * distanceFromTarget * direction;
|
||||
@@ -1121,7 +1117,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
// Set rotation and velocity
|
||||
NPC.rotation = hoverRotation;
|
||||
|
||||
float chargeSpeed = (death ? 22.8f : 18f) + (death ? 1.5f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f);
|
||||
float chargeSpeed = death ? 19.25f + (phase1MaxChargeSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio))) : 18f;
|
||||
if (Main.getGoodWorld)
|
||||
chargeSpeed *= 1.2f;
|
||||
|
||||
@@ -1193,7 +1189,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
else if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
// Velocity
|
||||
float spazmatismPhase3ChargeSpeed = (death ? 23f : 20f) + (death ? 3f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f);
|
||||
float spazmatismPhase3ChargeSpeed = (death ? 22.5f : 20f) + (death ? 3f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f);
|
||||
if (NPC.ai[2] == -1f || (!retAlive && NPC.ai[3] == secondFastCharge))
|
||||
spazmatismPhase3ChargeSpeed *= 1.3f;
|
||||
if (Main.getGoodWorld)
|
||||
|
||||
@@ -38,6 +38,12 @@ namespace CalamityMod.Projectiles.BaseProjectiles
|
||||
/// </summary>
|
||||
public List<Vector2> SegmentTypeDrawOffsets = new List<Vector2>();
|
||||
|
||||
/// <summary>
|
||||
/// A list of all glow textures for the segments to draw with
|
||||
/// DOES include the head
|
||||
/// </summary>
|
||||
public virtual List<string?> GlowTextures { get; }
|
||||
|
||||
/// <summary>
|
||||
/// How far through the current animation this worm is
|
||||
/// </summary>
|
||||
@@ -73,6 +79,29 @@ namespace CalamityMod.Projectiles.BaseProjectiles
|
||||
/// Use SegmentTextureAssets to get the data stored here.
|
||||
/// </summary>
|
||||
private List<Asset<Texture2D>> internalTexAssets = new List<Asset<Texture2D>>();
|
||||
/// <summary>
|
||||
/// The textures for each glow type of this worm. Works like getting a texture from TextureAssets
|
||||
/// </summary>
|
||||
public List<Asset<Texture2D>> GlowTextureAssets
|
||||
{
|
||||
get
|
||||
{
|
||||
if (internalGlowAssets.Count == 0)
|
||||
for (var i = 0; i < GlowTextures.Count; i++)
|
||||
{
|
||||
if (GlowTextures[i] is not null)
|
||||
internalGlowAssets.Add(ModContent.Request<Texture2D>(GlowTextures[i]));
|
||||
else internalGlowAssets.Add(ModContent.Request<Texture2D>("CalamityMod/Projectiles/InvisibleProj"));
|
||||
}
|
||||
return internalGlowAssets;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Internal list that stores the glow textureassets.
|
||||
/// Use SegmentTextureAssets to get the data stored here.
|
||||
/// </summary>
|
||||
private List<Asset<Texture2D>> internalGlowAssets = new List<Asset<Texture2D>>();
|
||||
|
||||
public List<BaseWormSegment> Segments = new();
|
||||
|
||||
@@ -93,6 +122,11 @@ namespace CalamityMod.Projectiles.BaseProjectiles
|
||||
/// </summary>
|
||||
public float SegmentRigidity = 0.2f;
|
||||
|
||||
/// <summary>
|
||||
/// The max rotational offset from the direction of the previous segment
|
||||
/// </summary>
|
||||
public float SegmentMaxRotation = MathHelper.TwoPi;
|
||||
|
||||
/// <summary>
|
||||
/// The points used by ExactSegmentLogic to exactly follow the head
|
||||
/// </summary>
|
||||
@@ -158,7 +192,9 @@ namespace CalamityMod.Projectiles.BaseProjectiles
|
||||
nexSegDir = nexSegDir.MoveTowards((aheadSeg.rotation - thisSeg.rotation).ToRotationVector2(), 1f);
|
||||
}
|
||||
thisSeg.rotation = nexSegDir.ToRotation() + MathHelper.PiOver2;
|
||||
thisSeg.Center = aheadSeg.Center - nexSegDir.SafeNormalize(Vector2.Zero) * segmentDistance;
|
||||
float angledif = MathHelper.WrapAngle(thisSeg.rotation - aheadSeg.rotation);
|
||||
thisSeg.rotation = thisSeg.rotation.AngleLerp(aheadSeg.rotation + MathHelper.Clamp(angledif, -SegmentMaxRotation * 0.5f, SegmentMaxRotation * 0.5f), 0.25f);
|
||||
thisSeg.Center = aheadSeg.Center - (thisSeg.rotation - MathHelper.PiOver2).ToRotationVector2() * segmentDistance;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -243,6 +279,9 @@ namespace CalamityMod.Projectiles.BaseProjectiles
|
||||
DrawSegment(ref lightColor, Segments[i]);
|
||||
}
|
||||
Main.spriteBatch.Draw(TextureAssets.Projectile[Type].Value, Projectile.Center - Main.screenPosition, null, lightColor * Projectile.Opacity, Projectile.rotation, TextureAssets.Projectile[Type].Value.Size() / 2, Projectile.scale, SpriteEffects.None, 1);
|
||||
|
||||
if (GlowTextures.Count > 0 && GlowTextures[0] is not null)
|
||||
Main.spriteBatch.Draw(GlowTextureAssets[0].Value, Projectile.Center - Main.screenPosition, null, Color.White * Projectile.Opacity, Projectile.rotation, GlowTextureAssets[0].Size() / 2, Projectile.scale, SpriteEffects.None, 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -255,6 +294,12 @@ namespace CalamityMod.Projectiles.BaseProjectiles
|
||||
}
|
||||
var tex = SegmentTextureAssets[segment.segmentType].Value;
|
||||
Main.spriteBatch.Draw(tex, segment.Center - Main.screenPosition, null, color *segment.Opacity, segment.rotation, tex.Size() / 2 + (SegmentTypeDrawOffsets[segment.segmentType]), Projectile.scale, SpriteEffects.None, 1);
|
||||
if (GlowTextures is null || !GlowTextures.IndexInRange(segment.segmentType + 1) || GlowTextures[segment.segmentType + 1] is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
tex = GlowTextureAssets[segment.segmentType + 1].Value;
|
||||
Main.spriteBatch.Draw(tex, segment.Center - Main.screenPosition, null, Color.White * segment.Opacity, segment.rotation, tex.Size() / 2 + (SegmentTypeDrawOffsets[segment.segmentType]), Projectile.scale, SpriteEffects.None, 1);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
if (Projectile.timeLeft % 3 == 0)
|
||||
{
|
||||
FlameExplosion blast = new(Projectile.Center, Vector2.Zero, Color.Orange, Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0.1f, 0.17f, 15, 0.7f);
|
||||
FlameExplosion blast = new(Projectile.Center, Vector2.Zero, Color.Orange, Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0.1f, 0.25f, 15, 0.7f);
|
||||
GeneralParticleHandler.SpawnParticle(blast);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Utilities.Daybreak;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
@@ -206,41 +207,46 @@ namespace CalamityMod.Projectiles.Magic
|
||||
}
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
var tex = TextureAssets.Projectile[Type].Value;
|
||||
var connectioncolor = Color.SkyBlue * ((MathF.Sin(Main.GlobalTimeWrappedHourly) + 1) * 0.125f + 0.75f);
|
||||
for (var i = 0; i < Segments.Count; i++)
|
||||
using (Main.spriteBatch.Scope())
|
||||
{
|
||||
if (i == 0)
|
||||
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive,SamplerState.PointClamp,DepthStencilState.None,Main.Rasterizer,null,Main.Transform);
|
||||
var tex = TextureAssets.Projectile[Type].Value;
|
||||
var connectioncolor = Color.SkyBlue * ((MathF.Sin(Main.GlobalTimeWrappedHourly) + 1) * 0.125f + 0.75f);
|
||||
for (var i = 0; i < Segments.Count; i++)
|
||||
{
|
||||
CalamityUtils.DrawLineBetter(Main.spriteBatch, Projectile.Center, Segments[i].Center, connectioncolor, 2 * Projectile.scale);
|
||||
if (i == 0)
|
||||
{
|
||||
CalamityUtils.DrawLineBetter(Main.spriteBatch, Projectile.Center, Segments[i].Center, connectioncolor, 2 * Projectile.scale);
|
||||
}
|
||||
if (Segments.IndexInRange(i + 1))
|
||||
{
|
||||
var nextSegment = Segments[i + 1];
|
||||
CalamityUtils.DrawLineBetter(Main.spriteBatch, Segments[i].Center, nextSegment.Center, connectioncolor, 2 * Projectile.scale);
|
||||
}
|
||||
Main.spriteBatch.Draw(GetGlowTex(), Segments[i].Center - Main.screenPosition, null, Color.SkyBlue, 0, GetGlowTex().Size() * 0.5f, 0.2f * Projectile.scale, SpriteEffects.None, 0);
|
||||
|
||||
Main.spriteBatch.Draw(tex, Segments[i].Center - Main.screenPosition, null, Color.White, 0 * Segments[i].followDistance * 5f * Main.GlobalTimeWrappedHourly, tex.Size() * 0.5f, 0.75f * Projectile.scale, SpriteEffects.None, 0);
|
||||
}
|
||||
if (Segments.IndexInRange(i + 1))
|
||||
void DrawHeadStar(Vector2 offsetPercentage)
|
||||
{
|
||||
var nextSegment = Segments[i + 1];
|
||||
CalamityUtils.DrawLineBetter(Main.spriteBatch, Segments[i].Center, nextSegment.Center, connectioncolor, 2 * Projectile.scale);
|
||||
Main.spriteBatch.Draw(GetGlowTex(), Projectile.Center + offsetPercentage.RotatedBy(Projectile.rotation - MathHelper.PiOver2) * TailLength - Main.screenPosition, null, Color.SkyBlue, 0, GetGlowTex().Size() * 0.5f, 0.2f * Projectile.scale, SpriteEffects.None, 0);
|
||||
Main.spriteBatch.Draw(tex, Projectile.Center + offsetPercentage.RotatedBy(Projectile.rotation - MathHelper.PiOver2) * TailLength - Main.screenPosition, null, Color.White, 0 * Math.Abs(offsetPercentage.X) * 5f * Main.GlobalTimeWrappedHourly, tex.Size() * 0.5f, 0.75f * Projectile.scale, SpriteEffects.None, 0);
|
||||
}
|
||||
Main.spriteBatch.Draw(GetGlowTex(), Segments[i].Center - Main.screenPosition, null, Color.SkyBlue, 0, GetGlowTex().Size() * 0.5f, 0.2f * Projectile.scale, SpriteEffects.None, 0);
|
||||
void connectOffsets(Vector2 offset1, Vector2 offset2)
|
||||
{
|
||||
CalamityUtils.DrawLineBetter(Main.spriteBatch, Projectile.Center + offset1.RotatedBy(Projectile.rotation - MathHelper.PiOver2) * TailLength, Projectile.Center + offset2.RotatedBy(Projectile.rotation - MathHelper.PiOver2) * TailLength, connectioncolor, 2 * Projectile.scale);
|
||||
|
||||
Main.spriteBatch.Draw(tex, Segments[i].Center - Main.screenPosition, null, Color.White, 0 * Segments[i].followDistance * 5f * Main.GlobalTimeWrappedHourly, tex.Size() * 0.5f, 0.75f * Projectile.scale, SpriteEffects.None, 0);
|
||||
}
|
||||
connectOffsets(new(), new(-0.0425f, 0.0637f));
|
||||
connectOffsets(new(), new(0.0307f, 0.0418f));
|
||||
connectOffsets(new(-0.0425f, 0.0637f), new(0.0168f, 0.0791f));
|
||||
connectOffsets(new(0.0307f, 0.0418f), new(0.0168f, 0.0791f));
|
||||
DrawHeadStar(new());
|
||||
DrawHeadStar(new(-0.0425f, 0.0637f));
|
||||
DrawHeadStar(new(0.0307f, 0.0418f));
|
||||
DrawHeadStar(new(0.0168f, 0.0791f));
|
||||
Main.spriteBatch.End();
|
||||
}
|
||||
void DrawHeadStar(Vector2 offsetPercentage)
|
||||
{
|
||||
Main.spriteBatch.Draw(GetGlowTex(), Projectile.Center + offsetPercentage.RotatedBy(Projectile.rotation - MathHelper.PiOver2) * TailLength - Main.screenPosition, null, Color.SkyBlue, 0, GetGlowTex().Size() * 0.5f, 0.2f * Projectile.scale, SpriteEffects.None, 0);
|
||||
Main.spriteBatch.Draw(tex, Projectile.Center + offsetPercentage.RotatedBy(Projectile.rotation - MathHelper.PiOver2) * TailLength - Main.screenPosition, null, Color.White, 0 * Math.Abs(offsetPercentage.X) * 5f * Main.GlobalTimeWrappedHourly, tex.Size() * 0.5f, 0.75f * Projectile.scale, SpriteEffects.None, 0);
|
||||
}
|
||||
void connectOffsets(Vector2 offset1, Vector2 offset2)
|
||||
{
|
||||
CalamityUtils.DrawLineBetter(Main.spriteBatch, Projectile.Center + offset1.RotatedBy(Projectile.rotation - MathHelper.PiOver2) * TailLength, Projectile.Center + offset2.RotatedBy(Projectile.rotation - MathHelper.PiOver2) * TailLength, connectioncolor, 2 * Projectile.scale);
|
||||
|
||||
}
|
||||
connectOffsets(new(), new(-0.0425f, 0.0637f));
|
||||
connectOffsets(new(), new(0.0307f, 0.0418f));
|
||||
connectOffsets(new(-0.0425f, 0.0637f), new(0.0168f, 0.0791f));
|
||||
connectOffsets(new(0.0307f, 0.0418f), new(0.0168f, 0.0791f));
|
||||
DrawHeadStar(new());
|
||||
DrawHeadStar(new(-0.0425f, 0.0637f));
|
||||
DrawHeadStar(new(0.0307f, 0.0418f));
|
||||
DrawHeadStar(new(0.0168f, 0.0791f));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@ namespace CalamityMod.Projectiles.Magic
|
||||
public float fadeIn = 0;
|
||||
public bool launch = true;
|
||||
public Color bColor = Color.OrangeRed;
|
||||
public int launchTime = 0;
|
||||
public Vector2 endPoint;
|
||||
public new string LocalizationCategory => "Projectiles.Magic";
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -23,7 +25,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
Projectile.height = 16;
|
||||
Projectile.friendly = true;
|
||||
Projectile.penetrate = -1;
|
||||
Projectile.timeLeft = 240;
|
||||
Projectile.timeLeft = 500;
|
||||
Projectile.extraUpdates = 2;
|
||||
Projectile.tileCollide = false;
|
||||
Projectile.DamageType = DamageClass.Magic;
|
||||
@@ -37,7 +39,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
Vector2 mouse = Owner.Calamity().mouseWorld;
|
||||
fadeIn = Utils.GetLerpValue(0, Owner.itemAnimationMax * 0.5f * Projectile.MaxUpdates, time, true);
|
||||
float velFade = Utils.GetLerpValue(1.5f, 6.5f, Projectile.velocity.Length(), true);
|
||||
Vector2 velocity = Utils.DirectionTo(Owner.Center, mouse) * Owner.HeldItem.shootSpeed;
|
||||
Vector2 velocity = Utils.DirectionTo(Owner.Center, mouse) * 8f;
|
||||
Projectile.scale = fadeIn * 1.5f;
|
||||
if (fadeIn < 1) // Hold the projectile in front of the player while they case the spell
|
||||
{
|
||||
@@ -49,8 +51,9 @@ namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
Projectile.tileCollide = true;
|
||||
|
||||
Vector2 staticSpeed = Utils.DirectionTo(Owner.Center, mouse) * Utils.Distance(Owner.Center, Owner.ClampedMouseWorld()) * 0.0165f;
|
||||
Vector2 staticSpeed = Utils.DirectionTo(Owner.Center, mouse) * Utils.Distance(Projectile.Center, Owner.ClampedMouseWorld()) * 0.0165f;
|
||||
Projectile.velocity = staticSpeed;
|
||||
endPoint = Owner.ClampedMouseWorld();
|
||||
|
||||
SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/HalleysInfernoShoot") with { Volume = 0.45f, Pitch = 0.3f }, Projectile.Center);
|
||||
for (int i = 0; i < 20; i++)
|
||||
@@ -73,7 +76,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
launch = false;
|
||||
}
|
||||
|
||||
if (Main.rand.NextBool(10) && velFade > 0.1f)
|
||||
if (Main.rand.NextBool(8) && launchTime < 56)
|
||||
{
|
||||
Particle fx = new CustomSpark(Projectile.Center + Main.rand.NextVector2Circular(8, 8), -Projectile.velocity * 0.9f, "CalamityMod/Particles/FireTypeParticle", false, 32, 1.15f, Color.Lerp(bColor, Color.Red, 0.5f), new Vector2(0.8f, 1f), true, false);
|
||||
GeneralParticleHandler.SpawnParticle(fx);
|
||||
@@ -91,13 +94,16 @@ namespace CalamityMod.Projectiles.Magic
|
||||
GeneralParticleHandler.SpawnParticle(trail);
|
||||
}
|
||||
|
||||
if (Projectile.timeLeft < 120)
|
||||
{
|
||||
Projectile.velocity *= 0.98f;
|
||||
}
|
||||
|
||||
Projectile.rotation += 0.3f * Projectile.direction;
|
||||
time++;
|
||||
if (!launch)
|
||||
{
|
||||
Projectile.Center = Vector2.Lerp(Projectile.Center, endPoint, 0.035f);
|
||||
Projectile.velocity *= 0.9f;
|
||||
launchTime++;
|
||||
if (launchTime >= (Owner.itemAnimationMax + 28))
|
||||
Projectile.Kill();
|
||||
}
|
||||
}
|
||||
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Items.Weapons.Magic;
|
||||
using CalamityMod.Particles;
|
||||
@@ -23,6 +24,8 @@ namespace CalamityMod.Projectiles.Magic
|
||||
public Color fireColor = Color.OrangeRed;
|
||||
public Color iceColor = Color.DeepSkyBlue;
|
||||
public SlotId chargeSound;
|
||||
public int launchTime = 0;
|
||||
public Vector2 endPoint;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = 20;
|
||||
@@ -43,7 +46,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
Lighting.AddLight(Projectile.Center, lightColor.ToVector3());
|
||||
Vector2 mouse = Owner.Calamity().mouseWorld;
|
||||
fadeIn = launch ? Utils.GetLerpValue(0, Owner.itemAnimationMax * 0.5f * Projectile.MaxUpdates, time, true) : 1;
|
||||
Vector2 velocity = Utils.DirectionTo(Owner.Center, mouse) * Owner.HeldItem.shootSpeed;
|
||||
Vector2 velocity = Utils.DirectionTo(Owner.Center, mouse) * 10;
|
||||
Projectile.scale = fadeIn * (bigMagic ? 1.3f : 1);
|
||||
if (fadeIn < 1) // Hold the projectile in front of the player while they case the spell
|
||||
{
|
||||
@@ -71,6 +74,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
Projectile.tileCollide = true;
|
||||
Vector2 staticSpeed = Utils.DirectionTo(Owner.Center, mouse) * Utils.Distance(Owner.Center, Owner.ClampedMouseWorld()) * 0.01f;
|
||||
Projectile.velocity = (bigMagic ? staticSpeed : velocity);
|
||||
endPoint = Owner.ClampedMouseWorld();
|
||||
|
||||
SoundEngine.PlaySound(FrigidflashBolt.UseSound with { Volume = 1f, Pitch = (bigMagic ? -0.15f : 0.15f) }, Projectile.Center);
|
||||
if (bigMagic)
|
||||
@@ -97,7 +101,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
launch = false;
|
||||
}
|
||||
|
||||
if (Main.rand.NextBool(8))
|
||||
if (Main.rand.NextBool(bigMagic ? 3 : 8) && launchTime < 56)
|
||||
{
|
||||
bool type = Main.rand.NextBool();
|
||||
Particle fx = new CustomSpark(Projectile.Center + Main.rand.NextVector2Circular(12, 12), -Projectile.velocity * 0.3f, type ? "CalamityMod/Particles/FireTypeParticle" : "CalamityMod/Particles/IceTypeParticle", false, 32, 0.9f, type ? fireColor : iceColor, new Vector2(0.8f, 1f), true, false, shrinkSpeed: type ? 0.2f : 0);
|
||||
@@ -112,9 +116,13 @@ namespace CalamityMod.Projectiles.Magic
|
||||
}
|
||||
if (bigMagic)
|
||||
{
|
||||
if (Projectile.timeLeft < 145)
|
||||
if (!launch)
|
||||
{
|
||||
Projectile.velocity *= 0.98f;
|
||||
Projectile.Center = Vector2.Lerp(Projectile.Center, endPoint, 0.035f);
|
||||
Projectile.velocity *= 0.9f;
|
||||
launchTime++;
|
||||
if (launchTime >= (Owner.itemAnimationMax * 2.5f + 28))
|
||||
Projectile.Kill();
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -48,8 +48,10 @@ namespace CalamityMod.Projectiles.Magic
|
||||
if (mainColor == Color.White)
|
||||
{
|
||||
Projectile.scale = 0.4f;
|
||||
if (Projectile.ai[1] == -1)
|
||||
mainColor = Color.Turquoise;
|
||||
if (Projectile.ai[1] == 0)
|
||||
mainColor = Color.HotPink;
|
||||
mainColor = Color.Orchid;
|
||||
|
||||
if (Projectile.ai[1] == 2)
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
public override LocalizedText DisplayName => CalamityUtils.GetItemName<Wingman>();
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Magic/Wingman";
|
||||
|
||||
public Color StaticEffectsColor = Color.HotPink;
|
||||
public Color StaticEffectsColor = Color.Orchid;
|
||||
private ref float ShootingTimer => ref Projectile.ai[0];
|
||||
private ref float PostFireCooldown => ref Projectile.ai[1];
|
||||
public float yOffset;
|
||||
@@ -50,6 +50,8 @@ namespace CalamityMod.Projectiles.Magic
|
||||
public override void AI()
|
||||
{
|
||||
Owner ??= Main.player[Projectile.owner];
|
||||
if (Projectile.ai[2] == 1)
|
||||
StaticEffectsColor = Color.Turquoise;
|
||||
|
||||
Lighting.AddLight(Projectile.Center, StaticEffectsColor.ToVector3() * 0.2f);
|
||||
|
||||
@@ -192,13 +194,13 @@ namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
SoundStyle fire = new("CalamityMod/Sounds/Item/DeadSunExplosion");
|
||||
SoundEngine.PlaySound(fire with { Volume = 0.35f, Pitch = -0.4f, PitchVariance = 0.2f }, Projectile.Center);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), tipPosition, (firingVelocity * 1.3f) * Utils.GetLerpValue(60, 10, FiringTime, true), ModContent.ProjectileType<WingmanGrenade>(), (int)(Projectile.damage * 6), Projectile.knockBack * 5, Projectile.owner, 0);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), tipPosition, (firingVelocity * 1.3f) * Utils.GetLerpValue(60, 10, FiringTime, true), ModContent.ProjectileType<WingmanGrenade>(), (int)(Projectile.damage * 6), Projectile.knockBack * 5, Projectile.owner, 0, (Projectile.ai[2] == 1 ? -1 : 0));
|
||||
}
|
||||
else
|
||||
{
|
||||
SoundStyle fire = new("CalamityMod/Sounds/Item/MagnaCannonShot");
|
||||
SoundEngine.PlaySound(fire with { Volume = 0.25f, Pitch = 1f, PitchVariance = 0.35f }, Projectile.Center);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), tipPosition, firingVelocity * Utils.GetLerpValue(80, 10, FiringTime, true), ModContent.ProjectileType<WingmanShot>(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), tipPosition, firingVelocity * Utils.GetLerpValue(80, 10, FiringTime, true), ModContent.ProjectileType<WingmanShot>(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, (Projectile.ai[2] == 1 ? -1 : 0));
|
||||
}
|
||||
|
||||
// Inside here go all the things that dedicated servers shouldn't spend resources on.
|
||||
|
||||
@@ -36,8 +36,10 @@ namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
if (mainColor == Color.White)
|
||||
{
|
||||
if (Projectile.ai[1] == -1)
|
||||
mainColor = Color.Turquoise;
|
||||
if (Projectile.ai[1] == 0)
|
||||
mainColor = Color.HotPink;
|
||||
mainColor = Color.Orchid;
|
||||
if (Projectile.ai[1] == 1)
|
||||
mainColor = Color.MediumSlateBlue;
|
||||
if (Projectile.ai[1] == 2)
|
||||
|
||||
@@ -0,0 +1,324 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CalamityMod.Effects;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.NPCs.Deconstructors;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Projectiles.BaseProjectiles;
|
||||
using CalamityMod.Systems;
|
||||
using CalamityMod.Systems.Mechanic;
|
||||
using CalamityMod.Tiles.Ores;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Pets
|
||||
{
|
||||
public class BurrowerPet : BaseWormProjectile, ILocalizedModType
|
||||
{
|
||||
public override string Texture => "CalamityMod/NPCs/Deconstructors/DeconstructorMK1Head";
|
||||
public override List<string> SegmentTextures => new()
|
||||
{
|
||||
"CalamityMod/NPCs/Deconstructors/DeconstructorMK1Body",
|
||||
"CalamityMod/NPCs/Deconstructors/DeconstructorMK1BodyAlt1",
|
||||
"CalamityMod/NPCs/Deconstructors/DeconstructorMK1BodyAlt2",
|
||||
"CalamityMod/NPCs/Deconstructors/DeconstructorMK1Tail"
|
||||
};
|
||||
|
||||
public override List<string?> GlowTextures => new()
|
||||
{
|
||||
null,
|
||||
"CalamityMod/NPCs/Deconstructors/DeconstructorMK1BodyGlow",
|
||||
"CalamityMod/NPCs/Deconstructors/DeconstructorMK1BodyAlt1Glow",
|
||||
"CalamityMod/NPCs/Deconstructors/DeconstructorMK1BodyAlt2Glow"
|
||||
};
|
||||
public override int SegmentCount => 3;
|
||||
|
||||
public override List<float> SegmentTypePositionOffsets => new()
|
||||
{
|
||||
32,
|
||||
32,
|
||||
32,
|
||||
32,
|
||||
32
|
||||
};
|
||||
public new string LocalizationCategory => "Projectiles.Pets";
|
||||
public Player Owner => Main.player[Projectile.owner];
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.projPet[Type] = true;
|
||||
ProjectileID.Sets.LightPet[Type] = true;
|
||||
base.SetStaticDefaults();
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
ProjectileID.Sets.DrawScreenCheckFluff[Type] = 1600; //100 tiles offscreen
|
||||
Projectile.width = 38;
|
||||
Projectile.height = 38;
|
||||
Projectile.friendly = true;
|
||||
Projectile.netImportant = true;
|
||||
Projectile.penetrate = -1;
|
||||
Projectile.tileCollide = false;
|
||||
Projectile.ignoreWater = true;
|
||||
for (var i = 0; i < SegmentCount - 1; i++)
|
||||
{
|
||||
Segments.Add(new BaseWormSegment(this, i % 3));
|
||||
}
|
||||
Segments.Add(new BaseWormSegment(this, 3));
|
||||
}
|
||||
|
||||
public bool VerifyOwnerIsPresent()
|
||||
{
|
||||
// No logic should be run if the player is no longer active in the game.
|
||||
if (!Owner.active)
|
||||
{
|
||||
Projectile.Kill();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Owner.dead)
|
||||
Owner.Calamity().burrowerPet = false;
|
||||
if (Owner.Calamity().burrowerPet)
|
||||
Projectile.timeLeft = 2;
|
||||
|
||||
return false;
|
||||
}
|
||||
#region AI Variables
|
||||
|
||||
public enum AttackState
|
||||
{
|
||||
Idle,
|
||||
Mining,
|
||||
Shocked
|
||||
}
|
||||
public AttackState ActiveAttackState
|
||||
{
|
||||
get { return (AttackState)Projectile.ai[1]; }
|
||||
set { Projectile.ai[1] = (float)value; }
|
||||
}
|
||||
public float MainTimer
|
||||
{
|
||||
get { return Projectile.ai[0]; }
|
||||
set { Projectile.ai[0] = value; }
|
||||
}
|
||||
|
||||
public float AttackSubstate
|
||||
{
|
||||
get { return Projectile.ai[2]; }
|
||||
set { Projectile.ai[2] = value; }
|
||||
}
|
||||
|
||||
public float StateChangeCounter
|
||||
{
|
||||
get { return Projectile.ai[3]; }
|
||||
set { Projectile.ai[3] = value; }
|
||||
}
|
||||
public float VelocityRotation
|
||||
{
|
||||
|
||||
get { return Projectile.velocity.ToRotation(); }
|
||||
set { Projectile.velocity = value.ToRotationVector2() * Projectile.velocity.Length(); }
|
||||
}
|
||||
|
||||
public Vector2 TargetVector = Vector2.Zero;
|
||||
public Vector2 SecondaryVector = Vector2.Zero;
|
||||
public float StoredValue = 0;
|
||||
#endregion
|
||||
|
||||
public void SwitchAttackState(AttackState State, float Substate = 0, bool resetVector = true)
|
||||
{
|
||||
Projectile.netUpdate = true;
|
||||
ActiveAttackState = State;
|
||||
AttackSubstate = Substate;
|
||||
MainTimer = 0;
|
||||
if (resetVector)
|
||||
TargetVector = Vector2.Zero;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (VerifyOwnerIsPresent())
|
||||
return;
|
||||
|
||||
HandleAIStates();
|
||||
MainTimer++;
|
||||
UpdateSegments();
|
||||
}
|
||||
private void LowerTargetToGround()
|
||||
{
|
||||
var pointToCheck = TargetVector.ToTileCoordinates();
|
||||
for (var i = 0; i < 50; i++)
|
||||
{
|
||||
if (pointToCheck.X < 0 || pointToCheck.X >= Main.maxTilesX || pointToCheck.Y < 0 || pointToCheck.Y >= Main.maxTilesY)
|
||||
return;
|
||||
var targetTile = Main.tile[pointToCheck];
|
||||
if (targetTile == null || !targetTile.HasTile || !targetTile.IsTileSolidGround())
|
||||
pointToCheck.Y += 1;
|
||||
else
|
||||
{
|
||||
TargetVector = pointToCheck.ToWorldCoordinates() - new Vector2(0, 16);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void HandleAIStates()
|
||||
{
|
||||
Player player = Main.player[Projectile.owner];
|
||||
SegmentMaxRotation = 0.65f;
|
||||
SegmentRigidity = 0.2f;
|
||||
var distanceToPlayer = Projectile.Distance(player.Center);
|
||||
bool onScreen = true;
|
||||
if (Main.netMode == NetmodeID.SinglePlayer) //In singleplayer we base the "off screen" check on the actual screen. In multiplayer, we base it off the maximum zoom size.
|
||||
{
|
||||
onScreen = Collision.CheckAABBvAABBCollision(Projectile.position, Projectile.Size, Main.screenPosition, Main.ScreenSize.ToVector2());
|
||||
}
|
||||
else
|
||||
{
|
||||
//Terraria forces the game view to never go above 1920x1200px, regardless of actual resolution. This code marks the "off screen box" to match that maximum size game viewport. (960x600 is half of 1920x1200)
|
||||
onScreen = Collision.CheckAABBvAABBCollision(Projectile.position, Projectile.Size, player.Center - new Vector2(960, 600), new Vector2(1920, 1200));
|
||||
}
|
||||
bool noGravity = (!onScreen || Projectile.wet || Collision.SolidCollision(Projectile.position, Projectile.width, Projectile.height, true));
|
||||
switch (ActiveAttackState)
|
||||
{
|
||||
case AttackState.Idle:
|
||||
{
|
||||
if (TargetVector == Vector2.Zero || MainTimer > 300 || (MainTimer > 120 && Projectile.Distance(TargetVector) < 64))
|
||||
{
|
||||
if (Main.rand.NextBool())
|
||||
{
|
||||
var veins = Burrower.FindOreVeins(Projectile.Center.ToTileCoordinates());
|
||||
while (veins.Count > 0)
|
||||
{
|
||||
var targetVein = veins[Main.rand.Next(veins.Count)];
|
||||
var foundTarget = Burrower.FindTargetFromVein(targetVein);
|
||||
if (foundTarget is not null)
|
||||
{
|
||||
TargetVector = foundTarget.Value.Item1.ToWorldCoordinates();
|
||||
SecondaryVector = foundTarget.Value.Item2.ToWorldCoordinates();
|
||||
if (Projectile.Distance(TargetVector) > 160)
|
||||
GeneralParticleHandler.SpawnParticle(new EmoteExpressionParticle(Projectile.Top, -Vector2.UnitY * 5, 2, ArsenalEffects.ArsenalGaussColor, 60, EmoteExpressionParticle.EmoteType.Exclamation));
|
||||
SwitchAttackState(AttackState.Mining, resetVector: false);
|
||||
return;
|
||||
}
|
||||
else
|
||||
veins.Remove(targetVein);
|
||||
}
|
||||
}
|
||||
TargetVector = player.Center;
|
||||
LowerTargetToGround();
|
||||
MainTimer = 0;
|
||||
}
|
||||
|
||||
var playerDistance = Projectile.Distance(Owner.Center);
|
||||
float speed = 0.06f;
|
||||
if (playerDistance > CalamityUtils.TilesToPixels(150))
|
||||
{
|
||||
Projectile.Center = Owner.Center - Projectile.velocity.SafeNormalize(-Vector2.UnitY) * 200;
|
||||
Projectile.velocity = Projectile.velocity.ClampMagnitude(1, 8);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (playerDistance < 600 && !noGravity)
|
||||
Projectile.velocity.Y += 0.5f;
|
||||
if (playerDistance > 600)
|
||||
speed = 0.5f;
|
||||
if (playerDistance > 200f)
|
||||
speed = 0.4f;
|
||||
else if (playerDistance > 140f)
|
||||
speed = 0.2f;
|
||||
if (playerDistance > 100)
|
||||
Projectile.velocity += Projectile.DirectionTo(Owner.Center) * speed;
|
||||
else if (Projectile.velocity.Length() > 2)
|
||||
Projectile.velocity *= 0.9f;
|
||||
|
||||
Projectile.velocity = Projectile.velocity.ClampMagnitude(0, 16);
|
||||
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case AttackState.Mining:
|
||||
{
|
||||
Projectile.velocity += Projectile.DirectionTo(SecondaryVector).SafeNormalize(Vector2.UnitY);
|
||||
Projectile.velocity *= 0.9f;
|
||||
if (MainTimer > 600)
|
||||
SwitchAttackState(AttackState.Idle);
|
||||
if (Projectile.Distance(SecondaryVector) < 4)
|
||||
{
|
||||
var dir = SecondaryVector.DirectionTo(TargetVector);
|
||||
|
||||
if (Main.tile[TargetVector.ToTileCoordinates()].TileType == ModContent.TileType<AuricOre>())
|
||||
{
|
||||
Projectile.velocity = -Projectile.DirectionTo(TargetVector) * 16;
|
||||
Projectile.Center = SecondaryVector + Projectile.velocity;
|
||||
Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2;
|
||||
SwitchAttackState(AttackState.Shocked, 300); //Shock for 5 seconds
|
||||
AuricOre.Animate = true;
|
||||
SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/ExoMechs/TeslaShoot1"), Projectile.Center);
|
||||
return;
|
||||
}
|
||||
SegmentRigidity = 0f;
|
||||
Projectile.velocity = Vector2.Zero;
|
||||
Projectile.rotation = SecondaryVector.DirectionTo(TargetVector).ToRotation() + MathHelper.PiOver2;
|
||||
|
||||
if (Main.netMode != NetmodeID.Server && !(BurrowerPingTileEffect.Instance.Active))
|
||||
TilePingerSystem.AddPing(BurrowerPingTileEffect.Instance, Projectile.Center, player);
|
||||
for (int i = 0; i < 1; i++)
|
||||
{
|
||||
int sparkLifetime = Main.rand.Next(10, 20);
|
||||
float sparkScale = Main.rand.NextFloat(0.8f, 1f);
|
||||
Color sparkColor = Color.Lerp(Color.Silver, Color.Gold, Main.rand.NextFloat(0.7f));
|
||||
sparkColor = Color.Lerp(sparkColor, Color.Orange, Main.rand.NextFloat());
|
||||
|
||||
if (Main.rand.NextBool(10))
|
||||
sparkScale *= 2f;
|
||||
|
||||
Vector2 sparkVelocity = dir.RotatedByRandom(0.6f) * Main.rand.NextFloat(6f, 16f);
|
||||
SparkParticle spark = new SparkParticle((TargetVector + SecondaryVector) * 0.5f, -sparkVelocity, true, sparkLifetime, sparkScale, sparkColor);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
|
||||
if (MainTimer < 520)
|
||||
MainTimer = 520;
|
||||
}
|
||||
SoundEngine.PlaySound(SoundID.NPCHit18 with { Volume = 0.2f }, Projectile.Center);
|
||||
}
|
||||
else
|
||||
Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X) + MathHelper.PiOver2;
|
||||
break;
|
||||
}
|
||||
case AttackState.Shocked:
|
||||
{
|
||||
|
||||
if (AttackSubstate > 0)
|
||||
AttackSubstate--;
|
||||
else
|
||||
{
|
||||
SwitchAttackState(AttackState.Idle);
|
||||
break;
|
||||
}
|
||||
if (noGravity)
|
||||
{
|
||||
SegmentRigidity = 0;
|
||||
if (AttackSubstate < 295) //5 frames to get out of the auric ore that rejected it before it slows down from tiles
|
||||
Projectile.velocity *= 0.55f;
|
||||
foreach (var item in Segments)
|
||||
{
|
||||
if (!Collision.SolidCollision(item.Center - new Vector2(19, 17), 38, 38, true))
|
||||
item.Center.Y += 2f;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Projectile.velocity.Y += 0.5f;
|
||||
Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X) + MathHelper.PiOver2;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,29 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
ShotTimer = 4;
|
||||
var spawnpos = Projectile.Center;
|
||||
var dir = spawnpos.DirectionTo(Main.MouseWorld);
|
||||
Projectile.NewProjectile(Owner.GetSource_ItemUse_WithPotentialAmmo(Halley, AmmoID.Gel), spawnpos + dir * 16,dir * Halley.shootSpeed * 0.75f, ModContent.ProjectileType<HalleysStarburst>(), (int)Owner.GetDamage(DamageClass.Ranged).ApplyTo(Halley.damage), Halley.knockBack, Projectile.owner);
|
||||
var color = Main.rand.Next(1, 7);
|
||||
Color drawColor = Color.White;
|
||||
switch (color)
|
||||
{
|
||||
case 1:
|
||||
drawColor = Color.HotPink;
|
||||
break;
|
||||
case 2:
|
||||
drawColor = Color.Yellow;
|
||||
break;
|
||||
case 3:
|
||||
drawColor = Color.LimeGreen;
|
||||
break;
|
||||
case 4:
|
||||
drawColor = Color.SkyBlue;
|
||||
break;
|
||||
case 5:
|
||||
drawColor = Color.Lavender;
|
||||
break;
|
||||
}
|
||||
for (var i = 0; i < 5; i++)
|
||||
GeneralParticleHandler.SpawnParticle(new GlowSparkParticle(spawnpos + dir * 36, (dir * Halley.shootSpeed).RotatedByRandom(0.75f) * Main.rand.NextFloat(0.5f, 1.5f), false, 7, 0.02f, drawColor, new Vector2(0.5f, 1f)));
|
||||
Projectile.NewProjectile(Owner.GetSource_ItemUse_WithPotentialAmmo(Halley, AmmoID.Gel), spawnpos + dir * 16,dir * Halley.shootSpeed * 0.75f, ModContent.ProjectileType<HalleysStarburst>(), (int)Owner.GetDamage(DamageClass.Ranged).ApplyTo(Halley.damage), Halley.knockBack, Projectile.owner, color);
|
||||
Owner.Calamity().StratusStarburst--;
|
||||
SoundEngine.PlaySound(HalleysInferno.ShootSound);
|
||||
RecoilAmount = 4;
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
Projectile.ignoreWater = true;
|
||||
Projectile.DamageType = DamageClass.Ranged;
|
||||
Projectile.penetrate = 1;
|
||||
Projectile.MaxUpdates = 4;
|
||||
Projectile.MaxUpdates = 6;
|
||||
Projectile.timeLeft = 60 * Projectile.MaxUpdates;
|
||||
Projectile.usesLocalNPCImmunity = true;
|
||||
Projectile.localNPCHitCooldown = -1;
|
||||
@@ -42,28 +42,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
if (drawColor == Color.Black)
|
||||
{
|
||||
switch (Main.rand.Next(1, 7))
|
||||
{
|
||||
case 1:
|
||||
drawColor = Color.HotPink;
|
||||
break;
|
||||
case 2:
|
||||
drawColor = Color.Yellow;
|
||||
break;
|
||||
case 3:
|
||||
drawColor = Color.LimeGreen;
|
||||
break;
|
||||
case 4:
|
||||
drawColor = Color.SkyBlue;
|
||||
break;
|
||||
case 5:
|
||||
drawColor = Color.Lavender;
|
||||
break;
|
||||
case 6:
|
||||
|
||||
drawColor = Color.White;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
Projectile.rotation += Projectile.direction * 0.05f;
|
||||
if (Projectile.FinalExtraUpdate())
|
||||
@@ -90,7 +69,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
if (drawColor == Color.Black)
|
||||
{
|
||||
switch (Main.rand.Next(1, 7))
|
||||
switch (Projectile.ai[0])
|
||||
{
|
||||
case 1:
|
||||
drawColor = Color.HotPink;
|
||||
|
||||
@@ -33,8 +33,8 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
public int maxStealthHits = 5; // How many bounces the stealth strike has. This does not include the inital and final hit, so be sure to take those into account if you adjust this.
|
||||
|
||||
public Color mainColor = Color.White;
|
||||
public Color c1 = new Color(121, 240, 17);
|
||||
public Color c2 = new Color(0, 208, 240);
|
||||
public Color c1 = Color.Turquoise;
|
||||
public Color c2 = Color.Orchid;
|
||||
|
||||
public NPC lastHitTarget;
|
||||
public override void SetDefaults()
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(Projectile.Center, Color.GreenYellow.ToVector3());
|
||||
Lighting.AddLight(Projectile.Center, Color.GreenYellow.ToVector3()*0.75f);
|
||||
|
||||
//Idle chainsaw sounds
|
||||
if ((!SoundEngine.TryGetActiveSound(IdlingSoundSlot, out var idleSoundOut)))
|
||||
|
||||
@@ -35,15 +35,19 @@ namespace CalamityMod.Systems
|
||||
MostAlternateDifficulties = 1;
|
||||
//Initialize base mod difficulties
|
||||
Difficulties = new List<DifficultyMode>() { ModContent.GetInstance<NoDifficulty>(),
|
||||
ModContent.GetInstance<ExpertDifficulty>(),
|
||||
ModContent.GetInstance<MasterDifficulty>(), ModContent.GetInstance<RevengeanceDifficulty>(),
|
||||
ModContent.GetInstance<DeathDifficulty>() };
|
||||
ModContent.GetInstance<ExpertDifficulty>(),ModContent.GetInstance<RevengeanceDifficulty>(),
|
||||
ModContent.GetInstance<MasterDifficulty>(), ModContent.GetInstance<DeathDifficulty>(),
|
||||
ModContent.GetInstance<LegendaryDifficulty>(), ModContent.GetInstance<MaliceDifficulty>() };
|
||||
|
||||
journeyDifficultyUpdateMethod = typeof(CreativePowers.DifficultySliderPower).GetMethod("UpdateInfoFromSliderValueCache", BindingFlags.Instance | BindingFlags.NonPublic);
|
||||
|
||||
CalculateDifficultyData();
|
||||
}
|
||||
|
||||
public override void PostWorldLoad()
|
||||
{
|
||||
CalculateDifficultyData(); //Reload difficulties upon loading a world to adjust for FTW.
|
||||
}
|
||||
public override void OnModUnload()
|
||||
{
|
||||
Difficulties = null;
|
||||
@@ -58,6 +62,16 @@ namespace CalamityMod.Systems
|
||||
{
|
||||
case GameModeID.Normal:
|
||||
{
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
// if death was activated, change it to revengence
|
||||
if (GetCurrentDifficulty.CountAs<DeathDifficulty>())
|
||||
{
|
||||
ModeIndicatorUI.SwitchToDifficulty(ModContent.GetInstance<RevengeanceDifficulty>(), broadcast: true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// vanilla game mode in classic, but cal difficulty >= expert
|
||||
if (GetCurrentDifficulty.CountAs<DeathDifficulty>() || GetCurrentDifficulty.CountAs<RevengeanceDifficulty>())
|
||||
{
|
||||
@@ -67,6 +81,15 @@ namespace CalamityMod.Systems
|
||||
}
|
||||
case GameModeID.Expert:
|
||||
{
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
if (GetCurrentDifficulty.CountAs<LegendaryDifficulty>())
|
||||
{
|
||||
ModeIndicatorUI.SwitchToDifficulty(ModContent.GetInstance<DeathDifficulty>(), broadcast: true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// if death was activated, change it to revengence
|
||||
if (GetCurrentDifficulty.CountAs<DeathDifficulty>())
|
||||
{
|
||||
@@ -76,6 +99,14 @@ namespace CalamityMod.Systems
|
||||
}
|
||||
case GameModeID.Master:
|
||||
{
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
if (!GetCurrentDifficulty.CountAs<MaliceDifficulty>() && CalamityWorld.revenge)
|
||||
{
|
||||
ModeIndicatorUI.SwitchToDifficulty(ModContent.GetInstance<MaliceDifficulty>(), broadcast: true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
// if revengence and master both activated, change it to death
|
||||
if (!GetCurrentDifficulty.CountAs<DeathDifficulty>() && CalamityWorld.revenge)
|
||||
{
|
||||
@@ -143,6 +174,10 @@ namespace CalamityMod.Systems
|
||||
|
||||
for (int i = 0; i < Difficulties.Count; i++)
|
||||
{
|
||||
//Only add difficulties that are allowed in the current world type;
|
||||
if ((Main.getGoodWorld && Difficulties[i].GetForTheWorthyDisplay == DifficultyMode.FTWDisplayMode.NotForTheWorthy)
|
||||
|| (!Main.getGoodWorld && Difficulties[i].GetForTheWorthyDisplay == DifficultyMode.FTWDisplayMode.OnlyForTheWorthy))
|
||||
continue;
|
||||
//if we are at a new tier, create a new list of difficulties at that tier.
|
||||
if (currentTier != Difficulties[i].DifficultyScale)
|
||||
{
|
||||
@@ -235,6 +270,12 @@ namespace CalamityMod.Systems
|
||||
|
||||
public abstract class DifficultyMode : ModType
|
||||
{
|
||||
public enum FTWDisplayMode
|
||||
{
|
||||
Always,
|
||||
OnlyForTheWorthy,
|
||||
NotForTheWorthy,
|
||||
}
|
||||
protected sealed override void Register()
|
||||
{
|
||||
ModTypeLookup<DifficultyMode>.Register(this);
|
||||
@@ -251,6 +292,11 @@ namespace CalamityMod.Systems
|
||||
public abstract Asset<Texture2D> Texture { get; }
|
||||
protected Asset<Texture2D> _textureDisabled;
|
||||
public abstract Asset<Texture2D> TextureDisabled { get; }
|
||||
|
||||
protected Asset<Texture2D> _outlineTexture;
|
||||
public abstract Asset<Texture2D> OutlineTexture { get; }
|
||||
public virtual FTWDisplayMode GetForTheWorthyDisplay { get; } = FTWDisplayMode.Always;
|
||||
|
||||
protected SoundStyle? _activationSound;
|
||||
public abstract SoundStyle ActivationSound { get; }
|
||||
public abstract int BackBoneGameModeID { get; }
|
||||
@@ -262,8 +308,8 @@ namespace CalamityMod.Systems
|
||||
public abstract LocalizedText ShortDescription { get; }
|
||||
public virtual LocalizedText ExpandedDescription => LocalizedText.Empty;
|
||||
|
||||
public abstract LocalizedText FTWName { get; }
|
||||
public abstract Color FTWTextColor { get; }
|
||||
public virtual LocalizedText FTWName { get; } = null;
|
||||
public virtual Color? FTWTextColor { get; } = null;
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -304,6 +350,8 @@ namespace CalamityMod.Systems
|
||||
|
||||
public override Asset<Texture2D> Texture => _texture ??= ModContent.Request<Texture2D>("CalamityMod/UI/ModeIndicator/ModeIndicator_Classic");
|
||||
|
||||
public override Asset<Texture2D> OutlineTexture => _outlineTexture ??= ModContent.Request<Texture2D>("CalamityMod/UI/ModeIndicator/ModeIndicator_Classic_Border");
|
||||
|
||||
public override Asset<Texture2D> TextureDisabled => _textureDisabled ??= ModContent.Request<Texture2D>("CalamityMod/UI/ModeIndicator/ModeIndicator_Classic_Off");
|
||||
|
||||
public override SoundStyle ActivationSound => _activationSound ??= SoundID.MenuTick with { Volume = 1f };
|
||||
@@ -317,17 +365,14 @@ namespace CalamityMod.Systems
|
||||
public override Color ChatTextColor => Color.White;
|
||||
|
||||
public override LocalizedText ShortDescription => GetText("UI.ClassicInfo");
|
||||
|
||||
public override LocalizedText FTWName => Language.GetText("UI.Expert");
|
||||
|
||||
public override Color FTWTextColor => new Color(255, 186, 117); // World display: Main.mcColor
|
||||
public override FTWDisplayMode GetForTheWorthyDisplay => FTWDisplayMode.NotForTheWorthy;
|
||||
}
|
||||
|
||||
public class ExpertDifficulty : DifficultyMode
|
||||
{
|
||||
public override bool Enabled
|
||||
{
|
||||
get => Main.getGoodWorld ? Main.masterMode : Main.expertMode;
|
||||
get => Main.expertMode;
|
||||
set
|
||||
{
|
||||
if (!Main.GameModeInfo.IsJourneyMode)
|
||||
@@ -342,32 +387,29 @@ namespace CalamityMod.Systems
|
||||
}
|
||||
|
||||
public override Asset<Texture2D> Texture => _texture ??= ModContent.Request<Texture2D>("CalamityMod/UI/ModeIndicator/ModeIndicator_Expert");
|
||||
public override Asset<Texture2D> OutlineTexture => _outlineTexture ??= ModContent.Request<Texture2D>("CalamityMod/UI/ModeIndicator/ModeIndicator_Expert_Border");
|
||||
|
||||
public override Asset<Texture2D> TextureDisabled => _textureDisabled ??= ModContent.Request<Texture2D>("CalamityMod/UI/ModeIndicator/ModeIndicator_Expert_Off");
|
||||
|
||||
public override SoundStyle ActivationSound => _activationSound ??= SoundID.ForceRoarPitched;
|
||||
|
||||
public override int BackBoneGameModeID => GameModeID.Expert;
|
||||
public override int BackBoneGameModeID => Main.getGoodWorld ? GameModeID.Normal : GameModeID.Expert;
|
||||
|
||||
public override float DifficultyScale => 0.1f;
|
||||
|
||||
public override LocalizedText Name => Language.GetText("UI.Expert");
|
||||
public override Color ChatTextColor => new Color(255, 186, 117); // World display: Main.mcColor
|
||||
public override Color ChatTextColor => Main.mcColor;
|
||||
|
||||
public override LocalizedText ShortDescription => GetText("UI.ExpertShortInfo");
|
||||
|
||||
public override LocalizedText ExpandedDescription => GetText("UI.ExpertExpandedInfo");
|
||||
|
||||
public override LocalizedText FTWName => Language.GetText("UI.Master");
|
||||
|
||||
public override Color FTWTextColor => new Color(28, 255, 170); // World display: Main.hcColor
|
||||
}
|
||||
|
||||
public class MasterDifficulty : DifficultyMode
|
||||
{
|
||||
public override bool Enabled
|
||||
{
|
||||
get => Main.getGoodWorld ? CalamityWorld.LegendaryMode : Main.masterMode;
|
||||
get => Main.masterMode;
|
||||
set
|
||||
{
|
||||
if (!Main.GameModeInfo.IsJourneyMode)
|
||||
@@ -382,26 +424,63 @@ namespace CalamityMod.Systems
|
||||
}
|
||||
|
||||
public override Asset<Texture2D> Texture => _texture ??= ModContent.Request<Texture2D>("CalamityMod/UI/ModeIndicator/ModeIndicator_Master");
|
||||
public override Asset<Texture2D> OutlineTexture => _outlineTexture ??= ModContent.Request<Texture2D>("CalamityMod/UI/ModeIndicator/ModeIndicator_Master_Border");
|
||||
|
||||
public override Asset<Texture2D> TextureDisabled => _textureDisabled ??= ModContent.Request<Texture2D>("CalamityMod/UI/ModeIndicator/ModeIndicator_Master_Off");
|
||||
|
||||
public override SoundStyle ActivationSound => _activationSound ??= SoundID.NPCDeath10;
|
||||
|
||||
public override int BackBoneGameModeID => GameModeID.Master;
|
||||
public override int BackBoneGameModeID => Main.getGoodWorld ? GameModeID.Expert : GameModeID.Master;
|
||||
|
||||
public override float DifficultyScale => 0.25f;
|
||||
|
||||
public override LocalizedText Name => Language.GetText("UI.Master");
|
||||
|
||||
public override Color ChatTextColor => new Color(28, 255, 170); // World display: Main.hcColor
|
||||
public override Color ChatTextColor => Main.hcColor;
|
||||
|
||||
public override LocalizedText ShortDescription => GetText("UI.MasterShortInfo");
|
||||
|
||||
public override LocalizedText ExpandedDescription => GetText("UI.MasterExpandedInfo");
|
||||
|
||||
public override LocalizedText FTWName => Language.GetText("UI.Legendary");
|
||||
}
|
||||
|
||||
public override Color FTWTextColor => Main.legendaryModeColor;
|
||||
public class LegendaryDifficulty : DifficultyMode
|
||||
{
|
||||
public override bool Enabled
|
||||
{
|
||||
get => CalamityWorld.LegendaryMode;
|
||||
set
|
||||
{
|
||||
if (!Main.GameModeInfo.IsJourneyMode)
|
||||
{
|
||||
Main.GameMode = value == true ? GameModeID.Master : GameModeID.Expert;
|
||||
}
|
||||
else
|
||||
{
|
||||
DifficultyModeSystem.AlignJourneyDifficultySlider();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override Asset<Texture2D> Texture => _texture ??= ModContent.Request<Texture2D>("CalamityMod/UI/ModeIndicator/ModeIndicator_Legendary");
|
||||
public override Asset<Texture2D> OutlineTexture => _outlineTexture ??= ModContent.Request<Texture2D>("CalamityMod/UI/ModeIndicator/ModeIndicator_Legendary_Border");
|
||||
|
||||
public override Asset<Texture2D> TextureDisabled => _textureDisabled ??= ModContent.Request<Texture2D>("CalamityMod/UI/ModeIndicator/ModeIndicator_Legendary_Off");
|
||||
|
||||
public override SoundStyle ActivationSound => _activationSound ??= SoundID.NPCDeath10;
|
||||
|
||||
public override int BackBoneGameModeID => GameModeID.Master;
|
||||
|
||||
public override float DifficultyScale => 0.5f;
|
||||
|
||||
public override LocalizedText Name => Language.GetText("UI.Legendary");
|
||||
|
||||
public override Color ChatTextColor => Main.legendaryModeColor;
|
||||
|
||||
public override LocalizedText ShortDescription => GetText("UI.LegendaryShortInfo");
|
||||
|
||||
public override LocalizedText ExpandedDescription => GetText("UI.LegendaryExpandedInfo");
|
||||
public override FTWDisplayMode GetForTheWorthyDisplay => FTWDisplayMode.OnlyForTheWorthy;
|
||||
|
||||
}
|
||||
|
||||
@@ -412,25 +491,22 @@ namespace CalamityMod.Systems
|
||||
get => CalamityWorld.revenge;
|
||||
set
|
||||
{
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
CalamityWorld.revenge = value;
|
||||
CalamityWorld.death = value;
|
||||
}
|
||||
else
|
||||
CalamityWorld.revenge = value;
|
||||
CalamityWorld.revenge = value;
|
||||
if (value && !Main.GameModeInfo.IsJourneyMode)
|
||||
Main.GameMode = BackBoneGameModeID;
|
||||
}
|
||||
}
|
||||
|
||||
public override Asset<Texture2D> Texture => _texture ??= ModContent.Request<Texture2D>("CalamityMod/UI/ModeIndicator/ModeIndicator_Rev");
|
||||
public override Asset<Texture2D> OutlineTexture => _outlineTexture ??= ModContent.Request<Texture2D>("CalamityMod/UI/ModeIndicator/ModeIndicator_Rev_Border");
|
||||
|
||||
public override Asset<Texture2D> TextureDisabled => _textureDisabled ??= ModContent.Request<Texture2D>("CalamityMod/UI/ModeIndicator/ModeIndicator_Rev_Off");
|
||||
|
||||
public override SoundStyle ActivationSound => _activationSound ??= SoundID.Item119;
|
||||
|
||||
public override int BackBoneGameModeID => GameModeID.Expert;
|
||||
public override int BackBoneGameModeID => Main.getGoodWorld ? GameModeID.Normal : GameModeID.Expert;
|
||||
|
||||
public override float DifficultyScale => 0.25f;
|
||||
public override float DifficultyScale => 0.1f;
|
||||
|
||||
public override LocalizedText Name => GetText("UI.Revengeance");
|
||||
|
||||
@@ -447,24 +523,20 @@ namespace CalamityMod.Systems
|
||||
return GetText("UI.RevengeanceExpandedInfo").WithFormatArgs(rageKey, adrenKey);
|
||||
}
|
||||
}
|
||||
|
||||
public override LocalizedText FTWName => GetText("UI.Death");
|
||||
|
||||
public override Color FTWTextColor => new Color(192, 64, 219);
|
||||
}
|
||||
|
||||
public class DeathDifficulty : DifficultyMode
|
||||
{
|
||||
public override bool Enabled
|
||||
{
|
||||
get => Main.getGoodWorld ? CalamityWorld.death && CalamityWorld.LegendaryMode : CalamityWorld.death;
|
||||
get => CalamityWorld.death;
|
||||
set
|
||||
{
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
if (!Main.GameModeInfo.IsJourneyMode)
|
||||
{
|
||||
Main.GameMode = value == true ? GameModeID.Master : GameModeID.Expert;
|
||||
Main.GameMode = value == true ? GameModeID.Expert : GameModeID.Normal;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -473,19 +545,24 @@ namespace CalamityMod.Systems
|
||||
CalamityWorld.death = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
CalamityWorld.death = value;
|
||||
if (value && !Main.GameModeInfo.IsJourneyMode)
|
||||
Main.GameMode = BackBoneGameModeID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override Asset<Texture2D> Texture => _texture ??= ModContent.Request<Texture2D>("CalamityMod/UI/ModeIndicator/ModeIndicator_Death");
|
||||
public override Asset<Texture2D> OutlineTexture => _outlineTexture ??= ModContent.Request<Texture2D>("CalamityMod/UI/ModeIndicator/ModeIndicator_Death_Border");
|
||||
|
||||
public override Asset<Texture2D> TextureDisabled => _textureDisabled ??= ModContent.Request<Texture2D>("CalamityMod/UI/ModeIndicator/ModeIndicator_Death_Off");
|
||||
|
||||
public override SoundStyle ActivationSound => _activationSound ??= DemonshadeHelm.ActivationSound;
|
||||
|
||||
public override int BackBoneGameModeID => GameModeID.Master;
|
||||
public override int BackBoneGameModeID => Main.getGoodWorld ? GameModeID.Expert : GameModeID.Master;
|
||||
|
||||
public override float DifficultyScale => 0.5f;
|
||||
public override float DifficultyScale => 0.25f;
|
||||
|
||||
public override LocalizedText Name => GetText("UI.Death");
|
||||
|
||||
@@ -495,11 +572,6 @@ namespace CalamityMod.Systems
|
||||
|
||||
public override LocalizedText ExpandedDescription => GetText("UI.DeathExpandedInfo");
|
||||
|
||||
|
||||
public override LocalizedText FTWName => GetText("UI.Malice");
|
||||
|
||||
public override Color FTWTextColor => new Color(240, 128, 128);
|
||||
|
||||
public override int[] FavoredDifficultyAtTier(int tier)
|
||||
{
|
||||
DifficultyMode[] tierList = DifficultyModeSystem.DifficultyTiers[tier];
|
||||
@@ -518,4 +590,66 @@ namespace CalamityMod.Systems
|
||||
return difficulties.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
public class MaliceDifficulty : DifficultyMode
|
||||
{
|
||||
public override bool Enabled
|
||||
{
|
||||
get => Main.getGoodWorld ? CalamityWorld.death && CalamityWorld.LegendaryMode : false;
|
||||
set
|
||||
{
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
if (!Main.GameModeInfo.IsJourneyMode)
|
||||
{
|
||||
Main.GameMode = value == true ? GameModeID.Master : GameModeID.Expert;
|
||||
}
|
||||
else
|
||||
{
|
||||
DifficultyModeSystem.AlignJourneyDifficultySlider();
|
||||
}
|
||||
CalamityWorld.revenge = value;
|
||||
CalamityWorld.death = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override Asset<Texture2D> Texture => _texture ??= ModContent.Request<Texture2D>("CalamityMod/UI/ModeIndicator/ModeIndicator_Malice");
|
||||
public override Asset<Texture2D> OutlineTexture => _outlineTexture ??= ModContent.Request<Texture2D>("CalamityMod/UI/ModeIndicator/ModeIndicator_Malice_Border");
|
||||
|
||||
public override Asset<Texture2D> TextureDisabled => _textureDisabled ??= ModContent.Request<Texture2D>("CalamityMod/UI/ModeIndicator/ModeIndicator_Malice_Off");
|
||||
|
||||
public override SoundStyle ActivationSound => _activationSound ??= DemonshadeHelm.ActivationSound;
|
||||
|
||||
public override int BackBoneGameModeID => GameModeID.Master;
|
||||
|
||||
public override float DifficultyScale => 0.5f;
|
||||
|
||||
public override LocalizedText Name => GetText("UI.Malice");
|
||||
|
||||
public override Color ChatTextColor => new Color(240, 128, 128);
|
||||
|
||||
public override LocalizedText ShortDescription => GetText("UI.MaliceShortInfo");
|
||||
|
||||
public override LocalizedText ExpandedDescription => GetText("UI.MaliceExpandedInfo");
|
||||
public override FTWDisplayMode GetForTheWorthyDisplay => FTWDisplayMode.OnlyForTheWorthy;
|
||||
|
||||
public override int[] FavoredDifficultyAtTier(int tier)
|
||||
{
|
||||
DifficultyMode[] tierList = DifficultyModeSystem.DifficultyTiers[tier];
|
||||
|
||||
List<int> difficulties = new List<int>();
|
||||
|
||||
for (int i = 0; i < tierList.Length; i++)
|
||||
{
|
||||
if (tierList[i] is MasterDifficulty || tierList[i] is DeathDifficulty)
|
||||
difficulties.Add(i);
|
||||
}
|
||||
|
||||
if (difficulties.Count <= 0)
|
||||
difficulties.Add(0);
|
||||
|
||||
return difficulties.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -153,7 +153,7 @@ namespace CalamityMod.Systems
|
||||
|
||||
// Move spawn point in Celebrationmk10 to not be in the Sulphurous Sea
|
||||
int spawnPointIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Spawn Point"));
|
||||
if (spawnPointIndex != -1 && WorldGen.tenthAnniversaryWorldGen && !WorldGen.getGoodWorldGen)
|
||||
if (spawnPointIndex != -1 && WorldGen.tenthAnniversaryWorldGen && !WorldGen.remixWorldGen)
|
||||
{
|
||||
tasks.Insert(spawnPointIndex + 1, new PassLegacy("Fix Tenth Anniversary Spawn", (progress, config) =>
|
||||
{
|
||||
@@ -499,111 +499,6 @@ namespace CalamityMod.Systems
|
||||
}
|
||||
}
|
||||
|
||||
// Give Dead Man's Chests better loot.
|
||||
if (isDeadManChest)
|
||||
{
|
||||
for (int inventoryIndex = 0; inventoryIndex < 40; inventoryIndex++)
|
||||
{
|
||||
// Cavern Dead Man's Chests
|
||||
if (chest.y > GenVars.lavaLine || (chest.y <= GenVars.lavaLine && Main.remixWorld))
|
||||
{
|
||||
if (chest.item[inventoryIndex].type == ItemID.Dynamite)
|
||||
chest.item[inventoryIndex].SetDefaults(ItemID.StickyDynamite);
|
||||
|
||||
if (chest.item[inventoryIndex].type == ItemID.JestersArrow)
|
||||
{
|
||||
chest.item[inventoryIndex].SetDefaults(ItemID.HolyArrow);
|
||||
chest.item[inventoryIndex].stack = WorldGen.genRand.Next(25, 51);
|
||||
}
|
||||
|
||||
if (chest.item[inventoryIndex].type == ItemID.SilverBar ||
|
||||
chest.item[inventoryIndex].type == ItemID.TungstenBar ||
|
||||
chest.item[inventoryIndex].type == ItemID.GoldBar ||
|
||||
chest.item[inventoryIndex].type == ItemID.PlatinumBar)
|
||||
chest.item[inventoryIndex].stack = WorldGen.genRand.Next(6, 16);
|
||||
|
||||
if (chest.item[inventoryIndex].type == ItemID.FlamingArrow)
|
||||
{
|
||||
chest.item[inventoryIndex].SetDefaults(ItemID.HellfireArrow);
|
||||
chest.item[inventoryIndex].stack = WorldGen.genRand.Next(25, 51);
|
||||
}
|
||||
|
||||
if (chest.item[inventoryIndex].type == ItemID.ThrowingKnife)
|
||||
{
|
||||
chest.item[inventoryIndex].SetDefaults(ItemID.PoisonedKnife);
|
||||
chest.item[inventoryIndex].stack = WorldGen.genRand.Next(25, 51);
|
||||
}
|
||||
|
||||
if (chest.item[inventoryIndex].type == ItemID.HealingPotion)
|
||||
{
|
||||
chest.item[inventoryIndex].SetDefaults(ItemID.RestorationPotion);
|
||||
chest.item[inventoryIndex].stack = WorldGen.genRand.Next(3, 6);
|
||||
}
|
||||
|
||||
if (chest.item[inventoryIndex].type == ItemID.RecallPotion)
|
||||
chest.item[inventoryIndex].SetDefaults(ItemID.PotionOfReturn);
|
||||
|
||||
if (chest.item[inventoryIndex].type == ItemID.Torch)
|
||||
{
|
||||
chest.item[inventoryIndex].SetDefaults(ItemID.UltrabrightTorch);
|
||||
chest.item[inventoryIndex].stack = WorldGen.genRand.Next(15, 30);
|
||||
}
|
||||
|
||||
if (chest.item[inventoryIndex].type == ItemID.Glowstick)
|
||||
{
|
||||
chest.item[inventoryIndex].SetDefaults(ItemID.SpelunkerGlowstick);
|
||||
chest.item[inventoryIndex].stack = WorldGen.genRand.Next(15, 30);
|
||||
}
|
||||
|
||||
if (chest.item[inventoryIndex].type == ItemID.GoldCoin)
|
||||
chest.item[inventoryIndex].stack = WorldGen.genRand.Next(2, 4);
|
||||
}
|
||||
|
||||
// Underground Dead Man's Chests
|
||||
else
|
||||
{
|
||||
if (chest.item[inventoryIndex].type == ItemID.Bomb)
|
||||
{
|
||||
chest.item[inventoryIndex].SetDefaults(ItemID.StickyBomb);
|
||||
chest.item[inventoryIndex].stack = WorldGen.genRand.Next(10, 20);
|
||||
}
|
||||
|
||||
if (chest.item[inventoryIndex].type == ItemID.Rope)
|
||||
chest.item[inventoryIndex].stack = WorldGen.genRand.Next(100, 201);
|
||||
|
||||
if (chest.item[inventoryIndex].type == ItemID.IronBar ||
|
||||
chest.item[inventoryIndex].type == ItemID.LeadBar ||
|
||||
chest.item[inventoryIndex].type == ItemID.SilverBar ||
|
||||
chest.item[inventoryIndex].type == ItemID.TungstenBar)
|
||||
chest.item[inventoryIndex].stack = WorldGen.genRand.Next(10, 20);
|
||||
|
||||
if (chest.item[inventoryIndex].type == ItemID.WoodenArrow)
|
||||
{
|
||||
chest.item[inventoryIndex].SetDefaults(ItemID.FlamingArrow);
|
||||
chest.item[inventoryIndex].stack = WorldGen.genRand.Next(25, 50);
|
||||
}
|
||||
|
||||
if (chest.item[inventoryIndex].type == ItemID.Shuriken)
|
||||
{
|
||||
chest.item[inventoryIndex].SetDefaults(ItemID.ThrowingKnife);
|
||||
chest.item[inventoryIndex].stack = WorldGen.genRand.Next(25, 50);
|
||||
}
|
||||
|
||||
if (chest.item[inventoryIndex].type == ItemID.LesserHealingPotion)
|
||||
{
|
||||
chest.item[inventoryIndex].SetDefaults(ItemID.HealingPotion);
|
||||
chest.item[inventoryIndex].stack = WorldGen.genRand.Next(3, 6);
|
||||
}
|
||||
|
||||
if (chest.item[inventoryIndex].type == ItemID.SilverCoin)
|
||||
{
|
||||
chest.item[inventoryIndex].SetDefaults(ItemID.GoldCoin);
|
||||
chest.item[inventoryIndex].stack = WorldGen.genRand.Next(1, 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Adds Desert Medallion and The Comb to Sandstone Chests, each at a 20% chance
|
||||
if (isSandstoneChest)
|
||||
{
|
||||
|
||||
|
Before Width: | Height: | Size: 248 B |
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using CalamityMod.CalPlayer;
|
||||
@@ -7,6 +8,7 @@ using CalamityMod.Packets;
|
||||
using CalamityMod.Systems;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
@@ -23,15 +25,15 @@ namespace CalamityMod.UI.ModeIndicator
|
||||
{
|
||||
public static Rectangle MouseScreenArea => Utils.CenteredRectangle(Main.MouseScreen, Vector2.One * 2f);
|
||||
|
||||
public static Vector2 FrameSize => new Vector2(30f, 38f);
|
||||
public static Vector2 FrameSize => new Vector2(74f, 74f);
|
||||
public static Rectangle MainClickArea => Utils.CenteredRectangle(DrawCenter, FrameSize * MainIconScale);
|
||||
public static bool ClickingMouse => Main.mouseLeft && Main.mouseLeftRelease;
|
||||
public static Vector2 DrawCenter => new Vector2(Main.screenWidth - 400f - WidthForTier(MostAlternateDifficulties) * 0.5f, 82f) + FrameSize * 0.5f;
|
||||
|
||||
private static int GlowFadeAnimLength = 40;
|
||||
private static int GlowFadeAnimLength = 20;
|
||||
public static int GlowFadeTime = 0;
|
||||
//Lock icon
|
||||
internal const int LockAnimLength = 30;
|
||||
internal const int LockAnimLength = 15;
|
||||
private static int lockClickTime = 0;
|
||||
private static bool previousLockStatus = false;
|
||||
//Expand and shrink on hover
|
||||
@@ -43,10 +45,10 @@ namespace CalamityMod.UI.ModeIndicator
|
||||
public static float MainIconScale => 1f + iconHoverScaleBoost;
|
||||
//Menu state
|
||||
private static bool menuOpen = false;
|
||||
internal static int MenuAnimLength => MostAlternateDifficulties > 1 ? 60 : 40;
|
||||
internal static int MenuAnimLength => MostAlternateDifficulties > 1 ? 30 : 20;
|
||||
private static int menuOpenTransitionTime = 0;
|
||||
private static DifficultyMode previouslyHoveredMode = null;
|
||||
public static float WidthForTier(int alts) => (alts - 1) * 44f;
|
||||
public static float WidthForTier(int alts) => (alts - 1) * 76f;
|
||||
|
||||
private static void ClearVariables()
|
||||
{
|
||||
@@ -204,14 +206,14 @@ namespace CalamityMod.UI.ModeIndicator
|
||||
if (MouseScreenArea.Intersects(MainClickArea))
|
||||
{
|
||||
//Display the first non-none difficulty by default
|
||||
string modeToDisplay = Main.getGoodWorld ? Difficulties[0].FTWName.ToString() : Difficulties[1].Name.ToString();
|
||||
string modeToDisplay = Main.getGoodWorld && Difficulties[0].FTWName is not null ? Difficulties[0].FTWName.ToString() : Difficulties[1].Name.ToString();
|
||||
bool anyActiveMode = Main.getGoodWorld ? true : false;
|
||||
|
||||
for (int i = 1; i < Difficulties.Count; i++)
|
||||
{
|
||||
if (GetCurrentDifficulty == Difficulties[i])
|
||||
{
|
||||
modeToDisplay = Main.getGoodWorld ? Difficulties[i].FTWName.ToString() : Difficulties[i].Name.ToString();
|
||||
modeToDisplay = Main.getGoodWorld && Difficulties[i].FTWName is not null ? Difficulties[i].FTWName.ToString() : Difficulties[i].Name.ToString();
|
||||
anyActiveMode = true;
|
||||
}
|
||||
}
|
||||
@@ -295,12 +297,10 @@ namespace CalamityMod.UI.ModeIndicator
|
||||
public static void ManageHexIcons(SpriteBatch spriteBatch, out string text)
|
||||
{
|
||||
int tiers = DifficultyTiers.Count();
|
||||
float barLength = 68 * tiers * BarExpansionProgress;
|
||||
float barLength = 90 * tiers * BarExpansionProgress;
|
||||
float progress = menuOpen ? 1 - menuOpenTransitionTime / (float)MenuAnimLength : menuOpenTransitionTime / (float)MenuAnimLength;
|
||||
Vector2 basePosition = DrawCenter + (barLength / (float)(tiers + 1f)) * Vector2.UnitY;
|
||||
|
||||
Texture2D outlineTexture = ModContent.Request<Texture2D>("CalamityMod/UI/ModeIndicator/ModeIndicatorOutline").Value;
|
||||
|
||||
text = string.Empty;
|
||||
bool modeHovered = false;
|
||||
Vector2 positionOffset = (barLength / (float)(tiers + 1f)) * Vector2.UnitY;
|
||||
@@ -332,6 +332,7 @@ namespace CalamityMod.UI.ModeIndicator
|
||||
if (mode == GetCurrentDifficulty)
|
||||
{
|
||||
usedOpacity = 1f;
|
||||
Texture2D outlineTexture = mode.OutlineTexture.Value;
|
||||
spriteBatch.Draw(outlineTexture, iconPosition, null, mode.ChatTextColor * progressMult, 0f, outlineTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f);
|
||||
}
|
||||
|
||||
@@ -368,9 +369,10 @@ namespace CalamityMod.UI.ModeIndicator
|
||||
#region Difficulty toggling
|
||||
public static string GetDifficultyText(DifficultyMode mode)
|
||||
{
|
||||
LocalizedText preface = Main.getGoodWorld ? mode.FTWName : mode.Name;
|
||||
bool useFTWName = mode.FTWName is not null && Main.getGoodWorld;
|
||||
LocalizedText preface = useFTWName ? mode.FTWName : mode.Name;
|
||||
if (mode == GetCurrentDifficulty)
|
||||
preface = CalamityUtils.GetText("UI.CurrentlySelected").WithFormatArgs(Main.getGoodWorld ? mode.FTWName.ToString() : mode.Name.ToString());
|
||||
preface = CalamityUtils.GetText("UI.CurrentlySelected").WithFormatArgs(useFTWName ? mode.FTWName.ToString() : mode.Name.ToString());
|
||||
|
||||
string text = "\n" + mode.ShortDescription.ToString();
|
||||
|
||||
@@ -396,8 +398,8 @@ namespace CalamityMod.UI.ModeIndicator
|
||||
return;
|
||||
|
||||
// This has to be put before difficulties change as to not disrupt GetCurrentDifficulty
|
||||
BroadcastFormattedText("Mods.CalamityMod.UI.DifficultySwitch", Color.White, Main.getGoodWorld ? GetCurrentDifficulty.FTWTextColor.Hex3() : GetCurrentDifficulty.ChatTextColor.Hex3(), Main.getGoodWorld ? GetCurrentDifficulty.FTWName : GetCurrentDifficulty.Name
|
||||
, Main.getGoodWorld ? mode.FTWTextColor.Hex3() : mode.ChatTextColor.Hex3(), Main.getGoodWorld ? mode.FTWName : mode.Name);
|
||||
BroadcastFormattedText("Mods.CalamityMod.UI.DifficultySwitch", Color.White, Main.getGoodWorld && GetCurrentDifficulty.FTWTextColor is not null ? GetCurrentDifficulty.FTWTextColor.Value.Hex3() : GetCurrentDifficulty.ChatTextColor.Hex3(), Main.getGoodWorld && GetCurrentDifficulty.FTWName is not null ? GetCurrentDifficulty.FTWName : GetCurrentDifficulty.Name
|
||||
, Main.getGoodWorld && GetCurrentDifficulty.FTWTextColor is not null ? mode.FTWTextColor.Value.Hex3() : mode.ChatTextColor.Hex3(), Main.getGoodWorld && GetCurrentDifficulty.FTWName is not null ? mode.FTWName : mode.Name);
|
||||
|
||||
// Todo, maybe in the future having a way to have multiple difficulty options on the same tier that can coexist, and it works in branching pathes? Not very necessary for cal & addons.
|
||||
// But would be super useful so other mods can let their own difficulties go there.
|
||||
|
||||
|
Before Width: | Height: | Size: 942 B After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 648 B |
|
Before Width: | Height: | Size: 836 B After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 621 B |
|
Before Width: | Height: | Size: 982 B After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 655 B |
|
Before Width: | Height: | Size: 953 B After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 634 B |
|
After Width: | Height: | Size: 1.1 KiB |