This commit is contained in:
Andrew Marheine committed 2020-11-09 21:41:43 -06:00
commit ee604f85ce
145 files changed
+760 -414

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.DamageOverTime
{
public class HeavyBleeding : ModBuff
{
public override void SetDefaults()
{
DisplayName.SetDefault("Heavy Bleeding");
Description.SetDefault("You're losing a lot of blood");
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
longerExpertDebuff = false;
}
public override void Update(Player player, ref int buffIndex) => player.Calamity().waterLeechBleeding = true;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 740 B

+34 -20
View File
@@ -286,6 +286,7 @@ namespace CalamityMod.CalPlayer
public float stealthAcceleration = 1f;
public bool stealthStrikeThisFrame = false;
public bool stealthStrikeHalfCost = false;
public bool stealthStrike75Cost = false;
public bool stealthStrikeAlwaysCrits = false;
public bool wearingRogueArmor = false;
public float accStealthGenBoost = 0f;
@@ -776,6 +777,7 @@ namespace CalamityMod.CalPlayer
public bool vaporfied = false;
public bool energyShellCooldown = false;
public bool prismaticCooldown = false;
public bool waterLeechBleeding = false;
#endregion
#region Buff
@@ -1792,6 +1794,7 @@ namespace CalamityMod.CalPlayer
vaporfied = false;
energyShellCooldown = false;
prismaticCooldown = false;
waterLeechBleeding = false;
revivify = false;
trinketOfChiBuff = false;
@@ -2137,11 +2140,12 @@ namespace CalamityMod.CalPlayer
vaporfied = false;
energyShellCooldown = false;
prismaticCooldown = false;
#endregion
waterLeechBleeding = false;
#endregion
#region Rogue
// Stealth
rogueStealth = 0f;
#region Rogue
// Stealth
rogueStealth = 0f;
rogueStealthMax = 0f;
stealthAcceleration = 1f;
@@ -3561,23 +3565,15 @@ namespace CalamityMod.CalPlayer
if (badgeOfBraveryRare)
{
float maxDistance = 480f; // 30 tile distance
float meleeSpeedBoost = 0f;
for (int l = 0; l < Main.maxNPCs; l++)
{
NPC nPC = Main.npc[l];
if (nPC.active && !nPC.friendly && nPC.damage > 0 && !nPC.dontTakeDamage && Vector2.Distance(player.Center, nPC.Center) <= maxDistance)
NPC npc = Main.npc[l];
if (npc.active && !npc.friendly && (npc.damage > 0 || npc.boss) && !npc.dontTakeDamage && Vector2.Distance(player.Center, npc.Center) <= maxDistance)
{
meleeSpeedMult += MathHelper.Lerp(0f, 0.3f, 1f - (Vector2.Distance(player.Center, nPC.Center) / maxDistance));
if (meleeSpeedBoost >= 0.3f)
{
meleeSpeedBoost = 0.3f;
break;
}
meleeSpeedMult += MathHelper.Lerp(0f, 0.3f, 1f - (Vector2.Distance(player.Center, npc.Center) / maxDistance));
}
}
meleeSpeedMult += meleeSpeedBoost;
}
}
if (eGauntlet)
{
meleeSpeedMult += 0.15f;
@@ -4231,6 +4227,10 @@ namespace CalamityMod.CalPlayer
{
damageSource = PlayerDeathReason.ByCustomReason(player.name + " fell prey to their sins.");
}
if (waterLeechBleeding && damage == 10.0 && hitDirection == 0 && damageSource.SourceOtherIndex == 8)
{
damageSource = PlayerDeathReason.ByCustomReason(player.name + " lost too much blood.");
}
if (shadowflame && damage == 10.0 && hitDirection == 0 && damageSource.SourceOtherIndex == 8)
{
damageSource = PlayerDeathReason.ByCustomReason(player.name + "'s spirit was turned to ash.");
@@ -4346,8 +4346,10 @@ namespace CalamityMod.CalPlayer
#region Get Heal Life
public override void GetHealLife(Item item, bool quickHeal, ref int healValue)
{
if (bloodPactBoost)
healValue = (int)(healValue * 1.5);
double healMult = 1D +
(coreOfTheBloodGod ? 0.15 : 0) +
(bloodPactBoost ? 0.5 : 0);
healValue = (int)(healValue * healMult);
if (CalamityWorld.ironHeart)
healValue = 0;
}
@@ -9675,6 +9677,7 @@ namespace CalamityMod.CalPlayer
stealthGenMoving = 1f;
stealthStrikeThisFrame = false;
stealthStrikeHalfCost = false;
stealthStrike75Cost = false;
stealthStrikeAlwaysCrits = false;
// stealthAcceleration only resets if you don't have either of the accelerator accessories equipped
@@ -9845,7 +9848,12 @@ namespace CalamityMod.CalPlayer
{
if (rogueStealthMax <= 0f)
return false;
return rogueStealth >= rogueStealthMax * (stealthStrikeHalfCost ? 0.5f : 1f);
float consumptionMult = 1f;
if (stealthStrikeHalfCost)
consumptionMult = 0.5f;
else if (stealthStrike75Cost)
consumptionMult = 0.75f;
return rogueStealth >= rogueStealthMax * consumptionMult;
}
internal void ConsumeStealthByAttacking()
@@ -9859,7 +9867,13 @@ namespace CalamityMod.CalPlayer
if (rogueStealth <= 0f)
rogueStealth = 0f;
}
else
else if (stealthStrike75Cost)
{
rogueStealth -= 0.75f * rogueStealthMax;
if (rogueStealth <= 0f)
rogueStealth = 0f;
}
else
rogueStealth = 0f;
}
#endregion
+14 -1
View File
@@ -202,7 +202,20 @@ namespace CalamityMod.CalPlayer
lifeRegenLost += 16;
}
if (modPlayer.pFlames)
if (modPlayer.waterLeechBleeding)
{
if (player.lifeRegen > 0)
player.lifeRegen = 0;
player.lifeRegenTime = 0;
lifeRegenLost += 6;
if (CalamityWorld.downedAquaticScourge)
lifeRegenLost += 6;
if (CalamityWorld.downedPolterghast)
lifeRegenLost += 12;
}
if (modPlayer.pFlames)
{
if (player.lifeRegen > 0)
player.lifeRegen = 0;
+33 -17
View File
@@ -289,9 +289,10 @@ namespace CalamityMod.CalPlayer
else
{
// If any boss is alive (or you are between DoG phases), you gain adrenaline smoothly.
// If any boss is alive (or you are between DoG phases or Boss Rush is active), you gain adrenaline smoothly.
// EXCEPTION: Wall of Flesh is alive and you are not in hell. Then you don't get anything.
if ((CalamityPlayer.areThereAnyDamnBosses || CalamityWorld.DoGSecondStageCountdown > 0) && !wofAndNotHell)
if ((CalamityPlayer.areThereAnyDamnBosses || CalamityWorld.DoGSecondStageCountdown > 0 || BossRushEvent.BossRushActive) &&
!wofAndNotHell)
{
int numAdrenBoosts =
(modPlayer.adrenalineBoostOne ? 1 : 0) +
@@ -1262,6 +1263,18 @@ namespace CalamityMod.CalPlayer
player.buffTime[l] += 1;
}
// See later as Laud cancels out the normal effects
if (hasBuff == ModContent.BuffType<ArmorCrunch>())
{
// +15 defense
player.statDefense += ArmorCrunch.DefenseReduction;
}
if (hasBuff == ModContent.BuffType<WarCleave>())
{
// +10% damage reduction
player.endurance += 0.1f;
}
switch (hasBuff)
{
case BuffID.Obstructed:
@@ -3175,13 +3188,13 @@ namespace CalamityMod.CalPlayer
player.magicDamage -= 0.1f;
}
if (modPlayer.aCrunch)
if (modPlayer.aCrunch && !modPlayer.laudanum)
{
player.statDefense -= ArmorCrunch.DefenseReduction;
player.endurance *= 0.33f;
}
if (modPlayer.wCleave)
if (modPlayer.wCleave && !modPlayer.laudanum)
{
player.statDefense -= WarCleave.DefenseReduction;
player.endurance *= 0.75f;
@@ -3261,22 +3274,14 @@ namespace CalamityMod.CalPlayer
if (modPlayer.badgeOfBraveryRare)
{
float maxDistance = 480f; // 30 tile distance
float damageBoost = 0f;
for (int l = 0; l < Main.maxNPCs; l++)
{
NPC nPC = Main.npc[l];
if (nPC.active && !nPC.friendly && nPC.damage > 0 && !nPC.dontTakeDamage && Vector2.Distance(player.Center, nPC.Center) <= maxDistance)
NPC npc = Main.npc[l];
if (npc.active && !npc.friendly && (npc.damage > 0 || npc.boss) && !npc.dontTakeDamage && Vector2.Distance(player.Center, npc.Center) <= maxDistance)
{
damageBoost += MathHelper.Lerp(0f, 0.3f, 1f - (Vector2.Distance(player.Center, nPC.Center) / maxDistance));
if (damageBoost >= 0.3f)
{
damageBoost = 0.3f;
break;
}
player.meleeDamage += MathHelper.Lerp(0f, 0.3f, 1f - (Vector2.Distance(player.Center, npc.Center) / maxDistance));
}
}
player.meleeDamage += damageBoost;
}
if (modPlayer.calamitasLore)
@@ -3935,8 +3940,19 @@ namespace CalamityMod.CalPlayer
((player.head == ArmorIDs.Head.MoltenHelmet && player.body == ArmorIDs.Body.MoltenBreastplate && player.legs == ArmorIDs.Legs.MoltenGreaves) ? 0.2 : 0) +
(player.kbGlove ? 0.1 : 0) +
(modPlayer.eGauntlet ? 0.1 : 0) +
(modPlayer.yInsignia ? 0.1 : 0) +
(modPlayer.badgeOfBraveryRare ? 0.2 : 0);
(modPlayer.yInsignia ? 0.1 : 0);
if (modPlayer.badgeOfBraveryRare)
{
float maxDistance = 480f; // 30 tile distance
for (int l = 0; l < Main.maxNPCs; l++)
{
NPC npc = Main.npc[l];
if (npc.active && !npc.friendly && (npc.damage > 0 || npc.boss) && !npc.dontTakeDamage && Vector2.Distance(player.Center, npc.Center) <= maxDistance)
{
damageAdd += MathHelper.Lerp(0f, 0.3f, 1f - (Vector2.Distance(player.Center, npc.Center) / maxDistance));
}
}
}
modPlayer.trueMeleeDamage += damageAdd;
// Intentionally at the end: Bloodflare Core's defense reduction (after all other boosting effects and whatnot)
+18
View File
@@ -128,6 +128,24 @@ namespace CalamityMod
[Tooltip("Sets Reactive Boss DR to always be full strength, even if the boss has already been defeated.\nIf disabled, the effect is only 66% as powerful after the boss has been defeated.\n\nReactive Boss DR makes bosses smoothly take less damage if they are being killed very quickly.\nIn most cases, the system has no noticeable effect.")]
public bool FullPowerReactiveBossDR { get; set; }
[Label("Let Town NPCs spawn at night.")]
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(false)]
[Tooltip("Allows you to determine if town NPCs (including the Old Man) can spawn at night.")]
public bool CanTownNPCsSpawnAtNight { get; set; }
private const int MinTownNPCSpawnMultiplier = 1;
private const int MaxTownNPCSpawnMultiplier = 10;
[Label("Town NPC Spawn Rate Multiplier")]
[BackgroundColor(192, 54, 64, 192)]
[Range(MinTownNPCSpawnMultiplier, MaxTownNPCSpawnMultiplier)]
[Increment(1)]
[DrawTicks]
[DefaultValue(MinTownNPCSpawnMultiplier)]
[Tooltip("Makes town NPCs spawn more quickly, the higher this value is.")]
public int TownNPCSpawnRateMultiplier { get; set; }
private const float MinBossHealthBoost = 0f;
private const float MaxBossHealthBoost = 900f;
+4
View File
@@ -402,6 +402,7 @@ namespace CalamityMod
ProjectileID.VortexBeater,
ProjectileID.DD2PhoenixBow,
ProjectileID.LastPrism,
ProjectileID.LastPrismLaser,
ProjectileID.LaserMachinegun,
ProjectileID.ChargedBlasterCannon,
ProjectileID.MedusaHead,
@@ -418,7 +419,10 @@ namespace CalamityMod
ModContent.ProjectileType<T1000Proj>(),
ModContent.ProjectileType<YharimsCrystalPrism>(),
ModContent.ProjectileType<DarkSparkPrism>(),
ModContent.ProjectileType<YharimsCrystalBeam>(),
ModContent.ProjectileType<DarkSparkBeam>(),
ModContent.ProjectileType<GhastlyVisageProj>(),
// ModContent.ProjectileType<ApotheosisWorm>(), // TODO: ADD THE APOTHEOSIS WORM HERE LATER. IT IS IN A DIFFERENT BRANCH AS OF WRITING THIS.
ModContent.ProjectileType<FlakKrakenProj>(),
ModContent.ProjectileType<SylvanSlashAttack>(),
+8 -1
View File
@@ -126,7 +126,7 @@ namespace CalamityMod
TarraHotKey = RegisterHotKey("Armor Set Bonus", "Y");
AstralTeleportHotKey = RegisterHotKey("Astral Teleport", "P");
AstralArcanumUIHotkey = RegisterHotKey("Astral Arcanum UI Toggle", "O");
MomentumCapacitatorHotkey = RegisterHotKey("Momentom Capacitator Effect", "U");
MomentumCapacitatorHotkey = RegisterHotKey("Momentum Capacitor Effect", "U");
SandCloakHotkey = RegisterHotKey("Sand Cloak Effect", "C");
SpectralVeilHotKey = RegisterHotKey("Spectral Veil Teleport", "Z");
PlaguePackHotKey = RegisterHotKey("Booster Dash", "Q");
@@ -815,6 +815,13 @@ namespace CalamityMod
return true;
}, InterfaceScaleType.None));
// Mode Indicator UI.
layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Mode Indicator UI", delegate ()
{
ModeIndicatorUI.Draw(Main.spriteBatch);
return true;
}, InterfaceScaleType.UI));
// Astral Arcanum overlay (if open)
layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Astral Arcanum UI", delegate ()
{
+1 -1
View File
@@ -214,7 +214,7 @@ namespace CalamityMod.Events
}, usesSpecialSound: true),
new Boss(ModContent.NPCType<SupremeCalamitas>(), spawnContext: type =>
{
CalamityUtils.DisplayLocalizedText("BossRushTierFourEndText2", XerocTextColor);
CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.BossRushTierFourEndText2", XerocTextColor);
for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++)
{
if (Main.player[playerIndex].active)
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 539 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 523 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 567 B

+48
View File
@@ -3,6 +3,7 @@ using Mono.Cecil.Cil;
using MonoMod.Cil;
using System;
using System.Collections.Generic;
using System.Reflection;
using Terraria;
using Terraria.GameInput;
using Terraria.ID;
@@ -27,8 +28,13 @@ namespace CalamityMod.ILEditing
/// </summary>
public static void Initialize()
{
var spawnTownNPCMethod = typeof(Main).GetMethod("UpdateTime_SpawnTownNPCs", BindingFlags.Static | BindingFlags.NonPublic);
cachedUpdateTime_SpawnTownNPCs = Delegate.CreateDelegate(typeof(Action), spawnTownNPCMethod) as Action;
On.Terraria.NPC.SlimeRainSpawns += PreventBossSlimeRainSpawns;
ApplyLifeBytesChanges();
SlideDungeonOver();
AlterTownNPCSpawnRate();
LabDoorFixes();
PreventStupidTreesNearOcean();
}
@@ -72,6 +78,48 @@ namespace CalamityMod.ILEditing
On.Terraria.WorldGen.OpenDoor += LabDoorsOpen;
On.Terraria.WorldGen.CloseDoor += LabDoorsClose;
}
private static void PreventBossSlimeRainSpawns(On.Terraria.NPC.orig_SlimeRainSpawns orig, int plr)
{
if (!Main.player[plr].Calamity().bossZen)
orig(plr);
}
private static Action cachedUpdateTime_SpawnTownNPCs;
private static void AlterTownNPCSpawnRate()
{
IL.Terraria.Main.UpdateTime += (il) =>
{
// Don't do town NPC spawning at the end (after a !Main.dayTime return).
// Do it at the beginning in spite of time.
var cursor = new ILCursor(il);
cursor.EmitDelegate<Action>(() =>
{
// A cached delegate is used here instead of direct reflection for performance reasons
// since UpdateTime is called every frame.
if (Main.dayTime || CalamityConfig.Instance.CanTownNPCsSpawnAtNight)
cachedUpdateTime_SpawnTownNPCs();
});
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchCallOrCallvirt<Main>("UpdateTime_SpawnTownNPCs")))
{
CalamityMod.Instance.Logger.Warn("Town NPC spawn editing code failed.");
return;
}
cursor.Emit(OpCodes.Ret);
};
On.Terraria.Main.UpdateTime_SpawnTownNPCs += (orig) =>
{
int oldWorldRate = Main.worldRate;
Main.worldRate *= CalamityConfig.Instance.TownNPCSpawnRateMultiplier;
orig();
Main.worldRate = oldWorldRate;
};
}
#endregion
#region IL Editing Injection Functions
+3 -5
View File
@@ -28,8 +28,7 @@ namespace CalamityMod.Items.Accessories
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Vector2 origin = new Vector2(19f, 20f);
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Accessories/Affliction"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Accessories/Affliction"));
}
public override void UpdateAccessory(Player player, bool hideVisual)
@@ -38,10 +37,9 @@ namespace CalamityMod.Items.Accessories
modPlayer.affliction = true;
if (player.whoAmI != Main.myPlayer && player.miscCounter % 10 == 0)
{
int myPlayer = Main.myPlayer;
if (Main.player[myPlayer].team == player.team && player.team != 0)
if (Main.LocalPlayer.team == player.team && player.team != 0)
{
Main.player[myPlayer].AddBuff(ModContent.BuffType<Afflicted>(), 20, true);
Main.LocalPlayer.AddBuff(ModContent.BuffType<Afflicted>(), 20, true);
}
}
}
+6 -1
View File
@@ -1,3 +1,4 @@
using CalamityMod.Items.Materials;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -9,7 +10,8 @@ namespace CalamityMod.Items.Accessories
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Coin of Deceit");
Tooltip.SetDefault("6% increased rogue crit chance");
Tooltip.SetDefault("Stealth strikes only expend 75% of your max stealth\n" +
"6% increased rogue crit chance");
}
public override void SetDefaults()
@@ -24,6 +26,7 @@ namespace CalamityMod.Items.Accessories
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.Calamity().throwingCrit += 6;
player.Calamity().stealthStrike75Cost = true;
}
public override void AddRecipes()
@@ -31,6 +34,8 @@ namespace CalamityMod.Items.Accessories
ModRecipe recipe = new ModRecipe(mod);
recipe.AddRecipeGroup("AnyGoldBar", 4);
recipe.AddRecipeGroup("AnyCopperBar", 8);
// So you make fake coins out of wood, nobody will judge you
recipe.AddIngredient(ModContent.ItemType<Acidwood>(), 5);
recipe.AddTile(TileID.Anvils);
recipe.SetResult(this);
recipe.AddRecipe();
+1
View File
@@ -14,6 +14,7 @@ namespace CalamityMod.Items.Accessories
DisplayName.SetDefault("Core of the Blood God");
Tooltip.SetDefault("8% increased damage and damage reduction\n" +
"Boosts your max HP by 10%\n" +
"Healing Potions are 15% more effective\n" +
"Halves enemy contact damage\n" +
"When you take contact damage this effect has a 20 second cooldown");
}
+1 -1
View File
@@ -14,7 +14,7 @@ namespace CalamityMod.Items.Accessories
{
DisplayName.SetDefault("Eldritch Soul Artifact");
Tooltip.SetDefault("Knowledge\n" +
"Boosts melee speed by 10%, shoot speed by 25%, rogue damage by 15%, max minions by 2, and reduces mana cost by 15%");
"Boosts melee speed by 10%, ranged velocity by 25%, rogue damage by 15%, max minions by 2, and reduces mana cost by 15%");
}
public override void SetDefaults()
+1 -1
View File
@@ -143,7 +143,7 @@ namespace CalamityMod.Items.Accessories
sb.Append("Defense Lost: ").Append(defenseLoss);
}
else
sb.Append("Abyss stats only displayed while in the Abyss");
sb.Append("Other Abyss stats are only displayed while in the Abyss");
return sb.ToString();
}
+1 -2
View File
@@ -35,8 +35,7 @@ namespace CalamityMod.Items.Ammo
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Vector2 origin = new Vector2(11f, 21f);
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Ammo/VanquisherArrowGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Ammo/VanquisherArrowGlow"));
}
public override void AddRecipes()
+1 -1
View File
@@ -24,7 +24,7 @@ namespace CalamityMod.Items.Armor
item.height = 18;
item.value = Item.buyPrice(4, 0, 0, 0);
item.defense = 50;
item.Calamity().customRarity = CalamityRarity.Developer;
item.Calamity().customRarity = CalamityRarity.ItemSpecific;
}
public override void UpdateEquip(Player player)
+1 -1
View File
@@ -21,7 +21,7 @@ namespace CalamityMod.Items.Armor
item.height = 18;
item.value = Item.buyPrice(3, 0, 0, 0);
item.defense = 50; //15
item.Calamity().customRarity = CalamityRarity.Developer;
item.Calamity().customRarity = CalamityRarity.ItemSpecific;
}
public override void UpdateEquip(Player player)
+1 -1
View File
@@ -23,7 +23,7 @@ namespace CalamityMod.Items.Armor
item.height = 18;
item.value = Item.buyPrice(5, 0, 0, 0);
item.defense = 50; //15
item.Calamity().customRarity = CalamityRarity.Developer;
item.Calamity().customRarity = CalamityRarity.ItemSpecific;
}
public override bool IsArmorSet(Item head, Item body, Item legs)
+1 -2
View File
@@ -37,8 +37,7 @@ namespace CalamityMod.Items.Armor
{
player.setBonus = "Attacking and being attacked by enemies inflicts poison\n" +
"Grants an additional jump that summons a sulphurous bubble\n" +
"Reduces the severity of the sulphuric waters\n" +
"Slightly reduces breath loss in the abyss\n" +
"Provides increased underwater mobility and reduces the severity of the sulphuric waters\n" +
"Rogue stealth builds while not attacking and slower while moving, up to a max of 100\n" +
"Once you have built max stealth, you will be able to perform a Stealth Strike\n" +
"Rogue stealth only reduces when you attack, it does not reduce while moving\n" +
+34 -5
View File
@@ -2,6 +2,7 @@ using CalamityMod.Buffs.Potions;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.CalPlayer;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Armor;
using CalamityMod.Items.DifficultyItems;
using CalamityMod.Items.Materials;
using CalamityMod.Items.PermanentBoosters;
@@ -1125,7 +1126,7 @@ namespace CalamityMod.Items
break;
case CalamityRarity.ItemSpecific:
// Uniquely colored developer weapons
// Uniquely colored developer items
if (item.type == ModContent.ItemType<Fabstaff>())
tt2.overrideColor = new Color(Main.DiscoR, 100, 255);
if (item.type == ModContent.ItemType<BlushieStaff>())
@@ -1137,19 +1138,31 @@ namespace CalamityMod.Items
if (item.type == ModContent.ItemType<ProfanedSoulCrystal>())
tt2.overrideColor = CalamityUtils.ColorSwap(new Color(255, 166, 0), new Color(25, 250, 25), 4f); //alternates between emerald green and amber (BanditHueh)
if (item.type == ModContent.ItemType<BensUmbrella>())
tt2.overrideColor = CalamityUtils.ColorSwap(new Color(210, 0, 255), new Color(255, 248, 24), 2f);
tt2.overrideColor = CalamityUtils.ColorSwap(new Color(210, 0, 255), new Color(255, 248, 24), 4f);
if (item.type == ModContent.ItemType<Endogenesis>())
tt2.overrideColor = CalamityUtils.ColorSwap(new Color(131, 239, 255), new Color(36, 55, 230), 2f);
tt2.overrideColor = CalamityUtils.ColorSwap(new Color(131, 239, 255), new Color(36, 55, 230), 4f);
if (item.type == ModContent.ItemType<DraconicDestruction>())
tt2.overrideColor = CalamityUtils.ColorSwap(new Color(255, 69, 0), new Color(139, 0, 0), 2f);
tt2.overrideColor = CalamityUtils.ColorSwap(new Color(255, 69, 0), new Color(139, 0, 0), 4f);
if (item.type == ModContent.ItemType<ScarletDevil>())
tt2.overrideColor = CalamityUtils.ColorSwap(new Color(191, 45, 71), new Color(185, 187, 253), 2f);
tt2.overrideColor = CalamityUtils.ColorSwap(new Color(191, 45, 71), new Color(185, 187, 253), 4f);
if (item.type == ModContent.ItemType<RedSun>())
tt2.overrideColor = CalamityUtils.ColorSwap(new Color(204, 86, 80), new Color(237, 69, 141), 4f);
if (item.type == ModContent.ItemType<GaelsGreatsword>())
tt2.overrideColor = new Color(146, 0, 0);
if (item.type == ModContent.ItemType<CrystylCrusher>())
tt2.overrideColor = new Color(129, 29, 149);
if (item.type == ModContent.ItemType<Svantechnical>())
tt2.overrideColor = new Color(220, 20, 60);
if (item.type == ModContent.ItemType<SomaPrime>())
tt2.overrideColor = new Color(254, 253, 235);
if (item.type == ModContent.ItemType<Contagion>())
tt2.overrideColor = new Color(207, 17, 117);
if (item.type == ModContent.ItemType<TriactisTruePaladinianMageHammerofMightMelee>() || item.type == ModContent.ItemType<TriactisTruePaladinianMageHammerofMight>())
tt2.overrideColor = new Color(227, 226, 180);
if (item.type == ModContent.ItemType<RoyalKnivesMelee>() || item.type == ModContent.ItemType<RoyalKnives>())
tt2.overrideColor = CalamityUtils.ColorSwap(new Color(154, 255, 151), new Color(228, 151, 255), 4f);
if (item.type == ModContent.ItemType<DemonshadeHelm>() || item.type == ModContent.ItemType<DemonshadeBreastplate>() || item.type == ModContent.ItemType<DemonshadeGreaves>())
tt2.overrideColor = CalamityUtils.ColorSwap(new Color(255, 132, 22), new Color(221, 85, 7), 4f);
if (item.type == ModContent.ItemType<PrototypeAndromechaRing>())
{
if (Main.GlobalTime % 1f < 0.6f)
@@ -1165,6 +1178,22 @@ namespace CalamityMod.Items
tt2.overrideColor = Color.Lerp(Color.White, new Color(89, 229, 255), (Main.GlobalTime % 1f - 0.8f) / 0.2f);
}
}
if (item.type == ModContent.ItemType<Earth>())
{
List<Color> earthColors = new List<Color>()
{
new Color(255, 99, 146),
new Color(255, 228, 94),
new Color(127, 200, 248)
};
if (tt2 != null)
{
int colorIndex = (int)(Main.GlobalTime / 2 % earthColors.Count);
Color currentColor = earthColors[colorIndex];
Color nextColor = earthColors[(colorIndex + 1) % earthColors.Count];
tt2.overrideColor = Color.Lerp(currentColor, nextColor, Main.GlobalTime % 2f > 1f ? 1f : Main.GlobalTime % 1f);
}
}
// Uniquely colored legendary weapons and Yharim's Crystal
if (item.type == ModContent.ItemType<AegisBlade>() || item.type == ModContent.ItemType<YharimsCrystal>())
+27 -9
View File
@@ -1,13 +1,17 @@
using Terraria;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.DataStructures;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Terraria.ID;
namespace CalamityMod.Items.Materials
{
public class AscendantSpiritEssence : ModItem
{
public int frameCounter = 0;
public int frame = 0;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Ascendant Spirit Essence");
@@ -15,12 +19,6 @@ namespace CalamityMod.Items.Materials
Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 6));
}
public override void Update(ref float gravity, ref float maxFallSpeed)
{
float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f);
Lighting.AddLight(item.Center, 1.2f * brightness, 0.4f * brightness, 0.8f);
}
public override void SetDefaults()
{
item.width = 32;
@@ -30,6 +28,26 @@ namespace CalamityMod.Items.Materials
item.Calamity().customRarity = CalamityRarity.DarkBlue;
item.value = Item.sellPrice(gold: 25);
}
public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
{
Texture2D texture = Main.itemTexture[item.type];
spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 6, 6), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
return false;
}
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Materials/AscendantSpiritEssenceGlow");
spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 6, 6, false), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
}
public override void Update(ref float gravity, ref float maxFallSpeed)
{
float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f);
Lighting.AddLight(item.Center, 1.2f * brightness, 0.4f * brightness, 0.8f);
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

+16 -7
View File
@@ -10,6 +10,8 @@ namespace CalamityMod.Items.Materials
{
public class AuricBar : ModItem
{
public int frameCounter = 0;
public int frame = 0;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Auric Tesla Bar");
@@ -26,16 +28,23 @@ namespace CalamityMod.Items.Materials
item.Calamity().customRarity = CalamityRarity.Violet;
}
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
CalamityUtils.DrawItemGlowmask(item, spriteBatch, 16, rotation, ModContent.GetTexture("CalamityMod/Items/Materials/AuricBarGlow"));
}
public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
{
Texture2D texture = Main.itemTexture[item.type];
spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 6, 16), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
return false;
}
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Materials/AuricBarGlow");
spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 6, 16, false), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
}
public override void Update(ref float gravity, ref float maxFallSpeed)
{
float num = (float)Main.rand.Next(90, 111) * 0.01f;
num *= Main.essScale;
Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.5f * num, 0.7f * num, 0f);
float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f);
Lighting.AddLight(item.Center, 0.5f * brightness, 0.7f * brightness, 0f);
}
public override void AddRecipes()
+11 -5
View File
@@ -1,3 +1,5 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -13,19 +15,23 @@ namespace CalamityMod.Items.Materials
public override void SetDefaults()
{
item.width = 10;
item.height = 14;
item.width = 20;
item.height = 34;
item.maxStack = 999;
item.rare = ItemRarityID.Red;
item.value = Item.sellPrice(gold: 24);
item.Calamity().customRarity = CalamityRarity.Violet;
}
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, Main.itemTexture[item.type]);
}
public override void Update(ref float gravity, ref float maxFallSpeed)
{
float num = (float)Main.rand.Next(90, 111) * 0.01f;
num *= Main.essScale;
Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.1f * num, 0.1f * num, 0.1f * num);
float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f);
Lighting.AddLight(item.Center, 0.1f * brightness, 0.1f * brightness, 0.1f * brightness);
}
}
}
+9 -2
View File
@@ -1,3 +1,5 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -13,13 +15,18 @@ namespace CalamityMod.Items.Materials
public override void SetDefaults()
{
item.width = 40;
item.height = 40;
item.width = 36;
item.height = 36;
item.maxStack = 99;
item.value = Item.sellPrice(gold: 4);
item.rare = 8;
}
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Materials/CoreofCalamityGlow"));
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
Binary file not shown.

After

Width:  |  Height:  |  Size: 669 B

+11 -5
View File
@@ -1,3 +1,5 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -13,18 +15,22 @@ namespace CalamityMod.Items.Materials
public override void SetDefaults()
{
item.width = 16;
item.height = 16;
item.width = 36;
item.height = 36;
item.maxStack = 999;
item.value = Item.sellPrice(silver: 40);
item.rare = 8;
}
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Materials/CoreofChaosGlow"));
}
public override void Update(ref float gravity, ref float maxFallSpeed)
{
float num = (float)Main.rand.Next(90, 111) * 0.01f;
num *= Main.essScale;
Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.5f * num, 0.3f * num, 0.05f * num);
float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f);
Lighting.AddLight(item.Center, 0.5f * brightness, 0.3f * brightness, 0.05f * brightness);
}
public override void AddRecipes()
Binary file not shown.

After

Width:  |  Height:  |  Size: 429 B

+11 -5
View File
@@ -1,3 +1,5 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -13,18 +15,22 @@ namespace CalamityMod.Items.Materials
public override void SetDefaults()
{
item.width = 16;
item.height = 16;
item.width = 34;
item.height = 34;
item.maxStack = 999;
item.value = Item.sellPrice(silver: 40);
item.rare = 8;
}
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Materials/CoreofCinderGlow"));
}
public override void Update(ref float gravity, ref float maxFallSpeed)
{
float num = (float)Main.rand.Next(90, 111) * 0.01f;
num *= Main.essScale;
Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.3f * num, 0.3f * num, 0.05f * num);
float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f);
Lighting.AddLight(item.Center, 0.3f * brightness, 0.3f * brightness, 0.05f * brightness);
}
public override void AddRecipes()
Binary file not shown.

After

Width:  |  Height:  |  Size: 477 B

+11 -5
View File
@@ -1,3 +1,5 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -13,18 +15,22 @@ namespace CalamityMod.Items.Materials
public override void SetDefaults()
{
item.width = 16;
item.height = 16;
item.width = 34;
item.height = 34;
item.maxStack = 999;
item.value = Item.sellPrice(silver: 40);
item.rare = 8;
}
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Materials/CoreofEleumGlow"));
}
public override void Update(ref float gravity, ref float maxFallSpeed)
{
float num = (float)Main.rand.Next(90, 111) * 0.01f;
num *= Main.essScale;
Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.15f * num, 0.05f * num, 0.5f * num);
float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f);
Lighting.AddLight(item.Center, 0.15f * brightness, 0.05f * brightness, 0.5f * brightness);
}
public override void AddRecipes()
Binary file not shown.

After

Width:  |  Height:  |  Size: 459 B

+5 -17
View File
@@ -11,8 +11,8 @@ namespace CalamityMod.Items.Materials
{
public class CruptixBar : ModItem
{
private int frameCounter = 0;
private int frame = 0;
public int frameCounter = 0;
public int frame = 0;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Scoria Bar");
@@ -35,29 +35,17 @@ namespace CalamityMod.Items.Materials
item.rare = 8;
}
internal Rectangle GetCurrentFrame()
{
int frameAmt = 6;
if (frameCounter >= 6)
{
frameCounter = -1;
frame = frame == frameAmt - 1 ? 0 : frame + 1;
}
frameCounter++;
return new Rectangle(0, item.height * frame, item.width, item.height);
}
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale)
{
Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Materials/CruptixBar_Animated");
spriteBatch.Draw(texture, position, GetCurrentFrame(), Color.White, 0f, origin, scale, SpriteEffects.None, 0);
spriteBatch.Draw(texture, position, item.GetCurrentFrame(ref frame, ref frameCounter, 6, 6), Color.White, 0f, origin, scale, SpriteEffects.None, 0);
return false;
}
public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
{
Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Materials/CruptixBar_Animated");
spriteBatch.Draw(texture, item.position - Main.screenPosition, GetCurrentFrame(), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 6, 6), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
return false;
}
+21 -5
View File
@@ -1,3 +1,5 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.DataStructures;
using Terraria.ModLoader;
@@ -6,6 +8,8 @@ namespace CalamityMod.Items.Materials
{
public class DarksunFragment : ModItem
{
public int frameCounter = 0;
public int frame = 0;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Darksun Fragment");
@@ -15,19 +19,31 @@ namespace CalamityMod.Items.Materials
public override void SetDefaults()
{
item.width = 20;
item.height = 19;
item.width = 28;
item.height = 32;
item.maxStack = 999;
item.rare = 10;
item.value = Item.sellPrice(gold: 12);
item.Calamity().customRarity = CalamityRarity.Violet;
}
public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
{
Texture2D texture = Main.itemTexture[item.type];
spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 6, 8), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
return false;
}
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Materials/DarksunFragmentGlow");
spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 6, 8, false), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
}
public override void Update(ref float gravity, ref float maxFallSpeed)
{
float num = (float)Main.rand.Next(90, 111) * 0.01f;
num *= Main.essScale;
Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.5f * num, 0.5f * num, 0.5f * num);
float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f);
Lighting.AddLight(item.Center, 0.5f * brightness, 0.5f * brightness, 0.5f * brightness);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

+23 -1
View File
@@ -1,3 +1,5 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
@@ -13,10 +15,30 @@ namespace CalamityMod.Items.Materials
public override void SetDefaults()
{
item.width = 16;
item.height = 14;
item.height = 18;
item.maxStack = 999;
item.value = Item.sellPrice(silver: 6);
item.rare = 1;
}
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
{
if (item.notAmmo)
{
Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Materials/EbonianGelRed");
spriteBatch.Draw(texture, position, frame, Color.White, 0f, origin, scale, SpriteEffects.None, 0);
}
return !item.notAmmo;
}
public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
{
if (item.notAmmo)
{
Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Materials/EbonianGelRed");
spriteBatch.Draw(texture, item.position - Main.screenPosition, new Rectangle(0, 0, item.width, item.height), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
}
return !item.notAmmo;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

+25 -8
View File
@@ -1,3 +1,5 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
using Terraria.DataStructures;
@@ -6,6 +8,8 @@ namespace CalamityMod.Items.Materials
{
public class EndothermicEnergy : ModItem
{
public int frameCounter = 0;
public int frame = 0;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Endothermic Energy");
@@ -13,20 +17,33 @@ namespace CalamityMod.Items.Materials
Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 6));
}
public override void Update(ref float gravity, ref float maxFallSpeed)
{
float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f);
Lighting.AddLight(item.Center, 0f, 0f, 1.2f * brightness);
}
public override void SetDefaults()
{
item.width = 20;
item.height = 20;
item.width = 36;
item.height = 38;
item.maxStack = 999;
item.rare = 10;
item.value = Item.sellPrice(gold: 2);
item.Calamity().customRarity = CalamityRarity.DarkBlue;
}
public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
{
Texture2D texture = Main.itemTexture[item.type];
spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 6, 6), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
return false;
}
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Materials/EndothermicEnergyGlow");
spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 6, 6, false), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
}
public override void Update(ref float gravity, ref float maxFallSpeed)
{
float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f);
Lighting.AddLight(item.Center, 0f, 0f, 1.2f * brightness);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

+11 -5
View File
@@ -1,3 +1,5 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
@@ -13,18 +15,22 @@ namespace CalamityMod.Items.Materials
public override void SetDefaults()
{
item.width = 8;
item.height = 10;
item.width = 34;
item.height = 24;
item.maxStack = 999;
item.value = Item.sellPrice(silver: 40);
item.rare = 5;
}
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, Main.itemTexture[item.type]);
}
public override void Update(ref float gravity, ref float maxFallSpeed)
{
float num = (float)Main.rand.Next(90, 111) * 0.01f;
num *= Main.essScale;
Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.5f * num, 0.3f * num, 0.05f * num);
float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f);
Lighting.AddLight(item.Center, 0.5f * brightness, 0.3f * brightness, 0.05f * brightness);
}
}
}
+11 -5
View File
@@ -1,3 +1,5 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
@@ -13,18 +15,22 @@ namespace CalamityMod.Items.Materials
public override void SetDefaults()
{
item.width = 8;
item.height = 22;
item.width = 30;
item.height = 24;
item.maxStack = 999;
item.value = Item.sellPrice(silver: 40);
item.rare = 5;
}
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, Main.itemTexture[item.type]);
}
public override void Update(ref float gravity, ref float maxFallSpeed)
{
float num = (float)Main.rand.Next(90, 111) * 0.01f;
num *= Main.essScale;
Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.3f * num, 0.3f * num, 0.05f * num);
float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f);
Lighting.AddLight(item.Center, 0.3f * brightness, 0.3f * brightness, 0.05f * brightness);
}
}
}
+11 -5
View File
@@ -1,3 +1,5 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
@@ -13,18 +15,22 @@ namespace CalamityMod.Items.Materials
public override void SetDefaults()
{
item.width = 8;
item.height = 20;
item.width = 34;
item.height = 26;
item.maxStack = 999;
item.value = Item.sellPrice(silver: 40);
item.rare = 5;
}
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, Main.itemTexture[item.type]);
}
public override void Update(ref float gravity, ref float maxFallSpeed)
{
float num = (float)Main.rand.Next(90, 111) * 0.01f;
num *= Main.essScale;
Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.15f * num, 0.05f * num, 0.5f * num);
float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f);
Lighting.AddLight(item.Center, 0.15f * brightness, 0.05f * brightness, 0.5f * brightness);
}
}
}
+25 -8
View File
@@ -1,3 +1,5 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
using Terraria.DataStructures;
@@ -6,6 +8,8 @@ namespace CalamityMod.Items.Materials
{
public class NightmareFuel : ModItem
{
public int frameCounter = 0;
public int frame = 0;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Nightmare Fuel");
@@ -13,20 +17,33 @@ namespace CalamityMod.Items.Materials
Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 6));
}
public override void Update(ref float gravity, ref float maxFallSpeed)
{
float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f);
Lighting.AddLight(item.Center, 0.7f * brightness, 0.7f * brightness, 0f);
}
public override void SetDefaults()
{
item.width = 20;
item.height = 20;
item.width = 38;
item.height = 36;
item.maxStack = 999;
item.rare = 10;
item.value = Item.sellPrice(gold: 2);
item.Calamity().customRarity = CalamityRarity.DarkBlue;
}
public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
{
Texture2D texture = Main.itemTexture[item.type];
spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 6, 6), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
return false;
}
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Materials/NightmareFuelGlow");
spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 6, 6, false), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
}
public override void Update(ref float gravity, ref float maxFallSpeed)
{
float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f);
Lighting.AddLight(item.Center, 0.7f * brightness, 0.7f * brightness, 0f);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

+1 -4
View File
@@ -23,9 +23,6 @@ namespace CalamityMod.Items.Materials
item.Calamity().customRarity = CalamityRarity.PureGreen;
}
public override Color? GetAlpha(Color lightColor)
{
return new Color(200, 200, 200, 0);
}
public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, 0);
}
}
+6 -19
View File
@@ -10,8 +10,8 @@ namespace CalamityMod.Items.PermanentBoosters
{
public class Ectoheart : ModItem
{
private int frameCounter = 0;
private int frame = 0;
public int frameCounter = 0;
public int frame = 0;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Ectoheart");
@@ -34,37 +34,24 @@ namespace CalamityMod.Items.PermanentBoosters
public override bool CanUseItem(Player player) => !player.Calamity().adrenalineBoostThree;
internal Rectangle GetCurrentFrame(bool frameCounterUp = true)
{
int frameAmt = 3;
if (frameCounter >= 8)
{
frameCounter = -1;
frame = frame == frameAmt - 1 ? 0 : frame + 1;
}
if (frameCounterUp)
frameCounter++;
return new Rectangle(0, item.height * frame, item.width, item.height);
}
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale)
{
Texture2D texture = ModContent.GetTexture("CalamityMod/Items/PermanentBoosters/Ectoheart_Animated");
spriteBatch.Draw(texture, position, GetCurrentFrame(), Color.White, 0f, origin, scale, SpriteEffects.None, 0);
spriteBatch.Draw(texture, position, item.GetCurrentFrame(ref frame, ref frameCounter, 8, 3), Color.White, 0f, origin, scale, SpriteEffects.None, 0);
return false;
}
public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
{
Texture2D texture = ModContent.GetTexture("CalamityMod/Items/PermanentBoosters/Ectoheart_Animated");
spriteBatch.Draw(texture, item.position - Main.screenPosition, GetCurrentFrame(), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 8, 3), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
return false;
}
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Texture2D texture = ModContent.GetTexture("CalamityMod/Items/PermanentBoosters/EctoheartGlow");
spriteBatch.Draw(texture, item.position - Main.screenPosition, GetCurrentFrame(false), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 8, 3, false), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
}
public override bool UseItem(Player player)
@@ -10,8 +10,8 @@ namespace CalamityMod.Items.PermanentBoosters
{
public class RedLightningContainer : ModItem
{
private int frameCounter = 0;
private int frame = 0;
public int frameCounter = 0;
public int frame = 0;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Red Lightning Container");
@@ -34,37 +34,24 @@ namespace CalamityMod.Items.PermanentBoosters
public override bool CanUseItem(Player player) => !player.Calamity().rageBoostThree;
internal Rectangle GetCurrentFrame(bool frameCounterUp = true)
{
int frameAmt = 6;
if (frameCounter >= 5)
{
frameCounter = -1;
frame = frame == frameAmt - 1 ? 0 : frame + 1;
}
if (frameCounterUp)
frameCounter++;
return new Rectangle(0, item.height * frame, item.width, item.height);
}
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale)
{
Texture2D texture = ModContent.GetTexture("CalamityMod/Items/PermanentBoosters/RedLightningContainer_Animated");
spriteBatch.Draw(texture, position, GetCurrentFrame(), Color.White, 0f, origin, scale, SpriteEffects.None, 0);
spriteBatch.Draw(texture, position, item.GetCurrentFrame(ref frame, ref frameCounter, 5, 6), Color.White, 0f, origin, scale, SpriteEffects.None, 0);
return false;
}
public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
{
Texture2D texture = ModContent.GetTexture("CalamityMod/Items/PermanentBoosters/RedLightningContainer_Animated");
spriteBatch.Draw(texture, item.position - Main.screenPosition, GetCurrentFrame(), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 5, 6), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
return false;
}
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Texture2D texture = ModContent.GetTexture("CalamityMod/Items/PermanentBoosters/RedLightningContainerGlow");
spriteBatch.Draw(texture, item.position - Main.screenPosition, GetCurrentFrame(false), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 5, 6, false), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
}
public override bool UseItem(Player player)
+1 -3
View File
@@ -46,9 +46,7 @@ namespace CalamityMod.Items.Pets
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Pets/RotomRemoteGlow");
Vector2 origin = new Vector2(texture.Width / 2f, texture.Height / 2f - 2f);
spriteBatch.Draw(texture, item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Pets/RotomRemoteGlow"));
}
public override void AddRecipes()
@@ -7,7 +7,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Trophies
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Weaver Trophy");
DisplayName.SetDefault("Storm Weaver Trophy");
}
public override void SetDefaults()
+9
View File
@@ -1,4 +1,6 @@
using CalamityMod.Tiles;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items
@@ -16,6 +18,13 @@ namespace CalamityMod.Items
item.width = 20;
item.height = 20;
item.value = Item.buyPrice(0, 0, 0, 1);
item.createTile = ModContent.TileType<PlacedRock>();
item.useStyle = ItemUseStyleID.SwingThrow;
item.useTurn = true;
item.useAnimation = 15;
item.useTime = 10;
item.autoReuse = true;
item.consumable = true;
}
}
}
+1 -2
View File
@@ -32,8 +32,7 @@ namespace CalamityMod.Items.SummonItems
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Vector2 origin = new Vector2(21f, 27f); //21, 29
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/SummonItems/NecroplasmicBeaconGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/SummonItems/NecroplasmicBeaconGlow"));
}
public override bool CanUseItem(Player player)
+1 -2
View File
@@ -40,8 +40,7 @@ namespace CalamityMod.Items.TreasureBags
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Vector2 origin = new Vector2(18f, 20f); //18, 17
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/TreasureBags/DevourerofGodsBagGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/TreasureBags/DevourerofGodsBagGlow"));
}
public override bool CanRightClick()
+1 -2
View File
@@ -38,8 +38,7 @@ namespace CalamityMod.Items.TreasureBags
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Vector2 origin = new Vector2(16f, 20f); //16, 17
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/TreasureBags/PolterghastBagGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/TreasureBags/PolterghastBagGlow"));
}
public override bool CanRightClick()
@@ -51,9 +51,6 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Point mouseTileCoords = Main.MouseWorld.ToTileCoordinates();
if (CalamityUtils.ParanoidTileRetrieval(mouseTileCoords.X, mouseTileCoords.Y).active())
return false;
CalamityUtils.OnlyOneSentry(player, type);
Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, damage, knockBack, player.whoAmI);
player.UpdateMaxTurrets();
+2 -21
View File
@@ -38,28 +38,9 @@ namespace CalamityMod.Items.Weapons.Magic
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/AbyssShocker_mask");
spriteBatch.Draw
(
texture,
new Vector2
(
item.position.X - Main.screenPosition.X + item.width * 0.5f,
item.position.Y - Main.screenPosition.Y + item.height - texture.Height * 0.5f + 2f
),
new Rectangle(0, 0, texture.Width, texture.Height),
Color.White,
rotation,
texture.Size() * 0.5f,
scale,
SpriteEffects.None,
0f
);
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/AbyssShocker_mask"));
}
public override Vector2? HoldoutOffset()
{
return new Vector2(-14, 0);
}
public override Vector2? HoldoutOffset() => new Vector2(-14, 0);
}
}
+1 -2
View File
@@ -44,8 +44,7 @@ namespace CalamityMod.Items.Weapons.Magic
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Vector2 origin = new Vector2(15f, 15f);
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/ApotheosisGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/ApotheosisGlow"));
}
public override void AddRecipes()
+1 -2
View File
@@ -46,8 +46,7 @@ namespace CalamityMod.Items.Weapons.Magic
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Vector2 origin = new Vector2(40f, 42f);
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/DeathhailStaffGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/DeathhailStaffGlow"));
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
+1 -2
View File
@@ -45,8 +45,7 @@ namespace CalamityMod.Items.Weapons.Magic
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Vector2 origin = new Vector2(40f, 41f);
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/FatesRevealGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/FatesRevealGlow"));
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
+2 -14
View File
@@ -36,23 +36,11 @@ namespace CalamityMod.Items.Weapons.Magic
item.Calamity().customRarity = CalamityRarity.PureGreen;
}
public override bool CanUseItem(Player player)
{
for (int i = 0; i < Main.projectile.Length; i++)
{
Projectile p = Main.projectile[i];
if (p.active && p.type == ModContent.ProjectileType<GhastlyVisageProj>() && p.owner == player.whoAmI)
{
return false;
}
}
return true;
}
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0;
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Vector2 origin = new Vector2(16f, 16f);
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/GhastlyVisageGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/GhastlyVisageGlow"));
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
+1 -2
View File
@@ -45,8 +45,7 @@ namespace CalamityMod.Items.Weapons.Magic
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Vector2 origin = new Vector2(32f, 30f);
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/SoulPiercerGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/SoulPiercerGlow"));
}
public override void AddRecipes()
+1 -2
View File
@@ -41,8 +41,7 @@ namespace CalamityMod.Items.Weapons.Magic
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Vector2 origin = new Vector2(19f, 22f);
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/SubsumingVortexGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/SubsumingVortexGlow"));
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
+1 -2
View File
@@ -40,8 +40,7 @@ namespace CalamityMod.Items.Weapons.Melee
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Vector2 origin = new Vector2(60f, 52f);
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/BansheeHookGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/BansheeHookGlow"));
}
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0;
+2 -1
View File
@@ -11,7 +11,8 @@ namespace CalamityMod.Items.Weapons.Melee
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Cnidarian");
Tooltip.SetDefault("Fires a seashell when enemies are near");
Tooltip.SetDefault("Fires a seashell when enemies are near\n" +
"A very agile yoyo");
ItemID.Sets.Yoyo[item.type] = true;
ItemID.Sets.GamepadExtraRange[item.type] = 15;
ItemID.Sets.GamepadSmartQuickReach[item.type] = true;
+1 -1
View File
@@ -38,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Melee
item.autoReuse = true;
item.value = Item.buyPrice(5, 0, 0, 0);
item.rare = 10;
item.Calamity().customRarity = CalamityRarity.Developer;
item.Calamity().customRarity = CalamityRarity.ItemSpecific;
}
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
+1 -2
View File
@@ -48,8 +48,7 @@ namespace CalamityMod.Items.Weapons.Melee
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Vector2 origin = new Vector2(46f, 44f);
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/ElementalExcaliburGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/ElementalExcaliburGlow"));
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
+1 -2
View File
@@ -38,8 +38,7 @@ namespace CalamityMod.Items.Weapons.Melee
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Vector2 origin = new Vector2(31f, 29f);
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/EradicatorMeleeGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/EradicatorMeleeGlow"));
}
}
}
+1 -2
View File
@@ -39,8 +39,7 @@ namespace CalamityMod.Items.Weapons.Melee
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Vector2 origin = new Vector2(50f, 37f);
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/EssenceFlayerGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/EssenceFlayerGlow"));
}
public override void AddRecipes()
+5 -6
View File
@@ -38,16 +38,15 @@ namespace CalamityMod.Items.Weapons.Melee
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Vector2 origin = new Vector2(39f, 47f);
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/ExcelsusGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/ExcelsusGlow"));
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
for (int index = 0; index < 3; ++index)
{
float SpeedX = speedX + (float)Main.rand.Next(-30, 31) * 0.05f;
float SpeedY = speedY + (float)Main.rand.Next(-30, 31) * 0.05f;
float SpeedX = speedX + Main.rand.NextFloat(-1.5f, 1.5f);
float SpeedY = speedY + Main.rand.NextFloat(-1.5f, 1.5f);
switch (index)
{
case 0:
@@ -67,12 +66,12 @@ namespace CalamityMod.Items.Weapons.Melee
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
{
Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType<LaserFountain>(), 0, 0, Main.myPlayer);
Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType<LaserFountain>(), 0, 0, player.whoAmI);
}
public override void OnHitPvp(Player player, Player target, int damage, bool crit)
{
Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType<LaserFountain>(), 0, 0, Main.myPlayer);
Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType<LaserFountain>(), 0, 0, player.whoAmI);
}
}
}
+7 -21
View File
@@ -11,8 +11,8 @@ namespace CalamityMod.Items.Weapons.Melee
{
public class Murasama : ModItem
{
private int frameCounter = 0;
private int frame = 0;
public int frameCounter = 0;
public int frame = 0;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Murasama");
@@ -44,46 +44,32 @@ namespace CalamityMod.Items.Weapons.Melee
Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 14));
}
internal Rectangle GetCurrentFrame(bool frameCounterUp = true)
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale)
{
//0 = 6 frames, 8 = 3 frames]
int applicableCounter = frame == 0 ? 36 : frame == 8 ? 24 : 6;
if (frameCounter >= applicableCounter)
{
frameCounter = -1;
frame = frame == 13 ? 0 : frame + 1;
}
if (frameCounterUp)
frameCounter++;
return new Rectangle(0, item.height * frame, item.width, item.height);
}
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
{
Texture2D texture = ModContent.GetTexture(Texture);
spriteBatch.Draw(texture, position, GetCurrentFrame(), Color.White, 0f, origin, scale, SpriteEffects.None, 0);
spriteBatch.Draw(texture, position, item.GetCurrentFrame(ref frame, ref frameCounter, frame == 0 ? 36 : frame == 8 ? 24 : 6, 13), Color.White, 0f, origin, scale, SpriteEffects.None, 0);
return false;
}
public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
{
Texture2D texture = ModContent.GetTexture(Texture);
spriteBatch.Draw(texture, item.position - Main.screenPosition, GetCurrentFrame(), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, frame == 0 ? 36 : frame == 8 ? 24 : 6, 13), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
return false;
}
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/MurasamaGlow");
spriteBatch.Draw(texture, item.position - Main.screenPosition, GetCurrentFrame(false), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, frame == 0 ? 36 : frame == 8 ? 24 : 6, 13, false), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
}
public override bool CanUseItem(Player player)
{
if (player.ownedProjectileCounts[item.shoot] > 0)
return false;
return CalamityWorld.downedYharon || player.name == "Sam" || player.name == "Samuel Rodrigues";
return CalamityWorld.downedYharon || player.name == "Jetstream Sam" || player.name == "Samuel Rodrigues";
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
+1 -3
View File
@@ -81,9 +81,7 @@ namespace CalamityMod.Items.Weapons.Melee
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
//item.width and then item.height - 2f
Vector2 origin = new Vector2(25f, 23f);
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/PrismaticBreakerGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/PrismaticBreakerGlow"));
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
+1 -1
View File
@@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Melee
item.rare = 10;
item.shoot = ModContent.ProjectileType<RSSolarFlare>();
item.shootSpeed = 15f;
item.Calamity().customRarity = CalamityRarity.Developer;
item.Calamity().customRarity = CalamityRarity.ItemSpecific;
}
public override void AddRecipes()
+1 -1
View File
@@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Melee
item.rare = 10;
item.shoot = ModContent.ProjectileType<IllustriousKnife>();
item.shootSpeed = 9f;
item.Calamity().customRarity = CalamityRarity.Developer;
item.Calamity().customRarity = CalamityRarity.ItemSpecific;
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
+2 -1
View File
@@ -11,7 +11,8 @@ namespace CalamityMod.Items.Weapons.Melee
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Shimmerspark");
Tooltip.SetDefault("Fires stars when enemies are near");
Tooltip.SetDefault("Fires stars when enemies are near\n" +
"A very agile yoyo");
ItemID.Sets.Yoyo[item.type] = true;
ItemID.Sets.GamepadExtraRange[item.type] = 15;
ItemID.Sets.GamepadSmartQuickReach[item.type] = true;
+3 -4
View File
@@ -41,13 +41,12 @@ namespace CalamityMod.Items.Weapons.Melee
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Vector2 origin = new Vector2(50f, 48f);
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/StreamGougeGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/StreamGougeGlow"));
}
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0;
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0;
public override void AddRecipes()
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<CosmiliteBar>(), 14);
+1 -2
View File
@@ -38,8 +38,7 @@ namespace CalamityMod.Items.Weapons.Melee
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Vector2 origin = new Vector2(44f, 38f);
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/TerrorBladeGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/TerrorBladeGlow"));
}
public override void MeleeEffects(Player player, Rectangle hitbox)
+1 -2
View File
@@ -40,8 +40,7 @@ namespace CalamityMod.Items.Weapons.Melee
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Vector2 origin = new Vector2(50f, 48f);
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/TheEnforcerGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/TheEnforcerGlow"));
}
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
+2 -1
View File
@@ -10,7 +10,8 @@ namespace CalamityMod.Items.Weapons.Melee
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Oblivion");
Tooltip.SetDefault("Fires brimstone lasers when enemies are near");
Tooltip.SetDefault("Fires brimstone lasers when enemies are near\n" +
"A very agile yoyo");
ItemID.Sets.Yoyo[item.type] = true;
ItemID.Sets.GamepadExtraRange[item.type] = 15;
ItemID.Sets.GamepadSmartQuickReach[item.type] = true;
+2 -1
View File
@@ -12,7 +12,8 @@ namespace CalamityMod.Items.Weapons.Melee
public override void SetStaticDefaults()
{
DisplayName.SetDefault("The God's Gambit");
Tooltip.SetDefault("Fires a stream of slime when enemies are near");
Tooltip.SetDefault("Fires a stream of slime when enemies are near\n" +
"A very agile yoyo");
ItemID.Sets.Yoyo[item.type] = true;
ItemID.Sets.GamepadExtraRange[item.type] = 15;
ItemID.Sets.GamepadSmartQuickReach[item.type] = true;
+2 -1
View File
@@ -10,7 +10,8 @@ namespace CalamityMod.Items.Weapons.Melee
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Pandemic");
Tooltip.SetDefault("Fires plague seekers when enemies are near");
Tooltip.SetDefault("Fires plague seekers when enemies are near\n" +
"A very agile yoyo");
ItemID.Sets.Yoyo[item.type] = true;
ItemID.Sets.GamepadExtraRange[item.type] = 15;
ItemID.Sets.GamepadSmartQuickReach[item.type] = true;
@@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Melee
item.rare = 10;
item.shoot = ModContent.ProjectileType<TriactisOPHammer>();
item.shootSpeed = 25f;
item.Calamity().customRarity = CalamityRarity.Developer;
item.Calamity().customRarity = CalamityRarity.ItemSpecific;
}
public override void AddRecipes()
+2 -1
View File
@@ -11,7 +11,8 @@ namespace CalamityMod.Items.Weapons.Melee
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Riptide");
Tooltip.SetDefault("Sprays a spiral of aqua streams in random directions");
Tooltip.SetDefault("Sprays a spiral of aqua streams in random directions\n" +
"A very agile yoyo");
ItemID.Sets.Yoyo[item.type] = true;
ItemID.Sets.GamepadExtraRange[item.type] = 15;
ItemID.Sets.GamepadSmartQuickReach[item.type] = true;
+2 -1
View File
@@ -11,7 +11,8 @@ namespace CalamityMod.Items.Weapons.Melee
{
DisplayName.SetDefault("Yin-Yo");
Tooltip.SetDefault("Fires light or dark shards when enemies are near\n" +
"Shards fly back and forth");
"Shards fly back and forth\n" +
"A very agile yoyo");
ItemID.Sets.Yoyo[item.type] = true;
ItemID.Sets.GamepadExtraRange[item.type] = 15;
ItemID.Sets.GamepadSmartQuickReach[item.type] = true;
+1 -3
View File
@@ -61,9 +61,7 @@ namespace CalamityMod.Items.Weapons.Ranged
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Texture2D glowmask = ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/AuralisGlow");
Vector2 origin = new Vector2(glowmask.Width / 2f, glowmask.Height / 2f - 2f);
spriteBatch.Draw(glowmask, item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/AuralisGlow"));
}
public override Vector2? HoldoutOffset() => new Vector2(-10, 0);
+1 -3
View File
@@ -47,9 +47,7 @@ namespace CalamityMod.Items.Weapons.Ranged
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Texture2D glowmask = ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/AuroraBlazerGlow");
Vector2 origin = new Vector2(glowmask.Width / 2f, glowmask.Height / 2f - 2f);
spriteBatch.Draw(glowmask, item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/AuroraBlazerGlow"));
}
public override Vector2? HoldoutOffset() => new Vector2(-10, 0);
+1 -2
View File
@@ -39,8 +39,7 @@ namespace CalamityMod.Items.Weapons.Ranged
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Vector2 origin = new Vector2(32f, 14f);
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/CleansingBlazeGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/CleansingBlazeGlow"));
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
+1 -1
View File
@@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Ranged
item.shoot = ModContent.ProjectileType<ContagionBow>();
item.shootSpeed = 20f;
item.useAmmo = AmmoID.Arrow;
item.Calamity().customRarity = CalamityRarity.Developer;
item.Calamity().customRarity = CalamityRarity.ItemSpecific;
}
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0;
+1 -2
View File
@@ -42,8 +42,7 @@ namespace CalamityMod.Items.Weapons.Ranged
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Vector2 origin = new Vector2(31f, 62f);
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/DaemonsFlameGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/DaemonsFlameGlow"));
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
+1 -2
View File
@@ -39,8 +39,7 @@ namespace CalamityMod.Items.Weapons.Ranged
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Vector2 origin = new Vector2(20f, 41f);
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/DeathwindGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/DeathwindGlow"));
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
+10 -23
View File
@@ -9,8 +9,8 @@ namespace CalamityMod.Items.Weapons.Ranged
{
public class PristineFury : ModItem
{
private int frameCounter = 0;
private int frame = 0;
public int frameCounter = 0;
public int frame = 0;
public static int BaseDamage = 140;
public override void SetStaticDefaults()
@@ -69,49 +69,36 @@ namespace CalamityMod.Items.Weapons.Ranged
int flameAmt = 3;
for (int index = 0; index < flameAmt; ++index)
{
float SpeedX = speedX + (float)Main.rand.Next(-25, 26) * 0.05f;
float SpeedY = speedY + (float)Main.rand.Next(-25, 26) * 0.05f;
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<PristineSecondary>(), (int)(damage * 0.8f), knockBack, player.whoAmI, 0f, 0f);
float SpeedX = speedX + Main.rand.NextFloat(-1.25f, 1.25f);
float SpeedY = speedY + Main.rand.NextFloat(-1.25f, 1.25f);
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<PristineSecondary>(), (int)(damage * 0.8f), knockBack, player.whoAmI);
}
}
else
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<PristineFire>(), damage, knockBack, player.whoAmI, 0f, 0f);
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<PristineFire>(), damage, knockBack, player.whoAmI);
}
return false;
}
internal Rectangle GetCurrentFrame(bool frameCounterUp = true)
{
int frameAmt = 4;
if (frameCounter >= 5)
{
frameCounter = -1;
frame = frame == frameAmt - 1 ? 0 : frame + 1;
}
if (frameCounterUp)
frameCounter++;
return new Rectangle(0, item.height * frame, item.width, item.height);
}
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale)
{
Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/PristineFury_Animated");
spriteBatch.Draw(texture, position, GetCurrentFrame(), Color.White, 0f, origin, scale, SpriteEffects.None, 0);
spriteBatch.Draw(texture, position, item.GetCurrentFrame(ref frame, ref frameCounter, 5, 4), Color.White, 0f, origin, scale, SpriteEffects.None, 0);
return false;
}
public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
{
Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/PristineFury_Animated");
spriteBatch.Draw(texture, item.position - Main.screenPosition, GetCurrentFrame(), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 5, 4), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
return false;
}
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/PristineFuryGlow");
spriteBatch.Draw(texture, item.position - Main.screenPosition, GetCurrentFrame(false), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 5, 4, false), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
}
}
}
+1 -1
View File
@@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Ranged
item.shoot = ModContent.ProjectileType<SlashRound>();
item.shootSpeed = 30f;
item.useAmmo = AmmoID.Bullet;
item.Calamity().customRarity = CalamityRarity.Developer;
item.Calamity().customRarity = CalamityRarity.ItemSpecific;
}
public override Vector2? HoldoutOffset()
+1 -2
View File
@@ -65,8 +65,7 @@ namespace CalamityMod.Items.Weapons.Rogue
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Vector2 origin = new Vector2(item.width / 2f, item.height / 2f - 2f);
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Rogue/ApoctolithGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Rogue/ApoctolithGlow"));
}
}
}
+1 -3
View File
@@ -46,9 +46,7 @@ namespace CalamityMod.Items.Weapons.Rogue
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Texture2D glowmask = Main.itemTexture[item.type];
Vector2 origin = new Vector2(glowmask.Width / 2f, glowmask.Height / 2f - 2f);
spriteBatch.Draw(glowmask, item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, Main.itemTexture[item.type]);
}
}
}
+1 -2
View File
@@ -46,8 +46,7 @@ namespace CalamityMod.Items.Weapons.Rogue
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Vector2 origin = new Vector2(31f, 29f);
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Rogue/EradicatorGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Rogue/EradicatorGlow"));
}
}
}
+1 -2
View File
@@ -40,8 +40,7 @@ namespace CalamityMod.Items.Weapons.Rogue
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Vector2 origin = new Vector2(32f, 30f);
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Rogue/ExecutionersBladeGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Rogue/ExecutionersBladeGlow"));
}
public override void AddRecipes()
Loaded 100 of 145 files, more files were not shown because too many files have changed in this diff. Show more