Merge branch '1.4.4' into TheElixir

This commit is contained in:
sunny-raindrops committed 2026-04-27 17:12:52 -07:00
commit 26c8648cda
178 files changed
+3303 -713

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
using CalamityMod.DataStructures;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Alcohol
{
public class BaconOilBuff : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
AlcoholLevel = 3
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = false;
Main.persistentBuff[Type] = true;
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
BuffDatasets.DebuffDataset[Type] = debuffData;
}
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().baconOil = true;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

+6 -1
View File
@@ -1,10 +1,15 @@
using Terraria;
using CalamityMod.DataStructures;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Alcohol
{
public class BloodyMaryBuff : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
AlcoholLevel = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
+6 -1
View File
@@ -1,10 +1,15 @@
using Terraria;
using CalamityMod.DataStructures;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Alcohol
{
public class CaribbeanRumBuff : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
AlcoholLevel = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
+6 -1
View File
@@ -1,10 +1,15 @@
using Terraria;
using CalamityMod.DataStructures;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Alcohol
{
public class CinnamonRollBuff : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
AlcoholLevel = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
+6 -1
View File
@@ -1,10 +1,15 @@
using Terraria;
using CalamityMod.DataStructures;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Alcohol
{
public class EverclearBuff : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
AlcoholLevel = 2
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
+6 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Items.Potions.Alcohol;
using CalamityMod.DataStructures;
using CalamityMod.Items.Potions.Alcohol;
using Terraria;
using Terraria.ModLoader;
@@ -6,6 +7,10 @@ namespace CalamityMod.Buffs.Alcohol
{
public class EvergreenGinBuff : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
AlcoholLevel = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
+6 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Items.Potions.Alcohol;
using CalamityMod.DataStructures;
using CalamityMod.Items.Potions.Alcohol;
using Terraria;
using Terraria.ModLoader;
@@ -6,6 +7,10 @@ namespace CalamityMod.Buffs.Alcohol
{
public class FireballBuff : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
AlcoholLevel = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
+6 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Items.Potions.Alcohol;
using CalamityMod.DataStructures;
using CalamityMod.Items.Potions.Alcohol;
using Terraria;
using Terraria.ModLoader;
@@ -6,6 +7,10 @@ namespace CalamityMod.Buffs.Alcohol
{
public class GrapeBeerBuff : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
AlcoholLevel = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
+6 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Items.Potions.Alcohol;
using CalamityMod.DataStructures;
using CalamityMod.Items.Potions.Alcohol;
using Terraria;
using Terraria.ModLoader;
@@ -6,6 +7,10 @@ namespace CalamityMod.Buffs.Alcohol
{
public class ManhattanBuff : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
AlcoholLevel = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
+6 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Items.Potions.Alcohol;
using CalamityMod.DataStructures;
using CalamityMod.Items.Potions.Alcohol;
using Terraria;
using Terraria.ModLoader;
@@ -6,6 +7,10 @@ namespace CalamityMod.Buffs.Alcohol
{
public class MargaritaBuff : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
AlcoholLevel = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
+6 -1
View File
@@ -1,10 +1,15 @@
using Terraria;
using CalamityMod.DataStructures;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Alcohol
{
public class MoonshineBuff : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
AlcoholLevel = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
+6 -1
View File
@@ -1,10 +1,15 @@
using Terraria;
using CalamityMod.DataStructures;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Alcohol
{
public class MoscowMuleBuff : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
AlcoholLevel = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
+6 -1
View File
@@ -1,10 +1,15 @@
using Terraria;
using CalamityMod.DataStructures;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Alcohol
{
public class OldFashionedBuff : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
AlcoholLevel = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
+6 -1
View File
@@ -1,10 +1,15 @@
using Terraria;
using CalamityMod.DataStructures;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Alcohol
{
public class PurpleHazeBuff : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
AlcoholLevel = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
+6 -1
View File
@@ -1,10 +1,15 @@
using Terraria;
using CalamityMod.DataStructures;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Alcohol
{
public class RedWineBuff : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
AlcoholLevel = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
+6 -1
View File
@@ -1,10 +1,15 @@
using Terraria;
using CalamityMod.DataStructures;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Alcohol
{
public class RumBuff : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
AlcoholLevel = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
+6 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Items.Potions.Alcohol;
using CalamityMod.DataStructures;
using CalamityMod.Items.Potions.Alcohol;
using Terraria;
using Terraria.ModLoader;
@@ -6,6 +7,10 @@ namespace CalamityMod.Buffs.Alcohol
{
public class ScrewdriverBuff : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
AlcoholLevel = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
+6 -1
View File
@@ -1,10 +1,15 @@
using Terraria;
using CalamityMod.DataStructures;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Alcohol
{
public class StarBeamRyeBuff : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
AlcoholLevel = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
+6 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Items.Potions.Alcohol;
using CalamityMod.DataStructures;
using CalamityMod.Items.Potions.Alcohol;
using Terraria;
using Terraria.ModLoader;
@@ -6,6 +7,10 @@ namespace CalamityMod.Buffs.Alcohol
{
public class TequilaBuff : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
AlcoholLevel = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
+6 -1
View File
@@ -1,10 +1,15 @@
using Terraria;
using CalamityMod.DataStructures;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Alcohol
{
public class TequilaSunriseBuff : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
AlcoholLevel = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
+6 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Items.Potions.Alcohol;
using CalamityMod.DataStructures;
using CalamityMod.Items.Potions.Alcohol;
using Terraria;
using Terraria.ModLoader;
@@ -6,6 +7,10 @@ namespace CalamityMod.Buffs.Alcohol
{
public class VodkaBuff : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
AlcoholLevel = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
+6 -1
View File
@@ -1,10 +1,15 @@
using Terraria;
using CalamityMod.DataStructures;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Alcohol
{
public class WhiskeyBuff : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
AlcoholLevel = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
+6 -1
View File
@@ -1,10 +1,15 @@
using Terraria;
using CalamityMod.DataStructures;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Alcohol
{
public class WhiteWineBuff : ModBuff
{
public static DebuffData debuffData = new DebuffData()
{
AlcoholLevel = 1
};
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
+42
View File
@@ -0,0 +1,42 @@
using CalamityMod.DataStructures;
using CalamityMod.Items.Potions;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.GameContent;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Potions
{
public class SwinesWrathBuff : ModBuff
{
public static readonly SoundStyle TimerSound = new("CalamityMod/Sounds/Custom/TickingTimer");
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = false;
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
}
public override void Update(Player player, ref int buffIndex)
{
TheConcoctionPlayer concoctionPlayer = player.GetModPlayer<TheConcoctionPlayer>();
if (concoctionPlayer.swinesWrathCounter < 2 && concoctionPlayer.swinesWrathCounter != -1)
{
player.KillMe(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.SwinesWrath" + Main.rand.Next(1, 7 + 1)).ToNetworkText(player.name)), 1000, -1);
concoctionPlayer.swinesWrathCounter = -1;
}
else if (concoctionPlayer.swinesWrathCounter % 60 == 59)
SoundEngine.PlaySound(TimerSound with { Volume = ((600f - concoctionPlayer.swinesWrathCounter) / 600f) }, player.Center); // Gets louder as time progresses
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 522 B

+22
View File
@@ -0,0 +1,22 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.StatDebuffs
{
public class Malnourished : ModBuff
{
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
}
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().malnourished = true;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 798 B

+128 -1
View File
@@ -43,6 +43,7 @@ using CalamityMod.Items.PermanentBoosters;
using CalamityMod.Items.Placeables.Furniture;
using CalamityMod.Items.Potions;
using CalamityMod.Items.Potions.Alcohol;
using CalamityMod.Items.Potions.Food;
using CalamityMod.Items.Tools;
using CalamityMod.Items.Tools.ClimateChange;
using CalamityMod.Items.TreasureBags.MiscGrabBags;
@@ -380,9 +381,12 @@ namespace CalamityMod.CalPlayer
public int hideOfDeusMeleeBoostTimer = 0;
/// <summary>
/// The player's alcohol level. Increased by 1 for each alcohol the player has drank, 2 for Everclear.<br/>
/// If this value is greater than 3, the player is inflicted with Alcohol Poisoning.
/// If this value is greater than the max (normally 3), the player is inflicted with Alcohol Poisoning.
/// </summary>
public int alcoholPoisonLevel = 0;
public static int alcoholPoisonMaxBase = 3;
/// <summary> The maximum alcohol level the player can reach before getting Alcohol Poisoning. </summary>
public int alcoholPoisonMax = alcoholPoisonMaxBase;
public int dashTimeMod;
/// <summary>
/// Timer variable which tracks how long the player has spent outside of Providence's border radius, in frames.<br/>
@@ -805,6 +809,7 @@ namespace CalamityMod.CalPlayer
#endregion
#region Accessory
public int friendlyMinions = 0;
public bool shieldOfTheHighRulerDashVelocityBoosted = false;
public bool yharimsGift = false;
public bool luxorsGift = false;
@@ -1396,6 +1401,7 @@ namespace CalamityMod.CalPlayer
public bool riptide = false;
public bool hadopelagicPressure = false;
public bool fishAlert = false;
public bool malnourished = false;
public bool clamity = false;
public bool NOU = false;
public bool absorberAffliction = false;
@@ -1487,6 +1493,8 @@ namespace CalamityMod.CalPlayer
public bool whiteWine = false;
public float whiteWineTimer = 0;
public bool evergreenGin = false;
public bool baconOil = false;
public int baconOilSoundCooldown = 0;
public bool tranquilityCandle = false;
public bool chaosCandle = false;
public bool blueCandle = false;
@@ -2163,6 +2171,7 @@ namespace CalamityMod.CalPlayer
externalAuricRejectionImmunity = false;
alcoholPoisonLevel = 0;
alcoholPoisonMax = alcoholPoisonMaxBase;
noLifeRegen = false;
//Stratus Starburst amount management
@@ -2252,6 +2261,7 @@ namespace CalamityMod.CalPlayer
if (!pSoulArtifact)
pSoulShieldDurability = 0;
}
friendlyMinions = 0;
pSoulShieldVisible = false;
roverDrive = false;
roverDriveShieldVisible = false;
@@ -2696,6 +2706,7 @@ namespace CalamityMod.CalPlayer
riptide = false;
hadopelagicPressure = false;
fishAlert = false;
malnourished = false;
clamity = false;
NOU = false;
enraged = false;
@@ -2783,6 +2794,7 @@ namespace CalamityMod.CalPlayer
moscowMule = false;
whiteWine = false;
evergreenGin = false;
baconOil = false;
tranquilityCandle = false;
chaosCandle = false;
@@ -3180,6 +3192,7 @@ namespace CalamityMod.CalPlayer
riptide = false;
hadopelagicPressure = false;
fishAlert = false;
malnourished = false;
clamity = false;
NOU = false;
snowmanNoseless = false;
@@ -3294,6 +3307,7 @@ namespace CalamityMod.CalPlayer
moscowMule = false;
whiteWine = false;
evergreenGin = false;
baconOil = false;
tranquilityCandle = false;
chaosCandle = false;
blueCandle = false;
@@ -4887,6 +4901,32 @@ namespace CalamityMod.CalPlayer
}
}
}
if (malnourished) // Has to be here because alcoholPoisonLevel isn't updated until now
{
alcoholPoisonMax += TheSandwich.alcoholCapBoost;
// Gives inverted buffs from well fed
Player.statDefense -= 2;
Player.GetCritChance<GenericDamageClass>() -= 2;
Player.minionKB -= 0.5f;
Player.moveSpeed -= 0.05f;
// damage nerf/boost happens in PostUpdate
Player.pickSpeed += 0.05f;
for (int l = 0; l < Player.MaxBuffs; ++l)
{
int buffID = Player.buffType[l];
if ((BuffDatasets.DebuffDataset[buffID] != null && BuffDatasets.DebuffDataset[buffID].AlcoholLevel > 0) || buffID == BuffID.Tipsy)
{
Player.buffTime[l]++;
}
}
if (Player.wellFed)
Player.ClearBuff(ModContent.BuffType<Malnourished>());
}
if (moonshine)
Player.statLifeMax2 = (int)(Player.statLifeMax2 * (1 + Moonshine.MaxLifePercentBoost));
ForceVariousEffects();
@@ -5170,6 +5210,9 @@ namespace CalamityMod.CalPlayer
}
}
if (malnourished) // Has to be here because alcoholPoisonLevel isn't updated until now
Player.GetDamage<GenericDamageClass>() += -0.05f + TheSandwich.statBoost * alcoholPoisonLevel;
// Relic of Convergence defense cut
if (Player.ownedProjectileCounts[ModContent.ProjectileType<RelicOfConvergenceCrystal>()] > 0 && Player.HeldItem.type == ModContent.ItemType<RelicOfConvergence>())
Player.statDefense *= RelicOfConvergence.DefenseMultiplier;
@@ -5301,6 +5344,90 @@ namespace CalamityMod.CalPlayer
}
#endregion
if (Player.Calamity().baconOil && !Player.mount.Active)
{
Player.noFallDmg = true;
float velX = Math.Abs(Player.velocity.X);
float velY = Math.Abs(Player.velocity.Y);
float speedMult = Player.GetBestClassDamage().ApplyTo(1);
float maxMoveSpeed = 10.5f * speedMult;
float minMoveSpeed = 3; // Minimum move speed to be at if the player can bounce
float hitboxSizeMult = 0.45f;
bool onPlatform = false;
if (Player.velocity.Y > 0 && !Player.controlDown)
{
for (int i = 4; i < 8; i++)
{
Point bottom = (Player.Bottom + Vector2.UnitY * i).ToTileCoordinates();
if (TileID.Sets.Platforms[CalamityUtils.ParanoidTileRetrieval(bottom.X, bottom.Y).TileType])
{
onPlatform = true;
}
}
}
bool hitDown = velY > minMoveSpeed && (Collision.SolidCollision(Player.Bottom + Vector2.UnitY * Player.velocity.Y, (int)(Player.width * hitboxSizeMult), 1) || onPlatform);
bool hitUp = velY > minMoveSpeed && Collision.SolidCollision(Player.Top + Vector2.UnitY * Player.velocity.Y, (int)(Player.width * hitboxSizeMult), 1);
bool hitSide = velX > minMoveSpeed && Collision.SolidCollision(Vector2.Lerp(Player.TopLeft, Player.Left, 0.15f) + Vector2.UnitX * Player.velocity.X, 1, (int)(Player.height * hitboxSizeMult)) || Collision.SolidCollision(Vector2.Lerp(Player.TopRight, Player.Right, 0.15f) + Vector2.UnitX * Player.velocity.X, 1, (int)(Player.height * hitboxSizeMult));
float acceleration = 0.05f;
float decceleration = -0.025f / speedMult;
float riseSpeed = 0.8f; // The speed the player rises when in water or rain
float slipPower = 0.85f; //How strong the slippery effect is
float bounceReduction = 0.9f;
bool makeSound = false;
if (hitSide)
{
Player.velocity.X = -Player.velocity.X * bounceReduction;
Player.oldVelocity.X = -Player.oldVelocity.X * bounceReduction;
makeSound = true;
}
if ((hitDown || hitUp))
{
if (Player.controlUp)
bounceReduction = 1.3f;
Player.velocity.Y = -Player.velocity.Y * bounceReduction;
Player.oldVelocity.Y = -Player.oldVelocity.Y * bounceReduction;
if (hitDown)
{
Player.RefreshMovementAbilities(true);
}
makeSound = true;
}
int soundCDMax = 150;
if (makeSound && baconOilSoundCooldown < soundCDMax)
{
if (baconOilSoundCooldown < soundCDMax)
baconOilSoundCooldown += 30;
float pitch = 0.55f * Utils.GetLerpValue(0, soundCDMax, baconOilSoundCooldown, true);
SoundStyle boyoyoing = new("CalamityMod/Sounds/Item/BaconOilBounce");
SoundEngine.PlaySound(boyoyoing with { Volume = 0.45f, Pitch = hitSide ? pitch - 0.3f : pitch, MaxInstances = 5 }, Player.Center);
}
bool playerMoving = Player.controlLeft || Player.controlRight;
bool playerMovingInDirection = (Player.controlLeft && Player.oldVelocity.X < 0) || (Player.controlRight && Player.oldVelocity.X > 0);
if (((Player.oldVelocity.X > 0 && Player.velocity.X > 0) || (Player.oldVelocity.X < 0 && Player.velocity.X < 0)))
Player.velocity.X = MathHelper.Clamp(Player.velocity.X + maxMoveSpeed * MathF.Sign(Player.oldVelocity.X) *
((playerMovingInDirection || !playerMoving) ? Player.dashDelay == -1 ? decceleration : // If dashing, deccelerate to prevent infinite dash
// If not moving or holding in move direction, accelerate to max speed, otherwise deccelerate
acceleration : decceleration), -maxMoveSpeed, maxMoveSpeed);
bool raining = Player.Center.Y < Main.worldSurface * 16.0 && Main.raining;
if ((Player.wet || raining) && Player.velocity.Y > -maxMoveSpeed)
{
Player.velocity.Y -= riseSpeed; // Cover yourself in oil (go up in liquid)
}
Vector2 lerpedVel = Vector2.Lerp(Player.velocity, Player.oldVelocity, slipPower);
Player.velocity = new Vector2(lerpedVel.X, Player.velocity.Y);
}
if (baconOilSoundCooldown > 0)
baconOilSoundCooldown = (int)MathHelper.Lerp(baconOilSoundCooldown, 0, 0.027f);
Player.oldVelocity = Player.velocity; // Apparently this value is not updated on its own, so we do it
}
#endregion
+5 -11
View File
@@ -1,6 +1,7 @@
using System;
using System.Linq;
using CalamityMod.Buffs.Alcohol;
using CalamityMod.Buffs.Potions;
using CalamityMod.Buffs.StatBuffs;
using CalamityMod.CalPlayer.Dashes;
using CalamityMod.DataStructures;
@@ -12,9 +13,7 @@ using CalamityMod.Items.Armor.Silva;
using CalamityMod.Items.Armor.Tarragon;
using CalamityMod.Items.Fishing.BrimstoneCragCatches;
using CalamityMod.Items.Placeables.Furniture;
using CalamityMod.Items.Potions;
using CalamityMod.Items.Potions.Alcohol;
using CalamityMod.Items.Potions.Food;
using CalamityMod.NPCs;
using CalamityMod.Projectiles.Typeless;
using CalamityMod.Systems;
@@ -194,8 +193,8 @@ namespace CalamityMod.CalPlayer
for (int l = 0; l < Player.MaxBuffs; l++)
{
int buff = Player.buffType[l];
if (CalamityBuffSets.AlcoholStrength.TryGetValue(buff, out int level))
alcoholPoisonLevel += level;
if (BuffDatasets.DebuffDataset[buff] is not null && BuffDatasets.DebuffDataset[buff].AlcoholLevel > 0)
alcoholPoisonLevel += BuffDatasets.DebuffDataset[buff].AlcoholLevel;
}
if (Player.Calamity().ivDrip) // +1 stack of poisoning while IV Drip is equipped
alcoholPoisonLevel++;
@@ -213,7 +212,7 @@ namespace CalamityMod.CalPlayer
Player.fishingSkill += 5;
}
if (alcoholPoisonLevel > 3)
if (alcoholPoisonLevel > alcoholPoisonMax)
{
// Independently of Calamity's nerfs to Nebula life regen, it is disabled entirely by alcohol poisoning.
Player.nebulaLevelLife = 0;
@@ -558,12 +557,7 @@ namespace CalamityMod.CalPlayer
if (community)
{
int regenBoost = 1 + (int)(TheCommunity.CalculatePower() * TheCommunity.RegenMultiplier);
bool lesserEffect = false;
for (int l = 0; l < Player.MaxBuffs; l++)
{
int hasBuff = Player.buffType[l];
lesserEffect = CalamityBuffSets.AlcoholStrength.TryGetValue(hasBuff, out var a);
}
bool lesserEffect = Player.buffType.Any(i => BuffDatasets.DebuffDataset[i] is not null && BuffDatasets.DebuffDataset[i].AlcoholLevel > 0);
if (Player.lifeRegen < 0)
Player.lifeRegen += lesserEffect ? 1 : regenBoost;
}
+10 -1
View File
@@ -1721,6 +1721,16 @@ namespace CalamityMod.CalPlayer
if (rOfResilienceCooldown > 0)
rOfResilienceCooldown--;
if (Player.Calamity().friendlyMinions > 0)
{
int numOfPigs = Player.ownedProjectileCounts[ModContent.ProjectileType<Pigion>()];
if (numOfPigs < Player.Calamity().friendlyMinions)
{
int pigDamage = 7;
Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, new Vector2(0, -16).RotatedByRandom(MathHelper.Pi), ModContent.ProjectileType<Pigion>(), pigDamage, 0f, Player.whoAmI, 0, numOfPigs + 1);
}
}
if (transformer && Player.Calamity().transformerCooldown == 0 && transformerDelay == 0) // The code for this acursed thing took much... MUCH, too long to make
{
float zoneSize = 150;
@@ -3347,7 +3357,6 @@ namespace CalamityMod.CalPlayer
#region Other Buff Effects
private void OtherBuffEffects()
{
if (gravityNormalizer)
{
Player.buffImmune[BuffID.VortexDebuff] = true;
-7
View File
@@ -1030,13 +1030,6 @@ namespace CalamityMod.CalPlayer
Projectile.NewProjectile(spawnSource, proj.Center, Vector2.Zero, ProjectileType<EmpyreanBlast>(), blastDamage, 0f, proj.owner, 0f, 0f);
break;
case 4:
// Exodus Rogue Bubble: 60%
int bubbleDamage = (int)(proj.damage * 0.6f);
CalamityUtils.SpawnOrb(proj, bubbleDamage, ProjectileType<EmpyreanGlob>(), 800f, 15f);
xerocDmg += (int)(bubbleDamage * 0.5);
break;
default:
break;
}
+1 -2
View File
@@ -113,11 +113,10 @@ namespace CalamityMod.DataStructures
public bool GearCanModifyDebuff = true;
/// <summary>
/// UNIMPLEMENTED. WILL BE DONE IN A FUTURE PR
/// How much alcohol this counts as.
/// Default is 0, most alcohol is 1, and Everclear is 2
/// </summary>
public float AlcoholLevel = 0f;
public int AlcoholLevel = 0;
/// <summary>
/// UNIMPLEMENTED. WILL BE DONE IN A FUTURE PR
Binary file not shown.

After

Width:  |  Height:  |  Size: 155 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 B

+68
View File
@@ -774,5 +774,73 @@ namespace CalamityMod.ILEditing
}
}
#endregion
#region Tweak Pygmy Staff aggro distance logic
private static void PygmyAggroOnClosestPointInHitbox(ILContext context)
{
ILCursor cursor = new(context);
if (!cursor.TryGotoNext(i => i.MatchStloc(131)))
{// Go to the latest newly set variable near the point we wanna be, as that is an easy unique instruction to jump to
// 131 is the number assigned to that variable in ILview
LogFailure("Tweaking Pygmy Staff aggro distance logic", "Could not locate unique Stloc(131) instruction nearest to aggro distance check.");
return;
}
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdloc(126)))
{// Before the minion range variable emission so as to receive the value being targetted at it
LogFailure("Tweaking Pygmy Staff aggro distance logic", "Could not locate the minion range variable.");
return;
}
cursor.Emit(OpCodes.Ldarg_0); // Emit the Projectile entity as we are in Projectile.cs::AI_026
cursor.Emit(OpCodes.Ldloc, 129); // Emit the NPC index via the incremented loop variable
cursor.Emit(OpCodes.Ldloc, 6); // Emit the bool containing type check for pygmies
cursor.EmitDelegate((float distance, Projectile projectile, int npcIndex, bool pygmy) =>
{// Replace the distance with a different value calculated off of closest point in hitboxes
if (!pygmy)
return distance;
NPC npc = Main.npc[npcIndex];
Player player = Main.player[projectile.owner];
float finalDistance = npc.Hitbox.ClosestPointInRect(player.Center).Distance(player.Hitbox.ClosestPointInRect(npc.Center));
return finalDistance;
});
// That was part 1, time for part 2.
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchStloc(185)))
{// Go directly before the instruction that's meant to receive the distance value of this tagged NPC
LogFailure("Tweaking Pygmy Staff aggro distance logic", "Could not locate first unique Stloc(185) instruction.");
return;
}
cursor.Emit(OpCodes.Ldarg_0);
cursor.Emit(OpCodes.Ldloc, 181); // Emit the tagged NPC
cursor.Emit(OpCodes.Ldloc, 6);
cursor.EmitDelegate((float distance, Projectile projectile, NPC npc, bool pygmy) =>
{// Replace the distance with a different value calculated off of closest point in hitboxes
if (!pygmy)
return distance;
float finalDistance = npc.Hitbox.ClosestPointInRect(projectile.Center).Distance(projectile.Hitbox.ClosestPointInRect(npc.Center));
return finalDistance;
});
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchStloc(189)))
{// Go directly before the instruction that's meant to receive the distance value of this NPC currently being iterated over
LogFailure("Tweaking Pygmy Staff aggro distance logic", "Could not locate first unique Stloc(189) instruction.");
return;
}
cursor.Emit(OpCodes.Ldarg_0);
cursor.Emit(OpCodes.Ldloc, 186); // Emit the NPC index via the incremented loop variable
cursor.Emit(OpCodes.Ldloc, 6);
cursor.EmitDelegate((float distance, Projectile projectile, int npcIndex, bool pygmy) =>
{// Replace the distance with a different value calculated off of closest point in hitboxes
if (!pygmy)
return distance;
NPC npc = Main.npc[npcIndex];
float finalDistance = npc.Hitbox.ClosestPointInRect(projectile.Center).Distance(projectile.Hitbox.ClosestPointInRect(npc.Center));
return finalDistance;
});
}
#endregion Tweak Pygmy Staff aggro distance logic
}
}
+3
View File
@@ -188,6 +188,9 @@ namespace CalamityMod.ILEditing
// Fix vanilla behaviour of not calling CheckDead for NPCs that realLife is set
IL_NPC.StrikeNPC_HitInfo_bool_bool += EnsureCheckDeadOnSegments;
// Change Pygmy Staff minion AI to check distance based on closest points in hitboxes
IL_Projectile.AI_026 += PygmyAggroOnClosestPointInHitbox;
//Additional detours that are in their own item files given they are only relevant to these specific items:
//Rover drive detours on Player.DrawInfernoRings to draw its shield
//Wulfrum armor hooks on Player.KeyDoubleTap and DrawPendingMouseText to activate its set bonus and spoof the mouse text to display the stats of the activated weapon if shift is held
+1 -1
View File
@@ -34,7 +34,7 @@ namespace CalamityMod.Items.Accessories
CreateRecipe().
AddIngredient<SilencingSheath>().
AddIngredient<RuinMedallion>().
AddIngredient<MeldConstruct>(5).
AddIngredient<MeldBlob>(14). //Consistent with Vanilla lunar wing costs
AddTile(TileID.LunarCraftingStation).
Register();
}
+1 -1
View File
@@ -46,7 +46,7 @@ namespace CalamityMod.Items.Accessories
AddIngredient<Baroclaw>().
AddIngredient<GiantTortoiseShell>().
AddIngredient<MolluskHusk>(5).
AddIngredient<MeldConstruct>(6).
AddIngredient<MeldBlob>(14). //Consistent with Vanilla lunar wing costs
AddTile(TileID.LunarCraftingStation).
Register();
}
+1 -1
View File
@@ -77,7 +77,7 @@ namespace CalamityMod.Items.Accessories.Wings
{
CreateRecipe().
AddIngredient(ItemID.SoulofFlight, 20).
AddIngredient<MeldConstruct>(14).
AddIngredient<MeldBlob>(14).
AddIngredient(ItemID.LunarBar, 10).
AddTile(TileID.LunarCraftingStation).
Register();
+1 -1
View File
@@ -53,7 +53,7 @@ namespace CalamityMod.Items.Armor.Empyrean
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<MeldConstruct>(20).
AddIngredient<MeldBlob>(20).
AddIngredient(ItemID.LunarBar, 16).
AddTile(TileID.LunarCraftingStation).
Register();
+1 -1
View File
@@ -36,7 +36,7 @@ namespace CalamityMod.Items.Armor.Empyrean
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<MeldConstruct>(15).
AddIngredient<MeldBlob>(15).
AddIngredient(ItemID.LunarBar, 12).
AddTile(TileID.LunarCraftingStation).
Register();
+1 -1
View File
@@ -92,7 +92,7 @@ namespace CalamityMod.Items.Armor.Empyrean
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<MeldConstruct>(10).
AddIngredient<MeldBlob>(10).
AddIngredient(ItemID.LunarBar, 8).
AddTile(TileID.LunarCraftingStation).
SortBeforeFirstRecipesOf(ModContent.ItemType<EmpyreanCloak>()).
+12 -4
View File
@@ -7,18 +7,26 @@ namespace CalamityMod.Items.Materials
public class MeldBlob : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Materials";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 100;
Item.ResearchUnlockCount = 25;
ItemID.Sets.ItemIconPulse[Type] = true;
}
public override void SetDefaults()
{
Item.width = 16;
Item.height = 14;
Item.width = 24;
Item.height = 22;
Item.maxStack = Item.CommonMaxStack;
Item.value = Item.sellPrice(silver: 20);
Item.rare = ItemRarityID.Red;
Item.rare = ItemRarityID.Cyan;
ItemID.Sets.ItemNoGravity[Type] = true;
}
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.5f * brightness, 0.5f * brightness, 0.5f * brightness);
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 462 B

-33
View File
@@ -1,33 +0,0 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Materials
{
[LegacyName("MeldiateBar")]
public class MeldConstruct : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Materials";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 25;
}
public override void SetDefaults()
{
Item.width = 15;
Item.height = 12;
Item.maxStack = Item.CommonMaxStack;
Item.value = Item.sellPrice(silver: 42);
Item.rare = ItemRarityID.Red;
}
public override void AddRecipes()
{
CreateRecipe(3).
AddIngredient<MeldBlob>(6).
AddIngredient<StarblightSoot>(3).
AddTile(TileID.LunarCraftingStation).
Register();
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

+43
View File
@@ -0,0 +1,43 @@
using CalamityMod.NPCs;
using CalamityMod.Tiles.Furniture;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables.Furniture
{
public class TheMonument : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Placeables";
public const float MonumentTaxIncrease = 0.5f;
public const float MonumentHappinessReduction = 0.15f;
public override void SetDefaults()
{
Item.DefaultToPlaceableTile(ModContent.TileType<TheMonumentTile>());
Item.width = 40;
Item.height = 50;
Item.rare = ItemRarityID.Pink;
Item.value = Item.buyPrice(gold: 5);
}
public override void Load()
{
On_Player.CollectTaxes += AddMonumentTaxes;
}
private static void AddMonumentTaxes(On_Player.orig_CollectTaxes orig, Player self)
{
orig(self);
foreach (NPC n in Main.ActiveNPCs)
{
if (!n.homeless && !NPCID.Sets.IsTownPet[n.type] && NPC.TypeToDefaultHeadIndex(n.type) > 0 && n.GetGlobalNPC<CalamityGlobalTownNPC>().AffectedByTheMonument)
self.taxMoney += (int)(CalamityGlobalTownNPC.TotalTaxesPerNPC * MonumentTaxIncrease);
}
if (self.taxMoney > CalamityGlobalTownNPC.TaxesToCollectLimit)
self.taxMoney = CalamityGlobalTownNPC.TaxesToCollectLimit;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

+32
View File
@@ -0,0 +1,32 @@
using CalamityMod.Buffs.Alcohol;
using CalamityMod.Items.Materials;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Items.Potions.Alcohol
{
public class BaconOil : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Potions";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 20;
ItemID.Sets.DrinkParticleColors[Type] = new Color[3] {
new Color(204, 90, 73),
new Color(168, 37, 37),
new Color(120, 28, 28)
};
}
public override void SetDefaults()
{
Item.DefaultToFood(20, 32, ModContent.BuffType<BaconOilBuff>(), CalamityUtils.MinutesToFrames(6), true);
Item.value = Item.sellPrice(silver: 2);
Item.rare = ItemRarityID.Blue;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

+42
View File
@@ -0,0 +1,42 @@
using CalamityMod.Buffs.StatDebuffs;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Items.Potions.Food
{
public class TheSandwich : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Potions";
public static int alcoholCapBoost = 2;
public static float statBoost = 0.05f; // The player starts with negative stat boosts, so it is a bit less than you'd expect
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(statBoost.ToPercent());
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 5;
Main.RegisterItemAnimation(Type, new DrawAnimationVertical(int.MaxValue, 3));
ItemID.Sets.FoodParticleColors[Type] = new Color[3] {
new Color(132, 171, 87),
new Color(174, 91, 107),
new Color(218, 176, 133)
};
ItemID.Sets.IsFood[Type] = true;
}
public override void SetDefaults()
{
Item.DefaultToFood(70, 48, ModContent.BuffType<Malnourished>(), CalamityUtils.MinutesToFrames(10));
Item.value = Item.sellPrice(silver: 20);
Item.rare = ItemRarityID.Blue;
}
public override void UseAnimation(Player player)
{
player.ClearBuff(BuffID.WellFed);
player.ClearBuff(BuffID.WellFed2);
player.ClearBuff(BuffID.WellFed3);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

+89
View File
@@ -0,0 +1,89 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Buffs.Potions;
using CalamityMod.Items.Materials;
using CalamityMod.Rarities;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Potions
{
public class TheConcoction : ModItem, ILocalizedModType
{
private static int hoverTimer = 0;
private static bool wasHovering = false;
public new string LocalizationCategory => "Items.Potions";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 30;
ItemID.Sets.DrinkParticleColors[Type] = new Color[3]
{
new Color(255, 190, 250),
new Color(255, 225, 183),
new Color(246, 34, 79)
};
}
public override void SetDefaults()
{
Item.DefaultToHealingPotion(50, 56, 500);
Item.value = Item.sellPrice(silver: 60);
Item.rare = ItemRarityID.Green;
}
public override void OnConsumeItem(Player player)
{
TheConcoctionPlayer cocPlayer = player.GetModPlayer<TheConcoctionPlayer>();
cocPlayer.swinesWrathCounter = 1200; // Creates a 10 second delay before the buff is visible (triggers at 600)
}
public override void UpdateInventory(Player player)
{
wasHovering = Main.HoverItem?.type == Type;
}
// Display different text for the first 10 frames of hovering over the item's tooltip.
public override void ModifyTooltips(List<TooltipLine> tooltips)
{
bool isHovering = Main.HoverItem?.type == Type;
if (isHovering && !wasHovering)
hoverTimer = 0;
if (isHovering)
hoverTimer++;
if (hoverTimer <= 10 && hoverTimer > 0)
{
TooltipLine healLine = tooltips.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "HealLife");
healLine?.Text = this.GetLocalization("EasterEggText").Value;
}
}
}
public class TheConcoctionPlayer : ModPlayer
{
public int swinesWrathCounter = -1;
public override void PostUpdate()
{
if (swinesWrathCounter > 0)
{
swinesWrathCounter--;
if (swinesWrathCounter <= 600 && !Player.HasBuff<SwinesWrathBuff>()) // When there is 10 seconds left
{
Player.AddBuff(ModContent.BuffType<SwinesWrathBuff>(), 600);
SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/SwinesWrathProc"), Player.Center);
}
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 489 B

+1 -1
View File
@@ -40,7 +40,7 @@ namespace CalamityMod.Items.Tools
public override void AddRecipes()
{
CreateRecipe()
.AddIngredient<MeldConstruct>(12)
.AddIngredient<MeldBlob>(12)
.AddIngredient(ItemID.LunarBar, 10)
.AddTile(TileID.LunarCraftingStation)
.Register();
Binary file not shown.

After

Width:  |  Height:  |  Size: 510 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 541 B

+153
View File
@@ -0,0 +1,153 @@
using CalamityMod.Items.Placeables.Furniture;
using CalamityMod.NPCs;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Items.Tools
{
public class TheGift : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Tools";
public static readonly SoundStyle BadBuzzer = new SoundStyle("CalamityMod/Sounds/Custom/BadGiftBuzzer") with { Volume = 0.85f };
public override void SetDefaults()
{
Item.width = Item.height = 20;
Item.maxStack = Item.CommonMaxStack;
Item.useTime = Item.useAnimation = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.useTurn = true;
Item.noMelee = true;
Item.UseSound = SoundID.Item1;
Item.autoReuse = true;
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
Item.rare = ItemRarityID.Green;
}
public override void Load()
{
On_ShopHelper.ProcessMood += TheGiftHappiness;
}
public override void Update(ref float gravity, ref float maxFallSpeed)
{
// Controls actually applying the effect to an NPC
// None of this should work in Remix because Remix disables happiness
if (Item.noGrabDelay <= 0 && !Main.remixWorld)
{
foreach (NPC n in Main.ActiveNPCs)
{
// Don't run this code for NPCs that aren't affected by happiness
// Also don't run this if The Gift has already been used on this NPC; they all will hold grudges against you :)
if (!n.isLikeATownNPC || NPCID.Sets.NoTownNPCHappiness[n.type] || NPCID.Sets.IsTownPet[n.type] || n.GetGlobalNPC<CalamityGlobalTownNPC>().TheGiftStatus.HasValue)
continue;
if (Item.Hitbox.Intersects(n.Hitbox))
{
bool positive = Main.rand.NextBool();
Color c = positive ? Color.Green : Color.Red;
SoundEngine.PlaySound(positive ? SoundID.ResearchComplete : BadBuzzer, n.Center);
n.GetGlobalNPC<CalamityGlobalTownNPC>().TheGiftStatus = positive;
n.GetGlobalNPC<CalamityGlobalTownNPC>().TheGiftReset = 0.0;
// Visual effect to demonstrate that something happened
for (int i = 0; i < 6; i++)
{
Vector2 spawnPos = n.Center + Main.rand.NextVector2Circular(30f, 30f);
HealingPlus s = new(spawnPos, 0.5f, (spawnPos - n.Center).SafeNormalize(Vector2.Zero) * 0.65f, c, c * 0.2f, 25)
{
Rotation = positive ? 0f : MathHelper.PiOver4
};
GeneralParticleHandler.SpawnParticle(s);
}
for (int j = 0; j < 4; j++)
{
Vector2 spawnPos = n.Center + Main.rand.NextVector2Circular(50f, 50f);
Vector2 arrVel = -Vector2.UnitY * 0.6f * positive.ToDirectionInt();
StatChangeArrow arr = new(spawnPos, arrVel, -MathHelper.PiOver2 * positive.ToDirectionInt(), c, c * 0.1f, 0.7f, 40);
GeneralParticleHandler.SpawnParticle(arr);
}
Item.active = false;
Item.type = ItemID.None;
Item.stack = 0;
if (Main.dedServ)
NetMessage.SendData(MessageID.SyncItem, -1, -1, null, Item.whoAmI);
// Make sure it can't apply to multiple NPCs at once
break;
}
}
}
}
// Also contains logic for The Monument, so I can make sure these apply in the correct order
private static void TheGiftHappiness(On_ShopHelper.orig_ProcessMood orig, ShopHelper self, Player player, NPC npc)
{
orig(self, player, npc);
// Immediately exit early if it's Remix world, or if it's an NPC that should not be affected by happiness
if (Main.remixWorld || NPCID.Sets.NoTownNPCHappiness[npc.type] || NPCID.Sets.IsTownPet[npc.type])
return;
var gtnpc = npc.GetGlobalNPC<CalamityGlobalTownNPC>();
// The Monument lowers happiness by a fixed amount. This is not applied to the Tax Collector.
if (npc.type != NPCID.TaxCollector && gtnpc.SearchForTheMonument(npc))
{
float oldHappiness = self._currentPriceAdjustment;
self._currentPriceAdjustment += TheMonument.MonumentHappinessReduction;
self.LimitAndRoundMultiplier(self._currentPriceAdjustment);
string dialogueKey;
if (npc.type < NPCID.Count)
{
dialogueKey = $"Mods.CalamityMod.Vanilla.TownNPCMood.{NPCID.Search.GetName(npc.type)}.Monument";
// Zoologist has separate dialogue when transformed
if (npc.type == NPCID.BestiaryGirl && npc.ShouldBestiaryGirlBeLycantrope())
dialogueKey += "Transformed";
}
else
{
var modNPC = NPCLoader.GetNPC(npc.type);
dialogueKey = $"Mods.{modNPC.Mod.Name}.NPCs.{modNPC.Name}.TownNPCMood.Monument";
}
// If the NPC is content, it should override that text because they are no longer content
if (oldHappiness == 1f)
self._currentHappiness = Language.Exists(dialogueKey) ? Language.GetTextValue(dialogueKey) : CalamityUtils.GetTextValue("Vanilla.TownNPCMood.DefaultMonument") + " ";
else
self._currentHappiness += Language.Exists(dialogueKey) ? Language.GetTextValue(dialogueKey) : CalamityUtils.GetTextValue("Vanilla.TownNPCMood.DefaultMonument") + " ";
}
// The Gift sets happiness to a fixed either extremely high or extremely low value, depending on its random state.
bool? gift = gtnpc.TheGiftStatus;
if (gift.HasValue)
{
if (gift.Value)
self._currentPriceAdjustment = 0.5f;
else
self._currentPriceAdjustment = 1.75f;
string locKey = gift.Value ? "GiftPositive" : "GiftNegative";
string dialogueKey;
if (npc.type < NPCID.Count)
{
dialogueKey = $"Mods.CalamityMod.Vanilla.TownNPCMood.{NPCID.Search.GetName(npc.type)}.{locKey}";
// Zoologist has separate dialogue when transformed
if (npc.type == NPCID.BestiaryGirl && npc.ShouldBestiaryGirlBeLycantrope())
dialogueKey += "Transformed";
}
else
{
var modNPC = NPCLoader.GetNPC(npc.type);
dialogueKey = $"Mods.{modNPC.Mod.Name}.NPCs.{modNPC.Name}.TownNPCMood.{locKey}";
}
// Yes, it's intentional that this completely overrides all other happiness report dialogue
self._currentHappiness = Language.Exists(dialogueKey) ? Language.GetTextValue(dialogueKey) : CalamityUtils.GetTextValue($"Vanilla.TownNPCMood.Default{locKey}") + " ";
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 601 B

+395
View File
@@ -0,0 +1,395 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using CalamityMod.Dusts;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Particles;
using CalamityMod.Prefixes;
using CalamityMod.Projectiles.Environment;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Tools
{
public static class VoucherReforgeSystem
{
public static int ForcedPrefix = -1;
public static bool RollWon = false;
}
public class VoucherGlobalItem : GlobalItem
{
public override void PreReforge(Item item)
{
Player player = Main.LocalPlayer;
bool isAccessory = item.accessory;
VoucherReforgeSystem.ForcedPrefix = -1;
for (int i = 0; i < player.inventory.Length; i++)
{
Item invItem = player.inventory[i];
if (invItem.ModItem is VoucherItem voucher)
{
if (voucher.IsUsableVoucher(player, item, isAccessory))
{
VoucherReforgeSystem.ForcedPrefix = voucher.GetPrefixForItem(player, item, isAccessory);
invItem.stack--;
if (invItem.stack <= 0)
invItem.TurnToAir();
if (Main.netMode != NetmodeID.Server)
{
if (VoucherReforgeSystem.RollWon)
{
for (int dustCount = 0; dustCount < 8; dustCount++)
{
// Light dust and sparks
Vector2 sparkVel = Main.rand.NextVector2CircularEdge(1f, 1f) * Main.rand.NextFloat(3f, 12f);
Vector2 dustVel = (sparkVel).SafeNormalize(Vector2.UnitY).RotatedBy(Main.rand.Next(100)) * Main.rand.NextFloat(1f, 15f);
Vector2 fxPos = player.Center + sparkVel;
Color fxColor = Color.Lerp(Color.MediumAquamarine, Color.MediumSeaGreen, Main.rand.NextFloat(1f));
Particle fx = new CustomSpark(fxPos, sparkVel, "CalamityMod/Particles/Sparkle", false, (int)(Main.rand.Next(30, 60)), Main.rand.NextFloat(1.3f, 1.8f), fxColor, new Vector2(0.5f, 1.1f), extraRotation: 0, shrinkSpeed: Main.rand.NextFloat(0.1f, 0.3f));
GeneralParticleHandler.SpawnParticle(fx);
Dust dust = Dust.NewDustPerfect(fxPos, ModContent.DustType<LightDust>(), dustVel, 0, default, Main.rand.NextFloat(0.8f, 1.6f));
dust.noGravity = true;
dust.color = fxColor;
// Crit sparkles
Vector2 velocity = Main.rand.NextVector2CircularEdge(1f, 1f) * Main.rand.NextFloat(1f, 25f);
Color color = Main.rand.NextBool() ? Color.LightBlue : Color.LightSkyBlue;
Particle sparkle = new CritSpark(player.MountedCenter, velocity, color, bloom: Color.Cyan, scale: 1f, lifeTime: Main.rand.Next(15, 60));
GeneralParticleHandler.SpawnParticle(sparkle);
}
SoundEngine.PlaySound(SoundID.Item4, player.position);
}
else
{
for (int d = 0; d < 10; d++)
{
for (int smokeCount = 0; smokeCount < 3; smokeCount++)
{
Vector2 velocity = Main.rand.NextVector2CircularEdge(1f, 1f) * Main.rand.NextFloat(3f, 12f);
Color smokeStart = Main.rand.NextBool() ? Color.Gray : Color.LightGray;
Color smokeEnd = Color.DimGray;
float smokeSize = Main.rand.NextFloat(0.9f, 2f);
Particle smoke = new SmallSmokeParticle(player.MountedCenter, velocity, smokeStart, smokeEnd, smokeSize, Main.rand.Next(90, 140));
GeneralParticleHandler.SpawnParticle(smoke);
}
Particle skull = new DesertProwlerSkullParticle(player.Center, new Vector2(2.5f, 2.5f).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1f), Main.rand.NextBool() ? Color.LightGray : Color.Silver, Color.Gray, Main.rand.NextFloat(0.15f, 0.5f), Main.rand.Next(100, 190));
GeneralParticleHandler.SpawnParticle(skull);
}
SoundEngine.PlaySound(SoundID.Item16, player.position);
}
}
break;
}
}
}
}
}
public abstract class VoucherItem : ModItem
{
#region CyclePrefixes
protected virtual int[] prefixChoices => Array.Empty<int>();
protected int chosenPrefix = 0;
public override void ModifyTooltips(List<TooltipLine> tooltips)
{
string selected = GetSelectedPrefixName();
string all = GetAllPrefixNames();
foreach (var line in tooltips)
{
if (line.Mod == "Terraria" && line.Name.StartsWith("Tooltip"))
{
line.Text = line.Text
.Replace("{0}", selected)
.Replace("{1}", all);
}
}
}
public string GetAllPrefixNames()
{
var pool = prefixChoices;
if (pool.Length == 0)
return null;
List<string> names = new();
foreach (int p in pool)
{
if (p >= 0 && p < Lang.prefix.Length && Lang.prefix[p] != null)
names.Add(Lang.prefix[p].Value);
}
return string.Join(", ", names);
}
public string GetSelectedPrefixName()
{
var pool = prefixChoices;
if (pool.Length == 0)
return null;
int p = pool[chosenPrefix];
if (p >= 0 && p < Lang.prefix.Length && Lang.prefix[p] != null)
return Lang.prefix[p].Value;
return null;
}
#endregion
public bool IsUsableVoucher(Player player, Item itemBeingReforged, bool isAccessory)
{
return Item.favorited && CanApply(player, itemBeingReforged, isAccessory);
}
public override bool CanRightClick() => Main.keyState.PressingShift();
public override void RightClick(Player player)
{
if (prefixChoices.Length == 0)
return;
chosenPrefix++;
if (chosenPrefix >= prefixChoices.Length)
chosenPrefix = 0;
Item.NetStateChanged();
}
public override bool ConsumeItem(Player player) => false;
public override void NetSend(BinaryWriter writer)
{
writer.Write(chosenPrefix);
}
public override void NetReceive(BinaryReader reader)
{
chosenPrefix = reader.ReadInt32();
}
public virtual bool CanApply(Player player, Item itemBeingReforged, bool isAccessory)
{
return true;
}
public virtual int GetPrefixForItem(Player player, Item itemBeingReforged, bool isAccessory)
{
if (prefixChoices.Length == 0)
return -1;
if (isAccessory)
{
if (Main.rand.NextBool())
{
VoucherReforgeSystem.RollWon = true;
return prefixChoices[chosenPrefix];
}
else
{
VoucherReforgeSystem.RollWon = false;
return ModContent.PrefixType<Friendly>();
}
}
VoucherReforgeSystem.RollWon = true;
return prefixChoices[chosenPrefix];
}
}
public class CombatVoucher : VoucherItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Tools";
public override void SetDefaults()
{
Item.width = 36;
Item.height = 20;
Item.rare = ItemRarityID.Green;
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
Item.maxStack = Item.CommonMaxStack;
}
public override bool CanApply(Player player, Item itemBeingReforged, bool isAccessory)
{
return !isAccessory;
}
public override int GetPrefixForItem(Player player, Item itemBeingReforged, bool isAccessory)
{
int prefix = -1;
var category = itemBeingReforged.GetPrefixCategories();
if (!category.Any())
return -1;
if ((itemBeingReforged).knockBack == 0f) // Weapons which do not apply knockback universally have demonic as their best reforge
prefix = PrefixID.Demonic;
else if (itemBeingReforged.CountsAsClass<MeleeDamageClass>() && itemBeingReforged.type != ModContent.ItemType<TheBurningSky>())
{
bool weirdMelee = !category.Contains(PrefixCategory.Melee); // Weapons which deal melee damage but cannot recieve melee prefixes because Item.noUseGraphic is true
if (weirdMelee || itemBeingReforged.CountsAsClass<MeleeNoSpeedDamageClass>())
prefix = PrefixID.Godly;
else
prefix = PrefixID.Legendary;
}
else if (itemBeingReforged.CountsAsClass<RangedDamageClass>() || itemBeingReforged.type == ModContent.ItemType<TheBurningSky>())
prefix = PrefixID.Unreal;
else if (itemBeingReforged.CountsAsClass<MagicDamageClass>())
prefix = PrefixID.Mythical;
else if (itemBeingReforged.CountsAsClass<RogueDamageClass>())
prefix = ModContent.PrefixType<Flawless>();
else if (itemBeingReforged.CountsAsClass<SummonDamageClass>())
prefix = itemBeingReforged.IsWhip() ? PrefixID.Legendary : PrefixID.Ruthless;
else // Fallback case
prefix = PrefixID.Godly;
if (Main.rand.NextBool())
{
VoucherReforgeSystem.RollWon = true;
return prefix;
}
else
{
VoucherReforgeSystem.RollWon = false;
return ModContent.PrefixType<Horrible>();
}
}
}
public class AggressiveVoucher : VoucherItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Tools";
protected override int[] prefixChoices => new int[]
{
PrefixID.Jagged,
PrefixID.Angry,
PrefixID.Spiked,
PrefixID.Menacing,
PrefixID.Precise,
PrefixID.Lucky
};
public override void SetDefaults()
{
Item.width = 36;
Item.height = 20;
Item.rare = ItemRarityID.Green;
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
Item.maxStack = Item.CommonMaxStack;
}
public override bool CanApply(Player player, Item itemBeingReforged, bool isAccessory)
{
return isAccessory;
}
}
public class UnbreakableVoucher : VoucherItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Tools";
protected override int[] prefixChoices => new int[]
{
PrefixID.Hard,
PrefixID.Armored,
PrefixID.Guarding,
PrefixID.Warding,
ModContent.PrefixType<Invigorating>(),
ModContent.PrefixType<Dauntless>()
};
public override void SetDefaults()
{
Item.width = 36;
Item.height = 20;
Item.rare = ItemRarityID.Green;
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
Item.maxStack = Item.CommonMaxStack;
}
public override bool CanApply(Player player, Item itemBeingReforged, bool isAccessory)
{
return isAccessory;
}
}
public class HurriedVoucher : VoucherItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Tools";
protected override int[] prefixChoices => new int[]
{
PrefixID.Brisk,
PrefixID.Fleeting,
PrefixID.Hasty,
PrefixID.Quick
};
public override void SetDefaults()
{
Item.width = 36;
Item.height = 20;
Item.rare = ItemRarityID.Green;
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
Item.maxStack = Item.CommonMaxStack;
}
public override bool CanApply(Player player, Item itemBeingReforged, bool isAccessory)
{
return isAccessory;
}
}
public class OddVoucher : VoucherItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Tools";
protected override int[] prefixChoices => new int[]
{
PrefixID.Arcane,
PrefixID.Wild,
PrefixID.Rash,
PrefixID.Intrepid,
PrefixID.Violent,
ModContent.PrefixType<Silent>()
};
public override void SetDefaults()
{
Item.width = 36;
Item.height = 20;
Item.rare = ItemRarityID.Green;
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
Item.maxStack = Item.CommonMaxStack;
}
public override bool CanApply(Player player, Item itemBeingReforged, bool isAccessory)
{
return isAccessory;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 548 B

+1 -1
View File
@@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
{
Item.width = 26;
Item.height = 26;
Item.damage = 68;
Item.damage = 60;
Item.DamageType = TrueMeleeDamageClass.Instance;
Item.useTime = Item.useAnimation = 12;
Item.knockBack = 12f;
+1 -1
View File
@@ -48,7 +48,7 @@ namespace CalamityMod.Items.Weapons.Magic
{
CreateRecipe().
AddIngredient(ItemID.SpellTome).
AddIngredient<MeldConstruct>(9).
AddIngredient<MeldBlob>(18).
AddTile(TileID.Bookcases).
Register();
}
+1 -1
View File
@@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 56;
Item.height = 60;
Item.damage = 77;
Item.damage = 65;
Item.DamageType = TrueMeleeDamageClass.Instance;
Item.useAnimation = Item.useTime = 30;
Item.useStyle = ItemUseStyleID.Swing;
+1 -1
View File
@@ -103,7 +103,7 @@ namespace CalamityMod.Items.Weapons.Melee
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<MeldConstruct>(15).
AddIngredient<MeldBlob>(18).
AddTile(TileID.LunarCraftingStation).
Register();
}
+1 -1
View File
@@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 124;
Item.height = 124;
Item.damage = 3777; // Feel free to change these 7s as balance requires. The other 7s should stay - Update: no more 2777... :(
Item.damage = 5777; // Feel free to change these 7s as balance requires. The other 7s should stay - Update: no more 2777... :(
Item.DamageType = TrueMeleeDamageClass.Instance;
Item.useAnimation = 77;
Item.useTime = 77;
+1 -1
View File
@@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 130;
Item.height = 130;
Item.damage = 515;
Item.damage = 360;
Item.DamageType = TrueMeleeDamageClass.Instance;
Item.useAnimation = 35;
Item.useTime = 35;
+17 -9
View File
@@ -25,6 +25,7 @@ namespace CalamityMod.Items.Weapons.Melee
public bool spawnProj = true;
public bool spawnTrueMeleeProj = true;
public bool playSound = true;
public float scaling = 1;
public Color clr = Color.MediumOrchid;
@@ -32,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 78;
Item.height = 78;
Item.damage = 310;
Item.damage = 280;
Item.DamageType = DamageClass.Melee;
Item.useStyle = ItemUseStyleID.Swing;
Item.useAnimation = Item.useTime = 20;
@@ -48,10 +49,14 @@ namespace CalamityMod.Items.Weapons.Melee
{
return false;
}
public override void ModifyItemScale(Player player, ref float scale)
{
scale = scaling = player.GetMeleeScale();
}
public override void UseItemHitbox(Player player, ref Rectangle hitbox, ref bool noHitbox)
{
// Basically just insures the enemy is always able to be hit if they're in range, the actual collision check is done in CanHitNPC
float scale = 8f;
float scale = 8f * scaling;
Vector2 newSize = new Point(hitbox.Width, hitbox.Height).ToVector2() * scale;
hitbox = new Rectangle((int)(bladeHitboxPos.X - newSize.X / 2f), (int)(bladeHitboxPos.Y - newSize.Y / 2f), (int)newSize.X, (int)newSize.Y);
}
@@ -60,7 +65,7 @@ namespace CalamityMod.Items.Weapons.Melee
Vector2 mPos = player.Calamity().mouseWorld;
Vector2 shootDir = player.Center.DirectionTo(mPos);
float _ = float.NaN;
bool hitCheck = Collision.CheckAABBvLineCollision(target.Hitbox.TopLeft(), target.Hitbox.Size(), player.Center - shootDir * 30, player.Center + shootDir * 145, Item.width * 3f, ref _);
bool hitCheck = Collision.CheckAABBvLineCollision(target.Hitbox.TopLeft(), target.Hitbox.Size(), player.Center - shootDir * 30 * scaling, player.Center + shootDir * 145 * scaling, Item.width * 3f * scaling, ref _);
return ((canHit && hitCheck) ? null : false);
}
public override void UseAnimation(Player player)
@@ -109,9 +114,11 @@ namespace CalamityMod.Items.Weapons.Melee
if (completion >= 0.65f && spawnProj)
{
if (!player.Calamity().bladeArmEnchant) // Manually remove projectiles when Tainted
Projectile.NewProjectile(player.GetSource_FromThis(), player.Center, shootDir, Item.shoot, Item.damage, Item.knockBack, player.whoAmI, 0f);
Particle swipe = new CustomSpark(player.Center - shootDir * 5, shootDir.RotatedBy(0.4f * (dir * (swingCount % 2 == 0 ? 1 : -1))) * 2.5f, "CalamityMod/Particles/VerticalSmearLarge", false, (int)(14 / player.GetAttackSpeed(DamageClass.Melee)), 0.6f, clr, new Vector2(1f, 1f), true, false, 0, false, false);
{
Projectile beam = Projectile.NewProjectileDirect(player.GetSource_FromThis(), player.Center, shootDir, Item.shoot, Item.damage, Item.knockBack, player.whoAmI, 0f);
beam.ai[1] = scaling;
}
Particle swipe = new CustomSpark(player.Center - shootDir * 5 * scaling, shootDir.RotatedBy(0.4f * (dir * (swingCount % 2 == 0 ? 1 : -1))) * 2.5f, "CalamityMod/Particles/VerticalSmearLarge", false, (int)(14 / player.GetAttackSpeed(DamageClass.Melee)), 0.6f * scaling, clr, new Vector2(1f, 1f), true, false, 0, false, false);
GeneralParticleHandler.SpawnParticle(swipe);
SoundEngine.PlaySound(SoundID.Item60, player.Center);
@@ -123,7 +130,7 @@ namespace CalamityMod.Items.Weapons.Melee
}
float extraRot = (dir == 1 ? -MathHelper.PiOver4 : MathHelper.ToRadians(225));
bladeHitboxPos = player.Center + (player.itemRotation + extraRot).ToRotationVector2() * 180;
bladeHitboxPos = player.Center + (player.itemRotation + extraRot).ToRotationVector2() * 180 * scaling;
player.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, player.itemRotation + MathHelper.ToRadians(-130) * dir);
player.SetCompositeArmBack(true, Player.CompositeArmStretchAmount.Full, player.itemRotation + MathHelper.ToRadians(-130) * dir);
@@ -137,13 +144,14 @@ namespace CalamityMod.Items.Weapons.Melee
{
if (spawnTrueMeleeProj)
{
int beamDamage = player.CalcIntDamage<MeleeDamageClass>(Item.damage * 0.35f);
int beamDamage = player.CalcIntDamage<MeleeDamageClass>(Item.damage * 0.2f);
Vector2 mouseClamped = player.ClampedMouseWorld();
SoundEngine.PlaySound(SoundID.Item84 with { Volume = 1f, Pitch = Main.rand.NextFloat(0.5f, 0.7f) }, player.Center);
for (int i = 0; i < 2; i++)
{
Vector2 vel = player.Center.DirectionFrom(target.Center).RotatedByRandom(0.7f) * Main.rand.NextFloat(18, 20);
Projectile.NewProjectile(player.GetSource_ItemUse(Item), player.Center, vel, ModContent.ProjectileType<StarofJudgement>(), beamDamage, 0, player.whoAmI, 0, (i == 0 ? -1 : 1), 1);
Projectile star = Projectile.NewProjectileDirect(player.GetSource_ItemUse(Item), player.Center, vel, ModContent.ProjectileType<StarofJudgement>(), beamDamage, 0, player.whoAmI, 0, (i == 0 ? -1 : 1), 1);
star.scale = scaling;
}
spawnTrueMeleeProj = false;
}
+1 -1
View File
@@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 76;
Item.height = 76;
Item.damage = 144;
Item.damage = 100;
Item.DamageType = TrueMeleeDamageClass.Instance;
Item.crit = 11;
Item.useAnimation = Item.useTime = 90; // Yes it's actually supposed to be this slow
+2 -3
View File
@@ -15,10 +15,9 @@ namespace CalamityMod.Items.Weapons.Melee
Item.height = 146;
Item.damage = 100;
Item.DamageType = TrueMeleeNoSpeedDamageClass.Instance;
Item.crit = 45;
Item.useAnimation = 12;
Item.crit = 41;
Item.useTime = Item.useAnimation = 12;
Item.useStyle = ItemUseStyleID.Swing;
Item.useTime = 12;
Item.useTurn = true;
Item.knockBack = 6f;
Item.UseSound = SoundID.Item1;
+18 -10
View File
@@ -31,6 +31,7 @@ namespace CalamityMod.Items.Weapons.Melee
public bool spawnProj = true;
public bool spawnTrueMeleeProj = true;
public bool playSound = true;
public float scaling = 1;
public override void SetDefaults()
{
Item.width = Item.height = 112;
@@ -46,6 +47,10 @@ namespace CalamityMod.Items.Weapons.Melee
Item.shoot = ModContent.ProjectileType<OrderbringerWaveProj>();
Item.shootSpeed = 5.5f;
}
public override void ModifyItemScale(Player player, ref float scale)
{
scale = scaling = player.GetMeleeScale();
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
return false;
@@ -53,7 +58,7 @@ namespace CalamityMod.Items.Weapons.Melee
public override void UseItemHitbox(Player player, ref Rectangle hitbox, ref bool noHitbox)
{
// Basically just insures the enemy is always able to be hit if they're in range, the actual collision check is done in CanHitNPC
float scale = 8f;
float scale = 8f * scaling;
Vector2 newSize = new Point(hitbox.Width, hitbox.Height).ToVector2() * scale;
hitbox = new Rectangle((int)(bladeHitboxPos.X - newSize.X / 2f), (int)(bladeHitboxPos.Y - newSize.Y / 2f), (int)newSize.X, (int)newSize.Y);
}
@@ -62,7 +67,7 @@ namespace CalamityMod.Items.Weapons.Melee
Vector2 mPos = player.Calamity().mouseWorld;
Vector2 shootDir = player.Center.DirectionTo(mPos);
float _ = float.NaN;
bool hitCheck = Collision.CheckAABBvLineCollision(target.Hitbox.TopLeft(), target.Hitbox.Size(), player.Center - shootDir * 30, player.Center + shootDir * 245, Item.width * 3f, ref _);
bool hitCheck = Collision.CheckAABBvLineCollision(target.Hitbox.TopLeft(), target.Hitbox.Size(), player.Center - shootDir * 30 * scaling, player.Center + shootDir * 215 * scaling, Item.width * 3f * scaling, ref _);
return ((canHit && hitCheck) ? null : false);
}
public override void UseAnimation(Player player)
@@ -110,17 +115,19 @@ namespace CalamityMod.Items.Weapons.Melee
{
if (!player.Calamity().bladeArmEnchant) // Manually remove projectiles when Tainted
{
Projectile.NewProjectile(player.GetSource_FromThis(), player.Center, shootDir, Item.shoot, Item.damage, Item.knockBack, player.whoAmI, 0f);
Projectile beam = Projectile.NewProjectileDirect(player.GetSource_FromThis(), player.Center, shootDir, Item.shoot, Item.damage, Item.knockBack, player.whoAmI, 0f);
beam.ai[1] = scaling;
for (int i = 0; i < 4; i++)
{
float rot = Main.rand.NextFloat(0.5f, 0.65f) * (Main.rand.NextBool() ? 1 : -1);
Vector2 vel = (shootDir * 2.5f).RotatedByRandom(0.6f);
Projectile.NewProjectile(player.GetSource_FromThis(), player.ClampedMouseWorld() - (shootDir * 40) + Main.rand.NextVector2Circular(130, 130), vel.RotatedBy(rot) * Main.rand.NextFloat(0.9f, 1.2f), ModContent.ProjectileType<StarofOrder>(), (int)(Item.damage * 0.12f), (int)(Item.knockBack * 0.2f), player.whoAmI, 0, rot, 1);
Projectile star = Projectile.NewProjectileDirect(player.GetSource_FromThis(), player.ClampedMouseWorld() - (shootDir * 40) + Main.rand.NextVector2Circular(130, 130), vel.RotatedBy(rot) * Main.rand.NextFloat(0.9f, 1.2f), ModContent.ProjectileType<StarofOrder>(), (int)(Item.damage * 0.12f), (int)(Item.knockBack * 0.2f), player.whoAmI, 0, rot, 1);
star.scale = scaling;
}
}
Particle swipe = new CustomSpark(player.Center - shootDir * 5, shootDir.RotatedBy(0.4f * (dir * (swingCount % 2 == 0 ? 1 : -1))) * 2.5f, "CalamityMod/Particles/VerticalSmearLarge", false, (int)(14 / player.GetAttackSpeed(DamageClass.Melee)), 0.8f, player.Calamity().lightRGB, new Vector2(1f, 1f), true, false, 0, false, false);
Particle swipe = new CustomSpark(player.Center - shootDir * 5 * scaling, shootDir.RotatedBy(0.4f * (dir * (swingCount % 2 == 0 ? 1 : -1))) * 2.5f, "CalamityMod/Particles/VerticalSmearLarge", false, (int)(14 / player.GetAttackSpeed(DamageClass.Melee)), 0.8f * scaling, player.Calamity().lightRGB, new Vector2(1f, 1f), true, false, 0, false, false);
GeneralParticleHandler.SpawnParticle(swipe);
SoundEngine.PlaySound(SoundID.Item60, player.Center);
@@ -132,8 +139,8 @@ namespace CalamityMod.Items.Weapons.Melee
}
float extraRot = (dir == 1 ? -MathHelper.PiOver4 : MathHelper.ToRadians(225));
bladeHitboxPos = player.Center + (player.itemRotation + extraRot).ToRotationVector2() * 240;
Vector2 tipPos = player.Center + (player.itemRotation + extraRot).ToRotationVector2() * 180;
bladeHitboxPos = player.Center + (player.itemRotation + extraRot).ToRotationVector2() * 240 * scaling;
Vector2 tipPos = player.Center + (player.itemRotation + extraRot).ToRotationVector2() * 180 * scaling;
player.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, player.itemRotation + MathHelper.ToRadians(-130) * dir);
player.SetCompositeArmBack(true, Player.CompositeArmStretchAmount.Full, player.itemRotation + MathHelper.ToRadians(-130) * dir);
@@ -147,7 +154,7 @@ namespace CalamityMod.Items.Weapons.Melee
{
if (spawnTrueMeleeProj)
{
int beamDamage = player.CalcIntDamage<MeleeDamageClass>(Item.damage * 0.35f);
int beamDamage = player.CalcIntDamage<MeleeDamageClass>(Item.damage * 0.10f);
Vector2 mouseClamped = player.ClampedMouseWorld();
SoundEngine.PlaySound(SoundID.Item84 with { Volume = 1f, Pitch = Main.rand.NextFloat(0.5f, 0.7f) }, player.Center);
for (int i = 0; i < 2; i++)
@@ -159,7 +166,8 @@ namespace CalamityMod.Items.Weapons.Melee
Vector2 spawnPos = mouseClamped + new Vector2(Main.rand.NextFloat(-300, 300), -900);
Vector2 vel = (targetPos - spawnPos).SafeNormalize(Vector2.UnitY) * 10;
Projectile.NewProjectile(player.GetSource_ItemUse(Item), spawnPos, vel, ModContent.ProjectileType<OrderbringerBeam>(), beamDamage, 0, player.whoAmI);
Projectile skybeam = Projectile.NewProjectileDirect(player.GetSource_ItemUse(Item), spawnPos, vel, ModContent.ProjectileType<OrderbringerBeam>(), beamDamage, 0, player.whoAmI);
skybeam.scale = scaling;
}
spawnTrueMeleeProj = false;
}
+1 -1
View File
@@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 134;
Item.height = 54;
Item.damage = 3725;
Item.damage = 1400;
Item.crit = 18;
Item.knockBack = 12f;
Item.useTime = 5;
+4
View File
@@ -47,6 +47,10 @@ namespace CalamityMod.Items.Weapons.Melee
}
public override bool RangedPrefix() => true; //class identity is fake
public override bool MeleePrefix() => false;
public override void ModifyItemScale(Player player, ref float scale)
{
scale = player.GetMeleeScale();
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
+5 -3
View File
@@ -39,6 +39,7 @@ namespace CalamityMod.Items.Weapons.Melee
public static float ScrewBazingaModeDamageMult = 6.5f;
public static float ScrewBazingaAimAssistAngle = 0.52f; //This may look high but remember this is the FULL angle, so it actually checks for half that angle deviation
public static float ScrewBazingaAimAssistReach = 600f;
public float scaler = 1;
public override ModItem Clone(Item item)
{
@@ -99,6 +100,7 @@ namespace CalamityMod.Items.Weapons.Melee
public override void HoldItem(Player player)
{
scaler = player.GetMeleeScale();
player.Calamity().mouseWorldListener = true;
if (Main.myPlayer == player.whoAmI)
@@ -143,8 +145,8 @@ namespace CalamityMod.Items.Weapons.Melee
//Prevent it from being thrown at any less than -1f
chuckSpeed.Y = Math.Clamp(chuckSpeed.Y, -1f, 3f);
int p = Projectile.NewProjectile(source, position, chuckSpeed, ModContent.ProjectileType<WulfrumScrew>(), damage, knockback, player.whoAmI);
Projectile p = Projectile.NewProjectileDirect(source, position, chuckSpeed, ModContent.ProjectileType<WulfrumScrew>(), damage, knockback, player.whoAmI);
p.scale = scaler + 0.2f;
ScrewStored = false;
return false;
}
@@ -188,7 +190,7 @@ namespace CalamityMod.Items.Weapons.Melee
position = Vector2.Lerp(new Vector2(ScrewPosition.X, ScrewPosition.Y), new Vector2(ScrewStart.X, ScrewStart.Y), ProgressionOfScrew);
float rotation = ScrewPosition.Z.AngleLerp(ScrewStart.Z, ProgressionOfScrew);
float outlineOpacity = (float)Math.Pow(1 - ScrewTimer / ScrewTime, 2);
scale = 1.05f + 0.05f * (float)Math.Sin(Main.GlobalTimeWrappedHourly * 0.5f);
scale = 1.05f * scale + 0.05f * (float)Math.Sin(Main.GlobalTimeWrappedHourly * 0.5f);
Main.spriteBatch.Draw(screwOutlineTex, position, null, Color.Lerp(Color.GreenYellow, Color.White, (float)Math.Sin(Main.GlobalTimeWrappedHourly) * 0.5f + 0.5f) * outlineOpacity, rotation, screwOutlineTex.Size() / 2f, scale, 0, 0);
Main.spriteBatch.Draw(screwTex, position, null, Color.White, rotation, screwTex.Size() / 2f, scale, 0, 0);
+1 -1
View File
@@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Ranged
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<MeldConstruct>(12).
AddIngredient<MeldBlob>(18).
AddTile(TileID.LunarCraftingStation).
Register();
}
+51
View File
@@ -0,0 +1,51 @@
using CalamityMod.Projectiles.Ranged;
using CalamityMod.Rarities;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Ranged
{
public class OmniGun : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Ranged";
public static int AmmoSavedPercent = 66;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent);
public override void SetDefaults()
{
Item.width = 118;
Item.height = 32;
Item.damage = 57;
Item.DamageType = DamageClass.Ranged;
Item.useAnimation = Item.useTime = 6;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
Item.knockBack = 5f;
Item.UseSound = null;
Item.noUseGraphic = true;
Item.channel = true;
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType<OmniGunHoldout>();
Item.shootSpeed = 16f;
Item.useAmmo = AmmoID.Bullet;
Item.value = CalamityGlobalItem.RarityYellowBuyPrice;
Item.rare = ItemRarityID.Yellow;
}
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0 && Main.rand.Next(100) >= AmmoSavedPercent;
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType<OmniGunHoldout>(), damage, knockback, player.whoAmI);
// 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction
// We set the rotation to the direction to the mouse so the first frame doesn't appear bugged out.
holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero);
return false;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 962 B

+1 -1
View File
@@ -56,7 +56,7 @@ namespace CalamityMod.Items.Weapons.Rogue
AddIngredient<SamsaraSlicer>().
AddIngredient(ItemID.LunarBar, 5).
AddIngredient<LifeAlloy>(5).
AddIngredient<MeldConstruct>(5).
AddIngredient<MeldBlob>(5).
AddTile(TileID.MythrilAnvil).
Register();
}
+1 -1
View File
@@ -49,7 +49,7 @@ namespace CalamityMod.Items.Weapons.Rogue
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<MeldConstruct>(12).
AddIngredient<MeldBlob>(18).
AddTile(TileID.LunarCraftingStation).
Register();
}
+1 -1
View File
@@ -68,7 +68,7 @@ namespace CalamityMod.Items.Weapons.Rogue
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<MeldConstruct>(18).
AddIngredient<MeldBlob>(18).
AddTile(TileID.LunarCraftingStation).
Register();
}
@@ -8,6 +8,11 @@ AlcoholPoisoning: {
Description: You drank too much and you are now dying
}
BaconOilBuff: {
DisplayName: Bacon Oil
Description: Oh gosh you spilled it all over yourself!
}
BloodyMaryBuff: {
DisplayName: Bloody Mary
Description: Increased enemy spawn rates, reduced piercing weapon effectiveness
@@ -737,6 +742,11 @@ SulphurskinBuff: {
Description: The sulphuric waters have a lesser effect on you
}
SwinesWrathBuff: {
DisplayName: Swine's Wrath
Description: Divine essence is rejecting your body
}
WeaponImbueBrimstone: {
DisplayName: Weapon Imbue: Brimstone
Description: Melee, Whip, and Rogue attacks ignite enemies with brimstone flames
@@ -1758,6 +1768,15 @@ ForbiddenStealthSummonTagBuff: {
Description: If you're seeing this, something went horribly wrong
}
Malnourished: {
DisplayName: Malnourished
Description:
'''
Minor reductions to all stats
Your liver feels stronger!
'''
}
SeaKingsAssurance: {
DisplayName: Sea King's Assurance
Description: If you're seeing this, something assuredly went horribly wrong
@@ -175,12 +175,7 @@ Lumenyl: {
MeldBlob: {
DisplayName: Meld Blob
Tooltip: ""
}
MeldConstruct: {
DisplayName: Meld Construct
Tooltip: ""
Tooltip: "'Shrieks of distorted memories echo within this mass' "
}
MiracleMatter: {
@@ -995,6 +995,15 @@ ThaumaticChair: {
Tooltip: One of Chloe's finest creations
}
TheMonument: {
DisplayName: The Monument
Tooltip:
'''
A monument celebrating the accomplishments of capitalism
Funded by the taxes of nearby Town NPCs, though they may not be too happy about that
'''
}
ThermalTorch: {
DisplayName: Thermal Torch
Tooltip:
@@ -157,6 +157,12 @@ SupremeManaPotion: {
Tooltip: ""
}
TheConcoction: {
DisplayName: The Concoction
EasterEggText: Removes 500 life
Tooltip: ""
}
ZenPotion: {
DisplayName: Zen Potion
Tooltip: Vastly decreases enemy spawn rate
@@ -167,6 +173,16 @@ ZergPotion: {
Tooltip: Vastly increases enemy spawn rate
}
BaconOil: {
DisplayName: Bacon Oil
Tooltip:
'''
Provides "good" mobility that scales with your damage stat boosts
Counts as 3 alcohols for {$Buffs.AlcoholPoisoning.DisplayName}
{$Common.AlcoholWarning}
'''
}
BloodyMary: {
DisplayName: Bloody Mary
Tooltip:
@@ -457,3 +473,16 @@ ShroomBowl: {
'He has been grounded'
'''
}
TheSandwich: {
DisplayName: The Sandwich
Tooltip:
'''
A sandwich made of the finest bread, cheese, and fish in the land!
Minor reductions to all stats
{0}% increased damage for every alcohol you are affected by
Allows you to drink 2 more alcohols than normal
Alcohol effects will not expire while under the effects of The Sandwich
'Might actually taste good if it was the only thing you'd ever eaten...'
'''
}
@@ -13,6 +13,18 @@ AerialHamaxe: {
Tooltip: ""
}
AggressiveVoucher: {
DisplayName: Aggressive Voucher
Tooltip:
'''
Favorite this item in your inventory to increase the likelihood of obtaining a desirable reforge
This effect only applies when reforging accessories
Targeted Reforge: {0}
Selectable Reforges: {1}
[c/aaaaaa:Shift-<right> in your inventory to cycle between targeted reforges]
'''
}
AntiCystOintment: {
DisplayName: Anti-Cyst Ointment
Tooltip:
@@ -141,6 +153,15 @@ BrokenWaterFilter: {
'''
}
CombatVoucher: {
DisplayName: Combat Voucher
Tooltip:
'''
Favorite this item in your inventory to increase the likelihood of obtaining a desirable reforge
This effect only applies when reforging weapons
'''
}
Cosmolight: {
DisplayName: Cosmolight
Tooltip:
@@ -205,6 +226,18 @@ GreatbayPickaxe: {
Tooltip: Can mine Demonite, Crimtane, Meteorite, Sea Prisms and Sea Prism Crystals
}
HurriedVoucher: {
DisplayName: Hurried Voucher
Tooltip:
'''
Favorite this item in your inventory to increase the likelihood of obtaining a desirable reforge
This effect only applies when reforging accessories
Targeted Reforge: {0}
Selectable Reforges: {1}
[c/aaaaaa:Shift-<right> in your inventory to cycle between targeted reforges]
'''
}
InfernaCutter: {
DisplayName: Inferna Cutter
Tooltip:
@@ -268,6 +301,18 @@ NormalityRelocator: {
'''
}
OddVoucher: {
DisplayName: Odd Voucher
Tooltip:
'''
Favorite this item in your inventory to increase the likelihood of obtaining a desirable reforge
This effect only applies when reforging accessories
Targeted Reforge: {0}
Selectable Reforges: {1}
[c/aaaaaa:Shift-<right> in your inventory to cycle between targeted reforges]
'''
}
ReefclawHamaxe: {
DisplayName: Reefclaw Hamaxe
Tooltip: ""
@@ -358,6 +403,17 @@ TectonicTruncator: {
Tooltip: ""
}
TheGift: {
DisplayName: The Gift
Tooltip:
'''
Drop this fine gift on one of your Town NPCs as a token of appreciation
May make them either love you or hate you, you'll never know until they open it!
Effect will last for 24 hours
[c/F54278:'There's no return policy, better be responsible']
'''
}
TorrentialTear: {
DisplayName: Torrential Tear
Tooltip:
@@ -368,6 +424,18 @@ TorrentialTear: {
'''
}
UnbreakableVoucher: {
DisplayName: Unbreakable Voucher
Tooltip:
'''
Favorite this item in your inventory to increase the likelihood of obtaining a desirable reforge
This effect only applies when reforging accessories
Targeted Reforge: {0}
Selectable Reforges: {1}
[c/aaaaaa:Shift-<right> in your inventory to cycle between targeted reforges]
'''
}
VoodooDemonVoodooDoll: {
DisplayName: Voodoo Demon Voodoo Doll
Tooltip:
@@ -840,6 +840,20 @@ Onyxia: {
'''
}
OmniGun: {
DisplayName: The Omnigun
Tooltip:
'''
A multipurpose weapon with several modes which are used in sequence
The first shot is a sniper round which gains damage over time and always critically strikes
The second shot is a burst of 10 standard bullets
The third shot is a devastating point blank spread
The fourth shot is a dangerous but powerful grenade which destroys everything, including you
'What kind of gun is it?'
'Yes'
'''
}
OpalStriker: {
DisplayName: Opal Striker
Tooltip:
@@ -223,10 +223,7 @@ CosmicViperEngine: {
Cosmilamp: {
DisplayName: Cosmilamp
Tooltip:
'''
Summons a cosmic lantern above your head to fight for you
'''
Tooltip: Summons a cosmic lantern above your head to fight for you
}
CrimslimeStaff: {
@@ -352,10 +349,7 @@ EndoHydraStaff: {
EntropysVigil: {
DisplayName: Entropy's Vigil
Tooltip:
'''
Summons a mini Calamitas Clone and her brothers to protect you
'''
Tooltip: Summons a mini Calamitas Clone and her brothers to protect you
}
EtherealSubjugator: {
@@ -394,10 +388,7 @@ FleshOfInfidelity: {
FlowersOfMortality: {
DisplayName: Flowers of Mortality
Tooltip:
'''
Summons five rainbow flowers over your head that inflict [cbuff:CalamityMod/ElementalMix]
'''
Tooltip: Summons five rainbow flowers over your head that inflict [cbuff:CalamityMod/ElementalMix]
}
ForgottenApexWand: {
@@ -695,10 +686,7 @@ SeashineHilt: {
ShellfishStaff: {
DisplayName: Shellfish Staff
Tooltip:
'''
Summons a shellfish to latch onto enemies and inflict [cbuff:CalamityMod/ShellfishClaps]
'''
Tooltip: Summons a shellfish to latch onto enemies and inflict [cbuff:CalamityMod/ShellfishClaps]
}
Sirius: {
@@ -901,18 +889,12 @@ VoidEaterMarionette: {
WarloksMoonFist: {
DisplayName: Warloks' Moon Fist
Tooltip:
'''
Summons a celestial fist to punch enemies for you
'''
Tooltip: Summons a celestial fist to punch enemies for you
}
WitherBlossomsStaff: {
DisplayName: Wither Blossoms Staff
Tooltip:
'''
Summons four decaying [cbuff:CalamityMod/Plague] flowers over your head
'''
Tooltip: Summons four decaying [cbuff:CalamityMod/Plague] flowers over your head
}
WulfrumController: {
@@ -929,8 +911,5 @@ WulfrumController: {
YharonsKindleStaff: {
DisplayName: Yharon's Kindle Staff
Tooltip:
'''
Summons a fiery draconid to fight for you
'''
Tooltip: Summons a fiery draconid to fight for you
}
@@ -352,6 +352,9 @@ Archmage: {
DislikeNPC: I dislike {NPCName}'s blatant disregard of magic. I cannot blame his functions, but he is quite ignorant.
LikeNPC_Princess: "{NPCName} has some very quaint spells. I'm quite impressed, for someone of her age."
Princess_LovesNPC: "{NPCName} makes the best ice cream I've ever tasted, it's so good!"
Monument: What a hideous statue! I always advocated for artistic community projects, but this... you really should have better quality control over what gets into your town!
GiftPositive: '''"How culture shaped magic" by Medomaion of Stratia?! I thought this book was lost centuries ago! How did you find it, and how did you...?! Well, no matter! This is the perfect gift, thank you!'''
GiftNegative: Could you please explain what your last gift was? You made an attempt on my life by trying to freeze me!? You better have a good explanation about how a snowstorm made its way inside that box!
}
}
@@ -432,6 +435,9 @@ Bandit: {
DislikeNPC: What a goody two shoes, {NPCName} is! I dislike her out of principle! …And because she has almost no material goods.
LikeNPC_Princess: I couldn't bear to steal anything from {NPCName}, she's so cute!
Princess_LovesNPC: "{NPCName} gifts me with nice exact replicas of other's things, I wonder how they do it!"
Monument: Yo, if your pockets ever feel lighter, that's not me, alright? You brought this on yourself buddy.
GiftPositive: Heeeey, my man! How's it goin'? I really 'preciate your gift, I have no idea how you got your hands on that kind of lockpicker's kit, but you'd catch me dead before I asked any questions!
GiftNegative: Hey man, what the hell is up with that gift?! I'm the most wanted in seven different city-states, do you got any idea how much a warrant on my name messes up my work?! You better do something to clean that mess before they have me walking to the gallows!
}
}
@@ -475,6 +481,9 @@ BrimstoneWitch: {
DislikeNPC: Such a racket! All {NPCName} does is make noise, day in and day out! I can't stand her!
LikeNPC_Princess: What a strangely pleasant kid {NPCName} is to be around.
Princess_LovesNPC: "{NPCName} is always lonely, it's why I want to hang out with her, no one should be left alone like that!"
Monument: That monument is ugly as sin.
GiftPositive: Hey, uh... thanks for the gift, really. I never thought you'd ever give me anything, for obvious reasons. But... thanks, really. It's lovely.
GiftNegative: What the hell was that gift? You know what, I don't even want to think about it. Screw you.
}
}
@@ -558,6 +567,9 @@ SeaKing: {
HateNPC: "{NPCName} is just a child, but his attitude towards marine life is unacceptable! Absolutely unacceptable!"
LikeNPC_Princess: That child, {NPCName}. She is an innocent soul. Let us hope the horrors of war never reach her.
Princess_LovesNPC: "{NPCName} always smiles when I'm nearby, I like being around him just for that!"
Monument: Take that horrible statue out of my sight! It is a disgrace to art, and to so unabashedly extort your people...! I expected much more of you.
GiftPositive: It was quite the delight to see that you gifted me custom-made shoes. Few people seem to realize that "walking" tends to leave my tail quite sore. Thank you, sincerely!
GiftNegative: A dead fish?! You gifted me a dead fish?! You managed to cross every line with that "gift"! Leave, I don't want to see you any longer.
}
}
@@ -2,13 +2,16 @@ Accessory: {
Silent.DisplayName: Silent
Invigorating.DisplayName: Invigorating
Dauntless.DisplayName: Dauntless
Friendly.DisplayName: Friendly
// New modifier effects (this is only positive)
StealthGenTooltip: +{0}% stealth generation
LifeRegenTooltip: +{0} HP/s life regen
MaxLifeBoostTooltip: +{0} max life
FriendlyTooltip: +{0} Minion
}
Weapon: {
Horrible.DisplayName: Horrible
Atrocious.DisplayName: Atrocious
Blunt.DisplayName: Blunt
Feathered.DisplayName: Feathered
@@ -267,3 +267,6 @@ WaterSpout.DisplayName: Spout
WildfireBloomFire.DisplayName: Wildfire Fire
WildfireBloomFlare.DisplayName: Wildfire Flare
WulfrumScrapBullet.DisplayName: High Speed Scrap
OmniSniperShot.DisplayName: Omni Sniper Shot
OmniGrenade.DisplayName: Omni Grenade
OmniShotgunShot.DisplayName: Omni Shotgun Shot
@@ -51,7 +51,6 @@ DuneSandBallGun.DisplayName: Dunesand Ball
EarlyBloomBobber.DisplayName: Early Bloom Bobber
EmpyreanBlast.DisplayName: Empyrean Blast
EmpyreanEmber.DisplayName: Empyrean Ember
EmpyreanGlob.DisplayName: Empyeran Glob
EmpyreanMarble.DisplayName: Empyrean Marble
EmpyreanStellarDetritus.DisplayName: Empyrean Stellar Detritus
EnergyShell.DisplayName: Energy Shell
@@ -107,6 +106,7 @@ PauldronDash.DisplayName: Pauldron Dash
PauldronExplosion.DisplayName: Pauldron Explosion
PearlAuraShard.DisplayName: Prism Shard
PlaguePulse.DisplayName: Plague Pulse
Pigion.DisplayName: Pigion
PinkPearlFalling.DisplayName: Pink Pearl
PoisonousSeawater.DisplayName: Seawater
PolypSandBallFalling.DisplayName: Polyp Sand Ball
@@ -107,6 +107,13 @@ SulphurMeter: "{0} bathed too long in acidic waters."
SulphuricPoisoning1: "{0} was melted by the toxic waste."
SulphuricPoisoning2: "{0} ingested too many caustic chemicals."
SulphuricPoisoning3: "{0} couldn't handle the industrial backwash."
SwinesWrath1: "{0} was not ready to bask in divinity."
SwinesWrath2: "{0} now resides in Pigatory."
SwinesWrath3: "{0} was ground into a fine dust—a fibrous powder, by the wrath of Swine."
SwinesWrath4: "{0} should be careful what they wish for."
SwinesWrath5: "{0} had the last of their health swinedled out from under their nose."
SwinesWrath6: "{0} did not read the label on The Concoction."
SwinesWrath7: "{0}'s life was hogged to the bone."
ThornBlossom: "{0} was violently pricked by a flower."
UltracosmicMaelstrom1: "{0} was sublimated by [ceffect/dog:Ultracosmic Maelstrom]."
UltracosmicMaelstrom2: "{0} got cut down to size by [ceffect/dog:Ultracosmic Maelstrom]."
@@ -409,3 +409,169 @@ WitchDoctorChat: {
}
WizardChat.Hardmode: Space just got way too close for comfort.
TownNPCMood: {
// Default dialogues if, for example, a modded NPC does not have a dialogue line registered
DefaultMonument: I hate The Monument.
DefaultGiftPositive: I love The Gift.
DefaultGiftNegative: I hate The Gift.
Angler: {
Monument: That monument is sooooooo ugly! I think it needs some chopped fish thrown allllll over it!
GiftPositive: Hey! I don't know how you got a hold of all that squishy gross stuff in that gift, but it might be the best prank material I've ever seen! He he he!
GiftNegative: Are you stupid?! I would NEVER fall for such a laaaaame gift prank like that! You better catch a lot of awesome fish to make up!
}
ArmsDealer: {
Monument: Was anyone really itchin' to have a big ol' statue in my firing ground? Because I wasn't!
GiftPositive: That new ammo belt was just the gift I've been lookin' for, buddy! Let's test it out together later!
GiftNegative: Do you know what you're doin' by pullin' a bomb in a box prank on me? I can kill you in over seven hundred ways, and that's just with my guns!
}
BestiaryGirl: {
Monument: This monument is like, totally giving me the creeps, bro!
MonumentTransformed: Rrr... BIG ROCK. BAD! NO!!
GiftPositive: Hey!! You're like, suuuper rad and all for gifting me that cute little bunny! Now umm... I need to think of a name for it!
GiftPositiveTransformed: LOVE. GOOD GIFT. CUTE!
GiftNegative: Eek!! Did you really, like, gift me a dead bunny? I really totally hate when people think that's funny!
GiftNegativeTransformed: Grahh!! HATE. CRUEL. GIFT. WATCH YOURSELF!!
}
Clothier: {
Monument: I think I am becoming too old to understand this... "modern art".
GiftPositive: There was a simple bell in that gift, but its ring was simply extraordinary. Perhaps this means I truly believe...
GiftNegative: Can we get serious now? No one warned me! No one said "You are about to receive the most wretched gift in history". No one could train for that!
}
Cyborg: {
Monument: Analysis of nearby monument: Provides zero positive qualities to all lifeforms nearby.
GiftPositive: Gift content scan revealed extremely pure silicon for use in upgraded processors. It appears I appreciate that.
GiftNegative: Gift content scan revealed attempt to trigger malfunction in my systems. Translation: I hate this.
}
DD2Bartender: {
Monument: Had a lot of customers lately complaining about that big monument outside. I gotta say, they're right.
GiftPositive: The pint in that gift of yours reminded me of what I serve back in Etheria! Ahh, I really miss it... but that was quite thoughtful of you.
GiftNegative: What vile concoction of a drink was that? One sip of it and I had to wipe down the bar again! Were you conspiring with the Kobolds?!
}
Demolitionist: {
Monument: You know, there is a use for that monument - it'll make for a good demolition test for my biggest dynamite yet!
GiftPositive: Hey, is that a shipment of ale? That's the only thing us dwarves love more than blowing things up! You're da' bomb!
GiftNegative: ARGH! You see yourself as a joker, giving me a water gun? That's an affront to my craft in two ways! Now I'm itching to turn you into a firework!
}
Dryad: {
Monument: I don't like that monument. I can sense its ugly stain on nature.
GiftPositive: I have no need for material goods as a nature spirit... but I can at least sense your gift was given out of genuine compassion.
GiftNegative: It would be unwise for you to tread near me after "gifting" me an oozing mass of corruption. I question whether you are committed to purifying the world...
}
DyeTrader: {
Monument: Oh no no, that dull monument cannot be. Its mere presence is sucking the color and vibrancy out of life itself!
GiftPositive: What an extraordinary batch of rare flowers there was in that gift, friend! I must thank you for your help, browse my colors at reduced coin in exchange!
GiftNegative: You think you can pull such a drab gift prank on me, I don't think so! I want no business of yours after that attack on my precious palettes!
}
GoblinTinkerer: {
Monument: You know, even the barbaric goblin camp I was once part of never considered the concept of a useless monument that just funnels funds.
GiftPositive: What a fascinating welding-cutting combo tool in that gift! I would love to reverse-engineer and tinker it for my own research.
GiftNegative: When I reached into your unassuming gift, my hands were lacerated by a handful of spiky balls! I'm afraid I will have to hike my prices to cover the medical costs.
}
Golfer: {
Monument: This must be mockery. I don't want a monument of greed erected so close to my home.
GiftPositive: I don't know where you found that wedge, but it's been a real lifesaver in the sand. Thanks for helping my game!
GiftNegative: Tell me something. Why did the shoddy driver in that gift splinter all over the place after one swing? Golf is a delicate sport, and this really hurts!
}
Guide: {
Monument: I quite dislike that monument you have over there. How could one have such little humbleness!
GiftPositive: A thoughtful gift in this world is always a welcome sight. I greatly appreciate it!
GiftNegative: Apologies, I'm currently in shock over your decision to gift me my own voodoo doll. If only I could curse you!
}
Mechanic: {
Monument: Any more money I have to fork over for this monument and I'm going to have to start charging an electric bill! I would hate to do that.
GiftPositive: Thanks to your gift of signal extenders, I can connect more of this world than ever! That extra burst of motivation is just what I need to finish wiring up this town!
GiftNegative: What compelled you to be so reckless as to gift me an EMP device? Everyone is yelling at me like it's MY fault! Well, now it will be YOUR problem to pay it off when you buy all your wire.
}
Merchant: {
Monument: That awful monument is driving away my business!
GiftPositive: What a lovely gift of exotic wares you gave me, friend! Please peruse my shop at clearance rates.
GiftNegative: Why offer a "gift" of rubbish Angel Statues? I tire of your jokes, so if you want business, it'll be extra.
}
Nurse: {
Monument: Eww, who would put such an ugly rock in this town?
GiftPositive: Hey! Thanks for that gift from earlier. You ever need face reconstruction, you know who to call.
GiftNegative: YOU, I hope you understand that gifting the ONLY DOCTOR HERE some snake oil is how to make me never want to treat you!
}
Painter: {
Monument: That statue certainly is thought provoking. I'm awestruck by how bleak, dull, and hopeless it makes its environs feel.
GiftPositive: How did ya know exactly the paint color I have been looking for? My newest mural greatly appreciates dat!
GiftNegative: You must be sick and cruel, because that water bomb prank of yours washed all over my latest work! Aye, you oughta be covered in red, and not paint!
}
PartyGirl: {
Monument: Yeeesh, we're gonna have an ugly statue of big money around? That like, totally kills the party mood around here.
GiftPositive: PARTY GIFTS? FOR ME? Oh just you wait, I'm gonna throw the BIGGEST party this town has ever seen, forever and always!
GiftNegative: I knew you were trouble when you walked in that suspicious looking box! It's too late now to say sorry!
}
Pirate: {
Monument: Arr, ye landlubbers have filthy tastes in decoration! That statue be askin' to be washed away!
GiftPositive: HAR HAR! Ye bring me the best bottle o' rum I ever taste in me life! Nothin' more for me to say, sea dog!
GiftNegative: Arr, ye scallywag! Ye be askin' to be sent to Davy Jones' locker with that foul concoction ye gave me earlier!
}
Princess: {
Monument: Um... my people have been frequently complaining about that monument. May I request it be taken down, please?
GiftPositive: I do appreciate your thoughtfulness with this gift, my loyal subject! It's always so wonderful to see the many fantastic things inside one!
GiftNegative: Um... may I ask what you were implying with the contents of that gift? Perhaps I shouldn't worry so, but I do find myself concerned...
}
SantaClaus: {
Monument: Is this what the holiday season means to people now? Naughty, you are!
GiftPositive: Ho ho ho! What an unusual feeling for someone to be gifting me something at this time of year! You'd be great taking up the mantle!
GiftNegative: What a horrible gift you thought you could give me. You will get no presents this year!
}
Steampunker: {
Monument: Oi, that bloody big rock you got outside is a monumental mistake! Decommission it this very instant!
GiftPositive: Ahh, what a deeply inspiring jetpack engine! The breakthroughs in steampunk technology from this will be exquisite! Consider this sale a return of generosity.
GiftNegative: When I opened your gift, a sudden blast of cold air condensed all of my steam! Were it not for my backup systems, my machines would be unusable! You bloody better watch yourself!
}
Stylist: {
Monument: That statue has been the talk of the town! ...As in, everyone cannot stand the gross thing.
GiftPositive: Thanks hun, that gift of new exotic hair dyes was just what I was missin' in my life! I know just who else could use some of this style too!
GiftNegative: What were you pullin' on me with a fireball in a gift box? That could've singed me bald, and I could never be a stylist without hair! NEVER!
}
TaxCollector: {
Monument: Bah! You shouldn't be seeing this message, plebian!
GiftPositive: What a steal, getting a gift full of the only thing worth a damn in this world -- money!
GiftNegative: Bah! You think you're a jester with that lump of coal? Get out of my sight!
}
Truffle: {
Monument: Your kind have very strange decorative tastes, such as that monument nearby.
GiftPositive: I love them, my new gifted shroomble companions. It's great to see more of our kind around here!
GiftNegative: A little pig jumped out of that gift you gave me earlier, and tried to eat my face! Perhaps I can't trust you either.
}
WitchDoctor: {
Monument: A vile disruption of nature, that monument is. My soul is wracked with contempt for this unsightly edifice.
GiftPositive: A kind offering to my people, this gift is. May you be blessed by kindred spirits in trying times.
GiftNegative: Sacrilegious defilement against my arts - I speak of your false gift. May your woes be many, and your days few.
}
Wizard: {
Monument: If I was your age, I would've blasted that loathsome monument with a giant fireball! Alas, I can't recall the spell.
GiftPositive: An authentic tome of wisdom from the Archmage himself? What a prized possession!! ...uh, who is the Archmage again?
GiftNegative: Do you take me for a fool to place a hex on that gift? How about I place a hex on your wallet, and all of your money disappears when you buy from me!!
}
}
+61
View File
@@ -22,6 +22,7 @@ using CalamityMod.Items.Weapons.Rogue;
using CalamityMod.NPCs.TownNPCs;
using CalamityMod.Projectiles.Rogue;
using CalamityMod.Systems.Collections;
using CalamityMod.Tiles.Furniture;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
@@ -31,6 +32,7 @@ using Terraria.GameContent;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
using Terraria.WorldBuilding;
using static Terraria.ModLoader.ModContent;
namespace CalamityMod.NPCs
@@ -70,6 +72,18 @@ namespace CalamityMod.NPCs
public int shopAlertAnimTimer = 0;
/// <summary> <inheritdoc cref="shopAlertAnimTimer"/> </summary>
public int shopAlertAnimFrame = 0;
/// <summary>
/// Controls how this Town NPC is being affected by The Gift.<br/>
/// If true, happiness is overriden with an extremely high value. If false, happiness is overriden with an extremely low value. If null, uses vanilla happiness.
/// </summary>
public bool? TheGiftStatus = null;
/// <summary>
/// Timer to track when to reset the effects of The Gift, which occurs after 24 hours.<br/>
/// When The Gift is applied, this is set to 0 then starts counting up.
/// </summary>
public double TheGiftReset = -1.0;
public bool AffectedByTheMonument = false;
public override bool InstancePerEntity => true;
@@ -85,6 +99,9 @@ namespace CalamityMod.NPCs
myClone.setNewName = setNewName;
myClone.shopAlertAnimTimer = shopAlertAnimTimer;
myClone.shopAlertAnimFrame = shopAlertAnimFrame;
myClone.TheGiftStatus = TheGiftStatus;
myClone.TheGiftReset = TheGiftReset;
myClone.AffectedByTheMonument = AffectedByTheMonument;
return myClone;
}
@@ -805,8 +822,52 @@ namespace CalamityMod.NPCs
public override bool PreAI(NPC npc)
{
SetPatreonTownNPCName(npc, Mod);
// Reset The Gift after 24 hours
if (TheGiftReset >= 0.0)
{
TheGiftReset += Main.dayRate;
if (TheGiftReset >= Main.dayLength + Main.nightLength)
{
TheGiftReset = -1.0;
TheGiftStatus = null;
}
}
// Search for The Monument, for the purposes of assigning higher taxes
AffectedByTheMonument = false;
SearchForTheMonument(npc);
return true;
}
public bool SearchForTheMonument(NPC npc)
{
Point tileCenter = npc.Center.ToTileCoordinates();
Rectangle searchArea = new((int)(tileCenter.X - Main.buffScanAreaWidth / 2), (int)(tileCenter.Y - Main.buffScanAreaHeight / 2), Main.buffScanAreaWidth, Main.buffScanAreaHeight);
searchArea = WorldUtils.ClampToWorld(searchArea);
for (int i = searchArea.Left; i < searchArea.Right; i++)
{
for (int j = searchArea.Top; j < searchArea.Bottom; j++)
{
if (!searchArea.Contains(i, j))
continue;
Tile tile = Main.tile[i, j];
if (tile == null)
continue;
if (!tile.HasTile)
continue;
if (tile.TileType == TileType<TheMonumentTile>())
{
AffectedByTheMonument = true;
return true;
}
}
}
return false;
}
#endregion
#region PreDraw
+2 -10
View File
@@ -12,11 +12,8 @@ namespace CalamityMod.Particles
public override bool UseCustomDraw => true;
public override bool SetLifetime => true;
public Player Owner;
public Color StartColor;
public Color EndColor;
public Vector2 OverridePosition;
public float Opacity;
public HealingPlus(Vector2 position, float scale, Vector2 velocity, Color colorStart, Color colorEnd, int lifetime)
{
@@ -34,20 +31,15 @@ namespace CalamityMod.Particles
{
Color = Color.Lerp(StartColor, EndColor, LifetimeCompletion);
Lighting.AddLight(Position, Color.ToVector3() * 0.2f);
Opacity -= 0.5f;
}
public override void CustomDraw(SpriteBatch spriteBatch)
{
Texture2D tex = ModContent.Request<Texture2D>(Texture).Value;
Vector2 Size = new Vector2(Scale);
Vector2 origin = new Vector2(tex.Width, tex.Height) * 0.5f;
Vector2 origin = new Vector2(tex.Width, tex.Height);
Vector2 PositionAdjust = new Vector2(-16, -40);
spriteBatch.Draw(tex, Position - Main.screenPosition - PositionAdjust, null, Color, Rotation, origin, Size, SpriteEffects.None, 0);
spriteBatch.Draw(tex, Position - Main.screenPosition, null, Color, Rotation, origin, Size, SpriteEffects.None, 0);
}
}
Loaded 100 of 178 files, more files were not shown because too many files have changed in this diff. Show more