This commit is contained in:
mountaindrew10 committed 2022-04-05 21:02:54 -05:00
commit eb3ff15efd
98 files changed
+475 -461

No files matched your search

+1
View File
@@ -2690,6 +2690,7 @@ namespace CalamityMod.CalPlayer
if (Main.snowTiles > 300)
Player.ZoneSnow = true;
}
public override Texture2D GetMapBackgroundImage()
{
if (ZoneSulphur)
-25
View File
@@ -752,31 +752,6 @@ namespace CalamityMod
// This function returns an available Calamity Music Mod track, or null if the Calamity Music Mod is not available.
public int? GetMusicFromMusicMod(string songFilename) => MusicAvailable ? MusicLoader.GetMusicSlot(musicMod, "Sounds/Music/" + songFilename) : null;
public override void UpdateMusic(ref int music, ref MusicPriority priority)
{
if (Main.musicVolume != 0)
{
if (Main.myPlayer != -1 && !Main.gameMenu && Main.LocalPlayer.active)
{
Player p = Main.LocalPlayer;
if (CalamityWorld.DoGSecondStageCountdown <= 530 && CalamityWorld.DoGSecondStageCountdown > 50) // 8 seconds before DoG returns
{
music = GetMusicFromMusicMod("DevourerOfGodsP2") ?? MusicID.LunarBoss;
priority = MusicPriority.BossMedium;
}
// This section handles boss rush music. However, at the time of PR-ing the boss rush visuals branch not all
// of the boss rush themes have been completed. As such, the custom music is intentionally omitted for the time being.
/*
if (BossRushEvent.BossRushActive && BossRushEvent.StartTimer >= BossRushEvent.StartEffectTotalTime)
{
music = BossRushEvent.MusicToPlay;
priority = MusicPriority.BossHigh;
}
*/
}
}
}
#endregion
#region Mod Support
+18 -18
View File
@@ -1,33 +1,33 @@
using CalamityMod.World;
using Terraria.ModLoader;
using System;
using Terraria;
using Terraria.Localization;
namespace CalamityMod.CustomRecipes
{
public class SchematicRecipe : ModRecipe
public static class SchematicRecipe
{
public string SchematicName;
public SchematicRecipe(Mod mod, string schematicName) : base(mod) => SchematicName = schematicName;
public override bool RecipeAvailable()
// TODO -- Use an enumeration instead of strings in the switch cases.
public static NetworkText ConstructRecipeCondition(string schematicName, out Predicate<Recipe> condition)
{
// Allow old worlds to craft the new schematics; They don't exist in old worlds
if (!CalamityWorld.IsWorldAfterDraedonUpdate)
return true;
switch (SchematicName)
switch (schematicName)
{
case "Sunken Sea":
return RecipeUnlockHandler.HasFoundSunkenSeaSchematic;
default:
condition = r => RecipeUnlockHandler.HasFoundSunkenSeaSchematic;
return NetworkText.FromKey($"Mods.Calamity.SunkenSeaSchematicRecipeCondition");
case "Planetoid":
return RecipeUnlockHandler.HasFoundPlanetoidSchematic;
condition = r => RecipeUnlockHandler.HasFoundPlanetoidSchematic;
return NetworkText.FromKey($"Mods.Calamity.PlanetoidSchematicRecipeCondition");
case "Jungle":
return RecipeUnlockHandler.HasFoundJungleSchematic;
condition = r => RecipeUnlockHandler.HasFoundJungleSchematic;
return NetworkText.FromKey($"Mods.Calamity.JungleSchematicRecipeCondition");
case "Hell":
return RecipeUnlockHandler.HasFoundHellSchematic;
condition = r => RecipeUnlockHandler.HasFoundHellSchematic;
return NetworkText.FromKey($"Mods.Calamity.UnderworldSchematicRecipeCondition");
case "Ice":
return RecipeUnlockHandler.HasFoundIceSchematic;
condition = r => RecipeUnlockHandler.HasFoundIceSchematic;
return NetworkText.FromKey($"Mods.Calamity.IceSchematicRecipeCondition");
}
return false;
}
}
}
-17
View File
@@ -18,24 +18,7 @@ namespace CalamityMod.Gores
gore.behindTiles = true;
gore.timeLeft = Gore.goreTime * 3;
}
public override bool DrawBehind(Gore gore)
{
Main.instance.LoadGore(gore.type);
int num = Main.goreTexture[gore.type].Height / (int)gore.numFrames;
Color alpha = gore.GetAlpha(Lighting.GetColor((int)((double)gore.position.X + (double)Main.goreTexture[gore.type].Width * 0.5) / 16, (int)(((double)gore.position.Y + (double)num * 0.5) / 16.0)));
Main.spriteBatch.Draw(
Main.goreTexture[gore.type],
new Vector2(gore.position.X - Main.screenPosition.X + (float)(Main.goreTexture[gore.type].Width / 2), gore.position.Y - Main.screenPosition.Y + (float)(num / 2) - 2f),
new Rectangle(0, num * (int)gore.frame, Main.goreTexture[gore.type].Width, num),
alpha, gore.rotation,
new Vector2((float)(Main.goreTexture[gore.type].Width / 2), (float)(num / 2)),
gore.scale, SpriteEffects.None, 0f);
return false;
}
public override bool Update(Gore gore)
{
if ((double)gore.position.Y < Main.worldSurface * 16.0 + 8.0)
+7 -7
View File
@@ -1,4 +1,4 @@
using CalamityMod.Tiles.DraedonStructures;
using CalamityMod.Tiles.DraedonStructures;
using CalamityMod.Tiles.FurnitureExo;
using System;
using System.Collections.Generic;
@@ -42,7 +42,7 @@ namespace CalamityMod.ILEditing
On.Terraria.Wiring.Teleport += DisableTeleporters; // only applies in boss rush
IL.Terraria.Main.DrawInterface_40_InteractItemIcon += MakeMouseHoverItemsSupportAnimations;
On.Terraria.Item.AffixName += IncorporateEnchantmentInAffix;
On.Terraria.Projectile.NewProjectile_float_float_float_float_int_int_float_int_float_float += IncorporateMinionExplodingCountdown;
On.Terraria.Projectile.NewProjectile_IEntitySource_float_float_float_float_int_int_float_int_float_float += IncorporateMinionExplodingCountdown;
On.Terraria.Main.DrawCursor += UseCoolFireCursorEffect;
IL.Terraria.Player.QuickHeal += ApplyManaBurnIfNeeded;
IL.Terraria.Player.QuickMana += ApplyManaBurnIfNeeded;
@@ -60,7 +60,7 @@ namespace CalamityMod.ILEditing
// Damage and health balance
IL.Terraria.Main.DamageVar += AdjustDamageVariance;
IL.Terraria.NPC.scaleStats += RemoveExpertHardmodeScaling;
IL.Terraria.NPC.ScaleStats += RemoveExpertHardmodeScaling;
IL.Terraria.Projectile.AI_001 += AdjustChlorophyteBullets;
// Movement speed balance
@@ -91,7 +91,7 @@ namespace CalamityMod.ILEditing
IL.Terraria.Main.UpdateTime += BloodMoonsRequire200MaxLife;
// Fix vanilla bugs exposed by Calamity mechanics
On.Terraria.Main.InitLifeBytes += BossRushLifeBytes;
// On.Terraria.Main.InitLifeBytes += BossRushLifeBytes;
IL.Terraria.NPC.NPCLoot += FixSplittingWormBannerDrops;
// IL.Terraria.Main.DoUpdate += FixProjectileUpdatePriorityProblems;
}
@@ -116,7 +116,7 @@ namespace CalamityMod.ILEditing
On.Terraria.Wiring.Teleport -= DisableTeleporters;
IL.Terraria.Main.DrawInterface_40_InteractItemIcon -= MakeMouseHoverItemsSupportAnimations;
On.Terraria.Item.AffixName -= IncorporateEnchantmentInAffix;
On.Terraria.Projectile.NewProjectile_float_float_float_float_int_int_float_int_float_float -= IncorporateMinionExplodingCountdown;
On.Terraria.Projectile.NewProjectile_IEntitySource_float_float_float_float_int_int_float_int_float_float -= IncorporateMinionExplodingCountdown;
On.Terraria.Main.DrawCursor -= UseCoolFireCursorEffect;
IL.Terraria.Player.QuickHeal -= ApplyManaBurnIfNeeded;
IL.Terraria.Player.QuickMana -= ApplyManaBurnIfNeeded;
@@ -134,7 +134,7 @@ namespace CalamityMod.ILEditing
// Damage and health balance
IL.Terraria.Main.DamageVar -= AdjustDamageVariance;
IL.Terraria.NPC.scaleStats -= RemoveExpertHardmodeScaling;
IL.Terraria.NPC.ScaleStats -= RemoveExpertHardmodeScaling;
IL.Terraria.Projectile.AI_001 -= AdjustChlorophyteBullets;
// Movement speed balance
@@ -165,7 +165,7 @@ namespace CalamityMod.ILEditing
IL.Terraria.Main.UpdateTime -= BloodMoonsRequire200MaxLife;
// Fix vanilla bugs exposed by Calamity mechanics
On.Terraria.Main.InitLifeBytes -= BossRushLifeBytes;
// On.Terraria.Main.InitLifeBytes -= BossRushLifeBytes;
IL.Terraria.NPC.NPCLoot -= FixSplittingWormBannerDrops;
// IL.Terraria.Main.DoUpdate -= FixProjectileUpdatePriorityProblems;
}
+2 -1
View File
@@ -14,6 +14,7 @@ using Mono.Cecil.Cil;
using MonoMod.Cil;
using System;
using Terraria;
using Terraria.DataStructures;
using Terraria.GameContent.Liquid;
using Terraria.GameInput;
using Terraria.Graphics;
@@ -294,7 +295,7 @@ namespace CalamityMod.ILEditing
#endregion Incorporate Enchantments in Item Names
#region Hellbound Enchantment Projectile Creation Effects
private static int IncorporateMinionExplodingCountdown(On.Terraria.Projectile.orig_NewProjectile_float_float_float_float_int_int_float_int_float_float orig, float x, float y, float xSpeed, float ySpeed, int type, int damage, float knockback, int owner, float ai0, float ai1)
private static int IncorporateMinionExplodingCountdown(On.Terraria.Projectile.orig_NewProjectile_IEntitySource_float_float_float_float_int_int_float_int_float_float orig, IEntitySource spawnSource, float x, float y, float xSpeed, float ySpeed, int type, int damage, float knockback, int owner, float ai0, float ai1)
{
// This is unfortunately not something that can be done via SetDefaults since owner is set
// after that method is called. Doing it directly when the projectile is spawned appears to be the only reasonable way.
+4 -1
View File
@@ -1,4 +1,4 @@
using CalamityMod.NPCs;
using CalamityMod.NPCs;
using Microsoft.Xna.Framework;
using Mono.Cecil.Cil;
using MonoMod.Cil;
@@ -81,6 +81,7 @@ namespace CalamityMod.ILEditing
public static List<OrderedProjectileEntry> OrderedProjectiles = new List<OrderedProjectileEntry>();
/*
#region Fixing NPC HP Sync Byte Counts in Boss Rush
// CONTEXT FOR FIX: When NPCs sync they have a pre-determined amount of bytes that are used to store HP/Max NPC information in packets for efficiency.
// However, this may not always coincide with the true HP of the NPC when it's created if it has more HP than the allocated bytes can sufficiently store, which can
@@ -88,6 +89,7 @@ namespace CalamityMod.ILEditing
// To give an example, the Ancient Visions in the culst fight have a few thousand HP to work with, placing it in the 2-life-bytes category, and thusly allowing HP values
// of up to 2^15 - 1 (32767). However, in Boss Rush, as of writing this, it has 50000 HP. In order to mitigate this, it must be placed in the 4-byte category, which allows
// values up to the integer limit.
// NOTE -- This mechanic appears to have been removed in 1.4.
private static void BossRushLifeBytes(On.Terraria.Main.orig_InitLifeBytes orig)
{
orig();
@@ -95,6 +97,7 @@ namespace CalamityMod.ILEditing
Main.npcLifeBytes[npcType] = 4;
}
#endregion Fixing NPC HP Sync Byte Counts in Boss Rush
*/
#region Fixing Splitting Worm Banner Spam in Deathmode
// CONTEXT FOR FIX: In Death Mode, normal worms are capable of splitting similarly to the Eater of Worlds. This, as expected, comes with problems with loot dropping, as you can kill multiple
+8 -1
View File
@@ -1,3 +1,4 @@
using System;
using CalamityMod.CustomRecipes;
using CalamityMod.Items.Materials;
using Terraria;
@@ -34,7 +35,13 @@ namespace CalamityMod.Items.DraedonMisc
public override void AddRecipes()
{
CreateRecipe(1).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 10).AddIngredient(ModContent.ItemType<DubiousPlating>(), 10).AddIngredient(ItemID.Glass, 50).AddTile(TileID.Anvils).Register();
CreateRecipe(1).
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 10).
AddIngredient(ModContent.ItemType<DubiousPlating>(), 10).
AddIngredient(ItemID.Glass, 50).
AddCondition(SchematicRecipe.ConstructRecipeCondition("Hell", out Predicate<Recipe> condition), condition).
AddTile(TileID.Anvils).
Register();
}
}
}
+8 -1
View File
@@ -1,3 +1,4 @@
using System;
using CalamityMod.CustomRecipes;
using CalamityMod.Items.Materials;
using Terraria;
@@ -34,7 +35,13 @@ namespace CalamityMod.Items.DraedonMisc
public override void AddRecipes()
{
CreateRecipe(1).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 10).AddIngredient(ModContent.ItemType<DubiousPlating>(), 10).AddIngredient(ItemID.Glass, 50).AddTile(TileID.Anvils).Register();
CreateRecipe(1).
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 10).
AddIngredient(ModContent.ItemType<DubiousPlating>(), 10).
AddIngredient(ItemID.Glass, 50).
AddCondition(SchematicRecipe.ConstructRecipeCondition("Ice", out Predicate<Recipe> condition), condition).
AddTile(TileID.Anvils).
Register();
}
}
}
@@ -1,3 +1,4 @@
using System;
using CalamityMod.CustomRecipes;
using CalamityMod.Items.Materials;
using Terraria;
@@ -34,7 +35,13 @@ namespace CalamityMod.Items.DraedonMisc
public override void AddRecipes()
{
CreateRecipe(1).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 10).AddIngredient(ModContent.ItemType<DubiousPlating>(), 10).AddIngredient(ItemID.Glass, 50).AddTile(TileID.Anvils).Register();
CreateRecipe(1).
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 10).
AddIngredient(ModContent.ItemType<DubiousPlating>(), 10).
AddIngredient(ItemID.Glass, 50).
AddCondition(SchematicRecipe.ConstructRecipeCondition("Jungle", out Predicate<Recipe> condition), condition).
AddTile(TileID.Anvils).
Register();
}
}
}
@@ -1,3 +1,4 @@
using System;
using CalamityMod.CustomRecipes;
using CalamityMod.Items.Materials;
using Terraria;
@@ -34,7 +35,13 @@ namespace CalamityMod.Items.DraedonMisc
public override void AddRecipes()
{
CreateRecipe(1).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 10).AddIngredient(ModContent.ItemType<DubiousPlating>(), 10).AddIngredient(ItemID.Glass, 50).AddTile(TileID.Anvils).Register();
CreateRecipe(1).
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 10).
AddIngredient(ModContent.ItemType<DubiousPlating>(), 10).
AddIngredient(ItemID.Glass, 50).
AddCondition(SchematicRecipe.ConstructRecipeCondition("Planetoid", out Predicate<Recipe> condition), condition).
AddTile(TileID.Anvils).
Register();
}
}
}
@@ -1,4 +1,4 @@
using CalamityMod.CustomRecipes;
using CalamityMod.CustomRecipes;
using CalamityMod.Items.Materials;
using Terraria;
using Terraria.ID;
@@ -14,7 +14,7 @@ namespace CalamityMod.Items.DraedonMisc
Tooltip.SetDefault("Finely detailed diagrams of numerous devices and weaponry dance across the holographic screen.\n" +
"The weaponry I supply to the workers of the laboratories is weak. Hardly suited for battle.\n" +
"However, they suffice for self defense against any lab mechanisms or creations which may have gone rogue.\n" +
"Addendum: For those who think themselves powerful, search the upper bounds of this planet’s atmosphere for a structure similar to that of the Sunken Seas.\n" +
"Addendum: For those who think themselves powerful, search the upper bounds of this planet’s atmosphere for a structure similar to that of the Sunken Seas.\n" +
"I will know by the end if you are worthy of battling my creations.\n" +
"Picking up this item or holding it in your inventory permanently unlocks new recipes");
}
@@ -43,7 +43,13 @@ namespace CalamityMod.Items.DraedonMisc
// Recipe exists for posierity.
public override void AddRecipes()
{
CreateRecipe(1).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 10).AddIngredient(ModContent.ItemType<DubiousPlating>(), 10).AddIngredient(ItemID.Glass, 50).AddTile(TileID.Anvils).Register();
CreateRecipe(1).
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 10).
AddIngredient(ModContent.ItemType<DubiousPlating>(), 10).
AddIngredient(ItemID.Glass, 50).
AddCondition(SchematicRecipe.ConstructRecipeCondition("Sunken Sea", out Predicate<Recipe> condition), condition).
AddTile(TileID.Anvils).
Register();
}
}
}
+6
View File
@@ -208,6 +208,12 @@ namespace CalamityMod.Localization
new [] { "Tier3ArsenalRecipeCondition", "Decrypt a schematic from the lab deep within the jungle" },
new [] { "Tier4ArsenalRecipeCondition", "Decrypt a schematic from the lab near the edges of the underworld" },
new [] { "Tier5ArsenalRecipeCondition", "Decrypt a schematic from the lab deep within the frozen caverns" },
new [] { "SunkenSeaSchematicRecipeCondition", "Place a schematic from the lab near the Sunken Sea in your inventory at least once" },
new [] { "PlanetoidSchematicRecipeCondition", "Place a schematic from the lab in the large planetoid in your inventory at least once" },
new [] { "JungleSchematicRecipeCondition", "Place a schematic from the lab deep within the jungle in your inventory at least once" },
new [] { "UnderworldSchematicRecipeCondition", "Place a schematic from the lab near the edges of the underworld in your inventory at least once" },
new [] { "IceSchematicRecipeCondition", "Place a schematic from the lab within the frozen caverns in your inventory at least once" },
};
}
+92 -98
View File
@@ -63,6 +63,8 @@ using CalamityMod.NPCs.ExoMechs;
using CalamityMod.NPCs.VanillaNPCOverrides.Bosses;
using CalamityMod.NPCs.VanillaNPCOverrides.RegularEnemies;
using CalamityMod.Balancing;
using Terraria.GameContent;
using CalamityMod.Systems;
namespace CalamityMod.NPCs
{
@@ -380,7 +382,7 @@ namespace CalamityMod.NPCs
#region Life Regen
public override void UpdateLifeRegen(NPC npc, ref int damage)
{
if (npc.damage > 0 && !npc.boss && !npc.friendly && !npc.dontTakeDamage && CalamityWorld.sulphurTiles > 30 &&
if (npc.damage > 0 && !npc.boss && !npc.friendly && !npc.dontTakeDamage && BiomeTileCounterSystem.SulphurTiles > 30 &&
!npc.buffImmune[BuffID.Poisoned] && !npc.buffImmune[BuffType<CrushDepth>()])
{
if (npc.wet)
@@ -462,15 +464,15 @@ namespace CalamityMod.NPCs
Item heldItem = Main.player[owner].ActiveItem();
int totalDamage = (int)(150 * Main.player[owner].GetDamage(DamageClass.Summon));
bool forbidden = Main.player[owner].head == ArmorIDs.Head.AncientBattleArmor && Main.player[owner].body == ArmorIDs.Body.AncientBattleArmor && Main.player[owner].legs == ArmorIDs.Legs.AncientBattleArmor;
bool reducedNerf = Main.player[owner].Calamity().fearmongerSet || (forbidden && heldItem.magic);
bool reducedNerf = Main.player[owner].Calamity().fearmongerSet || (forbidden && heldItem.CountsAsClass<MagicDamageClass>());
double summonNerfMult = reducedNerf ? 0.75 : 0.5;
if (!Main.player[owner].Calamity().profanedCrystalBuffs)
{
if (heldItem.type > ItemID.None)
{
if (!heldItem.summon &&
(heldItem.melee || heldItem.ranged || heldItem.magic || heldItem.Calamity().rogue) &&
if (!heldItem.CountsAsClass<SummonDamageClass>() &&
(heldItem.CountsAsClass<MeleeDamageClass>() || heldItem.CountsAsClass<RangedDamageClass>() || heldItem.CountsAsClass<MagicDamageClass>() || heldItem.Calamity().rogue) &&
heldItem.hammer == 0 && heldItem.pick == 0 && heldItem.axe == 0 && heldItem.useStyle != 0 &&
!heldItem.accessory && heldItem.ammo == AmmoID.None)
{
@@ -2203,7 +2205,7 @@ namespace CalamityMod.NPCs
public static void DrawGlowmask(NPC npc, SpriteBatch spriteBatch, Texture2D texture = null, bool invertedDirection = false, Vector2 offset = default)
{
if (texture is null)
texture = Main.npcTexture[npc.type];
texture = TextureAssets.Npc[npc.type].Value;
SpriteEffects effects = npc.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
if (invertedDirection)
effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
@@ -2244,7 +2246,7 @@ namespace CalamityMod.NPCs
endingColor.A = 0;
Color drawColor = npc.GetAlpha(startingColor);
Texture2D npcTexture = texture ?? Main.npcTexture[npc.type];
Texture2D npcTexture = texture ?? TextureAssets.Npc[npc.type].Value;
Vector2 origin = npc.Size * 0.5f;
int afterimageCounter = 1;
while (afterimageCounter < NPCID.Sets.TrailCacheLength[npc.type] && CalamityConfig.Instance.Afterimages)
@@ -2272,9 +2274,9 @@ namespace CalamityMod.NPCs
if (Main.netMode == NetmodeID.SinglePlayer || numPlayers <= 1)
return;
bool countsAsBoss = npc.boss || NPCID.Sets.TechnicallyABoss[npc.type];
bool countsAsBoss = npc.boss || NPCID.Sets.ShouldBeCountedAsBoss[npc.type];
bool scalesLikeBoss = countsAsBoss || CalamityLists.bossHPScaleList.Contains(npc.type);
bool isCalamityNPC = npc.modNPC != null && npc.modNPC.Mod == CalamityMod.Instance;
bool isCalamityNPC = npc.ModNPC != null && npc.ModNPC.Mod == CalamityMod.Instance;
// All bosses, NPCs that are supposed to scale like bosses, and Calamity NPCs follow these rules.
if (scalesLikeBoss || isCalamityNPC)
@@ -2374,7 +2376,7 @@ namespace CalamityMod.NPCs
effectiveDefense = 0;
// Apply vanilla-style defense before DR, using Calamity's reduced defense.
damage = Main.CalculateDamage((int)damage, effectiveDefense);
damage = Main.CalculateDamageNPCsTake((int)damage, effectiveDefense);
// DR applies after vanilla defense.
damage = ApplyDR(npc, damage, yellowCandleDamage);
@@ -2403,7 +2405,7 @@ namespace CalamityMod.NPCs
// Cancel out vanilla defense math by reversing the calculation vanilla is about to perform.
// While roundabout, this is safer than returning false to stop vanilla damage calculations entirely.
// Other mods will probably expect the vanilla code to run and may compensate for it themselves.
damage = Main.CalculateDamage((int)damage, -defense);
damage = Main.CalculateDamageNPCsTake((int)damage, -defense);
return true;
}
@@ -3900,7 +3902,7 @@ namespace CalamityMod.NPCs
npc.type == NPCType<DarkEnergy>() || npc.type == NPCType<RavagerBody>() || CalamityLists.AresIDs.Contains(npc.type) || npc.type == NPCType<CrabulonIdle>())
{
double damageMult = CalamityLists.ThanatosIDs.Contains(npc.type) ? 0.35 : 0.5;
if (item.melee && item.type != ItemType<UltimusCleaver>() && item.type != ItemType<InfernaCutter>())
if (item.CountsAsClass<MeleeDamageClass>() && item.type != ItemType<UltimusCleaver>() && item.type != ItemType<InfernaCutter>())
damage = (int)(damage * damageMult);
}
}
@@ -4866,7 +4868,7 @@ namespace CalamityMod.NPCs
return null;
}
public override bool PreDraw(NPC npc, SpriteBatch spriteBatch, Color drawColor)
public override bool PreDraw(NPC npc, SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
if (npc.type != NPCID.BrainofCthulhu && (npc.type != NPCID.DukeFishron || npc.ai[0] <= 9f) && npc.active)
{
@@ -4876,123 +4878,123 @@ namespace CalamityMod.NPCs
// Damage over time debuffs
if (aFlames > 0)
buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/AbyssalFlames"));
buffTextureList.Add(Request<Texture2D>("CalamityMod/Buffs/DamageOverTime/AbyssalFlames").Value);
if (astralInfection > 0)
buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/AstralInfectionDebuff"));
buffTextureList.Add(Request<Texture2D>("CalamityMod/Buffs/DamageOverTime/AstralInfectionDebuff").Value);
if (bFlames > 0)
buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/BrimstoneFlames"));
buffTextureList.Add(Request<Texture2D>("CalamityMod/Buffs/DamageOverTime/BrimstoneFlames").Value);
if (bBlood > 0)
buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/BurningBlood"));
buffTextureList.Add(Request<Texture2D>("CalamityMod/Buffs/DamageOverTime/BurningBlood").Value);
if (cDepth > 0)
buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/CrushDepth"));
buffTextureList.Add(Request<Texture2D>("CalamityMod/Buffs/DamageOverTime/CrushDepth").Value);
if (dFlames > 0)
buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/DemonFlames"));
buffTextureList.Add(Request<Texture2D>("CalamityMod/Buffs/DamageOverTime/DemonFlames").Value);
if (gsInferno > 0)
buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/GodSlayerInferno"));
buffTextureList.Add(Request<Texture2D>("CalamityMod/Buffs/DamageOverTime/GodSlayerInferno").Value);
if (hFlames > 0)
buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/HolyFlames"));
buffTextureList.Add(Request<Texture2D>("CalamityMod/Buffs/DamageOverTime/HolyFlames").Value);
if (nightwither > 0)
buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/Nightwither"));
buffTextureList.Add(Request<Texture2D>("CalamityMod/Buffs/DamageOverTime/Nightwither").Value);
if (pFlames > 0)
buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/Plague"));
buffTextureList.Add(Request<Texture2D>("CalamityMod/Buffs/DamageOverTime/Plague").Value);
if (shellfishVore > 0)
buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/ShellfishEating"));
buffTextureList.Add(Request<Texture2D>("CalamityMod/Buffs/DamageOverTime/ShellfishEating").Value);
if (somaShredStacks > 0)
buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/Shred"));
buffTextureList.Add(Request<Texture2D>("CalamityMod/Buffs/DamageOverTime/Shred").Value);
if (clamDebuff > 0)
buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/SnapClamDebuff"));
buffTextureList.Add(Request<Texture2D>("CalamityMod/Buffs/DamageOverTime/SnapClamDebuff").Value);
if (sulphurPoison > 0)
buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/SulphuricPoisoning"));
buffTextureList.Add(Request<Texture2D>("CalamityMod/Buffs/DamageOverTime/SulphuricPoisoning").Value);
if (sagePoisonTime > 0)
buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/SagePoison"));
buffTextureList.Add(Request<Texture2D>("CalamityMod/Buffs/DamageOverTime/SagePoison").Value);
if (vaporfied > 0)
buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/Vaporfied"));
buffTextureList.Add(Request<Texture2D>("CalamityMod/Buffs/DamageOverTime/Vaporfied").Value);
// Stat debuffs
if (aCrunch > 0)
buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/ArmorCrunch"));
buffTextureList.Add(Request<Texture2D>("CalamityMod/Buffs/StatDebuffs/ArmorCrunch").Value);
if (enraged > 0)
buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/Enraged"));
buffTextureList.Add(Request<Texture2D>("CalamityMod/Buffs/StatDebuffs/Enraged").Value);
if (eutrophication > 0)
buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/Eutrophication"));
buffTextureList.Add(Request<Texture2D>("CalamityMod/Buffs/StatDebuffs/Eutrophication").Value);
if (eFreeze > 0)
buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/ExoFreeze"));
buffTextureList.Add(Request<Texture2D>("CalamityMod/Buffs/StatDebuffs/ExoFreeze").Value);
if (gState > 0)
buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/GlacialState"));
buffTextureList.Add(Request<Texture2D>("CalamityMod/Buffs/StatDebuffs/GlacialState").Value);
if (irradiated > 0)
buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/Irradiated"));
buffTextureList.Add(Request<Texture2D>("CalamityMod/Buffs/StatDebuffs/Irradiated").Value);
if (kamiFlu > 0)
buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/KamiDebuff"));
buffTextureList.Add(Request<Texture2D>("CalamityMod/Buffs/StatDebuffs/KamiDebuff").Value);
if (marked > 0)
buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/MarkedforDeath"));
buffTextureList.Add(Request<Texture2D>("CalamityMod/Buffs/StatDebuffs/MarkedforDeath").Value);
if (pearlAura > 0)
buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/PearlAura"));
buffTextureList.Add(Request<Texture2D>("CalamityMod/Buffs/StatDebuffs/PearlAura").Value);
if (relicOfResilienceWeakness > 0)
buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/ProfanedWeakness"));
buffTextureList.Add(Request<Texture2D>("CalamityMod/Buffs/StatDebuffs/ProfanedWeakness").Value);
if (tSad > 0)
buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/TemporalSadness"));
buffTextureList.Add(Request<Texture2D>("CalamityMod/Buffs/StatDebuffs/TemporalSadness").Value);
if (tesla > 0)
buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/TeslaFreeze"));
buffTextureList.Add(Request<Texture2D>("CalamityMod/Buffs/StatDebuffs/TeslaFreeze").Value);
if (timeSlow > 0)
buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/TimeSlow"));
buffTextureList.Add(Request<Texture2D>("CalamityMod/Buffs/StatDebuffs/TimeSlow").Value);
if (wCleave > 0)
buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/WarCleave"));
buffTextureList.Add(Request<Texture2D>("CalamityMod/Buffs/StatDebuffs/WarCleave").Value);
if (wDeath > 0)
buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/WhisperingDeath"));
buffTextureList.Add(Request<Texture2D>("CalamityMod/Buffs/StatDebuffs/WhisperingDeath").Value);
if (wither > 0)
buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/WitherDebuff"));
buffTextureList.Add(Request<Texture2D>("CalamityMod/Buffs/StatDebuffs/WitherDebuff").Value);
// Vanilla damage over time debuffs
if (electrified > 0)
buffTextureList.Add(Main.buffTexture[BuffID.Electrified]);
buffTextureList.Add(TextureAssets.Buff[BuffID.Electrified].Value);
if (npc.onFire)
buffTextureList.Add(Main.buffTexture[BuffID.OnFire]);
buffTextureList.Add(TextureAssets.Buff[BuffID.OnFire].Value);
if (npc.poisoned)
buffTextureList.Add(Main.buffTexture[BuffID.Poisoned]);
buffTextureList.Add(TextureAssets.Buff[BuffID.Poisoned].Value);
if (npc.onFire2)
buffTextureList.Add(Main.buffTexture[BuffID.CursedInferno]);
buffTextureList.Add(TextureAssets.Buff[BuffID.CursedInferno].Value);
if (npc.onFrostBurn)
buffTextureList.Add(Main.buffTexture[BuffID.Frostburn]);
buffTextureList.Add(TextureAssets.Buff[BuffID.Frostburn].Value);
if (npc.venom)
buffTextureList.Add(Main.buffTexture[BuffID.Venom]);
buffTextureList.Add(TextureAssets.Buff[BuffID.Venom].Value);
if (npc.shadowFlame)
buffTextureList.Add(Main.buffTexture[BuffID.ShadowFlame]);
buffTextureList.Add(TextureAssets.Buff[BuffID.ShadowFlame].Value);
if (npc.oiled)
buffTextureList.Add(Main.buffTexture[BuffID.Oiled]);
buffTextureList.Add(TextureAssets.Buff[BuffID.Oiled].Value);
if (npc.javelined)
buffTextureList.Add(Main.buffTexture[BuffID.BoneJavelin]);
buffTextureList.Add(TextureAssets.Buff[BuffID.BoneJavelin].Value);
if (npc.daybreak)
buffTextureList.Add(Main.buffTexture[BuffID.Daybreak]);
buffTextureList.Add(TextureAssets.Buff[BuffID.Daybreak].Value);
if (npc.celled)
buffTextureList.Add(Main.buffTexture[BuffID.StardustMinionBleed]);
buffTextureList.Add(TextureAssets.Buff[BuffID.StardustMinionBleed].Value);
if (npc.dryadBane)
buffTextureList.Add(Main.buffTexture[BuffID.DryadsWardDebuff]);
buffTextureList.Add(TextureAssets.Buff[BuffID.DryadsWardDebuff].Value);
if (npc.dryadWard)
buffTextureList.Add(Main.buffTexture[BuffID.DryadsWard]);
buffTextureList.Add(TextureAssets.Buff[BuffID.DryadsWard].Value);
if (npc.soulDrain && npc.realLife == -1)
buffTextureList.Add(Main.buffTexture[BuffID.SoulDrain]);
buffTextureList.Add(TextureAssets.Buff[BuffID.SoulDrain].Value);
// Vanilla stat debuffs
if (npc.confused)
buffTextureList.Add(Main.buffTexture[BuffID.Confused]);
buffTextureList.Add(TextureAssets.Buff[BuffID.Confused].Value);
if (npc.ichor)
buffTextureList.Add(Main.buffTexture[BuffID.Ichor]);
buffTextureList.Add(TextureAssets.Buff[BuffID.Ichor].Value);
if (slowed > 0)
buffTextureList.Add(Main.buffTexture[BuffID.Slow]);
buffTextureList.Add(TextureAssets.Buff[BuffID.Slow].Value);
if (webbed > 0)
buffTextureList.Add(Main.buffTexture[BuffID.Webbed]);
buffTextureList.Add(TextureAssets.Buff[BuffID.Webbed].Value);
if (npc.midas)
buffTextureList.Add(Main.buffTexture[BuffID.Midas]);
buffTextureList.Add(TextureAssets.Buff[BuffID.Midas].Value);
if (npc.loveStruck)
buffTextureList.Add(Main.buffTexture[BuffID.Lovestruck]);
buffTextureList.Add(TextureAssets.Buff[BuffID.Lovestruck].Value);
if (npc.stinky)
buffTextureList.Add(Main.buffTexture[BuffID.Stinky]);
buffTextureList.Add(TextureAssets.Buff[BuffID.Stinky].Value);
if (npc.betsysCurse)
buffTextureList.Add(Main.buffTexture[BuffID.BetsysCurse]);
buffTextureList.Add(TextureAssets.Buff[BuffID.BetsysCurse].Value);
if (npc.dripping)
buffTextureList.Add(Main.buffTexture[BuffID.Wet]);
buffTextureList.Add(TextureAssets.Buff[BuffID.Wet].Value);
if (npc.drippingSlime)
buffTextureList.Add(Main.buffTexture[BuffID.Slimed]);
buffTextureList.Add(TextureAssets.Buff[BuffID.Slimed].Value);
// Total amount of elements in the buff list
int buffTextureListLength = buffTextureList.Count;
@@ -5008,14 +5010,11 @@ namespace CalamityMod.NPCs
float drawPosX = totalLength >= 80f ? 40f : (float)(totalLength / 2);
// The height of a single frame of the npc
float npcHeight = (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2) * npc.scale;
float npcHeight = (float)(TextureAssets.Npc[npc.type].Value.Height / Main.npcFrameCount[npc.type] / 2) * npc.scale;
// Offset the debuff display based on the npc's graphical offset, and 16 units, to create some space between the sprite and the display
float drawPosY = npcHeight + npc.gfxOffY + 16f;
// The position where the display is drawn
Vector2 drawPos = npc.Center - Main.screenPosition;
// Iterate through the buff texture list
for (int i = 0; i < buffTextureList.Count; i++)
{
@@ -5033,7 +5032,7 @@ namespace CalamityMod.NPCs
// Draw the display
var tex = buffTextureList.ElementAt(i);
spriteBatch.Draw(tex, drawPos - new Vector2(drawPosX, drawPosY + additionalYOffset), null, Color.White, 0f, default, 0.5f, SpriteEffects.None, 0f);
spriteBatch.Draw(tex, npc.Center - screenPos - new Vector2(drawPosX, drawPosY + additionalYOffset), null, Color.White, 0f, default, 0.5f, SpriteEffects.None, 0f);
// TODO -- Show number of Shred stacks (how?)
}
@@ -5051,19 +5050,19 @@ namespace CalamityMod.NPCs
if (npc.type == NPCID.GolemHeadFree)
{
// Draw the head as usual.
Texture2D golemHeadTexture = Main.npcTexture[npc.type];
Vector2 headDrawPosition = npc.Center + Vector2.UnitY * npc.gfxOffY - Main.screenPosition;
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, Main.golemTexture[1].Width, Main.golemTexture[1].Height / 2);
spriteBatch.Draw(Main.golemTexture[1], eyesDrawPosition, eyesFrame, eyeColor, 0f, eyesFrame.Size() * 0.5f, npc.scale, SpriteEffects.None, 0f);
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);
return false;
}
if (Main.LocalPlayer.Calamity().trippy)
if (Main.LocalPlayer.Calamity().trippy && !npc.IsABestiaryIconDummy)
{
SpriteEffects spriteEffects = SpriteEffects.None;
if (npc.spriteDirection == 1)
@@ -5072,7 +5071,7 @@ namespace CalamityMod.NPCs
}
float num66 = 0f;
Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2);
Vector2 vector11 = new Vector2(TextureAssets.Npc[npc.type].Value.Width / 2, TextureAssets.Npc[npc.type].Value.Height / Main.npcFrameCount[npc.type] / 2);
Color color9 = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, 0);
Color alpha15 = npc.GetAlpha(color9);
float num212 = 0.99f;
@@ -5108,7 +5107,7 @@ namespace CalamityMod.NPCs
position9.Y -= npc.height / 2;
Main.spriteBatch.Draw(Main.npcTexture[npc.type], new Vector2(position9.X - Main.screenPosition.X + npc.width / 2 - Main.npcTexture[npc.type].Width * npc.scale / 2f + vector11.X * npc.scale, position9.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + vector11.Y * npc.scale + num66 + npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(npc.frame), alpha15, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
Main.spriteBatch.Draw(TextureAssets.Npc[npc.type].Value, new Vector2(position9.X - screenPos.X + npc.width / 2 - TextureAssets.Npc[npc.type].Value.Width * npc.scale / 2f + vector11.X * npc.scale, position9.Y - screenPos.Y + npc.height - TextureAssets.Npc[npc.type].Value.Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + vector11.Y * npc.scale + num66 + npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(npc.frame), alpha15, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
}
}
else
@@ -5144,27 +5143,27 @@ namespace CalamityMod.NPCs
Filters.Scene["CrystalDestructionColor"].GetShader().UseIntensity((float)Math.Sin(animationTime * MathHelper.Pi) * 0.4f);
}
Vector2 drawPosition = npc.Center - Main.screenPosition + Vector2.UnitY * 60f;
Vector2 drawPosition = npc.Center - screenPos + Vector2.UnitY * 60f;
for (int i = 0; i < 4; i++)
{
float intensity = MathHelper.Clamp(animationTime * 2f - i / 3f, 0f, 1f);
Vector2 origin = new Vector2(Main.magicPixel.Width / 2f, Main.magicPixel.Height);
Vector2 origin = new Vector2(TextureAssets.MagicPixel.Value.Width / 2f, TextureAssets.MagicPixel.Value.Height);
Vector2 scale = new Vector2((float)Math.Sqrt(intensity) * 50f, intensity * 4f);
Color beamColor = new Color(0.4f, 0.17f, 0.4f, 0f) * (intensity * (1f - MathHelper.Clamp((animationTime - 0.8f) / 0.2f, 0f, 1f))) * 0.5f;
spriteBatch.Draw(Main.magicPixel, drawPosition, null, beamColor, 0f, origin, scale, SpriteEffects.None, 0f);
spriteBatch.Draw(TextureAssets.MagicPixel.Value, drawPosition, null, beamColor, 0f, origin, scale, SpriteEffects.None, 0f);
}
}
return true;
}
public override void PostDraw(NPC npc, SpriteBatch spriteBatch, Color drawColor)
public override void PostDraw(NPC npc, SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
if (CalamityWorld.revenge || BossRushEvent.BossRushActive)
{
// His afterimages I can't get to work, so fuck it
if (npc.type == NPCID.SkeletronPrime)
{
Texture2D npcTexture = Main.npcTexture[npc.type];
Texture2D npcTexture = TextureAssets.Npc[npc.type].Value;
int frameHeight = npcTexture.Height / Main.npcFrameCount[npc.type];
npc.frame.Y = (int)newAI[3];
@@ -5203,16 +5202,16 @@ namespace CalamityMod.NPCs
if (npc.spriteDirection == 1)
spriteEffects = SpriteEffects.FlipHorizontally;
spriteBatch.Draw(npcTexture, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame, npc.GetAlpha(drawColor), npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0f);
spriteBatch.Draw(npcTexture, npc.Center - screenPos + new Vector2(0, npc.gfxOffY), npc.frame, npc.GetAlpha(drawColor), npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0f);
spriteBatch.Draw(Main.BoneEyesTexture, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY),
spriteBatch.Draw(TextureAssets.BoneEyes.Value, npc.Center - screenPos + new Vector2(0, npc.gfxOffY),
npc.frame, new Color(200, 200, 200, 0), npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0f);
}
else if (CalamityLists.DestroyerIDs.Contains(npc.type))
{
if (drawColor != Color.Black)
{
Texture2D npcTexture = Main.npcTexture[npc.type];
Texture2D npcTexture = TextureAssets.Npc[npc.type].Value;
int frameHeight = npcTexture.Height / Main.npcFrameCount[npc.type];
Vector2 halfSize = npc.frame.Size() / 2;
@@ -5229,7 +5228,7 @@ namespace CalamityMod.NPCs
}
// Draw segments
spriteBatch.Draw(npcTexture, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY),
spriteBatch.Draw(npcTexture, npc.Center - screenPos + new Vector2(0, npc.gfxOffY),
npc.frame, npc.GetAlpha(drawColor), npc.rotation, halfSize, npc.scale, spriteEffects, 0f);
// Draw lights
@@ -5237,12 +5236,12 @@ namespace CalamityMod.NPCs
{
if ((newAI[3] >= 900f && npc.life / (float)npc.lifeMax < 0.5f) || (newAI[1] < 600f && newAI[1] > 60f))
{
spriteBatch.Draw(Main.destTexture[npc.type - NPCID.TheDestroyer], npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame,
spriteBatch.Draw(TextureAssets.Dest[npc.type - NPCID.TheDestroyer].Value, npc.Center - screenPos + new Vector2(0, npc.gfxOffY), npc.frame,
new Color(50, 50, 255, 0) * (1f - npc.alpha / 255f), npc.rotation, halfSize, npc.scale, spriteEffects, 0f);
}
else
{
spriteBatch.Draw(Main.destTexture[npc.type - NPCID.TheDestroyer], npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame,
spriteBatch.Draw(TextureAssets.Dest[npc.type - NPCID.TheDestroyer].Value, npc.Center - screenPos + new Vector2(0, npc.gfxOffY), npc.frame,
new Color(255, 255, 255, 0) * (1f - npc.alpha / 255f), npc.rotation, halfSize, npc.scale, spriteEffects, 0f);
}
}
@@ -5561,7 +5560,7 @@ namespace CalamityMod.NPCs
{
if (plr == Main.myPlayer && projectile.ai[0] == 0f)
{
for (int item = 0; item < Main.maxInventory; item++)
for (int item = 0; item < Main.InventorySlotsTotal; item++)
{
if (player.inventory[item].type == baitType)
{
@@ -5603,7 +5602,7 @@ namespace CalamityMod.NPCs
if (proj is null)
return;
int oldDuke = NPC.NewNPC((int)proj.Center.X, (int)proj.Center.Y + 100, NPCType<OldDuke.OldDuke>());
int oldDuke = NPC.NewNPC(NPC.GetBossSpawnSource(player.whoAmI), (int)proj.Center.X, (int)proj.Center.Y + 100, NPCType<OldDuke.OldDuke>());
CalamityUtils.BossAwakenMessage(oldDuke);
}
else
@@ -5995,11 +5994,6 @@ namespace CalamityMod.NPCs
{
for (int j = y - 1; j <= y + 1; j++)
{
if (Main.tile[i, j] is null)
{
return;
}
if (Main.tile[i, j].WallType > 0)
{
flag = true;
+2 -2
View File
@@ -262,8 +262,8 @@ namespace CalamityMod.Projectiles.Pets
if (num345 >= num347 - lastTileRangeX && num345 <= num347 + lastTileRangeX + 1 && num346 >= num348 - lastTileRangeY && num346 <= num348 + lastTileRangeY + 1)
{
Main.player[projectile.owner].noThrow = 2;
Main.player[projectile.owner].showItemIcon = true;
Main.player[projectile.owner].showItemIcon2 = 3213;
Main.player[projectile.owner].cursorItemIconEnabled = true;
Main.player[projectile.owner].cursorItemIconID = 3213;
if (PlayerInput.UsingGamepad)
{
Main.player[projectile.owner].GamepadEnableGrappleCooldown();
+15
View File
@@ -0,0 +1,15 @@
using CalamityMod.World;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Systems
{
public class DoGPhase2TransitionMusicSystem : ModSceneEffect
{
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("DevourerOfGodsP2") ?? MusicID.LunarBoss;
public override SceneEffectPriority Priority => SceneEffectPriority.BossMedium;
public override bool IsSceneEffectActive(Player player) => CalamityWorld.DoGSecondStageCountdown <= 530 && CalamityWorld.DoGSecondStageCountdown > 50;
}
}
+6 -6
View File
@@ -85,20 +85,20 @@ namespace CalamityMod.Tiles.Astral
public override void MouseOver(int i, int j)
{
Main.LocalPlayer.showItemIcon2 = ModContent.ItemType<TitanHeart>();
Main.LocalPlayer.cursorItemIconID = ModContent.ItemType<TitanHeart>();
if (Main.LocalPlayer.HasItem(ModContent.ItemType<Starcore>()))
Main.LocalPlayer.showItemIcon2 = ModContent.ItemType<Starcore>();
Main.LocalPlayer.cursorItemIconID = ModContent.ItemType<Starcore>();
Main.LocalPlayer.noThrow = 2;
Main.LocalPlayer.showItemIcon = true;
Main.LocalPlayer.cursorItemIconEnabled = true;
}
public override void MouseOverFar(int i, int j)
{
Main.LocalPlayer.showItemIcon2 = ModContent.ItemType<TitanHeart>();
Main.LocalPlayer.cursorItemIconID = ModContent.ItemType<TitanHeart>();
if (Main.LocalPlayer.HasItem(ModContent.ItemType<Starcore>()))
Main.LocalPlayer.showItemIcon2 = ModContent.ItemType<Starcore>();
Main.LocalPlayer.cursorItemIconID = ModContent.ItemType<Starcore>();
Main.LocalPlayer.noThrow = 2;
Main.LocalPlayer.showItemIcon = true;
Main.LocalPlayer.cursorItemIconEnabled = true;
}
}
}
+56 -61
View File
@@ -1,4 +1,4 @@
using CalamityMod.Events;
using CalamityMod.Events;
using CalamityMod.Items.Potions;
using CalamityMod.Items.TreasureBags;
using CalamityMod.Items.Weapons.Melee;
@@ -17,6 +17,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
@@ -24,7 +25,7 @@ namespace CalamityMod.Tiles
{
public class CalamityGlobalTile : GlobalTile
{
public static IList<ModWaterStyle> WaterStyles => (IList<ModWaterStyle>)typeof(WaterStyleLoader).GetField("waterStyles", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null);
public static IList<ModWaterStyle> WaterStyles => (IList<ModWaterStyle>)typeof(WaterStylesLoader).GetField("waterStyles", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null);
public static ushort[] PlantTypes = new ushort[]
{
@@ -36,22 +37,22 @@ namespace CalamityMod.Tiles
TileID.JunglePlants2,
TileID.HallowedPlants,
TileID.HallowedPlants2,
TileID.FleshWeeds,
TileID.CrimsonPlants,
(ushort)ModContent.TileType<AstralShortPlants>(),
(ushort)ModContent.TileType<AstralTallPlants>()
};
public static List<int> GrowthTiles = new List<int>
public static List<int> GrowthTiles = new List<int>()
{
(ushort)ModContent.TileType<SeaPrism>(),
(ushort)ModContent.TileType<Navystone>(),
(ushort)ModContent.TileType<Voidstone>()
ModContent.TileType<SeaPrism>(),
ModContent.TileType<Navystone>(),
ModContent.TileType<Voidstone>()
};
public override void SetStaticDefaults()
{
Main.tileSpelunker[TileID.LunarOre] = true;
Main.tileValue[TileID.LunarOre] = 900;
Main.tileOreFinderPriority[TileID.LunarOre] = 900;
}
public override bool PreHitWire(int i, int j, int type)
@@ -94,32 +95,28 @@ namespace CalamityMod.Tiles
int frameY = tile.TileFrameY;
// Search down the cactus to find out whether the block it is planted in is Astral Sand.
bool astralCactus = false;
if (!Main.canDrawColorTile(i, j))
{
int xTile = i;
if (frameX == 36) // Cactus segment which splits left
xTile--;
if (frameX == 54) // Cactus segment which splits right
xTile++;
if (frameX == 108) // Cactus segment which splits both directions
xTile += (frameY == 18) ? -1 : 1;
int xTile = i;
if (frameX == 36) // Cactus segment which splits left
xTile--;
if (frameX == 54) // Cactus segment which splits right
xTile++;
if (frameX == 108) // Cactus segment which splits both directions
xTile += (frameY == 18) ? -1 : 1;
int yTile = j;
bool slidingDownCactus = Main.tile[xTile, yTile] != null && Main.tile[xTile, yTile].TileType == TileID.Cactus && Main.tile[xTile, yTile].HasTile;
while (!Main.tile[xTile, yTile].HasTile || !Main.tileSolid[Main.tile[xTile, yTile].TileType] || !slidingDownCactus)
int yTile = j;
bool slidingDownCactus = Main.tile[xTile, yTile] != null && Main.tile[xTile, yTile].TileType == TileID.Cactus && Main.tile[xTile, yTile].HasTile;
while (!Main.tile[xTile, yTile].HasTile || !Main.tileSolid[Main.tile[xTile, yTile].TileType] || !slidingDownCactus)
{
if (Main.tile[xTile, yTile].TileType == TileID.Cactus && Main.tile[xTile, yTile].HasTile)
{
if (Main.tile[xTile, yTile].TileType == TileID.Cactus && Main.tile[xTile, yTile].HasTile)
{
slidingDownCactus = true;
}
yTile++;
// Cacti are assumed to be no more than 20 blocks tall.
if (yTile > i + 20)
break;
slidingDownCactus = true;
}
astralCactus = Main.tile[xTile, yTile].TileType == (ushort)ModContent.TileType<AstralSand>();
yTile++;
// Cacti are assumed to be no more than 20 blocks tall.
if (yTile > i + 20)
break;
}
bool astralCactus = Main.tile[xTile, yTile].TileType == (ushort)ModContent.TileType<AstralSand>();
// If it is actually astral cactus, then draw its glowmask.
if (astralCactus)
@@ -134,20 +131,18 @@ namespace CalamityMod.Tiles
public override void KillTile(int i, int j, int type, ref bool fail, ref bool effectOnly, ref bool noItem)
{
Tile tile = Main.tile[i, j];
if (tile is null)
return;
// Helper function to shatter crystals attached to neighboring solid tiles.
void CheckShatterCrystal(int xPos, int yPos)
static void CheckShatterCrystal(int xPos, int yPos)
{
if (xPos < 0 || xPos >= Main.maxTilesX || yPos < 0 || yPos >= Main.maxTilesY)
return;
Tile t = Main.tile[xPos, yPos];
if (t != null && t.HasTile && (t.TileType == ModContent.TileType<LumenylCrystals>() || (t.TileType == ModContent.TileType<SeaPrismCrystals>() && DownedBossSystem.downedDesertScourge)))
if (t.HasTile && (t.TileType == ModContent.TileType<LumenylCrystals>() || (t.TileType == ModContent.TileType<SeaPrismCrystals>() && DownedBossSystem.downedDesertScourge)))
{
WorldGen.KillTile(xPos, yPos, false, false, false);
if (!Main.tile[xPos, yPos].HasTile && Main.netMode != NetmodeID.SinglePlayer)
NetMessage.SendData(MessageID.TileChange, -1, -1, null, 0, xPos, yPos, 0f, 0, 0, 0);
NetMessage.SendData(MessageID.TileManipulation, -1, -1, null, 0, xPos, yPos, 0f, 0, 0, 0);
}
}
@@ -180,22 +175,22 @@ namespace CalamityMod.Tiles
{
if (type == ModContent.TileType<AbyssalPots>())
{
Item.NewItem(i * 16, j * 16, 16, 16, ModContent.ItemType<AbyssalTreasure>());
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ModContent.ItemType<AbyssalTreasure>());
for (int k = 0; k < Main.rand.Next(1, 2 + 1); k++)
{
Gore.NewGore(new Vector2(i, j) * 16, Main.rand.NextVector2CircularEdge(3f, 3f), Mod.GetGoreSlot("Gores/SulphSeaGen/AbyssPotGore1"));
Gore.NewGore(new Vector2(i, j) * 16, Main.rand.NextVector2CircularEdge(3f, 3f), Mod.GetGoreSlot("Gores/SulphSeaGen/AbyssPotGore2"));
Gore.NewGore(new Vector2(i, j) * 16, Main.rand.NextVector2CircularEdge(3f, 3f), Mod.Find<ModGore>("Gores/SulphSeaGen/AbyssPotGore1").Type);
Gore.NewGore(new Vector2(i, j) * 16, Main.rand.NextVector2CircularEdge(3f, 3f), Mod.Find<ModGore>("Gores/SulphSeaGen/AbyssPotGore2").Type);
}
}
else if (type == ModContent.TileType<SulphurousPots>())
{
Item.NewItem(i * 16, j * 16, 16, 16, ModContent.ItemType<SulphuricTreasure>());
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ModContent.ItemType<SulphuricTreasure>());
for (int k = 0; k < Main.rand.Next(1, 2 + 1); k++)
{
Gore.NewGore(new Vector2(i, j) * 16, Main.rand.NextVector2CircularEdge(3f, 3f), Mod.GetGoreSlot("Gores/SulphSeaGen/SulphPotGore1"));
Gore.NewGore(new Vector2(i, j) * 16, Main.rand.NextVector2CircularEdge(3f, 3f), Mod.GetGoreSlot("Gores/SulphSeaGen/SulphPotGore2"));
Gore.NewGore(new Vector2(i, j) * 16, Main.rand.NextVector2CircularEdge(3f, 3f), Mod.Find<ModGore>("Gores/SulphSeaGen/SulphPotGore1").Type);
Gore.NewGore(new Vector2(i, j) * 16, Main.rand.NextVector2CircularEdge(3f, 3f), Mod.Find<ModGore>("Gores/SulphSeaGen/SulphPotGore2").Type);
}
}
else if (type == TileID.DemonAltar && Main.hardMode)
@@ -209,11 +204,11 @@ namespace CalamityMod.Tiles
{
pos.X += Main.rand.NextFloat(-32f, 32f);
pos.Y += Main.rand.NextFloat(-32f, 32f);
Item.NewItem(pos, ItemID.SoulofNight);
Item.NewItem(new EntitySource_TileBreak(i, j), pos, ItemID.SoulofNight);
}
}
if (WorldGen.altarCount % 3 == 0 && WorldGen.altarCount > 1)
Item.NewItem(pos, ModContent.ItemType<EvilSmasher>());
Item.NewItem(new EntitySource_TileBreak(i, j), pos, ModContent.ItemType<EvilSmasher>());
}
}
@@ -283,7 +278,7 @@ namespace CalamityMod.Tiles
ItemID.LifeforcePotion,
ItemID.InfernoPotion
});
Item.NewItem(i * 16, j * 16, 16, 16, potionType, 1, false, 0, false, false);
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, potionType, 1, false, 0, false, false);
}
else
{
@@ -295,20 +290,20 @@ namespace CalamityMod.Tiles
{
sglowstickAmt += Main.rand.Next(1, 7);
}
Item.NewItem(i * 16, j * 16, 16, 16, ItemID.SpelunkerGlowstick, sglowstickAmt, false, 0, false, false);
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ItemID.SpelunkerGlowstick, sglowstickAmt, false, 0, false, false);
}
else if (lootType == 1) //hellfire arrows
{
int arrowAmt = Main.rand.Next(10, 21);
Item.NewItem(i * 16, j * 16, 16, 16, ItemID.HellfireArrow, arrowAmt, false, 0, false, false);
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ItemID.HellfireArrow, arrowAmt, false, 0, false, false);
}
else if (lootType == 2) //stew
{
Item.NewItem(i * 16, j * 16, 16, 16, ModContent.ItemType<SunkenStew>(), 1, false, 0, false, false);
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ModContent.ItemType<SunkenStew>(), 1, false, 0, false, false);
}
else if (lootType == 3) //sticky dynamite
{
Item.NewItem(i * 16, j * 16, 16, 16, ItemID.StickyDynamite, 1, false, 0, false, false);
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ItemID.StickyDynamite, 1, false, 0, false, false);
}
else //money
{
@@ -327,7 +322,7 @@ namespace CalamityMod.Tiles
ptCoinAmt /= Main.rand.Next(3) + 1;
}
num13 -= (float)(1000000 * ptCoinAmt);
Item.NewItem(i * 16, j * 16, 16, 16, ItemID.PlatinumCoin, ptCoinAmt, false, 0, false, false);
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ItemID.PlatinumCoin, ptCoinAmt, false, 0, false, false);
}
else if (num13 > 10000f)
{
@@ -341,7 +336,7 @@ namespace CalamityMod.Tiles
auCoinAmt /= Main.rand.Next(3) + 1;
}
num13 -= (float)(10000 * auCoinAmt);
Item.NewItem(i * 16, j * 16, 16, 16, ItemID.GoldCoin, auCoinAmt, false, 0, false, false);
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ItemID.GoldCoin, auCoinAmt, false, 0, false, false);
}
else if (num13 > 100f)
{
@@ -355,7 +350,7 @@ namespace CalamityMod.Tiles
agCoinAmt /= Main.rand.Next(3) + 1;
}
num13 -= (float)(100 * agCoinAmt);
Item.NewItem(i * 16, j * 16, 16, 16, ItemID.SilverCoin, agCoinAmt, false, 0, false, false);
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ItemID.SilverCoin, agCoinAmt, false, 0, false, false);
}
else
{
@@ -373,7 +368,7 @@ namespace CalamityMod.Tiles
cuCoinAmt = 1;
}
num13 -= (float)cuCoinAmt;
Item.NewItem(i * 16, j * 16, 16, 16, ItemID.CopperCoin, cuCoinAmt, false, 0, false, false);
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ItemID.CopperCoin, cuCoinAmt, false, 0, false, false);
}
}
}
@@ -402,7 +397,7 @@ namespace CalamityMod.Tiles
ItemID.LifeforcePotion,
ItemID.InfernoPotion
});
Item.NewItem(i * 16, j * 16, 16, 16, potionType, 1, false, 0, false, false);
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, potionType, 1, false, 0, false, false);
}
else
{
@@ -414,21 +409,21 @@ namespace CalamityMod.Tiles
{
glowstickAmt += Main.rand.Next(1, 7);
}
Item.NewItem(i * 16, j * 16, 16, 16, ItemID.Glowstick, glowstickAmt, false, 0, false, false);
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ItemID.Glowstick, glowstickAmt, false, 0, false, false);
}
else if (lootType == 1) //jesters arrows
{
int jArrowAmt = Main.rand.Next(10, 21);
Item.NewItem(i * 16, j * 16, 16, 16, ItemID.JestersArrow, jArrowAmt, false, 0, false, false);
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ItemID.JestersArrow, jArrowAmt, false, 0, false, false);
}
else if (lootType == 2) //potion
{
Item.NewItem(i * 16, j * 16, 16, 16, ItemID.HealingPotion, 1, false, 0, false, false);
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ItemID.HealingPotion, 1, false, 0, false, false);
}
else if (lootType == 3) //bomb
{
int bombAmt = Main.rand.Next(5, 9);
Item.NewItem(i * 16, j * 16, 16, 16, ItemID.Bomb, bombAmt, false, 0, false, false);
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ItemID.Bomb, bombAmt, false, 0, false, false);
}
else //money
{
@@ -447,7 +442,7 @@ namespace CalamityMod.Tiles
ptCoinAmt /= Main.rand.Next(3) + 1;
}
num13 -= (float)(1000000 * ptCoinAmt);
Item.NewItem(i * 16, j * 16, 16, 16, ItemID.PlatinumCoin, ptCoinAmt, false, 0, false, false);
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ItemID.PlatinumCoin, ptCoinAmt, false, 0, false, false);
}
else if (num13 > 10000f)
{
@@ -461,7 +456,7 @@ namespace CalamityMod.Tiles
auCoinAmt /= Main.rand.Next(3) + 1;
}
num13 -= (float)(10000 * auCoinAmt);
Item.NewItem(i * 16, j * 16, 16, 16, ItemID.GoldCoin, auCoinAmt, false, 0, false, false);
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ItemID.GoldCoin, auCoinAmt, false, 0, false, false);
}
else if (num13 > 100f)
{
@@ -475,7 +470,7 @@ namespace CalamityMod.Tiles
agCoinAmt /= Main.rand.Next(3) + 1;
}
num13 -= (float)(100 * agCoinAmt);
Item.NewItem(i * 16, j * 16, 16, 16, ItemID.SilverCoin, agCoinAmt, false, 0, false, false);
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ItemID.SilverCoin, agCoinAmt, false, 0, false, false);
}
else
{
@@ -493,7 +488,7 @@ namespace CalamityMod.Tiles
cuCoinAmt = 1;
}
num13 -= (float)cuCoinAmt;
Item.NewItem(i * 16, j * 16, 16, 16, ItemID.CopperCoin, cuCoinAmt, false, 0, false, false);
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ItemID.CopperCoin, cuCoinAmt, false, 0, false, false);
}
}
}
@@ -65,8 +65,8 @@ namespace CalamityMod.Tiles.DraedonStructures
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<AgedLaboratoryDoorItem>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<AgedLaboratoryDoorItem>();
}
}
}
@@ -65,8 +65,8 @@ namespace CalamityMod.Tiles.DraedonStructures
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<AgedLaboratoryDoorItem>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<AgedLaboratoryDoorItem>();
}
}
}
@@ -65,8 +65,8 @@ namespace CalamityMod.Tiles.DraedonStructures
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<LaboratoryDoorItem>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<LaboratoryDoorItem>();
}
}
}
@@ -65,8 +65,8 @@ namespace CalamityMod.Tiles.DraedonStructures
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<LaboratoryDoorItem>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<LaboratoryDoorItem>();
}
}
}
+6 -5
View File
@@ -1,7 +1,8 @@
using CalamityMod.Buffs.Placeables;
using CalamityMod.Buffs.Placeables;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
@@ -23,8 +24,8 @@ namespace CalamityMod.Tiles.Furniture
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.Furniture.ChaosCandle>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.Furniture.ChaosCandle>();
}
public override void NearbyEffects(int i, int j, bool closer)
@@ -57,7 +58,7 @@ namespace CalamityMod.Tiles.Furniture
CalamityUtils.LightHitWire(Type, i, j, 1, 1);
}
public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex)
public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData)
{
if (Main.tile[i, j].TileFrameX < 18)
CalamityUtils.DrawFlameSparks(235, 5, i, j);
@@ -65,7 +66,7 @@ namespace CalamityMod.Tiles.Furniture
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
CalamityUtils.DrawFlameEffect(ModContent.Request<Texture2D>("CalamityMod/Tiles/Furniture/ChaosCandleFlame"), i, j);
CalamityUtils.DrawFlameEffect(ModContent.Request<Texture2D>("CalamityMod/Tiles/Furniture/ChaosCandleFlame").Value, i, j);
}
public override bool RightClick(int i, int j)
@@ -1,4 +1,4 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.DataStructures;
@@ -64,10 +64,10 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
CalamityUtils.DrawStaticFlameEffect(ModContent.Request<Texture2D>("CalamityMod/Tiles/Furniture/CraftingStations/AncientAltarFlame"), i, j, offsetY: animationFrame * animationFrameHeight);
CalamityUtils.DrawStaticFlameEffect(ModContent.Request<Texture2D>("CalamityMod/Tiles/Furniture/CraftingStations/AncientAltarFlame").Value, i, j, offsetY: animationFrame * animationFrameHeight);
}
public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex)
public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData)
{
Tile tile = Main.tile[i, j];
if (tile.TileFrameX == 18 && tile.TileFrameY == 18)
@@ -64,10 +64,10 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
CalamityUtils.DrawStaticFlameEffect(ModContent.Request<Texture2D>("CalamityMod/Tiles/Furniture/CraftingStations/AshenAltarFlame"), i, j, offsetY: animationFrame * animationFrameHeight);
CalamityUtils.DrawStaticFlameEffect(ModContent.Request<Texture2D>("CalamityMod/Tiles/Furniture/CraftingStations/AshenAltarFlame").Value, i, j, offsetY: animationFrame * animationFrameHeight);
}
public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex)
public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData)
{
Tile tile = Main.tile[i, j];
if (tile.TileFrameX == 18 && tile.TileFrameY == 18)
@@ -1,4 +1,4 @@
using CalamityMod.Items.Placeables.Furniture.Fountains;
using CalamityMod.Items.Placeables.Furniture.Fountains;
using Microsoft.Xna.Framework;
using System.Linq;
using Terraria;
@@ -73,8 +73,8 @@ namespace CalamityMod.Tiles.Furniture.Fountains
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<AbyssFountainItem>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<AbyssFountainItem>();
}
}
}
@@ -74,8 +74,8 @@ namespace CalamityMod.Tiles.Furniture.Fountains
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<AstralFountainItem>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<AstralFountainItem>();
}
}
}
@@ -73,8 +73,8 @@ namespace CalamityMod.Tiles.Furniture.Fountains
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<SulphurousFountainItem>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<SulphurousFountainItem>();
}
}
}
@@ -73,8 +73,8 @@ namespace CalamityMod.Tiles.Furniture.Fountains
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<SunkenSeaFountain>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<SunkenSeaFountain>();
}
}
}
+6 -6
View File
@@ -90,23 +90,23 @@ namespace CalamityMod.Tiles.Furniture
public override void MouseOver(int i, int j)
{
if (Main.LocalPlayer.HasItem(ModContent.ItemType<EyeofExtinction>()))
Main.LocalPlayer.showItemIcon2 = ModContent.ItemType<EyeofExtinction>();
Main.LocalPlayer.cursorItemIconID = ModContent.ItemType<EyeofExtinction>();
else
Main.LocalPlayer.showItemIcon2 = ModContent.ItemType<CalamityDust>();
Main.LocalPlayer.cursorItemIconID = ModContent.ItemType<CalamityDust>();
Main.LocalPlayer.noThrow = 2;
Main.LocalPlayer.showItemIcon = true;
Main.LocalPlayer.cursorItemIconEnabled = true;
}
public override void MouseOverFar(int i, int j)
{
if (Main.LocalPlayer.HasItem(ModContent.ItemType<EyeofExtinction>()))
Main.LocalPlayer.showItemIcon2 = ModContent.ItemType<EyeofExtinction>();
Main.LocalPlayer.cursorItemIconID = ModContent.ItemType<EyeofExtinction>();
else
Main.LocalPlayer.showItemIcon2 = ModContent.ItemType<CalamityDust>();
Main.LocalPlayer.cursorItemIconID = ModContent.ItemType<CalamityDust>();
Main.LocalPlayer.noThrow = 2;
Main.LocalPlayer.showItemIcon = true;
Main.LocalPlayer.cursorItemIconEnabled = true;
}
}
}
+6 -5
View File
@@ -1,7 +1,8 @@
using CalamityMod.Buffs.Placeables;
using CalamityMod.Buffs.Placeables;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
@@ -23,8 +24,8 @@ namespace CalamityMod.Tiles.Furniture
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.Furniture.TranquilityCandle>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.Furniture.TranquilityCandle>();
}
public override void NearbyEffects(int i, int j, bool closer)
@@ -57,7 +58,7 @@ namespace CalamityMod.Tiles.Furniture
CalamityUtils.LightHitWire(Type, i, j, 1, 1);
}
public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex)
public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData)
{
if (Main.tile[i, j].TileFrameX < 18)
CalamityUtils.DrawFlameSparks(62, 5, i, j);
@@ -65,7 +66,7 @@ namespace CalamityMod.Tiles.Furniture
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
CalamityUtils.DrawFlameEffect(ModContent.Request<Texture2D>("CalamityMod/Tiles/Furniture/TranquilityCandleFlame"), i, j);
CalamityUtils.DrawFlameEffect(ModContent.Request<Texture2D>("CalamityMod/Tiles/Furniture/TranquilityCandleFlame").Value, i, j);
}
public override bool RightClick(int i, int j)
+2 -2
View File
@@ -47,8 +47,8 @@ namespace CalamityMod.Tiles.FurnitureAbyss
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureAbyss.AbyssBed>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureAbyss.AbyssBed>();
}
}
}
+2 -2
View File
@@ -55,8 +55,8 @@ namespace CalamityMod.Tiles.FurnitureAbyss
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureAbyss.AbyssCandle>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureAbyss.AbyssCandle>();
}
public override bool RightClick(int i, int j)
+2 -2
View File
@@ -41,8 +41,8 @@ namespace CalamityMod.Tiles.FurnitureAbyss
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureAbyss.AbyssDoor>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureAbyss.AbyssDoor>();
}
}
}
+2 -2
View File
@@ -41,8 +41,8 @@ namespace CalamityMod.Tiles.FurnitureAbyss
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureAbyss.AbyssDoor>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureAbyss.AbyssDoor>();
}
}
}
+2 -2
View File
@@ -36,8 +36,8 @@ namespace CalamityMod.Tiles.FurnitureAbyss
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureAbyss.AbyssTorch>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureAbyss.AbyssTorch>();
}
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
+2 -2
View File
@@ -45,8 +45,8 @@ namespace CalamityMod.Tiles.FurnitureAcidwood
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<AcidwoodBed>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<AcidwoodBed>();
}
}
}
@@ -56,8 +56,8 @@ namespace CalamityMod.Tiles.FurnitureAcidwood
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<AcidwoodCandle>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<AcidwoodCandle>();
}
public override bool RightClick(int i, int j)
@@ -42,8 +42,8 @@ namespace CalamityMod.Tiles.FurnitureAcidwood
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<AcidwoodDoor>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<AcidwoodDoor>();
}
}
}
+2 -2
View File
@@ -42,8 +42,8 @@ namespace CalamityMod.Tiles.FurnitureAcidwood
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<AcidwoodDoor>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<AcidwoodDoor>();
}
}
}
+2 -2
View File
@@ -48,8 +48,8 @@ namespace CalamityMod.Tiles.FurnitureAncient
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureAncient.AncientBed>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureAncient.AncientBed>();
}
}
}
+2 -2
View File
@@ -42,8 +42,8 @@ namespace CalamityMod.Tiles.FurnitureAncient
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureAncient.AncientDoor>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureAncient.AncientDoor>();
}
}
}
+2 -2
View File
@@ -42,8 +42,8 @@ namespace CalamityMod.Tiles.FurnitureAncient
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureAncient.AncientDoor>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureAncient.AncientDoor>();
}
}
}
+3 -3
View File
@@ -1,4 +1,4 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.DataStructures;
@@ -74,10 +74,10 @@ namespace CalamityMod.Tiles.FurnitureAshen
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
CalamityUtils.DrawStaticFlameEffect(ModContent.Request<Texture2D>("CalamityMod/Tiles/FurnitureAshen/AshenBasinFlame"), i, j, offsetY: animationFrame * animationFrameHeight);
CalamityUtils.DrawStaticFlameEffect(ModContent.Request<Texture2D>("CalamityMod/Tiles/FurnitureAshen/AshenBasinFlame").Value, i, j, offsetY: animationFrame * AnimationFrameHeight);
}
public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex)
public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData)
{
Tile tile = Main.tile[i, j];
if (tile.TileFrameY == 18 && tile.TileFrameX < 54)
+2 -2
View File
@@ -48,8 +48,8 @@ namespace CalamityMod.Tiles.FurnitureAshen
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureAshen.AshenBed>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureAshen.AshenBed>();
}
}
}
+2 -2
View File
@@ -56,8 +56,8 @@ namespace CalamityMod.Tiles.FurnitureAshen
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureAshen.AshenCandle>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureAshen.AshenCandle>();
}
public override bool RightClick(int i, int j)
+2 -2
View File
@@ -43,8 +43,8 @@ namespace CalamityMod.Tiles.FurnitureAshen
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<AshenDoor>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<AshenDoor>();
}
}
}
+2 -2
View File
@@ -43,8 +43,8 @@ namespace CalamityMod.Tiles.FurnitureAshen
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<AshenDoor>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<AshenDoor>();
}
}
}
+2 -2
View File
@@ -73,8 +73,8 @@ namespace CalamityMod.Tiles.FurnitureAstral
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureAstral.MonolithBed>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureAstral.MonolithBed>();
}
}
}
+2 -2
View File
@@ -83,8 +83,8 @@ namespace CalamityMod.Tiles.FurnitureAstral
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureAstral.MonolithCandle>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureAstral.MonolithCandle>();
}
public override bool RightClick(int i, int j)
+2 -2
View File
@@ -67,8 +67,8 @@ namespace CalamityMod.Tiles.FurnitureAstral
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureAstral.MonolithDoor>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureAstral.MonolithDoor>();
}
}
}
+2 -2
View File
@@ -67,8 +67,8 @@ namespace CalamityMod.Tiles.FurnitureAstral
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureAstral.MonolithDoor>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureAstral.MonolithDoor>();
}
}
}
+2 -2
View File
@@ -49,8 +49,8 @@ namespace CalamityMod.Tiles.FurnitureBotanic
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureBotanic.BotanicBed>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureBotanic.BotanicBed>();
}
}
}
+2 -2
View File
@@ -56,8 +56,8 @@ namespace CalamityMod.Tiles.FurnitureBotanic
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureBotanic.BotanicCandle>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureBotanic.BotanicCandle>();
}
public override bool RightClick(int i, int j)
+2 -2
View File
@@ -43,8 +43,8 @@ namespace CalamityMod.Tiles.FurnitureBotanic
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureBotanic.BotanicDoor>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureBotanic.BotanicDoor>();
}
}
}
+2 -2
View File
@@ -43,8 +43,8 @@ namespace CalamityMod.Tiles.FurnitureBotanic
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureBotanic.BotanicDoor>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureBotanic.BotanicDoor>();
}
}
}
+2 -2
View File
@@ -48,8 +48,8 @@ namespace CalamityMod.Tiles.FurnitureCosmilite
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureCosmilite.CosmiliteBed>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureCosmilite.CosmiliteBed>();
}
}
}
+2 -2
View File
@@ -55,8 +55,8 @@ namespace CalamityMod.Tiles.FurnitureCosmilite
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureCosmilite.CosmiliteCandle>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureCosmilite.CosmiliteCandle>();
}
public override bool RightClick(int i, int j)
@@ -42,8 +42,8 @@ namespace CalamityMod.Tiles.FurnitureCosmilite
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureCosmilite.CosmiliteDoor>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureCosmilite.CosmiliteDoor>();
}
}
}
@@ -42,8 +42,8 @@ namespace CalamityMod.Tiles.FurnitureCosmilite
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureCosmilite.CosmiliteDoor>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureCosmilite.CosmiliteDoor>();
}
}
}
+2 -2
View File
@@ -47,8 +47,8 @@ namespace CalamityMod.Tiles.FurnitureEutrophic
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureEutrophic.EutrophicBed>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureEutrophic.EutrophicBed>();
}
}
}
+2 -2
View File
@@ -54,8 +54,8 @@ namespace CalamityMod.Tiles.FurnitureEutrophic
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureEutrophic.EutrophicCandle>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureEutrophic.EutrophicCandle>();
}
public override bool RightClick(int i, int j)
@@ -41,8 +41,8 @@ namespace CalamityMod.Tiles.FurnitureEutrophic
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureEutrophic.EutrophicDoor>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureEutrophic.EutrophicDoor>();
}
}
}
@@ -41,8 +41,8 @@ namespace CalamityMod.Tiles.FurnitureEutrophic
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureEutrophic.EutrophicDoor>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureEutrophic.EutrophicDoor>();
}
}
}
+2 -2
View File
@@ -48,8 +48,8 @@ namespace CalamityMod.Tiles.FurnitureExo
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<ExoBed>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<ExoBed>();
}
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
+2 -2
View File
@@ -58,8 +58,8 @@ namespace CalamityMod.Tiles.FurnitureExo
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<ExoCandle>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<ExoCandle>();
}
public override bool RightClick(int i, int j)
+2 -2
View File
@@ -65,8 +65,8 @@ namespace CalamityMod.Tiles.FurnitureExo
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<ExoDoor>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<ExoDoor>();
}
}
}
+2 -2
View File
@@ -65,8 +65,8 @@ namespace CalamityMod.Tiles.FurnitureExo
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<ExoDoor>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<ExoDoor>();
}
}
}
+2 -2
View File
@@ -49,8 +49,8 @@ namespace CalamityMod.Tiles.FurnitureOccult
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureOccult.OccultBed>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureOccult.OccultBed>();
}
}
}
+2 -2
View File
@@ -56,8 +56,8 @@ namespace CalamityMod.Tiles.FurnitureOccult
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureOccult.OccultCandle>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureOccult.OccultCandle>();
}
public override bool RightClick(int i, int j)
+2 -2
View File
@@ -43,8 +43,8 @@ namespace CalamityMod.Tiles.FurnitureOccult
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureOccult.OccultDoor>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureOccult.OccultDoor>();
}
}
}
+2 -2
View File
@@ -43,8 +43,8 @@ namespace CalamityMod.Tiles.FurnitureOccult
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureOccult.OccultDoor>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureOccult.OccultDoor>();
}
}
}
@@ -72,8 +72,8 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurniturePlaguedPlate.PlaguedPlateBed>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurniturePlaguedPlate.PlaguedPlateBed>();
}
}
}
@@ -54,8 +54,8 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurniturePlaguedPlate.PlaguedPlateCandle>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurniturePlaguedPlate.PlaguedPlateCandle>();
}
public override bool RightClick(int i, int j)
@@ -41,8 +41,8 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurniturePlaguedPlate.PlaguedPlateDoor>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurniturePlaguedPlate.PlaguedPlateDoor>();
}
}
}
@@ -40,8 +40,8 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurniturePlaguedPlate.PlaguedPlateDoor>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurniturePlaguedPlate.PlaguedPlateDoor>();
}
}
}
+2 -2
View File
@@ -49,8 +49,8 @@ namespace CalamityMod.Tiles.FurnitureProfaned
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureProfaned.ProfanedBed>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureProfaned.ProfanedBed>();
}
}
}
+2 -2
View File
@@ -57,8 +57,8 @@ namespace CalamityMod.Tiles.FurnitureProfaned
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureProfaned.ProfanedCandle>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureProfaned.ProfanedCandle>();
}
public override bool RightClick(int i, int j)
@@ -43,8 +43,8 @@ namespace CalamityMod.Tiles.FurnitureProfaned
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureProfaned.ProfanedDoor>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureProfaned.ProfanedDoor>();
}
}
}
+2 -2
View File
@@ -43,8 +43,8 @@ namespace CalamityMod.Tiles.FurnitureProfaned
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureProfaned.ProfanedDoor>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureProfaned.ProfanedDoor>();
}
}
}
+2 -2
View File
@@ -49,8 +49,8 @@ namespace CalamityMod.Tiles.FurnitureSilva
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureSilva.SilvaBed>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureSilva.SilvaBed>();
}
}
}
+2 -2
View File
@@ -56,8 +56,8 @@ namespace CalamityMod.Tiles.FurnitureSilva
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureSilva.SilvaCandle>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureSilva.SilvaCandle>();
}
public override bool RightClick(int i, int j)
+2 -2
View File
@@ -43,8 +43,8 @@ namespace CalamityMod.Tiles.FurnitureSilva
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureSilva.SilvaDoor>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureSilva.SilvaDoor>();
}
}
}
+2 -2
View File
@@ -43,8 +43,8 @@ namespace CalamityMod.Tiles.FurnitureSilva
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureSilva.SilvaDoor>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureSilva.SilvaDoor>();
}
}
}
+2 -2
View File
@@ -47,8 +47,8 @@ namespace CalamityMod.Tiles.FurnitureStatigel
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureStatigel.StatigelBed>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureStatigel.StatigelBed>();
}
}
}
+2 -2
View File
@@ -55,8 +55,8 @@ namespace CalamityMod.Tiles.FurnitureStatigel
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureStatigel.StatigelCandle>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureStatigel.StatigelCandle>();
}
public override bool RightClick(int i, int j)
@@ -41,8 +41,8 @@ namespace CalamityMod.Tiles.FurnitureStatigel
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureStatigel.StatigelDoor>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureStatigel.StatigelDoor>();
}
}
}
+2 -2
View File
@@ -41,8 +41,8 @@ namespace CalamityMod.Tiles.FurnitureStatigel
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureStatigel.StatigelDoor>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureStatigel.StatigelDoor>();
}
}
}
+2 -2
View File
@@ -48,8 +48,8 @@ namespace CalamityMod.Tiles.FurnitureStratus
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureStratus.StratusBed>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureStratus.StratusBed>();
}
}
}
+2 -2
View File
@@ -56,8 +56,8 @@ namespace CalamityMod.Tiles.FurnitureStratus
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureStratus.StratusCandle>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureStratus.StratusCandle>();
}
public override bool RightClick(int i, int j)
+2 -2
View File
@@ -42,8 +42,8 @@ namespace CalamityMod.Tiles.FurnitureStratus
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureStratus.StratusDoor>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureStratus.StratusDoor>();
}
}
}
+2 -2
View File
@@ -42,8 +42,8 @@ namespace CalamityMod.Tiles.FurnitureStratus
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureStratus.StratusDoor>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureStratus.StratusDoor>();
}
}
}
+2 -2
View File
@@ -47,8 +47,8 @@ namespace CalamityMod.Tiles.FurnitureVoid
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureVoid.VoidBed>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureVoid.VoidBed>();
}
}
}
+2 -2
View File
@@ -54,8 +54,8 @@ namespace CalamityMod.Tiles.FurnitureVoid
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureVoid.VoidCandle>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureVoid.VoidCandle>();
}
public override bool RightClick(int i, int j)
+2 -2
View File
@@ -41,8 +41,8 @@ namespace CalamityMod.Tiles.FurnitureVoid
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureVoid.VoidDoor>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureVoid.VoidDoor>();
}
}
}
+2 -2
View File
@@ -41,8 +41,8 @@ namespace CalamityMod.Tiles.FurnitureVoid
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.showItemIcon = true;
player.showItemIcon2 = ModContent.ItemType<Items.Placeables.FurnitureVoid.VoidDoor>();
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<Items.Placeables.FurnitureVoid.VoidDoor>();
}
}
}
+13 -8
View File
@@ -1,10 +1,11 @@
using CalamityMod.Dusts.Furniture;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;
using Terraria.DataStructures;
namespace CalamityMod.Tiles
{
@@ -35,6 +36,9 @@ namespace CalamityMod.Tiles
return false;
}
// TODO -- Fix the drapes from these. This uses specialized drawing hooks which appear to currently be private in 1.4.
// This may require either gross reflection or contacting TML developers to make the necessary information for this public again.
/*
public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex)
{
if ((Main.tile[i - 1, j - 1].TileType != Type || Main.tile[i, j - 1].TileType != Type || Main.tile[i + 1, j - 1].TileType != Type ||
@@ -47,22 +51,23 @@ namespace CalamityMod.Tiles
}
}
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
return TileFraming.BrimstoneFraming(i, j, resetFrame);
}
public override void SpecialDraw(int i, int j, SpriteBatch spriteBatch)
{
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
Color drawColour = GetDrawColour(i, j);
Texture2D leaves = ModContent.Request<Texture2D>("CalamityMod/Tiles/UelibloomBrick_Leaves");
Texture2D leaves = ModContent.Request<Texture2D>("CalamityMod/Tiles/UelibloomBrick_Leaves").Value;
DrawExtraTop(i, j, leaves, drawOffset, drawColour);
DrawExtraWallEnds(i, j, leaves, drawOffset, drawColour);
DrawExtraDrapes(i, j, leaves, drawOffset, drawColour);
}
*/
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
return TileFraming.BrimstoneFraming(i, j, resetFrame);
}
#region 'Extra Drapes' Drawing
private void DrawExtraTop(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour)
@@ -234,7 +239,7 @@ namespace CalamityMod.Tiles
private int GetExtraVariant(int i, int j)
{
return Main.tile[i, j].frameNumber() * extraFrameWidth;
return Main.tile[i, j].TileFrameNumber * extraFrameWidth;
}
/*
+41 -41
View File
@@ -140,32 +140,32 @@ namespace CalamityMod
top--;
}
int chest = Chest.FindChest(left, top);
player.showItemIcon2 = -1;
player.cursorItemIconID = -1;
if (chest < 0)
{
player.showItemIconText = Language.GetTextValue("LegacyChestType.0");
player.cursorItemIconText = Language.GetTextValue("LegacyChestType.0");
}
else
{
player.showItemIconText = Main.chest[chest].name.Length > 0 ? Main.chest[chest].name : chestName;
if (player.showItemIconText == chestName)
player.cursorItemIconText = Main.chest[chest].name.Length > 0 ? Main.chest[chest].name : chestName;
if (player.cursorItemIconText == chestName)
{
player.showItemIcon2 = ItemType<T>();
player.showItemIconText = "";
player.cursorItemIconID = ItemType<T>();
player.cursorItemIconText = "";
}
}
player.noThrow = 2;
player.showItemIcon = true;
player.cursorItemIconEnabled = true;
}
public static void ChestMouseFar<T>(string name, int i, int j) where T : ModItem
{
ChestMouseOver<T>(name, i, j);
Player player = Main.LocalPlayer;
if (player.showItemIconText == "")
if (player.cursorItemIconText == "")
{
player.showItemIcon = false;
player.showItemIcon2 = 0;
player.cursorItemIconEnabled = false;
player.cursorItemIconID = 0;
}
}
@@ -324,33 +324,33 @@ namespace CalamityMod
top--;
}
int chestIndex = Chest.FindChest(left, top);
player.showItemIcon2 = -1;
player.cursorItemIconID = -1;
if (chestIndex < 0)
{
player.showItemIconText = Language.GetTextValue("LegacyDresserType.0");
player.cursorItemIconText = Language.GetTextValue("LegacyDresserType.0");
}
else
{
if (Main.chest[chestIndex].name != "")
{
player.showItemIconText = Main.chest[chestIndex].name;
player.cursorItemIconText = Main.chest[chestIndex].name;
}
else
{
player.showItemIconText = chestName;
player.cursorItemIconText = chestName;
}
if (player.showItemIconText == chestName)
if (player.cursorItemIconText == chestName)
{
player.showItemIcon2 = ItemType<T>();
player.showItemIconText = "";
player.cursorItemIconID = ItemType<T>();
player.cursorItemIconText = "";
}
}
player.noThrow = 2;
player.showItemIcon = true;
if (player.showItemIconText == "")
player.cursorItemIconEnabled = true;
if (player.cursorItemIconText == "")
{
player.showItemIcon = false;
player.showItemIcon2 = 0;
player.cursorItemIconEnabled = false;
player.cursorItemIconID = 0;
}
}
@@ -366,32 +366,32 @@ namespace CalamityMod
top--;
}
int chestIndex = Chest.FindChest(left, top);
player.showItemIcon2 = -1;
player.cursorItemIconID = -1;
if (chestIndex < 0)
{
player.showItemIconText = Language.GetTextValue("LegacyDresserType.0");
player.cursorItemIconText = Language.GetTextValue("LegacyDresserType.0");
}
else
{
if (Main.chest[chestIndex].name != "")
{
player.showItemIconText = Main.chest[chestIndex].name;
player.cursorItemIconText = Main.chest[chestIndex].name;
}
else
{
player.showItemIconText = chestName;
player.cursorItemIconText = chestName;
}
if (player.showItemIconText == chestName)
if (player.cursorItemIconText == chestName)
{
player.showItemIcon2 = ItemType<T>();
player.showItemIconText = "";
player.cursorItemIconID = ItemType<T>();
player.cursorItemIconText = "";
}
}
player.noThrow = 2;
player.showItemIcon = true;
player.cursorItemIconEnabled = true;
if (Main.tile[Player.tileTargetX, Player.tileTargetY].TileFrameY > 0)
{
player.showItemIcon2 = ItemID.FamiliarShirt;
player.cursorItemIconID = ItemID.FamiliarShirt;
}
}
@@ -506,24 +506,24 @@ namespace CalamityMod
top--;
}
int chest = Chest.FindChest(left, top);
player.showItemIcon2 = -1;
player.cursorItemIconID = -1;
if (chest < 0)
{
player.showItemIconText = Language.GetTextValue("LegacyChestType.0");
player.cursorItemIconText = Language.GetTextValue("LegacyChestType.0");
}
else
{
player.showItemIconText = Main.chest[chest].name.Length > 0 ? Main.chest[chest].name : chestName;
if (player.showItemIconText == chestName)
player.cursorItemIconText = Main.chest[chest].name.Length > 0 ? Main.chest[chest].name : chestName;
if (player.cursorItemIconText == chestName)
{
player.showItemIcon2 = ItemType<C>();
player.cursorItemIconID = ItemType<C>();
if (Main.tile[left, top].TileFrameX / 36 == 1)
player.showItemIcon2 = ItemType<K>();
player.showItemIconText = "";
player.cursorItemIconID = ItemType<K>();
player.cursorItemIconText = "";
}
}
player.noThrow = 2;
player.showItemIcon = true;
player.cursorItemIconEnabled = true;
}
public static void LockedChestMouseOverFar<K, C>(string chestName, int i, int j)
@@ -531,10 +531,10 @@ namespace CalamityMod
{
LockedChestMouseOver<K, C>(chestName, i, j);
Player player = Main.LocalPlayer;
if (player.showItemIconText == "")
if (player.cursorItemIconText == "")
{
player.showItemIcon = false;
player.showItemIcon2 = 0;
player.cursorItemIconEnabled = false;
player.cursorItemIconID = 0;
}
}