Merge branch 'master' of https://github.com/CalamityTeam/CalamityMod
This commit is contained in:
commit
2bd8bcf3fb
12 files changed
+1698
-1274
No files matched your search
@@ -191,6 +191,7 @@ namespace CalamityMod.CalPlayer
|
||||
public int armorPenetrationStat = 0;
|
||||
public float wingFlightTimeStat = 0f;
|
||||
public float jumpSpeedStat = 0f;
|
||||
public int rageDamageStat = 0;
|
||||
public int adrenalineDamageStat = 0;
|
||||
public int adrenalineDRStat = 0;
|
||||
public int moveSpeedStat = 0;
|
||||
@@ -349,9 +350,8 @@ namespace CalamityMod.CalPlayer
|
||||
public int rageCombatFrames = 0;
|
||||
public static readonly int RageCombatDelayTime = CalamityUtils.SecondsToFrames(10);
|
||||
public static readonly int RageFadeTime = CalamityUtils.SecondsToFrames(30);
|
||||
public static readonly double RageDamageBoost = 0.5D; // +50%
|
||||
public static readonly float MinRageDR = 0.1f; // 10% DR
|
||||
public static readonly float MaxRageDR = 0.2f; // 20% DR
|
||||
public static readonly double DefaultRageDamageBoost = 0.5D; // +50%
|
||||
public double RageDamageBoost = DefaultRageDamageBoost;
|
||||
#endregion
|
||||
|
||||
#region Adrenaline
|
||||
@@ -481,6 +481,7 @@ namespace CalamityMod.CalPlayer
|
||||
public bool reducedPlagueDmg = false;
|
||||
public bool abaddon = false;
|
||||
public bool community = false;
|
||||
public bool shatteredCommunity = false;
|
||||
public bool fleshTotem = false;
|
||||
public bool fleshTotemCooldown = false;
|
||||
public bool bloodPact = false;
|
||||
@@ -1338,6 +1339,9 @@ namespace CalamityMod.CalPlayer
|
||||
int integerTypeBoost = (int)(floatTypeBoost * 50f);
|
||||
player.statLifeMax2 += player.statLifeMax / 5 / 20 * integerTypeBoost;
|
||||
}
|
||||
// Shattered Community gives the same max health boost as normal full-power Community (10%)
|
||||
if (shatteredCommunity)
|
||||
player.statLifeMax2 += (player.statLifeMax / 5 / 10) * 5;
|
||||
|
||||
// Max health reductions
|
||||
if (crimEffigy)
|
||||
@@ -1539,6 +1543,7 @@ namespace CalamityMod.CalPlayer
|
||||
reducedPlagueDmg = false;
|
||||
abaddon = false;
|
||||
community = false;
|
||||
shatteredCommunity = false;
|
||||
stressPills = false;
|
||||
laudanum = false;
|
||||
fleshTotem = false;
|
||||
@@ -1964,6 +1969,7 @@ namespace CalamityMod.CalPlayer
|
||||
rageModeActive = false;
|
||||
adrenalineModeActive = false;
|
||||
RageDuration = DefaultRageDuration;
|
||||
RageDamageBoost = DefaultRageDamageBoost;
|
||||
|
||||
lastProjectileHit = null;
|
||||
}
|
||||
@@ -4699,6 +4705,12 @@ namespace CalamityMod.CalPlayer
|
||||
CalamityPlayerOnHit.ItemLifesteal(player, mod, target, item, damage);
|
||||
CalamityPlayerOnHit.ItemOnHit(player, mod, item, damage, target.Center, crit, (target.damage > 5 || target.boss) && !target.SpawnedFromStatue);
|
||||
CalamityPlayerOnHit.NPCDebuffs(player, mod, target, item.melee, item.ranged, item.magic, item.summon, item.Calamity().rogue, false);
|
||||
|
||||
// Shattered Community tracks all damage dealt with Rage Mode (ignoring dummies).
|
||||
if (target.type == NPCID.TargetDummy || target.type == ModContent.NPCType<SuperDummyNPC>())
|
||||
return;
|
||||
if (rageModeActive && shatteredCommunity)
|
||||
ShatteredCommunity.AccumulateRageDamage(player, this, damage);
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -4835,6 +4847,12 @@ namespace CalamityMod.CalPlayer
|
||||
CalamityPlayerOnHit.ProjLifesteal(player, mod, target, proj, damage, crit);
|
||||
CalamityPlayerOnHit.ProjOnHit(player, mod, proj, target.Center, crit, (target.damage > 5 || target.boss) && !target.SpawnedFromStatue);
|
||||
CalamityPlayerOnHit.NPCDebuffs(player, mod, target, proj.melee, proj.ranged, proj.magic, proj.IsSummon(), proj.Calamity().rogue, true);
|
||||
|
||||
// Shattered Community tracks all damage dealt with Rage Mode (ignoring dummies).
|
||||
if (target.type == NPCID.TargetDummy || target.type == ModContent.NPCType<SuperDummyNPC>())
|
||||
return;
|
||||
if (rageModeActive && shatteredCommunity)
|
||||
ShatteredCommunity.AccumulateRageDamage(player, this, damage);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -7094,11 +7112,14 @@ namespace CalamityMod.CalPlayer
|
||||
if ((godSlayerDamage && damage <= 80) || damage < 1)
|
||||
damage = 1;
|
||||
|
||||
// Gain rage based on the amount of damage taken. Also set the Rage gain cooldown to prevent bizarre abuse cases.
|
||||
if (CalamityWorld.revenge && CalamityConfig.Instance.Rippers && rageGainCooldown == 0)
|
||||
// Shattered Community makes the player gain rage based on the amount of damage taken.
|
||||
// Also set the Rage gain cooldown to prevent bizarre abuse cases.
|
||||
if (CalamityWorld.revenge && CalamityConfig.Instance.Rippers && shatteredCommunity && rageGainCooldown == 0)
|
||||
{
|
||||
float HPRatio = (float)damage / player.statLifeMax2;
|
||||
rage += rageMax * HPRatio;
|
||||
// Damage to rage conversion is half as effective while Rage Mode is active.
|
||||
float rageConversionRatio = rageModeActive ? 0.4f : 0.8f;
|
||||
rage += rageMax * HPRatio * rageConversionRatio;
|
||||
rageGainCooldown = DefaultRageGainCooldown;
|
||||
// Rage capping is handled in MiscEffects
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace CalamityMod.CalPlayer
|
||||
Main.expertDebuffTime = 1f;
|
||||
|
||||
// Bool for any existing bosses, true if any boss NPC is active
|
||||
CalamityPlayer.areThereAnyDamnBosses = CalamityGlobalNPC.AnyBossNPCS();
|
||||
CalamityPlayer.areThereAnyDamnBosses = CalamityUtils.AnyBossNPCS();
|
||||
|
||||
// Bool for any existing events, true if any event is active
|
||||
CalamityPlayer.areThereAnyDamnEvents = CalamityGlobalNPC.AnyEvents(player);
|
||||
@@ -294,27 +294,115 @@ namespace CalamityMod.CalPlayer
|
||||
// This is how much Rage will be changed by this frame.
|
||||
float rageDiff = 0;
|
||||
|
||||
// Draedon's Heart provides constant rage generation that scales with missing health.
|
||||
if (modPlayer.draedonsHeart)
|
||||
// If the player equips multiple rage generation accessories they get the max possible effect without stacking any of them.
|
||||
{
|
||||
float percentMissingHealth = 1f - player.statLife / player.statLifeMax2;
|
||||
float rageGainLerp = MathHelper.Lerp(DraedonsHeart.MinRagePerSecond, DraedonsHeart.MaxRagePerSecond, percentMissingHealth);
|
||||
rageDiff += modPlayer.rageMax * rageGainLerp / 60f;
|
||||
float rageGen = 0f;
|
||||
|
||||
// Draedon's Heart provides constant rage generation that scales with missing health.
|
||||
if (modPlayer.draedonsHeart)
|
||||
{
|
||||
float percentMissingHealth = 1f - player.statLife / player.statLifeMax2;
|
||||
float rageGainLerp = MathHelper.Lerp(DraedonsHeart.MinRagePerSecond, DraedonsHeart.MaxRagePerSecond, percentMissingHealth);
|
||||
float dhRageGen = modPlayer.rageMax * rageGainLerp / 60f;
|
||||
if (rageGen < dhRageGen)
|
||||
rageGen = dhRageGen;
|
||||
}
|
||||
// Shattered Community provides constant rage generation (stronger than Heart of Darkness).
|
||||
if (modPlayer.shatteredCommunity)
|
||||
{
|
||||
float scRageGen = modPlayer.rageMax * ShatteredCommunity.RagePerSecond / 60f;
|
||||
if (rageGen < scRageGen)
|
||||
rageGen = scRageGen;
|
||||
}
|
||||
// Heart of Darkness grants constant rage generation.
|
||||
else if (modPlayer.heartOfDarkness)
|
||||
{
|
||||
float hodRageGen = modPlayer.rageMax * HeartofDarkness.RagePerSecond / 60f;
|
||||
if (rageGen < hodRageGen)
|
||||
rageGen = hodRageGen;
|
||||
}
|
||||
|
||||
rageDiff += rageGen;
|
||||
}
|
||||
// Heart of Darkness grants constant rage generation.
|
||||
else if (modPlayer.heartOfDarkness)
|
||||
rageDiff += modPlayer.rageMax * HeartofDarkness.RagePerSecond / 60f;
|
||||
|
||||
// Holding Gael's Greatsword grants constant rage generation.
|
||||
if (modPlayer.heldGaelsLastFrame)
|
||||
rageDiff += modPlayer.rageMax * GaelsGreatsword.RagePerSecond / 60f;
|
||||
|
||||
// Calculate and grant proximity rage.
|
||||
// Regular enemies can give up to 1x proximity rage. Bosses can give up to 3x. Multiple regular enemies don't stack.
|
||||
// Proximity rage is maxed out when within 10 blocks (160 pixels) of the enemy's hitbox.
|
||||
// Its max range is 50 blocks (800 pixels), at which you get zero proximity rage.
|
||||
float bossProxRageMultiplier = 3f;
|
||||
float minProxRageDistance = 160f;
|
||||
float maxProxRageDistance = 800f;
|
||||
float enemyDistance = maxProxRageDistance + 1f;
|
||||
float bossDistance = maxProxRageDistance + 1f;
|
||||
|
||||
for (int i = 0; i < Main.maxNPCs; ++i)
|
||||
{
|
||||
NPC npc = Main.npc[i];
|
||||
if (npc is null || !npc.IsAnEnemy())
|
||||
continue;
|
||||
|
||||
// Take the longer of the two directions for the NPC's hitbox to be generous.
|
||||
float generousHitboxWidth = Math.Max(npc.Hitbox.Width / 2f, npc.Hitbox.Height / 2f);
|
||||
float hitboxEdgeDist = npc.Distance(player.Center) - generousHitboxWidth;
|
||||
|
||||
// If this enemy is closer than the previous, reduce the current minimum proximity distance.
|
||||
if (enemyDistance > hitboxEdgeDist)
|
||||
{
|
||||
enemyDistance = hitboxEdgeDist;
|
||||
|
||||
// If they're a boss, reduce the boss distance.
|
||||
// Boss distance will always be >= enemy distance, so there's no need to do another check.
|
||||
// Worm boss body and tail segments are not counted as bosses for this calculation.
|
||||
if (npc.IsABoss() && !CalamityLists.noRageWormSegmentList.Contains(npc.type))
|
||||
bossDistance = hitboxEdgeDist;
|
||||
}
|
||||
}
|
||||
|
||||
// Helper function to implement proximity rage formula
|
||||
float ProxRageFromDistance(float dist)
|
||||
{
|
||||
// Adjusted distance with the 160 grace pixels added in. If you're closer than that it counts as zero.
|
||||
float d = Math.Max(dist - minProxRageDistance, 0f);
|
||||
|
||||
// The first term is exponential decay which reduces rage gain significantly over distance.
|
||||
// The second term is a linear component which allows a baseline but weak rage generation even at far distances.
|
||||
// This function takes inputs from 0.0 to 640.0 and returns a value from 1.0 to 0.0.
|
||||
float r = 1f / (0.034f * d + 2f) + (590.5f - d) / 1181f;
|
||||
return MathHelper.Clamp(r, 0f, 1f);
|
||||
}
|
||||
|
||||
// If anything is close enough then provide proximity rage.
|
||||
// You can only get proximity rage from one target at a time. You gain rage from whatever target would give you the most rage.
|
||||
if (enemyDistance <= maxProxRageDistance)
|
||||
{
|
||||
// If the player is close enough to get proximity rage they are also considered to have rage combat frames.
|
||||
// This prevents proximity rage from fading away unless you run away without attacking for some reason.
|
||||
modPlayer.rageCombatFrames = Math.Max(modPlayer.rageCombatFrames, 3);
|
||||
|
||||
float proxRageFromEnemy = ProxRageFromDistance(enemyDistance);
|
||||
float proxRageFromBoss = 0f;
|
||||
if (bossDistance <= maxProxRageDistance)
|
||||
proxRageFromBoss = bossProxRageMultiplier * ProxRageFromDistance(bossDistance);
|
||||
|
||||
float finalProxRage = Math.Max(proxRageFromEnemy, proxRageFromBoss);
|
||||
|
||||
// 300% proximity rage (max possible from a boss) will fill the Rage meter in 10 seconds.
|
||||
// 100% proximity rage (max possible from an enemy) will fill the Rage meter in 30 seconds.
|
||||
rageDiff += finalProxRage * modPlayer.rageMax / 30f;
|
||||
}
|
||||
|
||||
bool rageFading = modPlayer.rageCombatFrames <= 0 && !modPlayer.heartOfDarkness && !modPlayer.shatteredCommunity;
|
||||
|
||||
// If Rage Mode is currently active, you smoothly lose all rage over the duration.
|
||||
if (modPlayer.rageModeActive)
|
||||
rageDiff -= modPlayer.rageMax / modPlayer.RageDuration;
|
||||
|
||||
// If out of combat and NOT using Heart of Darkness, Rage fades away.
|
||||
else if (!modPlayer.rageModeActive && modPlayer.rageCombatFrames <= 0 && !modPlayer.heartOfDarkness)
|
||||
// If out of combat and NOT using Heart of Darkness or Shattered Community, Rage fades away.
|
||||
else if (!modPlayer.rageModeActive && rageFading)
|
||||
rageDiff -= modPlayer.rageMax / CalamityPlayer.RageFadeTime;
|
||||
|
||||
// Apply the rage change and cap rage in both directions.
|
||||
@@ -2653,6 +2741,9 @@ namespace CalamityMod.CalPlayer
|
||||
player.moveSpeed += floatTypeBoost;
|
||||
flightTimeMult += floatTypeBoost;
|
||||
}
|
||||
// Shattered Community gives the same wing time boost as normal Community
|
||||
if (modPlayer.shatteredCommunity)
|
||||
flightTimeMult += 0.15f;
|
||||
|
||||
if (modPlayer.profanedCrystalBuffs && modPlayer.gOffense && modPlayer.gDefense)
|
||||
{
|
||||
@@ -3922,6 +4013,7 @@ namespace CalamityMod.CalPlayer
|
||||
(player.wereWolf ? 0.2f : 0f) +
|
||||
(player.jumpBoost ? 1.5f : 0f);
|
||||
modPlayer.jumpSpeedStat = trueJumpSpeedBoost * 20f;
|
||||
modPlayer.rageDamageStat = (int)(100D * modPlayer.RageDamageBoost);
|
||||
modPlayer.adrenalineDamageStat = (int)(100D * modPlayer.GetAdrenalineDamage());
|
||||
int extraAdrenalineDR = 0 +
|
||||
(modPlayer.adrenalineBoostOne ? 5 : 0) +
|
||||
|
||||
+1152
-1128
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,252 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader.IO;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public class ShatteredCommunity : ModItem
|
||||
{
|
||||
// The percentage of a full Rage bar that is gained every second with the Shattered Community equipped.
|
||||
public const float RagePerSecond = 0.02f;
|
||||
private static readonly Color rarityColorOne = new Color(128, 62, 128);
|
||||
private static readonly Color rarityColorTwo = new Color(245, 105, 245);
|
||||
|
||||
private bool everInInventory = false;
|
||||
|
||||
// Base level cost is 400,000 damage dealt while Rage is active.
|
||||
// Each successive level costs (400,000 * level) MORE damage, so the total required goes up quadratically.
|
||||
// Total required to reach level 60 is 732,000,000 damage dealt.
|
||||
// This is within one order of magnitude of the integer limit, so relevant values are stored as longs.
|
||||
private const long BaseLevelCost = 400000L;
|
||||
private static long LevelCost(int level) => BaseLevelCost * level;
|
||||
private static long CumulativeLevelCost(int level) => (BaseLevelCost / 2L) * level * (level + 1);
|
||||
private const int MaxLevel = 60;
|
||||
|
||||
internal int rageLevel = 0;
|
||||
internal long totalRageDamage = 0L;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Shattered Community");
|
||||
Tooltip.SetDefault("Ruined by unknowable hatred, it still contains (most of) the power of The Community...\n" +
|
||||
"Legendary Accessory\n" +
|
||||
"You generate rage over time and rage does not fade away out of combat\n" +
|
||||
"Taking damage gives rage, this effect is not hindered by your defensive stats\n" +
|
||||
"While Rage Mode is active, taking damage gives only half as much rage\n" +
|
||||
"Deal damage with Rage Mode to further empower your wrath\n");
|
||||
Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(7, 5));
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 20;
|
||||
item.height = 20;
|
||||
item.accessory = true;
|
||||
item.value = CalamityGlobalItem.RarityHotPinkBuyPrice;
|
||||
item.rare = ItemRarityID.Red;
|
||||
item.Calamity().customRarity = CalamityRarity.ItemSpecific;
|
||||
}
|
||||
|
||||
// Not overriding these Clones makes tooltips fail to function correctly due to HoverItem spaghetti.
|
||||
public override ModItem Clone()
|
||||
{
|
||||
var clone = (ShatteredCommunity)base.Clone();
|
||||
clone.everInInventory = everInInventory;
|
||||
clone.rageLevel = rageLevel;
|
||||
clone.totalRageDamage = totalRageDamage;
|
||||
return clone;
|
||||
}
|
||||
public override ModItem Clone(Item item)
|
||||
{
|
||||
var clone = (ShatteredCommunity)base.Clone();
|
||||
clone.everInInventory = everInInventory;
|
||||
clone.rageLevel = rageLevel;
|
||||
clone.totalRageDamage = totalRageDamage;
|
||||
return clone;
|
||||
}
|
||||
|
||||
internal static Color GetRarityColor() => CalamityUtils.ColorSwap(rarityColorOne, rarityColorTwo, 3f);
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.shatteredCommunity = true;
|
||||
|
||||
// Shattered Community gives (mostly) the same boosts as normal Community
|
||||
// It does not give melee speed or minion knockback, but always gives life regen (instead of only conditionally)
|
||||
player.allDamage += 0.1f;
|
||||
modPlayer.AllCritBoost(5);
|
||||
player.statDefense += 10;
|
||||
player.endurance += 0.05f;
|
||||
player.lifeRegen += 2;
|
||||
player.moveSpeed += 0.2f;
|
||||
|
||||
// Shattered Community provides a stacking +1% Rage Mode damage per level.
|
||||
modPlayer.RageDamageBoost += rageLevel * 0.01;
|
||||
}
|
||||
|
||||
// Community and Shattered Community are mutually exclusive
|
||||
public override bool CanEquipAccessory(Player player, int slot) => !player.Calamity().community;
|
||||
public override bool CanUseItem(Player player) => false;
|
||||
|
||||
public override void UpdateInventory(Player player)
|
||||
{
|
||||
everInInventory = true;
|
||||
}
|
||||
|
||||
// Produces purple light while in the world.
|
||||
public override void PostUpdate()
|
||||
{
|
||||
float brightness = Main.essScale;
|
||||
Lighting.AddLight(item.Center, 0.92f * brightness, 0.42f * brightness, 0.92f * brightness);
|
||||
}
|
||||
|
||||
internal static void AccumulateRageDamage(Player player, CalamityPlayer mp, long damage)
|
||||
{
|
||||
if (!mp.shatteredCommunity)
|
||||
return;
|
||||
// Static context, so the item ID has to be retrieved from TML.
|
||||
int thisItemID = ModContent.ItemType<ShatteredCommunity>();
|
||||
ShatteredCommunity sc = null;
|
||||
|
||||
// First, find the Shattered Community in the player's inventory.
|
||||
// slots 3, 4, 5, 6, 7, 8, 9 are valid non-vanity accessories
|
||||
for (int i = 3; i <= 9; ++i)
|
||||
{
|
||||
Item acc = player.armor[i];
|
||||
if (acc.type == thisItemID)
|
||||
sc = acc.modItem as ShatteredCommunity;
|
||||
}
|
||||
|
||||
// Safety check in case for some reason the equipped Shattered Community isn't found.
|
||||
if (sc is null)
|
||||
return;
|
||||
|
||||
// Actually accumulate the damage.
|
||||
sc.totalRageDamage += damage;
|
||||
|
||||
// Level up if applicable.
|
||||
if (sc.totalRageDamage > CumulativeLevelCost(sc.rageLevel + 1))
|
||||
{
|
||||
++sc.rageLevel;
|
||||
sc.LevelUpEffects(player);
|
||||
}
|
||||
}
|
||||
|
||||
private void LevelUpEffects(Player player)
|
||||
{
|
||||
// TODO -- it should probably do something fancy involving dust or whatever
|
||||
}
|
||||
|
||||
public override void ModifyTooltips(List<TooltipLine> tooltips)
|
||||
{
|
||||
// Shattered Community hides its full tooltip when viewed via Recipe Browser or similar.
|
||||
// Instead, it notifies the player that it must be crafted with a full-power Community.
|
||||
// Once it has entered a player's inventory, it permanently behaves normally.
|
||||
if (!everInInventory)
|
||||
{
|
||||
tooltips.RemoveAll(line => line.Name != "Tooltip0" && line.Name != "Tooltip1" && line.Name != "Tooltip2" && line.Name.StartsWith("Tooltip"));
|
||||
tooltips.Find(line => line.Name == "Tooltip2").text = "Must be crafted with a fully powered Community";
|
||||
return;
|
||||
}
|
||||
|
||||
// Stat tooltips are added dynamically.
|
||||
StringBuilder sb = new StringBuilder(256);
|
||||
|
||||
// Line 6: Current level
|
||||
sb.Append("Current level: ");
|
||||
sb.Append(rageLevel);
|
||||
sb.Append(" (+");
|
||||
sb.Append(rageLevel);
|
||||
sb.Append("% Rage Mode damage)");
|
||||
tooltips.Add(new TooltipLine(mod, "Tooltip6", sb.ToString()));
|
||||
sb.Clear();
|
||||
|
||||
if (rageLevel < MaxLevel)
|
||||
{
|
||||
long progressToNextLevel = totalRageDamage - CumulativeLevelCost(rageLevel);
|
||||
long totalToNextLevel = LevelCost(rageLevel + 1);
|
||||
double ratio = (double)progressToNextLevel / totalToNextLevel;
|
||||
string percent = (100D * ratio).ToString("0.00");
|
||||
|
||||
// Line 7: Progress to next level
|
||||
sb.Append("Progress to next level: ");
|
||||
sb.Append(percent);
|
||||
sb.Append('%');
|
||||
tooltips.Add(new TooltipLine(mod, "Tooltip7", sb.ToString()));
|
||||
sb.Clear();
|
||||
}
|
||||
|
||||
// Line 8: Total damage dealt
|
||||
sb.Append("Total Rage Mode damage: ");
|
||||
sb.Append(totalRageDamage);
|
||||
tooltips.Add(new TooltipLine(mod, "Tooltip8", sb.ToString()));
|
||||
}
|
||||
|
||||
public override TagCompound Save()
|
||||
{
|
||||
TagCompound tag = new TagCompound
|
||||
{
|
||||
{ "real", everInInventory },
|
||||
{ "level", rageLevel },
|
||||
{ "totalDamage", totalRageDamage }
|
||||
};
|
||||
return tag;
|
||||
}
|
||||
|
||||
public override void Load(TagCompound tag)
|
||||
{
|
||||
everInInventory = tag.GetBool("real");
|
||||
rageLevel = tag.GetInt("level");
|
||||
totalRageDamage = tag.GetLong("totalDamage");
|
||||
}
|
||||
|
||||
public override void NetSend(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(everInInventory);
|
||||
writer.Write(rageLevel);
|
||||
writer.Write(totalRageDamage);
|
||||
}
|
||||
|
||||
public override void NetRecieve(BinaryReader reader)
|
||||
{
|
||||
everInInventory = reader.ReadBoolean();
|
||||
rageLevel = reader.ReadInt32();
|
||||
totalRageDamage = reader.ReadInt64();
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe r = new ShatteredCommunityRecipe(mod);
|
||||
r.SetResult(this);
|
||||
r.AddIngredient(ModContent.ItemType<TheCommunity>());
|
||||
r.AddIngredient(ModContent.ItemType<HeartofDarkness>());
|
||||
r.AddIngredient(ModContent.ItemType<CalamitousEssence>(), 120);
|
||||
r.AddRecipe();
|
||||
}
|
||||
|
||||
// The Shattered Community can only be crafted with a full-power Community.
|
||||
// That is, in a world where all relevant bosses have been defeated.
|
||||
private class ShatteredCommunityRecipe : ModRecipe
|
||||
{
|
||||
public ShatteredCommunityRecipe(Mod mod) : base(mod) { }
|
||||
|
||||
public override bool RecipeAvailable()
|
||||
{
|
||||
bool vanillaBosses = NPC.downedSlimeKing && NPC.downedBoss1 && NPC.downedBoss2 && NPC.downedQueenBee && NPC.downedBoss3 && Main.hardMode;
|
||||
vanillaBosses &= NPC.downedMechBossAny && NPC.downedPlantBoss && NPC.downedGolemBoss && NPC.downedFishron && NPC.downedAncientCultist && NPC.downedMoonlord;
|
||||
bool calamityBosses = CalamityWorld.downedProvidence && CalamityWorld.downedDoG && CalamityWorld.downedYharon;
|
||||
return vanillaBosses && calamityBosses;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
@@ -77,6 +77,7 @@ namespace CalamityMod.Items.Accessories
|
||||
// Only append rippers stats in Rev+, if rippers are enabled.
|
||||
if (CalamityWorld.revenge && CalamityConfig.Instance.Rippers)
|
||||
{
|
||||
sb.Append("Rage Damage Boost: ").Append(modPlayer.rageDamageStat).Append("%\n");
|
||||
sb.Append("Adrenaline Damage Boost: ").Append(modPlayer.adrenalineDamageStat)
|
||||
.Append("% | Adrenaline DR Boost: ").Append(modPlayer.adrenalineDRStat)
|
||||
.Append("%\n\n");
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
@@ -26,7 +27,7 @@ namespace CalamityMod.Items.Accessories
|
||||
item.width = 20;
|
||||
item.height = 20;
|
||||
item.value = CalamityGlobalItem.Rarity7BuyPrice;
|
||||
item.rare = 7;
|
||||
item.rare = ItemRarityID.Lime;
|
||||
item.accessory = true;
|
||||
item.Calamity().customRarity = CalamityRarity.Rainbow;
|
||||
}
|
||||
@@ -36,5 +37,8 @@ namespace CalamityMod.Items.Accessories
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.community = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Community and Shattered Community are mutually exclusive
|
||||
public override bool CanEquipAccessory(Player player, int slot) => !player.Calamity().shatteredCommunity;
|
||||
}
|
||||
}
|
||||
@@ -1147,6 +1147,8 @@ namespace CalamityMod.Items
|
||||
tt2.overrideColor = Judgement.GetSyncedLightColor();
|
||||
if (item.type == ModContent.ItemType<NanoblackReaperRogue>())
|
||||
tt2.overrideColor = new Color(0.34f, 0.34f + 0.66f * Main.DiscoG / 255f, 0.34f + 0.5f * Main.DiscoG / 255f);
|
||||
if (item.type == ModContent.ItemType<ShatteredCommunity>())
|
||||
tt2.overrideColor = ShatteredCommunity.GetRarityColor();
|
||||
if (item.type == ModContent.ItemType<ProfanedSoulCrystal>())
|
||||
tt2.overrideColor = CalamityUtils.ColorSwap(new Color(255, 166, 0), new Color(25, 250, 25), 4f); //alternates between emerald green and amber (BanditHueh)
|
||||
if (item.type == ModContent.ItemType<BensUmbrella>())
|
||||
|
||||
@@ -36,7 +36,6 @@ using CalamityMod.NPCs.StormWeaver;
|
||||
using CalamityMod.NPCs.SulphurousSea;
|
||||
using CalamityMod.NPCs.SupremeCalamitas;
|
||||
using CalamityMod.NPCs.Yharon;
|
||||
using CalamityMod.Projectiles.Boss;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
@@ -4519,22 +4518,6 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Any Boss NPCs
|
||||
public static bool AnyBossNPCS()
|
||||
{
|
||||
for (int i = 0; i < Main.maxNPCs; i++)
|
||||
{
|
||||
if (Main.npc[i].active && Main.npc[i].type != NPCID.MartianSaucerCore &&
|
||||
(Main.npc[i].boss || Main.npc[i].type == NPCID.EaterofWorldsHead || Main.npc[i].type == NPCID.EaterofWorldsTail || Main.npc[i].type == NPCType<SlimeGodRun>() ||
|
||||
Main.npc[i].type == NPCType<SlimeGodRunSplit>() || Main.npc[i].type == NPCType<SlimeGod.SlimeGod>() || Main.npc[i].type == NPCType<SlimeGodSplit>()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return CalamityUtils.FindFirstProjectile(ProjectileType<DeusRitualDrama>()) != -1;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Any Events
|
||||
public static bool AnyEvents(Player player)
|
||||
{
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace CalamityMod.NPCs.TownNPCs
|
||||
}
|
||||
}
|
||||
|
||||
if (CalamityGlobalNPC.AnyBossNPCS())
|
||||
if (CalamityUtils.AnyBossNPCS())
|
||||
return "Nothard/10, if I fight bosses I wanna feel like screaming 'OH YES DADDY!' while I die repeatedly.";
|
||||
|
||||
IList<string> dialogue = new List<string>();
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace CalamityMod.UI
|
||||
{
|
||||
//Don't do anything if not open
|
||||
bool forceOpenAndTeleport = BossRushEvent.BossRushStage < BossRushEvent.Bosses.Count - 1 && BossRushEvent.CurrentlyFoughtBoss == NPCID.WallofFlesh &&
|
||||
!NPCs.CalamityGlobalNPC.AnyBossNPCS() && !Main.player[Main.myPlayer].ZoneUnderworldHeight;
|
||||
!CalamityUtils.AnyBossNPCS() && !Main.player[Main.myPlayer].ZoneUnderworldHeight;
|
||||
if (forceOpenAndTeleport)
|
||||
{
|
||||
Open = true;
|
||||
|
||||
+153
-108
@@ -5,9 +5,14 @@ using CalamityMod.Events;
|
||||
using CalamityMod.Items;
|
||||
using CalamityMod.Items.Tools.ClimateChange;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.NPCs.HiveMind;
|
||||
using CalamityMod.NPCs.Leviathan;
|
||||
using CalamityMod.NPCs.NormalNPCs;
|
||||
using CalamityMod.NPCs.Perforator;
|
||||
using CalamityMod.NPCs.Providence;
|
||||
using CalamityMod.NPCs.SlimeGod;
|
||||
using CalamityMod.Projectiles;
|
||||
using CalamityMod.Projectiles.Boss;
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
using CalamityMod.Projectiles.Summon;
|
||||
using CalamityMod.Tiles;
|
||||
@@ -42,6 +47,7 @@ using Terraria.ModLoader;
|
||||
using Terraria.ModLoader.IO;
|
||||
using Terraria.ObjectData;
|
||||
using Terraria.UI.Chat;
|
||||
using static Terraria.ModLoader.ModContent;
|
||||
|
||||
namespace CalamityMod
|
||||
{
|
||||
@@ -173,8 +179,7 @@ namespace CalamityMod
|
||||
}
|
||||
else if (mp.rageModeActive)
|
||||
{
|
||||
double rageBoost = CalamityPlayer.RageDamageBoost; // other effects forthcoming
|
||||
damageMult += rageBoost;
|
||||
damageMult += mp.RageDamageBoost;
|
||||
}
|
||||
else if (mp.adrenalineModeActive)
|
||||
damageMult += mp.GetAdrenalineDamage();
|
||||
@@ -188,11 +193,11 @@ namespace CalamityMod
|
||||
/// <returns>Inflicts debuffs if the target isn't immune.</returns>
|
||||
public static void ExoDebuffs(this Player target, float multiplier = 1f)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<ExoFreeze>(), (int)(30 * multiplier));
|
||||
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), (int)(120 * multiplier));
|
||||
target.AddBuff(ModContent.BuffType<GlacialState>(), (int)(120 * multiplier));
|
||||
target.AddBuff(ModContent.BuffType<Plague>(), (int)(120 * multiplier));
|
||||
target.AddBuff(ModContent.BuffType<HolyFlames>(), (int)(120 * multiplier));
|
||||
target.AddBuff(BuffType<ExoFreeze>(), (int)(30 * multiplier));
|
||||
target.AddBuff(BuffType<BrimstoneFlames>(), (int)(120 * multiplier));
|
||||
target.AddBuff(BuffType<GlacialState>(), (int)(120 * multiplier));
|
||||
target.AddBuff(BuffType<Plague>(), (int)(120 * multiplier));
|
||||
target.AddBuff(BuffType<HolyFlames>(), (int)(120 * multiplier));
|
||||
target.AddBuff(BuffID.CursedInferno, (int)(120 * multiplier));
|
||||
target.AddBuff(BuffID.Frostburn, (int)(120 * multiplier));
|
||||
target.AddBuff(BuffID.OnFire, (int)(120 * multiplier));
|
||||
@@ -246,6 +251,46 @@ namespace CalamityMod
|
||||
npc.Calamity().customDR = true;
|
||||
}
|
||||
|
||||
public static bool IsAnEnemy(this NPC npc)
|
||||
{
|
||||
// Null, inactive, town NPCs, friendlies, statue spawns, "non-enemies" (e.g. butterflies or projectile enemies),
|
||||
// or anything else with no contact damage (exception: Providence and Celestial Pillars) don't count for rage.
|
||||
if (npc is null || !npc.active || npc.townNPC || npc.friendly || npc.SpawnedFromStatue || npc.lifeMax <= 5 || (npc.damage <= 5 && npc.lifeMax <= 2000))
|
||||
return false;
|
||||
// Also explicitly exclude dummies and anything with a ridiculous health pool (dummies from Fargo's for example).
|
||||
if (npc.type == NPCID.TargetDummy || npc.type == NPCType<SuperDummyNPC>() || npc.lifeMax > 100000000)
|
||||
return false;
|
||||
// Finally, exclude boss spawners.
|
||||
if (npc.type == NPCType<LeviathanStart>() || npc.type == NPCType<HiveCyst>() || npc.type == NPCType<PerforatorCyst>())
|
||||
return false;
|
||||
|
||||
// Anything else is considered a valid enemy target.
|
||||
return true;
|
||||
}
|
||||
|
||||
// This function follows the behavior of Adrenaline.
|
||||
// Vanilla worm segments and Slime God slimes are specifically included.
|
||||
// Martian Saucers are specifically excluded.
|
||||
public static bool IsABoss(this NPC npc)
|
||||
{
|
||||
if (npc is null || !npc.active)
|
||||
return false;
|
||||
if (npc.boss && npc.type != NPCID.MartianSaucerCore)
|
||||
return true;
|
||||
if (npc.type == NPCID.EaterofWorldsBody || npc.type == NPCID.EaterofWorldsHead || npc.type == NPCID.EaterofWorldsTail)
|
||||
return true;
|
||||
return npc.type == NPCType<SlimeGod>() || npc.type == NPCType<SlimeGodRun>() ||
|
||||
npc.type == NPCType<SlimeGodSplit>() || npc.type== NPCType<SlimeGodRunSplit>();
|
||||
}
|
||||
|
||||
public static bool AnyBossNPCS()
|
||||
{
|
||||
for (int i = 0; i < Main.maxNPCs; i++)
|
||||
if (Main.npc[i] != null && Main.npc[i].IsABoss())
|
||||
return true;
|
||||
return FindFirstProjectile(ProjectileType<DeusRitualDrama>()) != -1;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the aggression multiplier used for NPCs in Master Mode Calamity rev+
|
||||
/// Will also be used to modify certain boss size/scale
|
||||
@@ -257,103 +302,103 @@ namespace CalamityMod
|
||||
/*if (!Main.masterMode)
|
||||
return 1f;*/
|
||||
|
||||
/*if (NPCType == ModContent.NPCType<DesertScourgeHead>())
|
||||
/*if (NPCType == NPCType<DesertScourgeHead>())
|
||||
{
|
||||
|
||||
}
|
||||
else if (NPCType == ModContent.NPCType<CrabulonIdle>())
|
||||
else if (NPCType == NPCType<CrabulonIdle>())
|
||||
{
|
||||
|
||||
}
|
||||
else if (NPCType == ModContent.NPCType<HiveMind>() || NPCType == ModContent.NPCType<HiveMindP2>())
|
||||
else if (NPCType == NPCType<HiveMind>() || NPCType == NPCType<HiveMindP2>())
|
||||
{
|
||||
|
||||
}
|
||||
else if (NPCType == ModContent.NPCType<PerforatorHive>())
|
||||
else if (NPCType == NPCType<PerforatorHive>())
|
||||
{
|
||||
|
||||
}
|
||||
else if (NPCType == ModContent.NPCType<SlimeGodCore>() || NPCType == ModContent.NPCType<SlimeGod>() || NPCType == ModContent.NPCType<SlimeGodRun>() || NPCType == ModContent.NPCType<SlimeGodSplit>() || NPCType == ModContent.NPCType<SlimeGodRunSplit>())
|
||||
else if (NPCType == NPCType<SlimeGodCore>() || NPCType == NPCType<SlimeGod>() || NPCType == NPCType<SlimeGodRun>() || NPCType == NPCType<SlimeGodSplit>() || NPCType == NPCType<SlimeGodRunSplit>())
|
||||
{
|
||||
|
||||
}
|
||||
else if (NPCType == ModContent.NPCType<Cryogen>())
|
||||
else if (NPCType == NPCType<Cryogen>())
|
||||
{
|
||||
|
||||
}
|
||||
else if (NPCType == ModContent.NPCType<AquaticScourgeHead>())
|
||||
else if (NPCType == NPCType<AquaticScourgeHead>())
|
||||
{
|
||||
|
||||
}
|
||||
else if (NPCType == ModContent.NPCType<BrimstoneElemental>())
|
||||
else if (NPCType == NPCType<BrimstoneElemental>())
|
||||
{
|
||||
|
||||
}
|
||||
else if (NPCType == ModContent.NPCType<Calamitas>() || NPCType == ModContent.NPCType<CalamitasRun3>())
|
||||
else if (NPCType == NPCType<Calamitas>() || NPCType == NPCType<CalamitasRun3>())
|
||||
{
|
||||
|
||||
}
|
||||
else if (NPCType == ModContent.NPCType<Leviathan>() || NPCType == ModContent.NPCType<Siren>())
|
||||
else if (NPCType == NPCType<Leviathan>() || NPCType == NPCType<Siren>())
|
||||
{
|
||||
|
||||
}
|
||||
else if (NPCType == ModContent.NPCType<AstrumAureus>())
|
||||
else if (NPCType == NPCType<AstrumAureus>())
|
||||
{
|
||||
|
||||
}
|
||||
else if (NPCType == ModContent.NPCType<AstrumDeusHeadSpectral>())
|
||||
else if (NPCType == NPCType<AstrumDeusHeadSpectral>())
|
||||
{
|
||||
|
||||
}
|
||||
else if (NPCType == ModContent.NPCType<PlaguebringerGoliath>())
|
||||
else if (NPCType == NPCType<PlaguebringerGoliath>())
|
||||
{
|
||||
|
||||
}
|
||||
else if (NPCType == ModContent.NPCType<RavagerBody>())
|
||||
else if (NPCType == NPCType<RavagerBody>())
|
||||
{
|
||||
|
||||
}
|
||||
else if (NPCType == ModContent.NPCType<ProfanedGuardianBoss>())
|
||||
else if (NPCType == NPCType<ProfanedGuardianBoss>())
|
||||
{
|
||||
|
||||
}
|
||||
else if (NPCType == ModContent.NPCType<Bumblefuck>())
|
||||
else if (NPCType == NPCType<Bumblefuck>())
|
||||
{
|
||||
|
||||
}
|
||||
else if (NPCType == ModContent.NPCType<Providence>())
|
||||
else if (NPCType == NPCType<Providence>())
|
||||
{
|
||||
|
||||
}
|
||||
else if (NPCType == ModContent.NPCType<CeaselessVoid>())
|
||||
else if (NPCType == NPCType<CeaselessVoid>())
|
||||
{
|
||||
|
||||
}
|
||||
else if (NPCType == ModContent.NPCType<StormWeaverHead>() || NPCType == ModContent.NPCType<StormWeaverHeadNaked>())
|
||||
else if (NPCType == NPCType<StormWeaverHead>() || NPCType == NPCType<StormWeaverHeadNaked>())
|
||||
{
|
||||
|
||||
}
|
||||
else if (NPCType == ModContent.NPCType<Signus>())
|
||||
else if (NPCType == NPCType<Signus>())
|
||||
{
|
||||
|
||||
}
|
||||
else if (NPCType == ModContent.NPCType<Polterghast>())
|
||||
else if (NPCType == NPCType<Polterghast>())
|
||||
{
|
||||
|
||||
}
|
||||
else if (NPCType == ModContent.NPCType<OldDuke>())
|
||||
else if (NPCType == NPCType<OldDuke>())
|
||||
{
|
||||
|
||||
}
|
||||
else if (NPCType == ModContent.NPCType<DevourerofGodsHead>() || NPCType == ModContent.NPCType<DevourerofGodsHeadS>())
|
||||
else if (NPCType == NPCType<DevourerofGodsHead>() || NPCType == NPCType<DevourerofGodsHeadS>())
|
||||
{
|
||||
|
||||
}
|
||||
else if (NPCType == ModContent.NPCType<Yharon>())
|
||||
else if (NPCType == NPCType<Yharon>())
|
||||
{
|
||||
|
||||
}
|
||||
else if (NPCType == ModContent.NPCType<SupremeCalamitas>())
|
||||
else if (NPCType == NPCType<SupremeCalamitas>())
|
||||
{
|
||||
|
||||
}
|
||||
@@ -497,8 +542,8 @@ namespace CalamityMod
|
||||
target.HitSound != SoundID.NPCHit5 && target.HitSound != SoundID.NPCHit11 && target.HitSound != SoundID.NPCHit30 &&
|
||||
target.HitSound != SoundID.NPCHit34 && target.HitSound != SoundID.NPCHit36 && target.HitSound != SoundID.NPCHit42 &&
|
||||
target.HitSound != SoundID.NPCHit49 && target.HitSound != SoundID.NPCHit52 && target.HitSound != SoundID.NPCHit53 &&
|
||||
target.HitSound != SoundID.NPCHit54 && target.HitSound != null) || target.type == ModContent.NPCType<Providence>() ||
|
||||
target.type == ModContent.NPCType<ScornEater>())
|
||||
target.HitSound != SoundID.NPCHit54 && target.HitSound != null) || target.type == NPCType<Providence>() ||
|
||||
target.type == NPCType<ScornEater>())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -524,8 +569,8 @@ namespace CalamityMod
|
||||
target.HitSound != SoundID.NPCHit43 && target.HitSound != SoundID.NPCHit44 && target.HitSound != SoundID.NPCHit45 &&
|
||||
target.HitSound != SoundID.NPCHit46 && target.HitSound != SoundID.NPCHit47 && target.HitSound != SoundID.NPCHit48 &&
|
||||
target.HitSound != SoundID.NPCHit50 && target.HitSound != SoundID.NPCHit51 && target.HitSound != SoundID.NPCHit55 &&
|
||||
target.HitSound != SoundID.NPCHit56 && target.HitSound != SoundID.NPCHit57 && target.type != ModContent.NPCType<AngryDog>() &&
|
||||
target.type != ModContent.NPCType<Providence>() && target.type != ModContent.NPCType<ScornEater>())
|
||||
target.HitSound != SoundID.NPCHit56 && target.HitSound != SoundID.NPCHit57 && target.type != NPCType<AngryDog>() &&
|
||||
target.type != NPCType<Providence>() && target.type != NPCType<ScornEater>())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -571,11 +616,11 @@ namespace CalamityMod
|
||||
{
|
||||
target.AddBuff(BuffID.Ichor, (int)(120 * multiplier));
|
||||
target.AddBuff(BuffID.CursedInferno, (int)(120 * multiplier));
|
||||
target.AddBuff(ModContent.BuffType<ExoFreeze>(), (int)(30 * multiplier));
|
||||
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), (int)(120 * multiplier));
|
||||
target.AddBuff(ModContent.BuffType<GlacialState>(), (int)(120 * multiplier));
|
||||
target.AddBuff(ModContent.BuffType<Plague>(), (int)(120 * multiplier));
|
||||
target.AddBuff(ModContent.BuffType<HolyFlames>(), (int)(120 * multiplier));
|
||||
target.AddBuff(BuffType<ExoFreeze>(), (int)(30 * multiplier));
|
||||
target.AddBuff(BuffType<BrimstoneFlames>(), (int)(120 * multiplier));
|
||||
target.AddBuff(BuffType<GlacialState>(), (int)(120 * multiplier));
|
||||
target.AddBuff(BuffType<Plague>(), (int)(120 * multiplier));
|
||||
target.AddBuff(BuffType<HolyFlames>(), (int)(120 * multiplier));
|
||||
target.AddBuff(BuffID.Frostburn, (int)(120 * multiplier));
|
||||
target.AddBuff(BuffID.OnFire, (int)(120 * multiplier));
|
||||
}
|
||||
@@ -1158,7 +1203,7 @@ namespace CalamityMod
|
||||
public static Projectile ProjectileRain(Vector2 targetPos, float xLimit, float xVariance, float yLimitLower, float yLimitUpper, float projSpeed, int projType, int damage, float knockback, int owner)
|
||||
{
|
||||
float x = targetPos.X + Main.rand.NextFloat(-xLimit, xLimit);
|
||||
if (projType == ModContent.ProjectileType<AstralStarMagic>())
|
||||
if (projType == ProjectileType<AstralStarMagic>())
|
||||
x = targetPos.X + xLimit;
|
||||
float y = targetPos.Y - Main.rand.NextFloat(yLimitLower, yLimitUpper);
|
||||
Vector2 source = new Vector2(x, y);
|
||||
@@ -1435,7 +1480,7 @@ namespace CalamityMod
|
||||
float maxDist = range;
|
||||
Vector2 targetVec = projectile.position;
|
||||
bool foundTarget = false;
|
||||
bool isButterfly = projectile.type == ModContent.ProjectileType<PurpleButterfly>();
|
||||
bool isButterfly = projectile.type == ProjectileType<PurpleButterfly>();
|
||||
//Prioritize the targeted enemy if possible
|
||||
if (player.HasMinionAttackTargetNPC)
|
||||
{
|
||||
@@ -2205,15 +2250,15 @@ namespace CalamityMod
|
||||
// Snows
|
||||
TileID.SnowBlock,
|
||||
// Calamity Tiles
|
||||
ModContent.TileType<AstralDirt>(),
|
||||
ModContent.TileType<AstralClay>(),
|
||||
ModContent.TileType<AstralStone>(),
|
||||
ModContent.TileType<AstralSand>(),
|
||||
ModContent.TileType<AstralSnow>(),
|
||||
ModContent.TileType<Navystone>(),
|
||||
ModContent.TileType<EutrophicSand>(),
|
||||
ModContent.TileType<AbyssGravel>(),
|
||||
ModContent.TileType<Voidstone>(),
|
||||
TileType<AstralDirt>(),
|
||||
TileType<AstralClay>(),
|
||||
TileType<AstralStone>(),
|
||||
TileType<AstralSand>(),
|
||||
TileType<AstralSnow>(),
|
||||
TileType<Navystone>(),
|
||||
TileType<EutrophicSand>(),
|
||||
TileType<AbyssGravel>(),
|
||||
TileType<Voidstone>(),
|
||||
});
|
||||
|
||||
/// <summary>
|
||||
@@ -2240,14 +2285,14 @@ namespace CalamityMod
|
||||
TileID.Titanium,
|
||||
TileID.LunarOre,
|
||||
// Calamity Ores
|
||||
ModContent.TileType<AerialiteOre>(),
|
||||
ModContent.TileType<CryonicOre>(),
|
||||
ModContent.TileType<PerennialOre>(),
|
||||
ModContent.TileType<CharredOre>(),
|
||||
ModContent.TileType<ChaoticOre>(),
|
||||
ModContent.TileType<AstralOre>(),
|
||||
ModContent.TileType<UelibloomOre>(),
|
||||
ModContent.TileType<AuricOre>(),
|
||||
TileType<AerialiteOre>(),
|
||||
TileType<CryonicOre>(),
|
||||
TileType<PerennialOre>(),
|
||||
TileType<CharredOre>(),
|
||||
TileType<ChaoticOre>(),
|
||||
TileType<AstralOre>(),
|
||||
TileType<UelibloomOre>(),
|
||||
TileType<AuricOre>(),
|
||||
});
|
||||
|
||||
/// <summary>
|
||||
@@ -2274,14 +2319,14 @@ namespace CalamityMod
|
||||
TileID.FossilOre,
|
||||
TileID.DesertFossil,
|
||||
// Astral Desert
|
||||
ModContent.TileType<AstralSand>(),
|
||||
ModContent.TileType<HardenedAstralSand>(),
|
||||
ModContent.TileType<AstralSandstone>(),
|
||||
ModContent.TileType<AstralFossil>(),
|
||||
TileType<AstralSand>(),
|
||||
TileType<HardenedAstralSand>(),
|
||||
TileType<AstralSandstone>(),
|
||||
TileType<AstralFossil>(),
|
||||
// Sunken Sea
|
||||
ModContent.TileType<EutrophicSand>(),
|
||||
ModContent.TileType<Navystone>(),
|
||||
ModContent.TileType<SeaPrism>(),
|
||||
TileType<EutrophicSand>(),
|
||||
TileType<Navystone>(),
|
||||
TileType<SeaPrism>(),
|
||||
});
|
||||
|
||||
/// <summary>
|
||||
@@ -2297,9 +2342,9 @@ namespace CalamityMod
|
||||
TileID.FleshIce,
|
||||
TileID.HallowedIce,
|
||||
// Astral Snow
|
||||
ModContent.TileType<AstralIce>(),
|
||||
ModContent.TileType<AstralSnow>(),
|
||||
ModContent.TileType<AstralSilt>(),
|
||||
TileType<AstralIce>(),
|
||||
TileType<AstralSnow>(),
|
||||
TileType<AstralSilt>(),
|
||||
});
|
||||
|
||||
/// <summary>
|
||||
@@ -2311,7 +2356,7 @@ namespace CalamityMod
|
||||
TileID.Hellstone,
|
||||
TileID.ObsidianBrick,
|
||||
TileID.HellstoneBrick,
|
||||
ModContent.TileType<BrimstoneSlag>(),
|
||||
TileType<BrimstoneSlag>(),
|
||||
});
|
||||
|
||||
/// <summary>
|
||||
@@ -2320,14 +2365,14 @@ namespace CalamityMod
|
||||
/// <param name="type">The tile whose merging properties will be set.</param>
|
||||
public static void MergeWithAbyss(int type) => MergeWithSet(type, new int[] {
|
||||
// Sulphurous Sea
|
||||
ModContent.TileType<SulphurousSand>(),
|
||||
ModContent.TileType<SulphurousSandstone>(),
|
||||
TileType<SulphurousSand>(),
|
||||
TileType<SulphurousSandstone>(),
|
||||
// Abyss
|
||||
ModContent.TileType<AbyssGravel>(),
|
||||
ModContent.TileType<Voidstone>(),
|
||||
ModContent.TileType<PlantyMush>(),
|
||||
ModContent.TileType<Tenebris>(),
|
||||
ModContent.TileType<ChaoticOre>(),
|
||||
TileType<AbyssGravel>(),
|
||||
TileType<Voidstone>(),
|
||||
TileType<PlantyMush>(),
|
||||
TileType<Tenebris>(),
|
||||
TileType<ChaoticOre>(),
|
||||
});
|
||||
|
||||
/// <summary>
|
||||
@@ -2337,18 +2382,18 @@ namespace CalamityMod
|
||||
public static void MergeAstralTiles(int type)
|
||||
{
|
||||
//Astral
|
||||
SetMerge(type, ModContent.TileType<AstralDirt>());
|
||||
SetMerge(type, ModContent.TileType<AstralStone>());
|
||||
SetMerge(type, ModContent.TileType<AstralMonolith>());
|
||||
SetMerge(type, ModContent.TileType<AstralClay>());
|
||||
SetMerge(type, TileType<AstralDirt>());
|
||||
SetMerge(type, TileType<AstralStone>());
|
||||
SetMerge(type, TileType<AstralMonolith>());
|
||||
SetMerge(type, TileType<AstralClay>());
|
||||
//Astral Desert
|
||||
SetMerge(type, ModContent.TileType<AstralSand>());
|
||||
SetMerge(type, ModContent.TileType<HardenedAstralSand>());
|
||||
SetMerge(type, ModContent.TileType<AstralSandstone>());
|
||||
SetMerge(type, ModContent.TileType<AstralFossil>());
|
||||
SetMerge(type, TileType<AstralSand>());
|
||||
SetMerge(type, TileType<HardenedAstralSand>());
|
||||
SetMerge(type, TileType<AstralSandstone>());
|
||||
SetMerge(type, TileType<AstralFossil>());
|
||||
//Astral Snow
|
||||
SetMerge(type, ModContent.TileType<AstralIce>());
|
||||
SetMerge(type, ModContent.TileType<AstralSnow>());
|
||||
SetMerge(type, TileType<AstralIce>());
|
||||
SetMerge(type, TileType<AstralSnow>());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2361,10 +2406,10 @@ namespace CalamityMod
|
||||
SetMerge(type, TileID.MarbleBlock);
|
||||
SetMerge(type, TileID.GraniteBlock);
|
||||
//Calam
|
||||
SetMerge(type, ModContent.TileType<SmoothNavystone>());
|
||||
SetMerge(type, ModContent.TileType<SmoothBrimstoneSlag>());
|
||||
SetMerge(type, ModContent.TileType<SmoothAbyssGravel>());
|
||||
SetMerge(type, ModContent.TileType<SmoothVoidstone>());
|
||||
SetMerge(type, TileType<SmoothNavystone>());
|
||||
SetMerge(type, TileType<SmoothBrimstoneSlag>());
|
||||
SetMerge(type, TileType<SmoothAbyssGravel>());
|
||||
SetMerge(type, TileType<SmoothVoidstone>());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2376,14 +2421,14 @@ namespace CalamityMod
|
||||
//Vanilla decor
|
||||
Main.tileBrick[type] = true;
|
||||
//Calam
|
||||
SetMerge(type, ModContent.TileType<CryonicBrick>());
|
||||
SetMerge(type, ModContent.TileType<PerennialBrick>());
|
||||
SetMerge(type, ModContent.TileType<UelibloomBrick>());
|
||||
SetMerge(type, ModContent.TileType<OccultStone>());
|
||||
SetMerge(type, ModContent.TileType<ProfanedSlab>());
|
||||
SetMerge(type, ModContent.TileType<RunicProfanedBrick>());
|
||||
SetMerge(type, ModContent.TileType<AshenSlab>());
|
||||
SetMerge(type, ModContent.TileType<VoidstoneSlab>());
|
||||
SetMerge(type, TileType<CryonicBrick>());
|
||||
SetMerge(type, TileType<PerennialBrick>());
|
||||
SetMerge(type, TileType<UelibloomBrick>());
|
||||
SetMerge(type, TileType<OccultStone>());
|
||||
SetMerge(type, TileType<ProfanedSlab>());
|
||||
SetMerge(type, TileType<RunicProfanedBrick>());
|
||||
SetMerge(type, TileType<AshenSlab>());
|
||||
SetMerge(type, TileType<VoidstoneSlab>());
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -2524,7 +2569,7 @@ namespace CalamityMod
|
||||
player.showItemIconText = Main.chest[chest].name.Length > 0 ? Main.chest[chest].name : chestName;
|
||||
if (player.showItemIconText == chestName)
|
||||
{
|
||||
player.showItemIcon2 = ModContent.ItemType<T>();
|
||||
player.showItemIcon2 = ItemType<T>();
|
||||
player.showItemIconText = "";
|
||||
}
|
||||
}
|
||||
@@ -2715,7 +2760,7 @@ namespace CalamityMod
|
||||
}
|
||||
if (player.showItemIconText == chestName)
|
||||
{
|
||||
player.showItemIcon2 = ModContent.ItemType<T>();
|
||||
player.showItemIcon2 = ItemType<T>();
|
||||
player.showItemIconText = "";
|
||||
}
|
||||
}
|
||||
@@ -2757,7 +2802,7 @@ namespace CalamityMod
|
||||
}
|
||||
if (player.showItemIconText == chestName)
|
||||
{
|
||||
player.showItemIcon2 = ModContent.ItemType<T>();
|
||||
player.showItemIcon2 = ItemType<T>();
|
||||
player.showItemIconText = "";
|
||||
}
|
||||
}
|
||||
@@ -2890,9 +2935,9 @@ namespace CalamityMod
|
||||
player.showItemIconText = Main.chest[chest].name.Length > 0 ? Main.chest[chest].name : chestName;
|
||||
if (player.showItemIconText == chestName)
|
||||
{
|
||||
player.showItemIcon2 = ModContent.ItemType<C>();
|
||||
player.showItemIcon2 = ItemType<C>();
|
||||
if (Main.tile[left, top].frameX / 36 == 1)
|
||||
player.showItemIcon2 = ModContent.ItemType<K>();
|
||||
player.showItemIcon2 = ItemType<K>();
|
||||
player.showItemIconText = "";
|
||||
}
|
||||
}
|
||||
@@ -3530,7 +3575,7 @@ namespace CalamityMod
|
||||
int left = i - t.frameX % (width * sheetSquare) / sheetSquare;
|
||||
int top = j - t.frameY % (height * sheetSquare) / sheetSquare;
|
||||
|
||||
byte chargerType = ModContent.GetInstance<T>().type;
|
||||
byte chargerType = GetInstance<T>().type;
|
||||
bool exists = TileEntity.ByPosition.TryGetValue(new Point16(left, top), out TileEntity te);
|
||||
return exists && te.type == chargerType ? (T)te : null;
|
||||
}
|
||||
@@ -3564,11 +3609,11 @@ namespace CalamityMod
|
||||
// Draws the Power Cell item slot in a UI. Used by both the Power Cell Factory and Charging Station.
|
||||
internal static void DrawPowercellSlot(SpriteBatch spriteBatch, Item item, Vector2 drawPosition, float iconScale = 0.7f)
|
||||
{
|
||||
Texture2D slotBackgroundTex = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/PowerCellSlot_Empty");
|
||||
Texture2D slotBackgroundTex = GetTexture("CalamityMod/ExtraTextures/UI/PowerCellSlot_Empty");
|
||||
|
||||
// This check is done twice because the draw order matters. We want to draw the background icon before any text.
|
||||
if (item.stack > 0)
|
||||
slotBackgroundTex = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/PowerCellSlot_Filled");
|
||||
slotBackgroundTex = GetTexture("CalamityMod/ExtraTextures/UI/PowerCellSlot_Filled");
|
||||
|
||||
spriteBatch.Draw(slotBackgroundTex, drawPosition, null, Color.White, 0f, slotBackgroundTex.Size() * 0.5f, iconScale, SpriteEffects.None, 0f);
|
||||
if (item.stack > 0)
|
||||
|
||||
Reference in new issue
Block a user