This commit is contained in:
apotofkoolaid committed 2024-06-01 20:55:50 -05:00
commit b13361e63a
24 files changed
+242 -107

No files matched your search

+15 -3
View File
@@ -6,17 +6,29 @@ namespace CalamityMod.Buffs.Placeables
{
public class CirrusBlueCandleBuff : ModBuff
{
public static float MoveSpeedBoost = 0.1f;
public static double WingTimeBoost = 0.1D;
public static float AccelerationBoost = 0.1f;
public override void SetStaticDefaults()
{
Main.buffNoTimeDisplay[Type] = true;
Main.debuff[Type] = true;
// These settings are standard for a "opt-in eternal" buff, which has the following properties:
// - Is not removed on death
// - Saves with the player / is not removed on logout
// - Does not display its time
// - Never reduces its duration
// - Can be manually canceled
Main.pvpBuff[Type] = true;
Main.persistentBuff[Type] = true;
Main.buffNoSave[Type] = false;
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
Main.buffNoTimeDisplay[Type] = true;
BuffID.Sets.TimeLeftDoesNotDecrease[Type] = true;
}
// Implementation is partially performed elsewhere using the blueCandle bool.
public override void Update(Player player, ref int buffIndex)
{
player.moveSpeed += MoveSpeedBoost;
player.Calamity().blueCandle = true;
}
}
+13 -7
View File
@@ -6,18 +6,24 @@ namespace CalamityMod.Buffs.Placeables
{
public class CirrusPinkCandleBuff : ModBuff
{
public static double PercentHealthPerSecond = 0.004D;
public override void SetStaticDefaults()
{
Main.buffNoTimeDisplay[Type] = true;
Main.debuff[Type] = true;
// These settings are standard for a "opt-in eternal" buff, which has the following properties:
// - Is not removed on death
// - Saves with the player / is not removed on logout
// - Does not display its time
// - Never reduces its duration
// - Can be manually canceled
Main.pvpBuff[Type] = true;
Main.persistentBuff[Type] = true;
Main.buffNoSave[Type] = false;
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
Main.buffNoTimeDisplay[Type] = true;
BuffID.Sets.TimeLeftDoesNotDecrease[Type] = true;
}
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().pinkCandle = true;
}
// Implementation is performed elsewhere using the pinkCandle bool.
public override void Update(Player player, ref int buffIndex) => player.Calamity().pinkCandle = true;
}
}
+9 -3
View File
@@ -10,11 +10,17 @@ namespace CalamityMod.Buffs.Placeables
public override void SetStaticDefaults()
{
Main.buffNoTimeDisplay[Type] = true;
Main.debuff[Type] = true;
// These settings are standard for a "opt-in eternal" buff, which has the following properties:
// - Is not removed on death
// - Saves with the player / is not removed on logout
// - Does not display its time
// - Never reduces its duration
// - Can be manually canceled
Main.pvpBuff[Type] = true;
Main.persistentBuff[Type] = true;
Main.buffNoSave[Type] = false;
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
Main.buffNoTimeDisplay[Type] = true;
BuffID.Sets.TimeLeftDoesNotDecrease[Type] = true;
}
public override void Update(Player player, ref int buffIndex)
+20 -7
View File
@@ -1,24 +1,37 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using static Terraria.NPC;
namespace CalamityMod.Buffs.Placeables
{
public class CirrusYellowCandleBuff : ModBuff
{
public static float ExtraChipDamageRatio = 0.07f;
public override void SetStaticDefaults()
{
Main.buffNoTimeDisplay[Type] = true;
Main.debuff[Type] = true;
// These settings are standard for a "opt-in eternal" buff, which has the following properties:
// - Is not removed on death
// - Saves with the player / is not removed on logout
// - Does not display its time
// - Never reduces its duration
// - Can be manually canceled
Main.pvpBuff[Type] = true;
Main.persistentBuff[Type] = true;
Main.buffNoSave[Type] = false;
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
// Spite (the +5% final damage effect of Yellow Candle) is a tag buff. Nothing is immune to it.
// They may however be unaffected by it (including only temporarily) if they have incredibly high DR.
BuffID.Sets.IsATagBuff[Type] = true;
Main.buffNoTimeDisplay[Type] = true;
BuffID.Sets.TimeLeftDoesNotDecrease[Type] = true;
}
// Implementation is performed elsewhere using the yellowCandle bool.
public override void Update(Player player, ref int buffIndex) => player.Calamity().yellowCandle = true;
// Yellow Candle is implemented as a dirty modifier.
internal static void ModifyHitInfo_Spite(ref HitInfo info)
{
int damageBoost = (int)(info.SourceDamage * ExtraChipDamageRatio);
info.Damage += damageBoost;
}
}
}
+2 -1
View File
@@ -4,6 +4,7 @@ using System.Linq;
using CalamityMod.Balancing;
using CalamityMod.BiomeManagers;
using CalamityMod.Buffs;
using CalamityMod.Buffs.Placeables;
using CalamityMod.Buffs.StatBuffs;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.CalPlayer.Dashes;
@@ -3715,7 +3716,7 @@ namespace CalamityMod.CalPlayer
(kamiBoost ? KamiBuff.RunAccelerationBoost : 0f) +
(CobaltSet ? CobaltArmorSetChange.SpeedBoostSetBonusPercentage * 0.01f : 0f) +
(silvaSet ? 0.05f : 0f) +
(blueCandle ? 0.05f : 0f) +
(blueCandle ? CirrusBlueCandleBuff.AccelerationBoost : 0f) +
(planarSpeedBoost > 0 ? (0.01f * planarSpeedBoost) : 0f) +
(hasteLevel * 0.05f);
+17
View File
@@ -3,6 +3,7 @@ using System.Linq;
using CalamityMod.Balancing;
using CalamityMod.Buffs.Cooldowns;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.Placeables;
using CalamityMod.Buffs.StatBuffs;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.CalPlayer.Dashes;
@@ -524,6 +525,14 @@ namespace CalamityMod.CalPlayer
// Apply all Calamity multipliers as a sum total to TML New Damage in a single step
modifiers.SourceDamage *= totalDamageMult;
// 01JUN2024: Ozzatron: apply Yellow Candle "chip damage" as a dirty modifier
// The registration of the dirty modifier is conditional to ensure it doesn't apply to "near invincible" targets
//
// FinalDamage cannot be used for the intended effect because there is no way to access the actual damage of the hit
CalamityGlobalNPC cgn = target.Calamity();
if (yellowCandle && cgn.DR < 0.99f && target.takenDamageMultiplier > 0.05f)
modifiers.ModifyHitInfo += CirrusYellowCandleBuff.ModifyHitInfo_Spite;
// Excalibur and True Excalibur deal +100% damage to targets above 75% HP.
if (item.type == ItemID.Excalibur || item.type == ItemID.TrueExcalibur)
{
@@ -590,6 +599,14 @@ namespace CalamityMod.CalPlayer
// Apply all Calamity multipliers as a sum total to TML New Damage in a single step
modifiers.SourceDamage *= totalDamageMult;
// 01JUN2024: Ozzatron: apply Yellow Candle "chip damage" as a dirty modifier
// The registration of the dirty modifier is conditional to ensure it doesn't apply to "near invincible" targets
//
// FinalDamage cannot be used for the intended effect because there is no way to access the actual damage of the hit
CalamityGlobalNPC cgn = target.Calamity();
if (yellowCandle && cgn.DR < 0.99f && target.takenDamageMultiplier > 0.05f)
modifiers.ModifyHitInfo += CirrusYellowCandleBuff.ModifyHitInfo_Spite;
// Stealth strike damage multipliers are applied here.
// TODO -- stealth should be its own damage class and this should be applied as player StealthDamage *= XYZ
if (proj.Calamity().stealthStrike && proj.CountsAsClass<RogueDamageClass>())
+2 -1
View File
@@ -2,6 +2,7 @@
using System.Linq;
using CalamityMod.Buffs.Alcohol;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.Placeables;
using CalamityMod.Cooldowns;
using CalamityMod.Items.Accessories;
using CalamityMod.NPCs;
@@ -735,7 +736,7 @@ namespace CalamityMod.CalPlayer
if (pinkCandle && !noLifeRegen)
{
// Every frame, add up 1/60th of the healing value (0.4% max HP per second)
pinkCandleHealFraction += Player.statLifeMax2 * 0.004 / 60;
pinkCandleHealFraction += Player.statLifeMax2 * CirrusPinkCandleBuff.PercentHealthPerSecond / 60;
if (pinkCandleHealFraction >= 1D)
{
+2 -4
View File
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using CalamityMod.Balancing;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.Placeables;
using CalamityMod.Buffs.Potions;
using CalamityMod.Buffs.StatBuffs;
using CalamityMod.Buffs.StatDebuffs;
@@ -2862,16 +2863,13 @@ namespace CalamityMod.CalPlayer
(harpyRing ? 0.2 : 0D) +
(reaverSpeed ? 0.1 : 0D) +
(angelTreads ? 0.1 : 0D) +
(blueCandle ? 0.05 : 0D) +
(blueCandle ? CirrusBlueCandleBuff.WingTimeBoost : 0D) +
(soaring ? 0.1 : 0D) +
(prismaticGreaves ? 0.1 : 0D) +
(plagueReaper ? 0.05 : 0D) +
(ascendantInsignia ? 0.05 : 0D) + // Added to soaring insignia's flight to get 30%
(Player.empressBrooch ? 0.25 : 0D);
if (blueCandle)
Player.moveSpeed += 0.05f;
if (community)
{
float baseBoost = TheCommunity.CalculatePower();
@@ -19,8 +19,8 @@ namespace CalamityMod.Items.Placeables.Furniture
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.consumable = true;
Item.value = Item.buyPrice(0, 25, 0, 0);
Item.rare = ItemRarityID.LightRed;
Item.value = Item.buyPrice(platinum: 2);
Item.rare = ItemRarityID.Pink;
Item.createTile = ModContent.TileType<Tiles.Furniture.PurpleCandle>();
}
}
+2 -2
View File
@@ -19,8 +19,8 @@ namespace CalamityMod.Items.Placeables.Furniture
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.consumable = true;
Item.value = Item.buyPrice(0, 25, 0, 0);
Item.rare = ItemRarityID.LightRed;
Item.value = Item.buyPrice(platinum: 2);
Item.rare = ItemRarityID.Pink;
Item.createTile = ModContent.TileType<Tiles.Furniture.YellowCandle>();
}
}
+2 -2
View File
@@ -19,8 +19,8 @@ namespace CalamityMod.Items.Placeables.Furniture
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.consumable = true;
Item.value = Item.buyPrice(0, 25, 0, 0);
Item.rare = ItemRarityID.LightRed;
Item.value = Item.buyPrice(platinum: 2);
Item.rare = ItemRarityID.Pink;
Item.createTile = ModContent.TileType<Tiles.Furniture.PinkCandle>();
}
}
@@ -19,8 +19,8 @@ namespace CalamityMod.Items.Placeables.Furniture
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.consumable = true;
Item.value = Item.buyPrice(0, 25, 0, 0);
Item.rare = ItemRarityID.LightRed;
Item.value = Item.buyPrice(platinum: 2);
Item.rare = ItemRarityID.Pink;
Item.createTile = ModContent.TileType<Tiles.Furniture.BlueCandle>();
}
}
@@ -465,17 +465,17 @@ CirrusBlueCandleBuff: {
CirrusPinkCandleBuff: {
DisplayName: Vigor
Description: Its brilliant light suffuses those nearby with hope
Description: The brilliant light suffuses you with hope
}
CirrusPurpleCandleBuff: {
DisplayName: Resilience
Description: Neither rain nor wind can snuff its undying flame
Description: Neither rain nor wind can snuff your undying flame
}
CirrusYellowCandleBuff: {
DisplayName: Spite
Description: Its hateful glow flickers with ire
Description: The hateful, flickering glow fuels your ire
}
CorruptionEffigyBuff: {
@@ -729,7 +729,9 @@ ResilientCandle: {
DisplayName: Resilient Candle
Tooltip:
'''
When placed, nearby players' defense blocks 10% more damage
<right> when placed to make defense block 10% more damage
(60% in Classic, 85% in Expert, and 110% in Master)
This cannot be stacked with other Cirrus Candle buffs
'Neither rain nor wind can snuff its undying flame'
'''
}
@@ -748,8 +750,9 @@ SpitefulCandle: {
DisplayName: Spiteful Candle
Tooltip:
'''
When placed, nearby enemies take 5% more damage.
This extra damage bypasses enemy damage reduction and defense
<right> when placed to deal 1.07x damage to all enemies
The extra 0.07x damage bypasses enemy defense and damage reduction
This cannot be stacked with other Cirrus Candle buffs
'Its hateful glow flickers with ire'
'''
}
@@ -973,8 +976,9 @@ VigorousCandle: {
DisplayName: Vigorous Candle
Tooltip:
'''
When placed, nearby players regenerate 0.4% of their maximum health per second
<right> when placed to regenerate 0.4% of your maximum health per second
This regeneration is at full power even while moving and bypasses Revengeance Mode caps
This cannot be stacked with other Cirrus Candle buffs
'Its brilliant light suffuses those nearby with hope'
'''
}
@@ -983,7 +987,8 @@ WeightlessCandle: {
DisplayName: Weightless Candle
Tooltip:
'''
When placed, nearby players gain 5% increased movement speed, wing time and acceleration
<right> when placed to gain 10% increased movement speed, wing time and acceleration
This cannot be stacked with other Cirrus Candle buffs
'The floating flame seems to uplift your very spirit'
'''
}
-8
View File
@@ -3221,14 +3221,6 @@ namespace CalamityMod.NPCs
if (effectiveDR <= 0f)
effectiveDR = 0f;
// Add Yellow Candle damage if the NPC isn't supposed to be "near invincible"
// Armor penetration has already been applied as bonus damage.
// Yellow Candle provides +5% damage which ignores both DR and defense.
// This means Yellow Candle is buffing armor penetration and technically not ignoring defense,
// but it's small enough to let it slide.
if (npc.HasBuff<CirrusYellowCandleBuff>() && DR < 0.99f && npc.takenDamageMultiplier > 0.05f)
finalMultiplier += 0.05f;
// Calculate extra DR based on kill time, similar to the Hush boss from The Binding of Isaac
// Cirrus being active makes the extra DR cease to function
bool cirrusBossActive = false;
+35 -11
View File
@@ -2,9 +2,9 @@
using CalamityMod.Items.Placeables.Furniture;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.Audio;
using Terraria.GameContent.ObjectInteractions;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
using Terraria.ObjectData;
@@ -12,6 +12,9 @@ namespace CalamityMod.Tiles.Furniture
{
public class BlueCandle : ModTile
{
// TODO -- Unique sounds for each Cirrus Candle.
public static readonly SoundStyle ActivationSound = new("CalamityMod/Sounds/Item/LouderPhantomPhoenix2");
public override void SetStaticDefaults()
{
Main.tileLighted[Type] = true;
@@ -22,9 +25,39 @@ namespace CalamityMod.Tiles.Furniture
AdjTiles = new int[] { TileID.Candles };
AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch);
AddMapEntry(new Color(238, 145, 105), CalamityUtils.GetItemName<WeightlessCandle>());
TileID.Sets.HasOutlines[Type] = true;
AnimationFrameHeight = 18;
}
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true;
public override bool RightClick(int i, int j)
{
Player p = Main.LocalPlayer;
// Forcibly remove all candle buffs.
p.ClearBuff(ModContent.BuffType<CirrusBlueCandleBuff>());
p.ClearBuff(ModContent.BuffType<CirrusPurpleCandleBuff>());
p.ClearBuff(ModContent.BuffType<CirrusPinkCandleBuff>());
p.ClearBuff(ModContent.BuffType<CirrusYellowCandleBuff>());
// 108000 is the duration used by Ammo Box.
p.AddBuff(ModContent.BuffType<CirrusBlueCandleBuff>(), 108000);
// Play a sound.
SoundEngine.PlaySound(ActivationSound, new Vector2(i * 16, j * 16));
return true;
}
public override void MouseOver(int i, int j)
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<WeightlessCandle>();
}
public override void AnimateTile(ref int frame, ref int frameCounter)
{
frameCounter++;
@@ -35,15 +68,6 @@ namespace CalamityMod.Tiles.Furniture
}
}
public override void NearbyEffects(int i, int j, bool closer)
{
Player player = Main.LocalPlayer;
if (player is null)
return;
if (!player.dead && player.active)
player.AddBuff(ModContent.BuffType<CirrusBlueCandleBuff>(), 20);
}
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
{
r = 0.35f;
Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

+35 -11
View File
@@ -2,9 +2,9 @@
using CalamityMod.Items.Placeables.Furniture;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.Audio;
using Terraria.GameContent.ObjectInteractions;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
using Terraria.ObjectData;
@@ -12,6 +12,9 @@ namespace CalamityMod.Tiles.Furniture
{
public class PinkCandle : ModTile
{
// TODO -- Unique sounds for each Cirrus Candle.
public static readonly SoundStyle ActivationSound = new("CalamityMod/Sounds/Item/LouderPhantomPhoenix2");
public override void SetStaticDefaults()
{
Main.tileLighted[Type] = true;
@@ -22,9 +25,39 @@ namespace CalamityMod.Tiles.Furniture
AdjTiles = new int[] { TileID.Candles };
AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch);
AddMapEntry(new Color(238, 145, 105), CalamityUtils.GetItemName<VigorousCandle>());
TileID.Sets.HasOutlines[Type] = true;
AnimationFrameHeight = 18;
}
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true;
public override bool RightClick(int i, int j)
{
Player p = Main.LocalPlayer;
// Forcibly remove all candle buffs.
p.ClearBuff(ModContent.BuffType<CirrusBlueCandleBuff>());
p.ClearBuff(ModContent.BuffType<CirrusPurpleCandleBuff>());
p.ClearBuff(ModContent.BuffType<CirrusPinkCandleBuff>());
p.ClearBuff(ModContent.BuffType<CirrusYellowCandleBuff>());
// 108000 is the duration used by Ammo Box.
p.AddBuff(ModContent.BuffType<CirrusPinkCandleBuff>(), 108000);
// Play a sound.
SoundEngine.PlaySound(ActivationSound, new Vector2(i * 16, j * 16));
return true;
}
public override void MouseOver(int i, int j)
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<VigorousCandle>();
}
public override void AnimateTile(ref int frame, ref int frameCounter)
{
frameCounter++;
@@ -35,15 +68,6 @@ namespace CalamityMod.Tiles.Furniture
}
}
public override void NearbyEffects(int i, int j, bool closer)
{
Player player = Main.LocalPlayer;
if (player is null)
return;
if (!player.dead && player.active)
player.AddBuff(ModContent.BuffType<CirrusPinkCandleBuff>(), 20);
}
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
{
r = 0.75f;
Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

+35 -11
View File
@@ -2,9 +2,9 @@
using CalamityMod.Items.Placeables.Furniture;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.Audio;
using Terraria.GameContent.ObjectInteractions;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
using Terraria.ObjectData;
@@ -12,6 +12,9 @@ namespace CalamityMod.Tiles.Furniture
{
public class PurpleCandle : ModTile
{
// TODO -- Unique sounds for each Cirrus Candle.
public static readonly SoundStyle ActivationSound = new("CalamityMod/Sounds/Item/LouderPhantomPhoenix2");
public override void SetStaticDefaults()
{
Main.tileLighted[Type] = true;
@@ -22,9 +25,39 @@ namespace CalamityMod.Tiles.Furniture
AdjTiles = new int[] { TileID.Candles };
AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch);
AddMapEntry(new Color(238, 145, 105), CalamityUtils.GetItemName<ResilientCandle>());
TileID.Sets.HasOutlines[Type] = true;
AnimationFrameHeight = 18;
}
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true;
public override bool RightClick(int i, int j)
{
Player p = Main.LocalPlayer;
// Forcibly remove all candle buffs.
p.ClearBuff(ModContent.BuffType<CirrusBlueCandleBuff>());
p.ClearBuff(ModContent.BuffType<CirrusPurpleCandleBuff>());
p.ClearBuff(ModContent.BuffType<CirrusPinkCandleBuff>());
p.ClearBuff(ModContent.BuffType<CirrusYellowCandleBuff>());
// 108000 is the duration used by Ammo Box.
p.AddBuff(ModContent.BuffType<CirrusPurpleCandleBuff>(), 108000);
// Play a sound.
SoundEngine.PlaySound(ActivationSound, new Vector2(i * 16, j * 16));
return true;
}
public override void MouseOver(int i, int j)
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<ResilientCandle>();
}
public override void AnimateTile(ref int frame, ref int frameCounter)
{
frameCounter++;
@@ -35,15 +68,6 @@ namespace CalamityMod.Tiles.Furniture
}
}
public override void NearbyEffects(int i, int j, bool closer)
{
Player player = Main.LocalPlayer;
if (player is null)
return;
if (!player.dead && player.active)
player.AddBuff(ModContent.BuffType<CirrusPurpleCandleBuff>(), 20);
}
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
{
r = 0.65f;
Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

+35 -23
View File
@@ -2,6 +2,8 @@
using CalamityMod.Items.Placeables.Furniture;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent.ObjectInteractions;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ObjectData;
@@ -10,6 +12,9 @@ namespace CalamityMod.Tiles.Furniture
{
public class YellowCandle : ModTile
{
// TODO -- Unique sounds for each Cirrus Candle.
public static readonly SoundStyle ActivationSound = new("CalamityMod/Sounds/Item/LouderPhantomPhoenix2");
public override void SetStaticDefaults()
{
Main.tileLighted[Type] = true;
@@ -19,9 +24,39 @@ namespace CalamityMod.Tiles.Furniture
TileObjectData.addTile(Type);
AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch);
AddMapEntry(new Color(238, 145, 105), CalamityUtils.GetItemName<SpitefulCandle>());
TileID.Sets.HasOutlines[Type] = true;
AnimationFrameHeight = 18;
}
public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true;
public override bool RightClick(int i, int j)
{
Player p = Main.LocalPlayer;
// Forcibly remove all candle buffs.
p.ClearBuff(ModContent.BuffType<CirrusBlueCandleBuff>());
p.ClearBuff(ModContent.BuffType<CirrusPurpleCandleBuff>());
p.ClearBuff(ModContent.BuffType<CirrusPinkCandleBuff>());
p.ClearBuff(ModContent.BuffType<CirrusYellowCandleBuff>());
// 108000 is the duration used by Ammo Box.
p.AddBuff(ModContent.BuffType<CirrusYellowCandleBuff>(), 108000);
// Play a sound.
SoundEngine.PlaySound(ActivationSound, new Vector2(i * 16, j * 16));
return true;
}
public override void MouseOver(int i, int j)
{
Player player = Main.LocalPlayer;
player.noThrow = 2;
player.cursorItemIconEnabled = true;
player.cursorItemIconID = ModContent.ItemType<SpitefulCandle>();
}
public override void AnimateTile(ref int frame, ref int frameCounter)
{
frameCounter++;
@@ -32,29 +67,6 @@ namespace CalamityMod.Tiles.Furniture
}
}
public override void NearbyEffects(int i, int j, bool closer)
{
Player player = Main.LocalPlayer;
if (player == null || !player.active || player.dead)
return;
player.AddBuff(ModContent.BuffType<CirrusYellowCandleBuff>(), 20);
if (Main.netMode == NetmodeID.MultiplayerClient)
return;
// All NPCs within a certain distance of the player get "Tagged" with Spite.
for (int m = 0; m < Main.maxNPCs; m++)
{
NPC npc = Main.npc[m];
if (npc is null || !npc.active || npc.friendly)
continue;
float dist2 = npc.DistanceSQ(player.Center);
if (dist2 < 23040000f) // 4800px range
Main.npc[m].AddBuff(ModContent.BuffType<CirrusYellowCandleBuff>(), 20, false);
}
}
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
{
r = 0.75f;
Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

+1 -1
View File
@@ -1,5 +1,5 @@
author = Fabsol and the Dev Team
version = 2.0.4.002
version = 2.0.4.003
displayName = Calamity Mod
modReferences = CalamityModMusic
homepage = https://discord.gg/calamity